Commit eadfd676 authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch 'basop-2302-inconsistency-in-the-threshold-for-lsf-q-codebook-type-decision' into 'main'

[non-BE] [allow-regression] [split-non-BE] Fix inconsistency in the threshold for LSF Q codebook-type decision

See merge request !2708
parents 98e55cf7 8bff9fd5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@
#define OPT_NBE_2311_HARM_GSC_GAIN                      /* VA: issue 2311: non-BE part of the GSC gain harmonization */
#define FIX_2261_REMOVE_LP_RESCALING                    /* VA: Remove of unnecessary lpc coefficient rescaling */
#define FIX_2320_OOB_SCE_SWITCHING                      /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */
#define FIX_2302_LSF_CDBK_THRESHOLD                     /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision  */

/* ##################### End NON-BE switches ########################### */

+13 −6
Original line number Diff line number Diff line
@@ -1580,15 +1580,21 @@ void lsf_end_enc_ivas_fx(

    IF( st->bwidth == NB )
    {
#ifdef FIX_2302_LSF_CDBK_THRESHOLD
        abs_threshold = L_add( SFNETLOWLIMIT_NB, 0 );
#else
#ifdef HARM_LSF_ENC
        abs_threshold = L_add( SFNETLOWLIMIT_NB, 0 );
#else
        abs_threshold = SFNETLOWLIMIT_NB / 2;
#endif
        move32();
#endif
    }
    ELSE
    {
#ifdef FIX_2302_LSF_CDBK_THRESHOLD
        abs_threshold = L_add( SFNETLOWLIMIT_WB, 0 );
#else
        abs_threshold = SFNETLOWLIMIT_WB / 2;
        move32();
#ifdef HARM_LSF_ENC
@@ -1596,6 +1602,7 @@ void lsf_end_enc_ivas_fx(
        {
            abs_threshold = L_add( SFNETLOWLIMIT_WB, 0 );
        }
#endif
#endif
    }

@@ -2638,12 +2645,12 @@ static Word32 vq_lvq_lsf_enc(
            diff[j] = shl_sat( diff[j], 4 );
            move16();
        }
        L_tmp = L_mult( mult( diff[0], shl_sat( w[0], 1 ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */
        L_tmp = L_mult( mult( diff[0], shl_sat( w[0], 1 ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q4 */
        FOR( j = 1; j < M; j++ )
        {
            L_tmp = L_mac( L_tmp, mult( diff[j], shl_sat( w[j], 1 ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */
            L_tmp = L_mac( L_tmp, mult( diff[j], shl_sat( w[j], 1 ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q4 */
        }
        e[i] = L_tmp; /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */
        e[i] = L_tmp; /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q4 */
        move32();
    }

@@ -2757,10 +2764,10 @@ static Word32 vq_lvq_lsf_enc_ivas_fx(
            diff[j] = shl_sat( diff[j], 4 );
            move16();
        }
        L_tmp = L_mult( mult( diff[0], shl_sat( w[0], 1 ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */
        L_tmp = L_mult( mult( diff[0], shl_sat( w[0], 1 ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q4 */
        FOR( j = 1; j < M; j++ )
        {
            L_tmp = L_mac_sat( L_tmp, mult( diff[j], shl_sat( w[j], 1 ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */
            L_tmp = L_mac_sat( L_tmp, mult( diff[j], shl_sat( w[j], 1 ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q4 */
        }
        e[i] = L_tmp;
        move32();