Lines Matching defs:avctx
183 int isampf = tctx->avctx->sample_rate / 1000;
184 int ibps = tctx->avctx->bit_rate / (1000 * tctx->avctx->ch_layout.nb_channels);
252 static int twinvq_read_bitstream(AVCodecContext *avctx, TwinVQContext *tctx,
257 int channels = tctx->avctx->ch_layout.nb_channels;
269 av_log(avctx, AV_LOG_ERROR, "Invalid window type, broken sample?\n");
320 static av_cold int twinvq_decode_init(AVCodecContext *avctx)
323 TwinVQContext *tctx = avctx->priv_data;
325 if (!avctx->extradata || avctx->extradata_size < 12) {
326 av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata\n");
329 channels = AV_RB32(avctx->extradata) + 1;
330 avctx->bit_rate = AV_RB32(avctx->extradata + 4) * 1000;
331 isampf = AV_RB32(avctx->extradata + 8);
334 av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate\n");
339 avctx->sample_rate = 44100;
342 avctx->sample_rate = 22050;
345 avctx->sample_rate = 11025;
348 avctx->sample_rate = isampf * 1000;
353 av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
357 av_channel_layout_uninit(&avctx->ch_layout);
358 av_channel_layout_default(&avctx->ch_layout, channels);
360 ibps = avctx->bit_rate / (1000 * channels);
362 av_log(avctx, AV_LOG_ERROR, "Bad bitrate per channel value %d\n", ibps);
395 av_log(avctx, AV_LOG_ERROR,
405 tctx->frame_size = avctx->bit_rate * tctx->mtab->size
406 / avctx->sample_rate + 8;
408 if (avctx->block_align && avctx->block_align * 8LL / tctx->frame_size > 1) {
409 av_log(avctx, AV_LOG_ERROR,
414 return ff_twinvq_decode_init(avctx);