Commit e0710ca3 authored by vaillancour's avatar vaillancour
Browse files

fix for missing saturation

parent c4f285a1
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@
#define FIX_1942_ASSERTION_LOWSHELF                          /* FhG: Modified the target_gains_db_fx calculation in compute_t60_coeffs_fx() */
#define FIX_1942_ASSERTION_LOWSHELF                          /* FhG: Modified the target_gains_db_fx calculation in compute_t60_coeffs_fx() */
#define FIX_1944_CRASH_FOR_STEREO                            /* FhG: improve TonalMDCTConceal_InsertNoise calculation precision */
#define FIX_1944_CRASH_FOR_STEREO                            /* FhG: improve TonalMDCTConceal_InsertNoise calculation precision */
#define FIX_1970_SBA_CRASH                                   /* Dlb: Fix for issue 1970, SBA crash */
#define FIX_1970_SBA_CRASH                                   /* Dlb: Fix for issue 1970, SBA crash */
#define FIX_1978_SAT_MISSING_IN_GAIN_ENC                     /* VA:  Fix add saturation missing that lead to a crash in P800-10 */


/* #################### Start BASOP porting switches ############################ */
/* #################### Start BASOP porting switches ############################ */


@@ -84,6 +85,7 @@
#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */
#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering 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 NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328  */



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


#endif
#endif
+8 −0
Original line number Original line Diff line number Diff line
@@ -728,10 +728,18 @@ void gain_enc_SQ_fx(


    *gain_pit = round_fx_o( L_shl_o( L_div, add( exp, exp_div ), &Overflow ), &Overflow ); /*Q14*/
    *gain_pit = round_fx_o( L_shl_o( L_div, add( exp, exp_div ), &Overflow ), &Overflow ); /*Q14*/


#ifdef FIX_1978_SAT_MISSING_IN_GAIN_ENC
    L_tmp1 = L_mult_sat( coeff[1], coeff[4] ); /*Q31*/
#else
    L_tmp1 = L_mult( coeff[1], coeff[4] ); /*Q31*/
    L_tmp1 = L_mult( coeff[1], coeff[4] ); /*Q31*/
#endif
    exp1 = add( exp_coeff[1], exp_coeff[4] );
    exp1 = add( exp_coeff[1], exp_coeff[4] );


#ifdef FIX_1978_SAT_MISSING_IN_GAIN_ENC
    L_tmp2 = L_mult_sat( coeff[0], coeff[3] ); /*Q31*/
#else
    L_tmp2 = L_mult( coeff[0], coeff[3] ); /*Q31*/
    L_tmp2 = L_mult( coeff[0], coeff[3] ); /*Q31*/
#endif
    exp2 = add( exp_coeff[0], exp_coeff[3] );
    exp2 = add( exp_coeff[0], exp_coeff[3] );


    IF( GT_16( exp1, exp2 ) )
    IF( GT_16( exp1, exp2 ) )