Loading lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -111,4 +111,7 @@ #define FIX_1733_CLDFB_BUG #define FIX_1740_MISING_POP_WMOPS /* VA: fix issue 1740: missing pop_wmops() */ #define FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC /* FhG: NON-BE!!! Simplify azimuth & elevation calculations, remove parameter mismatch for divide3232, fix copy/paste error for elevation */ #define FIX_ISSUE_1744_IVAS_DIRAC_GET_MONO_FLAG /* FhG: NON-BE!!! Simplify threshold - comparison, change (wrong) Equal-comparion to (correct) Greater-Than-comparison */ #endif lib_dec/ivas_spar_md_dec_fx.c +19 −3 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ /*------------------------------------------------------------------------------------------* * Local constants *------------------------------------------------------------------------------------------*/ #ifdef FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC #define INV_PI_DEG180_Q_22 ( (Word32) 0x394BB835 ) /* 2.0/PI in Q31 times DEGREE_180_Q_22) */ #endif #define IVAS_DEFAULT_DTX_CNG_RAMP ( 8 ) Loading Loading @@ -2946,8 +2949,13 @@ void ivas_spar_to_dirac_fx( radius_fx = Sqrt32( temp, &q_temp ); Word16 check_azi_fx = BASOP_util_atan2( dvy_fx[band], dvx_fx[band], 0 ); /*Q13*/ Word32 check_azi_fx_32 = L_shl( check_azi_fx, 16 ); /*Q29*/ #ifdef FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC Word32 azi_intermediate = Mpy_32_16_1( INV_PI_DEG180_Q_22, check_azi_fx ); #else Word16 check_azi_fx_res; Word32 check_azi_fx_32 = L_shl( check_azi_fx, 16 ); /*Q29*/ IF( check_azi_fx_32 < 0 ) { check_azi_fx_res = negate( divide3232( L_negate( check_azi_fx_32 ), 1686629760 /*3.145f in Q29*/ ) ); /*Q15*/ Loading @@ -2957,6 +2965,8 @@ void ivas_spar_to_dirac_fx( check_azi_fx_res = divide3232( check_azi_fx_32, 1686629760 /*3.145f in Q29*/ ); /*Q15*/ } Word32 azi_intermediate = Mpy_32_16_1( DEGREE_180_Q_22, check_azi_fx_res ); /*Q22*/ #endif azi_intermediate = L_add( azi_intermediate, ONE_IN_Q21 ); /*Q22*/ Word16 azi_res; Loading @@ -2970,9 +2980,14 @@ void ivas_spar_to_dirac_fx( } Word16 check_ele_fx = BASOP_util_atan2( dvz_fx[band], radius_fx, sub( add( 9, q_dvnorm ), q_temp ) ); /*Q13*/ Word32 check_ele_fx_32 = L_shl( check_ele_fx, 16 ); /*Q29*/ #ifdef FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC Word32 ele_intermediate = Mpy_32_16_1( INV_PI_DEG180_Q_22, check_ele_fx ); #else Word16 check_ele_fx_res; IF( check_azi_fx_32 < 0 ) Word32 check_ele_fx_32 = L_shl( check_ele_fx, 16 ); /*Q29*/ IF( check_ele_fx_32 < 0 ) { check_ele_fx_res = negate( divide3232( L_negate( check_ele_fx_32 ), 1686629760 /*3.145f in Q29*/ ) ); /*Q15*/ } Loading @@ -2981,6 +2996,7 @@ void ivas_spar_to_dirac_fx( check_ele_fx_res = divide3232( check_ele_fx_32, 1686629760 /*3.145f in Q29*/ ); /*Q15*/ } Word32 ele_intermediate = Mpy_32_16_1( DEGREE_180_Q_22, check_ele_fx_res ); /*Q22*/ #endif ele_intermediate = L_add( ele_intermediate, ONE_IN_Q21 ); /*Q22*/ Word16 ele_res; Loading lib_enc/ivas_dirac_enc_fx.c +15 −2 Original line number Diff line number Diff line Loading @@ -660,8 +660,20 @@ static Word16 ivas_dirac_get_mono_flag_fx( move32(); move16(); } IF( BASOP_Util_Cmp_Mant32Exp( divide3232( W_band_power, other_ch_band_power ), 31, threshold, threshold_e ) == 0 ) #ifdef FIX_ISSUE_1744_IVAS_DIRAC_GET_MONO_FLAG IF( BASOP_Util_Cmp_Mant32Exp( W_band_power, 31-16, Mpy_32_32(other_ch_band_power, threshold), threshold_e ) == 1 ) /* -16 is needed because divide3232() returned a 16-Bit value, and this 16-bit value was passed to an 32-bit mantissa argument*/ { any_mono_band = 1; move16(); } ELSE { any_mc_band = 1; move16(); } #else IF( BASOP_Util_Cmp_Mant32Exp( divide3232( W_band_power, other_ch_band_power ), 31, threshold, threshold_e ) == 1 ) { any_mono_band = 1; move16(); Loading @@ -671,6 +683,7 @@ static Word16 ivas_dirac_get_mono_flag_fx( any_mc_band = 1; move16(); } #endif } } } Loading Loading
lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -111,4 +111,7 @@ #define FIX_1733_CLDFB_BUG #define FIX_1740_MISING_POP_WMOPS /* VA: fix issue 1740: missing pop_wmops() */ #define FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC /* FhG: NON-BE!!! Simplify azimuth & elevation calculations, remove parameter mismatch for divide3232, fix copy/paste error for elevation */ #define FIX_ISSUE_1744_IVAS_DIRAC_GET_MONO_FLAG /* FhG: NON-BE!!! Simplify threshold - comparison, change (wrong) Equal-comparion to (correct) Greater-Than-comparison */ #endif
lib_dec/ivas_spar_md_dec_fx.c +19 −3 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ /*------------------------------------------------------------------------------------------* * Local constants *------------------------------------------------------------------------------------------*/ #ifdef FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC #define INV_PI_DEG180_Q_22 ( (Word32) 0x394BB835 ) /* 2.0/PI in Q31 times DEGREE_180_Q_22) */ #endif #define IVAS_DEFAULT_DTX_CNG_RAMP ( 8 ) Loading Loading @@ -2946,8 +2949,13 @@ void ivas_spar_to_dirac_fx( radius_fx = Sqrt32( temp, &q_temp ); Word16 check_azi_fx = BASOP_util_atan2( dvy_fx[band], dvx_fx[band], 0 ); /*Q13*/ Word32 check_azi_fx_32 = L_shl( check_azi_fx, 16 ); /*Q29*/ #ifdef FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC Word32 azi_intermediate = Mpy_32_16_1( INV_PI_DEG180_Q_22, check_azi_fx ); #else Word16 check_azi_fx_res; Word32 check_azi_fx_32 = L_shl( check_azi_fx, 16 ); /*Q29*/ IF( check_azi_fx_32 < 0 ) { check_azi_fx_res = negate( divide3232( L_negate( check_azi_fx_32 ), 1686629760 /*3.145f in Q29*/ ) ); /*Q15*/ Loading @@ -2957,6 +2965,8 @@ void ivas_spar_to_dirac_fx( check_azi_fx_res = divide3232( check_azi_fx_32, 1686629760 /*3.145f in Q29*/ ); /*Q15*/ } Word32 azi_intermediate = Mpy_32_16_1( DEGREE_180_Q_22, check_azi_fx_res ); /*Q22*/ #endif azi_intermediate = L_add( azi_intermediate, ONE_IN_Q21 ); /*Q22*/ Word16 azi_res; Loading @@ -2970,9 +2980,14 @@ void ivas_spar_to_dirac_fx( } Word16 check_ele_fx = BASOP_util_atan2( dvz_fx[band], radius_fx, sub( add( 9, q_dvnorm ), q_temp ) ); /*Q13*/ Word32 check_ele_fx_32 = L_shl( check_ele_fx, 16 ); /*Q29*/ #ifdef FIX_ISSUE_1744_IVAS_SPAR_TO_DIRAC Word32 ele_intermediate = Mpy_32_16_1( INV_PI_DEG180_Q_22, check_ele_fx ); #else Word16 check_ele_fx_res; IF( check_azi_fx_32 < 0 ) Word32 check_ele_fx_32 = L_shl( check_ele_fx, 16 ); /*Q29*/ IF( check_ele_fx_32 < 0 ) { check_ele_fx_res = negate( divide3232( L_negate( check_ele_fx_32 ), 1686629760 /*3.145f in Q29*/ ) ); /*Q15*/ } Loading @@ -2981,6 +2996,7 @@ void ivas_spar_to_dirac_fx( check_ele_fx_res = divide3232( check_ele_fx_32, 1686629760 /*3.145f in Q29*/ ); /*Q15*/ } Word32 ele_intermediate = Mpy_32_16_1( DEGREE_180_Q_22, check_ele_fx_res ); /*Q22*/ #endif ele_intermediate = L_add( ele_intermediate, ONE_IN_Q21 ); /*Q22*/ Word16 ele_res; Loading
lib_enc/ivas_dirac_enc_fx.c +15 −2 Original line number Diff line number Diff line Loading @@ -660,8 +660,20 @@ static Word16 ivas_dirac_get_mono_flag_fx( move32(); move16(); } IF( BASOP_Util_Cmp_Mant32Exp( divide3232( W_band_power, other_ch_band_power ), 31, threshold, threshold_e ) == 0 ) #ifdef FIX_ISSUE_1744_IVAS_DIRAC_GET_MONO_FLAG IF( BASOP_Util_Cmp_Mant32Exp( W_band_power, 31-16, Mpy_32_32(other_ch_band_power, threshold), threshold_e ) == 1 ) /* -16 is needed because divide3232() returned a 16-Bit value, and this 16-bit value was passed to an 32-bit mantissa argument*/ { any_mono_band = 1; move16(); } ELSE { any_mc_band = 1; move16(); } #else IF( BASOP_Util_Cmp_Mant32Exp( divide3232( W_band_power, other_ch_band_power ), 31, threshold, threshold_e ) == 1 ) { any_mono_band = 1; move16(); Loading @@ -671,6 +683,7 @@ static Word16 ivas_dirac_get_mono_flag_fx( any_mc_band = 1; move16(); } #endif } } } Loading