Commit 280b6442 authored by multrus's avatar multrus
Browse files

Merge branch '1984-crash-in-basop-encoder-ism4-190kbps' into 'main'

possible fix for 1984-crash-in-basop-encoder-ism4-190kbps

Closes #1984

See merge request !2189
parents 0b4901bd 2b2d3e40
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@
//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 */