Lines Matching refs:avctx
51 * @param avctx the codec context
54 static int pcm_bluray_parse_header(AVCodecContext *avctx,
67 if (avctx->debug & FF_DEBUG_PICT_INFO)
68 ff_dlog(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
72 avctx->bits_per_coded_sample = bits_per_samples[header[3] >> 6];
73 if (!(avctx->bits_per_coded_sample == 16 || avctx->bits_per_coded_sample == 24)) {
74 av_log(avctx, AV_LOG_ERROR, "unsupported sample depth (%d)\n", avctx->bits_per_coded_sample);
77 avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16
79 if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
80 avctx->bits_per_raw_sample = avctx->bits_per_coded_sample;
85 avctx->sample_rate = 48000;
88 avctx->sample_rate = 96000;
91 avctx->sample_rate = 192000;
94 avctx->sample_rate = 0;
95 av_log(avctx, AV_LOG_ERROR, "reserved sample rate (%d)\n",
106 av_channel_layout_uninit(&avctx->ch_layout);
107 avctx->ch_layout = channel_layouts[channel_layout];
108 if (!avctx->ch_layout.nb_channels) {
109 av_log(avctx, AV_LOG_ERROR, "reserved channel configuration (%d)\n",
114 avctx->bit_rate = FFALIGN(avctx->ch_layout.nb_channels, 2) * avctx->sample_rate *
115 avctx->bits_per_coded_sample;
117 if (avctx->debug & FF_DEBUG_PICT_INFO)
118 ff_dlog(avctx,
120 avctx->ch_layout.nb_channels, avctx->bits_per_coded_sample,
121 avctx->sample_rate, avctx->bit_rate);
125 static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame,
137 av_log(avctx, AV_LOG_ERROR, "PCM packet too small\n");
141 if ((retval = pcm_bluray_parse_header(avctx, src)))
149 num_source_channels = FFALIGN(avctx->ch_layout.nb_channels, 2);
151 (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3;
156 if ((retval = ff_get_buffer(avctx, frame, 0)) < 0)
162 switch (avctx->ch_layout.u.mask) {
168 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
187 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
190 bytestream2_get_buffer(&gb, dst16, avctx->ch_layout.nb_channels * 2);
191 dst16 += avctx->ch_layout.nb_channels;
193 channel = avctx->ch_layout.nb_channels;
202 channel = avctx->ch_layout.nb_channels;
212 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
236 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
264 if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
296 if (avctx->debug & FF_DEBUG_BITSTREAM)
297 ff_dlog(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",