Commit 0a1cdef5 authored by multrus's avatar multrus
Browse files

port flp mr 1630 - adjust mct max. channels

parent 2f05eceb
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1292,10 +1292,15 @@ typedef enum
#define LFE_CHANNEL                             3

#define MIN_LFE_NRG                             0.5f
#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                        MAX_TRANSPORT_CHANNELS
#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 */
+2 −0
Original line number Diff line number Diff line
@@ -170,6 +170,8 @@
#define NONBE_FIX_1376_MDCT_CONCEALMENT                 /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */
#define NONBE_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */
#define FIX_ISSUE_2008_MISSING_CODE_FROM_PORTING        /* FhG: Issue 2008: Code deleted while porting float-main MR !1504 (BASOP issue 1565)*/
#define ADJUST_MCT_CHANNELS_MAX                         /* FhG: set correct max mct channels constant*/

/* #################### End BASOP porting switches ############################ */

/* clang-format on */
+21 −5
Original line number Diff line number Diff line
@@ -77,8 +77,15 @@ void ivas_mct_side_bits(
    {
        for ( ch = 0; ch < CPE_CHANNELS; ch++ )
        {
#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++ )
        {
#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 )
@@ -207,7 +223,7 @@ void ivas_mct_core_dec(
        }
        i++;
    }

#endif
    bfi = sts[0]->bfi;

    for ( ch = 0; ch < nChannels; ch++ )
+9 −1
Original line number Diff line number Diff line
@@ -265,7 +265,15 @@ void ivas_mct_core_enc(
    {
        for ( ch = 0; ch < CPE_CHANNELS; 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++;