Commit 206ff2ec authored by Jonas Svedberg's avatar Jonas Svedberg
Browse files

separated initilization value fix into its own define and deactivated it, clang formatting applied

parent 84ab4119
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@


#define FIX617_UBSAN_DIVBYZERO_STEREOCNG                      /* Eri: Issue 617: Decoder UBSAN: division by zero in stereo cng when inut is 16kHz and output is 32kHz */
//#define FIX617_UBSAN_DIVBYZERO_STEREOCNG_LAST_SHB_ENER_INIT /* Eri: Issue 617:  old EVS initilization leads to incorrect interpolation in dB domain, likely not BE  */

/* ################## End BE DEVELOPMENT switches ######################### */

+7 −7
Original line number Diff line number Diff line
@@ -845,10 +845,10 @@ void td_cng_dec_init(
    hTdCngDec->shb_dtx_count = 0;
    hTdCngDec->trans_cnt = 0;
    hTdCngDec->burst_cnt = 0;
#ifdef FIX617_UBSAN_DIVBYZERO_STEREOCNG
#ifdef FIX617_UBSAN_DIVBYZERO_STEREOCNG_LAST_SHB_ENER_INIT
    if ( st->element_mode != EVS_MONO )
    {
        hTdCngDec->last_shb_ener = -82.0f; /* in dB domain */
        hTdCngDec->last_shb_ener = -82.0f; /* low level in dB domain corresspodning to index 0(-15) */
    }
    else
    {
+14 −8
Original line number Diff line number Diff line
@@ -382,6 +382,12 @@ static void stereo_dft_generate_comfort_noise(
                ftmp = ( *ptr1 * *ptr1 + *ptr2 * *ptr2 );
                assert( ftmp != 0.0f );
                ftmp = 1.0f / ftmp;
                /* in float:
                     both a = "div"=(1/(x^2+y^2) and sqrt(a)  is used and summed up in the same loop.

                  in BASOP:
                    sum up  using inv_sqrt( *ptr1 * *ptr1 + *ptr2 * *ptr2 ), in this loop 
                    and then sum up  enr = sum( *ptr0 * *ptr0 ),  in a subsequent MAC loop  */
#else
                ftmp = 1.0f / ( *ptr1 * *ptr1 + *ptr2 * *ptr2 );
#endif