Lines Matching defs:avctx
140 AVCodecContext *avctx;
291 static av_cold int mlp_decode_init(AVCodecContext *avctx)
294 MLPDecodeContext *m = avctx->priv_data;
297 m->avctx = avctx;
304 if (avctx->request_channel_layout) {
306 av_channel_layout_from_mask(&m->downmix_layout, avctx->request_channel_layout);
325 if ((ret = ff_mlp_read_major_sync(m->avctx, &mh, gb)) != 0)
329 av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown bits per sample\n");
333 av_log(m->avctx, AV_LOG_ERROR,
339 av_log(m->avctx, AV_LOG_ERROR,
345 av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown sampling rate\n");
349 av_log(m->avctx, AV_LOG_ERROR,
355 av_log(m->avctx, AV_LOG_ERROR,
361 av_log(m->avctx, AV_LOG_ERROR,
369 if (m->avctx->codec_id == AV_CODEC_ID_MLP && mh.num_substreams > 2) {
370 av_log(m->avctx, AV_LOG_ERROR, "MLP only supports up to 2 substreams.\n");
374 avpriv_request_sample(m->avctx,
391 m->avctx->sample_rate = mh.group1_samplerate;
392 m->avctx->frame_size = mh.access_unit_size;
394 m->avctx->bits_per_raw_sample = mh.group1_bits;
396 m->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
398 m->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
402 m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
411 if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
413 avpriv_request_sample(m->avctx,
423 avpriv_request_sample(m->avctx,
430 m->avctx->ch_layout.nb_channels == 2)
439 if (m->avctx->ch_layout.nb_channels > 2)
442 if (m->avctx->ch_layout.nb_channels <= 2 &&
444 av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n");
446 if (m->avctx->ch_layout.nb_channels == 2) {
447 av_channel_layout_uninit(&m->avctx->ch_layout);
448 m->avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
469 if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
512 const int std_max_matrix_channel = m->avctx->codec_id == AV_CODEC_ID_MLP
519 av_log(m->avctx, AV_LOG_ERROR,
526 if (m->avctx->codec_id == AV_CODEC_ID_MLP && noise_type) {
527 av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\n");
538 av_log(m->avctx, AV_LOG_ERROR,
545 av_log(m->avctx, AV_LOG_ERROR,
553 avpriv_request_sample(m->avctx,
561 av_log(m->avctx, AV_LOG_ERROR,
573 av_log(m->avctx, AV_LOG_DEBUG,
591 av_log(m->avctx, AV_LOG_WARNING,
602 if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
610 avpriv_request_sample(m->avctx,
621 av_log(m->avctx, AV_LOG_ERROR, "restart header checksum error\n");
647 av_channel_layout_uninit(&m->avctx->ch_layout);
648 av_channel_layout_from_mask(&m->avctx->ch_layout, s->mask);
652 m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
654 if (m->avctx->codec_id == AV_CODEC_ID_MLP && m->needs_reordering) {
688 av_log(m->avctx, AV_LOG_ERROR, "Filters may change only once per access unit.\n");
694 av_log(m->avctx, AV_LOG_ERROR,
710 av_log(m->avctx, AV_LOG_ERROR,
716 av_log(m->avctx, AV_LOG_ERROR,
729 av_log(m->avctx, AV_LOG_ERROR,
753 const int max_primitive_matrices = m->avctx->codec_id == AV_CODEC_ID_MLP
758 av_log(m->avctx, AV_LOG_ERROR, "Matrices may change only once per access unit.\n");
765 av_log(m->avctx, AV_LOG_ERROR,
778 av_log(m->avctx, AV_LOG_ERROR,
784 av_log(m->avctx, AV_LOG_ERROR,
837 av_log(m->avctx, AV_LOG_ERROR, "Total filter orders too high.\n");
843 av_log(m->avctx, AV_LOG_ERROR,
863 av_log(m->avctx, AV_LOG_ERROR, "Invalid huff_lsbs.\n");
890 av_log(m->avctx, AV_LOG_ERROR, "Invalid blocksize.\n");
906 avpriv_request_sample(m->avctx, "Negative output_shift");
914 m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
940 av_log(m->avctx, AV_LOG_ERROR, "quant_step_size larger than huff_lsbs\n");
994 avpriv_request_sample(m->avctx,
999 av_log(m->avctx, AV_LOG_ERROR, "too many audio samples in frame\n");
1017 av_log(m->avctx, AV_LOG_ERROR, "block data length mismatch\n");
1095 AVCodecContext *avctx = m->avctx;
1100 int is32 = (m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
1102 if (m->avctx->ch_layout.nb_channels != s->max_matrix_channel + 1) {
1103 av_log(m->avctx, AV_LOG_ERROR, "channel count mismatch\n");
1108 av_log(avctx, AV_LOG_ERROR, "No samples to output.\n");
1139 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
1167 static int read_access_unit(AVCodecContext *avctx, AVFrame *frame,
1172 MLPDecodeContext *m = avctx->priv_data;
1202 av_log(m->avctx, AV_LOG_WARNING,
1223 if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
1224 av_log(m->avctx, AV_LOG_ERROR, "There must be no extraword for MLP.\n");
1232 av_log(m->avctx, AV_LOG_ERROR, "Insufficient data for headers\n");
1237 av_log(m->avctx, AV_LOG_ERROR, "Invalid nonrestart_substr.\n");
1242 av_log(m->avctx, AV_LOG_ERROR,
1249 av_log(avctx, AV_LOG_ERROR,
1268 av_log(avctx, AV_LOG_ERROR, "Parity check failed.\n");
1279 m->substream[m->max_decoded_substream].max_channel == avctx->ch_layout.nb_channels - 1)
1323 if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD && shorten_by & 0x2000)
1325 else if (m->avctx->codec_id == AV_CODEC_ID_MLP && shorten_by != 0xD234)
1328 av_log(m->avctx, AV_LOG_DEBUG, "End of stream indicated.\n");
1342 av_log(m->avctx, AV_LOG_ERROR, "Substream %d parity check failed.\n", substr);
1344 av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n" , substr);
1352 av_log(m->avctx, AV_LOG_ERROR,
1375 av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n", substr);
1383 static void mlp_decode_flush(AVCodecContext *avctx)
1385 MLPDecodeContext *m = avctx->priv_data;