Lines Matching defs:avctx

43 static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)
45 PCMDVDContext *s = avctx->priv_data;
53 static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
57 PCMDVDContext *s = avctx->priv_data;
66 if (avctx->debug & FF_DEBUG_PICT_INFO)
67 av_log(avctx, AV_LOG_DEBUG, "pcm_dvd_parse_header: header = %02x%02x%02x\n",
79 avctx->bits_per_coded_sample = 16 + (header[1] >> 6 & 3) * 4;
80 if (avctx->bits_per_coded_sample == 28) {
81 av_log(avctx, AV_LOG_ERROR,
83 avctx->bits_per_coded_sample);
86 avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16
88 avctx->bits_per_raw_sample = avctx->bits_per_coded_sample;
91 avctx->sample_rate = frequencies[header[1] >> 4 & 3];
96 av_channel_layout_uninit(&avctx->ch_layout);
97 av_channel_layout_default(&avctx->ch_layout, channels);
99 avctx->bit_rate = channels *
100 avctx->sample_rate *
101 avctx->bits_per_coded_sample;
106 if (avctx->bits_per_coded_sample == 16) {
115 s->block_size = 4 * avctx->bits_per_coded_sample / 8;
121 s->block_size = 8 * avctx->bits_per_coded_sample / 8;
128 avctx->bits_per_coded_sample / 8;
135 if (avctx->debug & FF_DEBUG_PICT_INFO)
136 ff_dlog(avctx,
138 avctx->ch_layout.nb_channels, avctx->bits_per_coded_sample,
139 avctx->sample_rate, avctx->bit_rate);
146 static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
149 PCMDVDContext *s = avctx->priv_data;
157 switch (avctx->bits_per_coded_sample) {
163 int samples = blocks * avctx->ch_layout.nb_channels;
171 if (avctx->ch_layout.nb_channels == 1) {
199 if (avctx->ch_layout.nb_channels == 1) {
228 static int pcm_dvd_decode_frame(AVCodecContext *avctx, AVFrame *frame,
233 PCMDVDContext *s = avctx->priv_data;
239 av_log(avctx, AV_LOG_ERROR, "PCM packet too small\n");
243 if ((retval = pcm_dvd_parse_header(avctx, src)))
246 av_log(avctx, AV_LOG_WARNING, "block_size has changed %d != %d\n", s->last_block_size, s->block_size);
257 if ((retval = ff_get_buffer(avctx, frame, 0)) < 0)
267 dst = pcm_dvd_decode_samples(avctx, s->extra_samples, dst, 1);
282 pcm_dvd_decode_samples(avctx, src, dst, blocks);