diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 21579abc71213365dce0f0e8f1bdb1d195ed48ed..d2ae6f9bdde924115aeaa287df21f378a9390e70 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1292,10 +1292,14 @@ typedef enum #define LFE_CHANNEL 3 #define MIN_LFE_NRG 0.5f -#define MCT_MAX_CHANNELS MAX_TRANSPORT_CHANNELS +#ifdef ADJUST_MCT_CHANNELS_MAX +#define MCT_MAX_CHANNELS 11 /* == 7.1.4 LS channels without the LFE channel */ +#define MCT_MAX_BLOCKS ( ( MCT_MAX_CHANNELS + 1 ) / CPE_CHANNELS ) /* max. number of channel pairs (MCT_MAX_CHANNELS/2) within MCT*/ +#else +#define MCT_MAX_CHANNELS 12 #define MCT_MAX_BLOCKS ( MCT_MAX_CHANNELS / CPE_CHANNELS ) /* max. number of channel pairs (MCT_MAX_CHANNELS/2) within MCT*/ - #define MAX_NUM_DATA max( MCT_MAX_CHANNELS, 4 ) +#endif #define NBBITS_MCT_RATIO 4 #define BITRATE_MCT_RATIO_RANGE ( 1 << NBBITS_MCT_RATIO ) /* Range of the coded bitrate distribution ratio */ diff --git a/lib_com/options.h b/lib_com/options.h index 580747ece508f059913f59d7584f1342099b17be..b530fac825a39908c1ce7e8371531650fc4088f3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,7 @@ #define FIX_1053_AEID_FILE_TEST /* Philips: Tests for the -aeid file and fix for memory error */ #define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ +#define ADJUST_MCT_CHANNELS_MAX /* FhG: set correct max mct channels constant*/ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_mct_core_dec.c b/lib_dec/ivas_mct_core_dec.c index b7c4c95288f0f76f53b775c408588df29994d77d..909d08058ee4d28be638bfbda7fd60cfb199ce81 100644 --- a/lib_dec/ivas_mct_core_dec.c +++ b/lib_dec/ivas_mct_core_dec.c @@ -77,8 +77,15 @@ void ivas_mct_side_bits( { for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { - sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; - i++; +#ifdef ADJUST_MCT_CHANNELS_MAX + if ( i < MCT_MAX_CHANNELS ) + { +#endif + sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; + i++; +#ifdef ADJUST_MCT_CHANNELS_MAX + } +#endif } } @@ -194,11 +201,20 @@ void ivas_mct_core_dec( { for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { - sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; - i++; +#ifdef ADJUST_MCT_CHANNELS_MAX + if ( i < MCT_MAX_CHANNELS ) + { +#endif + sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; + i++; +#ifdef ADJUST_MCT_CHANNELS_MAX + } +#endif } } +#ifndef ADJUST_MCT_CHANNELS_MAX + /*seems like obsolete code*/ for ( ch = 0, i = 0; ch < nChannels; ch++ ) { if ( sts[ch]->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) @@ -208,6 +224,7 @@ void ivas_mct_core_dec( i++; } +#endif bfi = sts[0]->bfi; for ( ch = 0; ch < nChannels; ch++ ) diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 214da9fff729111a50552912a8fc06c081d0c2d7..fa25c6cecec0cc1ed03ee1c04c20eccac77589d7 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -265,7 +265,15 @@ void ivas_mct_core_enc( { for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { - sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; +#ifdef ADJUST_MCT_CHANNELS_MAX + if ( cpe_id * CPE_CHANNELS + ch < nChannels ) + { +#endif + sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; +#ifdef ADJUST_MCT_CHANNELS_MAX + } +#endif + if ( hCPE[cpe_id]->hCoreCoder[ch]->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) { i++;