Loading apps/decoder.c +7 −0 Original line number Diff line number Diff line Loading @@ -736,6 +736,13 @@ cleanup: } } #ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD /* This free differs from float version and is done always. This should be safe to do even though we leave a return * value as not handled. This is needed as HRTF statistics from ROM are currently converted from float values. */ IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); #endif IVAS_DEC_Close( &hIvasDec ); CustomLsReader_close( &hLsCustomReader ); hrtfFileReader_close( &hrtfReader ); Loading lib_com/options.h +5 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,8 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define FIX_ISSUE_1965_REPLACE_CARRY_OVERFLOW /* FhG: bit-exact, replace carry and overflow operations by 64-bit operations, MR 2166 */ #define ISSUE_1836_replace_overflow_libcom /* FhG: replace overflow operators by non-overflow-alternatives in lib_com - BE */ #define ISSUE_1836_replace_overflow_libcom /* FhG: BE - replace overflow operators by non-overflow-alternatives in lib_com */ #define ISSUE_1867_replace_overflow_libenc /* FhG: BE - replace overflow operators by non-overflow-alternatives all over the lib_enc module */ #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_1970_SBA_CRASH /* Dlb: Fix for issue 1970, SBA crash */ Loading @@ -86,6 +87,9 @@ #define FIX_1980_CRASH_FDCNG_ENCODESID /* FhG: Add one bit of headroom in e_fx calculation in FdCng_encodeSID_ivas_fx() */ #define FIX_1987_CRASH_OMASA_ENERGY /* FhG: Replace cldfbAnalysis_ts_fx_fix_q() with cldfbAnalysis_ts_fx_var_q() to avoid assertion error */ #define FIX_1985_SBA_714_HF_LOSS /* Dlb: Fix for issue 1985, improved dirac ref pow precision*/ #define FIX_1819_EIGENVALUE_ERROR /* FhG: Workaround for zero eigenvalue: replace with epsilon if det != 0*/ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure. */ #define FIX_1995_REVERB_INIT /* VA/Nokia: issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */ /* #################### Start BASOP porting switches ############################ */ Loading lib_com/stat_noise_uv_mod_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ void stat_noise_uv_mod_fx( { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ //??Sat exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ #else exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ #endif Loading Loading @@ -197,7 +197,7 @@ void stat_noise_uv_mod_fx( tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = shl_sat( tmp_res, tmp_shift ); //??Sat tmp_res = shl_sat( tmp_res, tmp_shift ); #else tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); #endif Loading lib_enc/acelp_core_switch_enc_fx.c +13 −1 Original line number Diff line number Diff line Loading @@ -726,9 +726,11 @@ static void bwe_switch_enc_fx( Word16 synth_subfr_bwe_fx[SWITCH_MAX_GAP]; /* synthesized bwe for core switching */ Word16 n, L; BSTR_ENC_HANDLE hBstr; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif hBstr = st_fx->hBstr; L = NS2SA_FX2( st_fx->input_Fs, FRAME_SIZE_NS ); Loading Loading @@ -845,7 +847,11 @@ static void bwe_switch_enc_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); #ifdef ISSUE_1867_replace_overflow_libenc gain_fx = round_fx_sat( Isqrt( L_tmp1 ) ); /*Q12 */ #else gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ #endif ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); /* Q0 */ push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); Loading @@ -872,9 +878,11 @@ static void bwe_switch_enc_ivas_fx( Word16 synth_subfr_bwe_fx[SWITCH_MAX_GAP]; /* synthesized bwe for core switching */ Word16 n, L; BSTR_ENC_HANDLE hBstr; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif hBstr = st_fx->hBstr; L = NS2SA_FX2( st_fx->input_Fs, FRAME_SIZE_NS ); Loading Loading @@ -988,7 +996,11 @@ static void bwe_switch_enc_ivas_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); #ifdef ISSUE_1867_replace_overflow_libenc gain_fx = round_fx_sat( Isqrt( L_tmp1 ) ); /*Q12 */ #else gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ #endif ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); Loading lib_enc/acelp_enc_util_fx.c +14 −2 Original line number Diff line number Diff line Loading @@ -161,8 +161,10 @@ void E_ACELP_conv( { Word16 i, k; Word32 L_tmp; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif FOR( k = 0; k < L_SUBFR; k++ ) { Loading @@ -175,7 +177,11 @@ void E_ACELP_conv( L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ } L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ #ifdef ISSUE_1867_replace_overflow_libenc cn2[k] = round_fx_sat( L_shl_sat( L_tmp, 5 ) ); /* Q0 */ #else cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0 */ #endif } } Loading @@ -187,8 +193,10 @@ void E_ACELP_conv_ivas_fx( { Word16 i, k; Word32 L_tmp; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif FOR( k = 0; k < L_SUBFR; k++ ) { Loading @@ -201,7 +209,11 @@ void E_ACELP_conv_ivas_fx( L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*Qnew + 11*/ } L_tmp = W_sat_l( L_tmp_64 ); /* Qnew + 11 */ #ifdef ISSUE_1867_replace_overflow_libenc cn2[k] = round_fx_sat( L_shl_sat( L_tmp, 5 ) ); /* Qnew*/ #else cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Qnew*/ #endif move16(); } } Loading Loading
apps/decoder.c +7 −0 Original line number Diff line number Diff line Loading @@ -736,6 +736,13 @@ cleanup: } } #ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD /* This free differs from float version and is done always. This should be safe to do even though we leave a return * value as not handled. This is needed as HRTF statistics from ROM are currently converted from float values. */ IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); #endif IVAS_DEC_Close( &hIvasDec ); CustomLsReader_close( &hLsCustomReader ); hrtfFileReader_close( &hrtfReader ); Loading
lib_com/options.h +5 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,8 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define FIX_ISSUE_1965_REPLACE_CARRY_OVERFLOW /* FhG: bit-exact, replace carry and overflow operations by 64-bit operations, MR 2166 */ #define ISSUE_1836_replace_overflow_libcom /* FhG: replace overflow operators by non-overflow-alternatives in lib_com - BE */ #define ISSUE_1836_replace_overflow_libcom /* FhG: BE - replace overflow operators by non-overflow-alternatives in lib_com */ #define ISSUE_1867_replace_overflow_libenc /* FhG: BE - replace overflow operators by non-overflow-alternatives all over the lib_enc module */ #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_1970_SBA_CRASH /* Dlb: Fix for issue 1970, SBA crash */ Loading @@ -86,6 +87,9 @@ #define FIX_1980_CRASH_FDCNG_ENCODESID /* FhG: Add one bit of headroom in e_fx calculation in FdCng_encodeSID_ivas_fx() */ #define FIX_1987_CRASH_OMASA_ENERGY /* FhG: Replace cldfbAnalysis_ts_fx_fix_q() with cldfbAnalysis_ts_fx_var_q() to avoid assertion error */ #define FIX_1985_SBA_714_HF_LOSS /* Dlb: Fix for issue 1985, improved dirac ref pow precision*/ #define FIX_1819_EIGENVALUE_ERROR /* FhG: Workaround for zero eigenvalue: replace with epsilon if det != 0*/ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure. */ #define FIX_1995_REVERB_INIT /* VA/Nokia: issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */ /* #################### Start BASOP porting switches ############################ */ Loading
lib_com/stat_noise_uv_mod_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ void stat_noise_uv_mod_fx( { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ //??Sat exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ #else exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ #endif Loading Loading @@ -197,7 +197,7 @@ void stat_noise_uv_mod_fx( tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = shl_sat( tmp_res, tmp_shift ); //??Sat tmp_res = shl_sat( tmp_res, tmp_shift ); #else tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); #endif Loading
lib_enc/acelp_core_switch_enc_fx.c +13 −1 Original line number Diff line number Diff line Loading @@ -726,9 +726,11 @@ static void bwe_switch_enc_fx( Word16 synth_subfr_bwe_fx[SWITCH_MAX_GAP]; /* synthesized bwe for core switching */ Word16 n, L; BSTR_ENC_HANDLE hBstr; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif hBstr = st_fx->hBstr; L = NS2SA_FX2( st_fx->input_Fs, FRAME_SIZE_NS ); Loading Loading @@ -845,7 +847,11 @@ static void bwe_switch_enc_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); #ifdef ISSUE_1867_replace_overflow_libenc gain_fx = round_fx_sat( Isqrt( L_tmp1 ) ); /*Q12 */ #else gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ #endif ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); /* Q0 */ push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); Loading @@ -872,9 +878,11 @@ static void bwe_switch_enc_ivas_fx( Word16 synth_subfr_bwe_fx[SWITCH_MAX_GAP]; /* synthesized bwe for core switching */ Word16 n, L; BSTR_ENC_HANDLE hBstr; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif hBstr = st_fx->hBstr; L = NS2SA_FX2( st_fx->input_Fs, FRAME_SIZE_NS ); Loading Loading @@ -988,7 +996,11 @@ static void bwe_switch_enc_ivas_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); #ifdef ISSUE_1867_replace_overflow_libenc gain_fx = round_fx_sat( Isqrt( L_tmp1 ) ); /*Q12 */ #else gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ #endif ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); Loading
lib_enc/acelp_enc_util_fx.c +14 −2 Original line number Diff line number Diff line Loading @@ -161,8 +161,10 @@ void E_ACELP_conv( { Word16 i, k; Word32 L_tmp; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif FOR( k = 0; k < L_SUBFR; k++ ) { Loading @@ -175,7 +177,11 @@ void E_ACELP_conv( L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ } L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ #ifdef ISSUE_1867_replace_overflow_libenc cn2[k] = round_fx_sat( L_shl_sat( L_tmp, 5 ) ); /* Q0 */ #else cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0 */ #endif } } Loading @@ -187,8 +193,10 @@ void E_ACELP_conv_ivas_fx( { Word16 i, k; Word32 L_tmp; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif FOR( k = 0; k < L_SUBFR; k++ ) { Loading @@ -201,7 +209,11 @@ void E_ACELP_conv_ivas_fx( L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*Qnew + 11*/ } L_tmp = W_sat_l( L_tmp_64 ); /* Qnew + 11 */ #ifdef ISSUE_1867_replace_overflow_libenc cn2[k] = round_fx_sat( L_shl_sat( L_tmp, 5 ) ); /* Qnew*/ #else cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Qnew*/ #endif move16(); } } Loading