Lines Matching defs:avctx

1613 static av_cold int qdm2_decode_init(AVCodecContext *avctx)
1616 QDM2Context *s = avctx->priv_data;
1654 if (!avctx->extradata || (avctx->extradata_size < 48)) {
1655 av_log(avctx, AV_LOG_ERROR, "extradata missing or truncated\n");
1659 bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
1669 av_log(avctx, AV_LOG_ERROR, "not enough extradata (%i)\n",
1678 av_log(avctx, AV_LOG_ERROR, "extradata size too small, %i < %i\n",
1683 av_log(avctx, AV_LOG_DEBUG, "size: %d\n", size);
1685 av_log(avctx, AV_LOG_ERROR, "invalid extradata, expecting QDCA\n");
1693 av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
1696 av_channel_layout_uninit(&avctx->ch_layout);
1697 av_channel_layout_default(&avctx->ch_layout, s->channels);
1699 avctx->sample_rate = bytestream2_get_be32(&gb);
1700 avctx->bit_rate = bytestream2_get_be32(&gb);
1705 av_log(avctx, AV_LOG_ERROR, "data block size invalid (%u)\n", s->checksum_size);
1713 avpriv_request_sample(avctx, "Unknown FFT order %d", s->fft_order);
1728 avpriv_request_sample(avctx, "large frames");
1742 if ((tmp * 1000) < avctx->bit_rate) tmp_val = 1;
1743 if ((tmp * 1440) < avctx->bit_rate) tmp_val = 2;
1744 if ((tmp * 1760) < avctx->bit_rate) tmp_val = 3;
1745 if ((tmp * 2240) < avctx->bit_rate) tmp_val = 4;
1748 if (avctx->bit_rate <= 8000)
1750 else if (avctx->bit_rate < 16000)
1756 av_log(avctx, AV_LOG_ERROR, "FFT size %d not power of 2.\n", s->fft_size);
1763 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
1770 static av_cold int qdm2_decode_close(AVCodecContext *avctx)
1772 QDM2Context *s = avctx->priv_data;
1841 static int qdm2_decode_frame(AVCodecContext *avctx, AVFrame *frame,
1846 QDM2Context *s = avctx->priv_data;
1857 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)