#include <stdint.h>
#include "avcodec.h"
-#include "dsputil.h"
#include "libavutil/intreadwrite.h"
#include "get_bits.h"
#include "libavutil/crc.h"
#include "parser.h"
#include "mlp_parser.h"
+#include "mlpdsp.h"
#include "mlp.h"
/** number of bits used for VLC lookup - longest Huffman code is 9 */
int8_t bypassed_lsbs[MAX_BLOCKSIZE][MAX_CHANNELS];
int32_t sample_buffer[MAX_BLOCKSIZE][MAX_CHANNELS];
- DSPContext dsp;
+ MLPDSPContext dsp;
} MLPDecodeContext;
static VLC huff_vlc[3];
m->avctx = avctx;
for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
m->substream[substr].lossless_check_data = 0xffffffff;
- ff_dsputil_init(&m->dsp, avctx);
+ ff_mlpdsp_init(&m->dsp);
avcodec_get_frame_defaults(&m->frame);
avctx->coded_frame = &m->frame;
} else {
m->avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1);
}
+ if (m->avctx->channels<=2 && m->avctx->channel_layout == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) {
+ av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n");
+ m->max_decoded_substream = 0;
+ if (m->avctx->channels==2)
+ m->avctx->channel_layout = AV_CH_LAYOUT_STEREO;
+ }
if (m->avctx->channels &&
!m->avctx->request_channels && !m->avctx->request_channel_layout &&
av_get_channel_layout_nb_channels(m->avctx->channel_layout) != m->avctx->channels) {