• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching refs:avctx

26 static void amr_decode_fix_avctx(AVCodecContext *avctx)
28 const int is_amr_wb = 1 + (avctx->codec_id == CODEC_ID_AMR_WB);
30 if (!avctx->sample_rate)
31 avctx->sample_rate = 8000 * is_amr_wb;
33 if (!avctx->channels)
34 avctx->channels = 1;
36 avctx->frame_size = 160 * is_amr_wb;
37 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
99 static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
101 AMRContext *s = avctx->priv_data;
105 av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\n");
109 amr_decode_fix_avctx(avctx);
111 if (avctx->channels > 1) {
112 av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
117 avctx->coded_frame = &s->frame;
122 static av_cold int amr_nb_decode_close(AVCodecContext *avctx)
124 AMRContext *s = avctx->priv_data;
131 static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
136 AMRContext *s = avctx->priv_data;
141 av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
142 buf, buf_size, avctx->frame_number);
146 if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
147 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
155 av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
160 av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
183 static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
185 AMRContext *s = avctx->priv_data;
187 if (avctx->sample_rate != 8000) {
188 av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
192 if (avctx->channels != 1) {
193 av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
197 avctx->frame_size = 160;
198 avctx->coded_frame = avcodec_alloc_frame();
202 av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n");
206 s->enc_mode = get_bitrate_mode(avctx->bit_rate, avctx);
207 s->enc_bitrate = avctx->bit_rate;
212 static av_cold int amr_nb_encode_close(AVCodecContext *avctx)
214 AMRContext *s = avctx->priv_data;
217 av_freep(&avctx->coded_frame);
221 static int amr_nb_encode_frame(AVCodecContext *avctx,
225 AMRContext *s = avctx->priv_data;
228 if (s->enc_bitrate != avctx->bit_rate) {
229 s->enc_mode = get_bitrate_mode(avctx->bit_rate, avctx);
230 s->enc_bitrate = avctx->bit_rate;
235 av_dlog(avctx, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
267 static av_cold int amr_wb_decode_init(AVCodecContext *avctx)
269 AMRWBContext *s = avctx->priv_data;
273 amr_decode_fix_avctx(avctx);
275 if (avctx->channels > 1) {
276 av_log(avctx, AV_LOG_ERROR, "amr_wb: multichannel decoding not supported\n");
281 avctx->coded_frame = &s->frame;
286 static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
291 AMRWBContext *s = avctx->priv_data;
298 if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
299 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
307 av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
320 static int amr_wb_decode_close(AVCodecContext *avctx)
322 AMRWBContext *s = avctx->priv_data;