Commit b490057b authored by vaclav's avatar vaclav Committed by Sandesh Venkatesh
Browse files

add comments

parent 12785e1f
Loading
Loading
Loading
Loading
Loading
+34 −14
Original line number Diff line number Diff line
@@ -1071,7 +1071,7 @@ ivas_error config_acelp1(
        {
            bits = sub( bits, TDM_IC_LSF_PRED_BITS );
        }
        /* gain Q bit-budget - part 1 */
        /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */
        test();
        test();
        test();
@@ -1079,7 +1079,9 @@ ivas_error config_acelp1(
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && !inactive_coder_type_flag ) )
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ ||
            ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */
        )
#else
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
@@ -1426,7 +1428,10 @@ ivas_error config_acelp1(
        move16();
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) )
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || /* @12.8kHz core except of GSC */
             ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ ||
             EQ_16( core, HQ_CORE ) /* ACELP -> HQ switching in EVS */
    )
#else
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) )
#endif
@@ -1494,7 +1499,9 @@ ivas_error config_acelp1(
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) )
        IF( flag_hardcoded /* EVS */ ||
            ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
@@ -1607,7 +1614,8 @@ ivas_error config_acelp1(
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) )
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
@@ -1651,7 +1659,9 @@ ivas_error config_acelp1(
        }
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && inactive_coder_type_flag ) )
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) /* LBR secondary channel in TD stereo */ ||
             ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) /* GSC @12.8kHz */ ||
             ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ )
#else
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
@@ -1796,7 +1806,8 @@ ivas_error config_acelp1(
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ ||
            ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* IVAS GSC @16kHz */
#else
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */
#endif
@@ -2202,9 +2213,10 @@ ivas_error config_acelp1_IVAS(
        test();
        test();
        test();
        /* gain Q bit-budget - part 1 */
        /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && !inactive_coder_type_flag ) )
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ ||
            ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */ )
#else
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && ( coder_type != INACTIVE ) && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( ( coder_type == INACTIVE ) && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
@@ -2553,7 +2565,9 @@ ivas_error config_acelp1_IVAS(
        move16();
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) )
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) /* @12.8kHz core except of GSC */ ||
             ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ ||
             EQ_16( core, HQ_CORE ) /* ACELP -> HQ switching in EVS */ )
#else
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) )
#endif
@@ -2621,7 +2635,9 @@ ivas_error config_acelp1_IVAS(
        test();
        /* algebraic codebook bit-budget */
#ifdef NONBE_FIX_GSC_BSTR
        IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) )
        IF( flag_hardcoded /* EVS */ ||
            ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
@@ -2726,7 +2742,8 @@ ivas_error config_acelp1_IVAS(
        test();
        /* AVQ codebook */
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( !inactive_coder_type_flag && coder_type == INACTIVE ) )
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
@@ -2768,7 +2785,9 @@ ivas_error config_acelp1_IVAS(
        }
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && inactive_coder_type_flag ) )
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) /* LBR secondary channel in TD stereo */ ||
             ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) /* GSC @12.8kHz */ ||
             ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ )
#else
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
@@ -2913,7 +2932,8 @@ ivas_error config_acelp1_IVAS(
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ ||
            ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* IVAS GSC @16kHz */
#else
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */
#endif