Commit 6a427cf5 authored by vaclav's avatar vaclav
Browse files

Merge branch '1553_ref_PortFlpMR1342' into 'float-pc'

Port MR 1342 from float to float-pc

See merge request !1527
parents e51eb5af 0257b4b3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -189,6 +189,8 @@
#define NONBE_FIX_935_SBA_REVERB                              /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */
#define FIX_969_USAN_IGF_ARITH                          /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */
#define FIX_959_MASA_LINEAR_REND                        /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */
#define FIX_971_LOG2_IDX_GAIN_0                         /* VA: prevent -Inf due to log2(ratio==0)  */


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

+6 −0
Original line number Diff line number Diff line
@@ -2753,6 +2753,12 @@ void fb_tbe_enc(
    hBWE_TD->prev_fb_energy = sum2_f( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 );
    fb_exc_energy = sum2_f( fb_exc, L_FRAME16k ) + EPSILON;
    ratio = (float) sqrt( temp2 / fb_exc_energy );
#ifdef FIX_971_LOG2_IDX_GAIN_0
    if ( ratio < 1.0f )
    {
        ratio = 1.0f;
    }
#endif
    idxGain = (int16_t) ( log2_f( (float) ratio ) + 0.5f );
    idxGain = max( 0, min( 15, idxGain ) );
    ratio = (float) ( 1 << idxGain );