Lines Matching refs:avctx
74 static av_cold int decode_init(AVCodecContext *avctx)
76 BinkAudioContext *s = avctx->priv_data;
77 int sample_rate = avctx->sample_rate;
82 dsputil_init(&s->dsp, avctx);
83 ff_fmt_convert_init(&s->fmt_conv, avctx);
86 if (avctx->sample_rate < 22050) {
88 } else if (avctx->sample_rate < 44100) {
94 if (avctx->channels > MAX_CHANNELS) {
95 av_log(avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels);
99 s->version_b = avctx->extradata && avctx->extradata[3] == 'b';
101 if (avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) {
103 sample_rate *= avctx->channels;
106 frame_len_bits += av_log2(avctx->channels);
108 s->channels = avctx->channels;
137 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
144 if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)
152 avctx->coded_frame = &s->frame;
291 static av_cold int decode_end(AVCodecContext *avctx)
293 BinkAudioContext * s = avctx->priv_data;
296 if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)
310 static int decode_frame(AVCodecContext *avctx, void *data,
313 BinkAudioContext *s = avctx->priv_data;
326 av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
342 s->frame.nb_samples = s->block_size / avctx->channels;
343 if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
344 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
349 if (decode_block(s, samples, avctx->codec->id == CODEC_ID_BINKAUDIO_DCT)) {
350 av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");