• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavcodec/

Lines Matching refs:avctx

30 static int amr_decode_fix_avctx(AVCodecContext *avctx)
32 const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);
34 if (!avctx->sample_rate)
35 avctx->sample_rate = 8000 * is_amr_wb;
37 if (avctx->channels > 1) {
38 avpriv_report_missing_feature(avctx, "multi-channel AMR");
42 avctx->channels = 1;
43 avctx->channel_layout = AV_CH_LAYOUT_MONO;
44 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
65 static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
67 AMRContext *s = avctx->priv_data;
70 if ((ret = amr_decode_fix_avctx(avctx)) < 0)
75 av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\n");
82 static av_cold int amr_nb_decode_close(AVCodecContext *avctx)
84 AMRContext *s = avctx->priv_data;
91 static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
97 AMRContext *s = avctx->priv_data;
102 av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
103 buf, buf_size, avctx->frame_number);
107 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
114 av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
119 av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
187 static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
189 AMRContext *s = avctx->priv_data;
191 if (avctx->sample_rate != 8000 && avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
192 av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
196 if (avctx->channels != 1) {
197 av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
201 avctx->frame_size = 160;
202 avctx->delay = 50;
203 ff_af_queue_init(avctx, &s->afq);
207 av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n");
211 s->enc_mode = get_bitrate_mode(avctx->bit_rate, avctx);
212 s->enc_bitrate = avctx->bit_rate;
217 static av_cold int amr_nb_encode_close(AVCodecContext *avctx)
219 AMRContext *s = avctx->priv_data;
226 static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
229 AMRContext *s = avctx->priv_data;
234 if (s->enc_bitrate != avctx->bit_rate) {
235 s->enc_mode = get_bitrate_mode(avctx->bit_rate, avctx);
236 s->enc_bitrate = avctx->bit_rate;
239 if ((ret = ff_alloc_packet2(avctx, avpkt, 32)) < 0)
243 if (frame->nb_samples < avctx->frame_size) {
244 flush_buf = av_mallocz_array(avctx->frame_size, sizeof(*flush_buf));
249 if (frame->nb_samples < avctx->frame_size - avctx->delay)
259 flush_buf = av_mallocz_array(avctx->frame_size, sizeof(*flush_buf));
268 av_dlog(avctx, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
272 ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
309 static av_cold int amr_wb_decode_init(AVCodecContext *avctx)
311 AMRWBContext *s = avctx->priv_data;
314 if ((ret = amr_decode_fix_avctx(avctx)) < 0)
322 static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
328 AMRWBContext *s = avctx->priv_data;
335 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
342 av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
347 av_log(avctx, AV_LOG_ERROR, "amr packet_size invalid\n");
358 static int amr_wb_decode_close(AVCodecContext *avctx)
360 AMRWBContext *s = avctx->priv_data;