Commit 395ce043 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1660-basop-porting-mr-195-port-mr-1466-from-float-implement-conversion-to-and-from-acn-sn3d
parents 2233467a 4e669c50
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@

#define FIX_1979_SAT_MISSING_IN_LSF_ENC                      /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */
#define FIX_1946_CRASH_JBM_PROCESSING                        /* FhG: Increased guard bits of DFT_fx */
#define FIX_1980_CRASH_FDCNG_ENCODESID                       /* FhG: Add one bit of headroom in e_fx calculation in FdCng_encodeSID_ivas_fx() */
/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
@@ -88,8 +89,10 @@
#define NONBE_1302_FIX_OMASA_JBM_FLUSH                  /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */
#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328  */
#define FIX_1319_STACK_SBA_DECODER                      /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */
#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */
//de-activate FIX_1320_STACK_CPE_DECODER due to sanitizer issues in #1986; also review needed for patch within FIX_1946_CRASH_JBM_PROCESSING, which gets partially disabled
//#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */

#define FIX_1984_SAT_IN_PSYCHAD                         /* VA: Issue 1984: proposal to fix an assert */

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

+9 −5
Original line number Diff line number Diff line
@@ -1446,7 +1446,11 @@ void PsychAdaptLowFreqDeemph(
        tmp_e = min_e;
        move16();
        tmp = Inv16( min, &tmp_e ); /*Q15 - tmp_e*/
#ifdef FIX_1984_SAT_IN_PSYCHAD
        L_tmp = L_shl_sat( L_mult_sat( tmp, max_val ), add( tmp_e, max_e ) ); /* Q31 */
#else
        L_tmp = L_shl( L_mult( tmp, max_val ), add( tmp_e, max_e ) );                     /* Q31 */
#endif
        L_tmp = BASOP_Util_Log2( L_tmp );    /* Q25 */
        L_tmp = L_shr( L_tmp, 7 );           /* 0.0078125f = 1.f/(1<<7) */
        L_tmp = BASOP_Util_InvLog2( L_tmp ); /* Q31 */
+10 −3
Original line number Diff line number Diff line
@@ -2469,7 +2469,11 @@ void FdCng_encodeSID_ivas_fx(
            v_fx[i] = Mpy_32_32( 671088640 /*10 in Q26*/, BASOP_Util_Log10( E_fx[i], hFdCngEnc->msNoiseEst_fx_exp ) ); // Q20 = 26+25-31
            move32();
        }
#ifdef FIX_1980_CRASH_FDCNG_ENCODESID
        e_fx = L_add( e_fx, L_shr( v_fx[i], 1 ) ); // Q19, add one bit headroom
#else
        e_fx = L_add( e_fx, v_fx[i] );    // Q20
#endif
    }

    /* Normalize MSVQ input */
@@ -2538,8 +2542,11 @@ void FdCng_encodeSID_ivas_fx(
    {
        gain_fx = L_add( gain_fx, v_fx[i] ); // Q = 31 - v_e
    }

#ifdef FIX_1980_CRASH_FDCNG_ENCODESID
    e_fx = L_shl( e_fx, sub( 12, v_e ) ); // Q = 31 - v_e
#else
    e_fx = L_shl( e_fx, sub( 11, v_e ) ); // Q = 31 - v_e
#endif
    gain_fx = Mpy_32_16_1( L_sub( e_fx, gain_fx ), div_s( 1, N ) ); // Q = 31 - v_e
    gain_fx = L_shl( gain_fx, sub( v_e, 8 ) );                      // Q23