Commit f14d119d authored by vaillancour's avatar vaillancour
Browse files

possible fix to 2015

parent d84cb600
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@
#define FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING          /* FhG: Replace L_shl with L_shl_sat to prevent overflow when calculating scale factors for very small numbers in the logarithmic domain */
#define FIX_APA_EXECS_SCALING                                /* VA: fix scaling of JBM APA buffer */
#define FIX_2164_ASSERT_IN_OMASA_PREPROC_FOR_EDIT            /* Nokia: Issue 2164: Prevent overflow when calculating equalization coefficient for editing before clamping to safe range */

#define FIX_2015_PREMPH_SAT                                  /* VA: saturation can happen during preemphasis filtering due to a too aggressive scaling factor */
/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+4 −0
Original line number Diff line number Diff line
@@ -231,7 +231,11 @@ ivas_error pre_proc_front_ivas_fx(

    Word16 Q_min = add( sub( 15, st->exp_old_inp_12k8 ), norm_arr( st->old_inp_12k8_fx, L_INP_MEM ) );
    Word16 input_frame_full = shl( input_frame, 1 ); //(old frame input length + new frame input length)
#ifndef FIX_2015_PREMPH_SAT
    Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) );
#else
    Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 + 1 ) );
#endif
    Q_min = s_max( -2, Q_min );
    Copy_Scale_sig_32_16( st->input32_fx - input_frame, st->input_fx - input_frame, input_frame_full, sub( Q_min, st->q_inp32 ) ); // Q_min
    st->q_inp = Q_min;