Lines Matching defs:avctx
77 static av_cold int MPA_encode_init(AVCodecContext *avctx)
79 MpegAudioContext *s = avctx->priv_data;
80 int freq = avctx->sample_rate;
81 int bitrate = avctx->bit_rate;
82 int channels = avctx->ch_layout.nb_channels;
87 av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
92 avctx->frame_size = MPA_FRAME_SIZE;
93 avctx->initial_padding = 512 - 32 + 1;
106 av_log(avctx, AV_LOG_ERROR, "Sampling rate %d is not allowed in mp2\n", freq);
116 if (i == 15 && !avctx->bit_rate) {
119 avctx->bit_rate = bitrate * 1000;
122 av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
143 ff_dlog(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
742 static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
745 MpegAudioContext *s = avctx->priv_data;
764 if ((ret = ff_alloc_packet(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)) < 0)
776 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);