Lines Matching refs:avctx
68 static av_cold int decode_init(AVCodecContext *avctx)
70 BinkAudioContext *s = avctx->priv_data;
71 int sample_rate = avctx->sample_rate;
77 if (avctx->sample_rate < 22050) {
79 } else if (avctx->sample_rate < 44100) {
85 if (avctx->channels < 1 || avctx->channels > MAX_CHANNELS) {
86 av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", avctx->channels);
89 avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
92 s->version_b = avctx->extradata_size >= 4 && avctx->extradata[3] == 'b';
94 if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) {
96 avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
97 sample_rate *= avctx->channels;
100 frame_len_bits += av_log2(avctx->channels);
102 s->channels = avctx->channels;
103 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
110 if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
136 if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
268 static av_cold int decode_end(AVCodecContext *avctx)
270 BinkAudioContext * s = avctx->priv_data;
273 if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
287 static int decode_frame(AVCodecContext *avctx, void *data,
290 BinkAudioContext *s = avctx->priv_data;
303 av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
322 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
326 avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT)) {
327 av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");
332 frame->nb_samples = s->block_size / avctx->channels;