Loading lib_com/options.h +3 −1 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ #define FIX_2346_DUPLICATED_IGF_FUNCTIONS_2 /* FhG: part 2 of basop issue 2346: Review potentially duplicated IGF functions */ #define FIX_2095_REMOVE_UNUSED_ISAR_TABLES /* Dolby: remove unused ISAR */ #define FIX_BASOP_2560_STEREO_DFT_DEC_RESET /* FhG: BASOP issue 2560: align reset of hStereoDft->res_gains_ind_fx[][] between BASOP and float */ #define HARMONIZE_2539_cng_energy /* FhG: basop issue 2539: harmonize cng_energy with its ivas derivate */ /* #################### End BE switches ################################## */ Loading Loading @@ -145,6 +146,7 @@ #define FIX_FMSW_DEC_2 /* float issue 1575: fix crash for format switching when bitsream starts with EVS */ #define FIX_BASOP_2561_STEREO_DFT_ENC_COMPUTE_ITD /* BASOP issue 2561: fix diffs in stereo_dft_enc_compute_itd() between float and BASOP */ #define FIX_BASOP_2517_CLICK_IN_OMASA_LTV /* FhG: BASOP #2517: preserve precision by removing one-bit headroom from Q_min and allowing saturation during buffer scaling */ #define FIX_BASOP_2559_Q_SYNTH_HISTORY_RESET /* FhG: BASOP issue 2559: reset hTcxDec->q_synth_history_fx in allocate_CoreCoder_TCX_fx() */ /* ##################### End NON-BE switches ########################### */ Loading lib_dec/ivas_stereo_switching_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,10 @@ static ivas_error allocate_CoreCoder_TCX_fx( st->hTcxDec->q_old_synth = 0; move16(); set16_fx( st->hTcxDec->synth_history_fx, 0, L_PROT48k + L_FRAME48k ); #ifdef FIX_BASOP_2559_Q_SYNTH_HISTORY_RESET st->hTcxDec->q_synth_history_fx = 0; move16(); #endif } IF( st->hTcxCfg == NULL ) Loading lib_enc/acelp_core_enc_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -434,7 +434,11 @@ ivas_error acelp_core_enc_fx( { IF( st->hTdCngEnc != NULL ) { #ifdef HARMONIZE_2539_cng_energy enr = cng_energy_fx( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att_fx, exc_fx, st->L_frame, Q_new ); /* Q8 */ #else enr = cng_energy_ivas_fx( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att_fx, exc_fx, st->L_frame, Q_new ); /* Q8 */ #endif /* calculate the energy quantization index */ enr_index = add( enr, 512 /* Q8(2.0) */ ); /* enr + 2.0 */ Loading lib_enc/fd_cng_enc_fx.c +61 −1 Original line number Diff line number Diff line Loading @@ -1163,7 +1163,7 @@ void generate_comfort_noise_enc_fx( return; } #ifndef HARMONIZE_2539_cng_energy /*-------------------------------------------------------------------* * cng_energy_fx() * Loading Loading @@ -1259,6 +1259,7 @@ Word16 cng_energy_fx( return enr; } #endif /*-------------------------------------------------------------------* * cng_energy_ivas_fx() Loading @@ -1267,7 +1268,11 @@ Word16 cng_energy_fx( *-------------------------------------------------------------------*/ /*! r: CNG energy */ #ifdef HARMONIZE_2539_cng_energy Word16 cng_energy_fx( #else Word16 cng_energy_ivas_fx( #endif const Word16 element_mode, /* i : element mode Q0*/ const Word16 bwidth, /* i : audio bandwidh Q0*/ const Word16 CNG_mode, /* i : mode for DTX configuration Q0*/ Loading @@ -1281,6 +1286,13 @@ Word16 cng_energy_ivas_fx( Word16 hi, lo, enr, tmp16, att; const Word16 *pt_res; Word32 L_ener, L_tmp; #ifdef HARMONIZE_2539_cng_energy Word64 W_ener = W_shr( W_deposit32_h( 1 ), 1 ); if ( EQ_16( element_mode, EVS_MONO ) ) { W_ener = W_neg( W_ener ); } #endif maxv = 0; move16(); Loading @@ -1291,10 +1303,35 @@ Word16 cng_energy_ivas_fx( scale = norm_s( maxv ); pt_res = exc; L_ener = L_deposit_l( 1 ); #ifdef HARMONIZE_2539_cng_energy Word16 scale_tmp; Word32 scale_tmp32; scale_tmp = sub( scale, 4 ); scale_tmp32 = 0x80000000; move32(); IF( EQ_16( element_mode, EVS_MONO ) ) { scale_tmp = scale; move16(); scale_tmp32 = L_shr( 0x40000000, 7 - 1 ); } #endif IF( EQ_16( len, L_FRAME ) ) { FOR( i = 0; i < 128; i++ ) { #ifdef HARMONIZE_2539_cng_energy tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mult0( tmp16, tmp16 ); pt_res++; tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mac0_sat( L_tmp, tmp16, tmp16 ); pt_res++; W_ener = W_msu0_32_32( W_ener, L_tmp, scale_tmp32 ); /* 2*(Q_new+scale)+1, divide by L_frame done here */ #else tmp16 = shl( *pt_res, sub( scale, 4 ) ); // Q_new + scale - 4 L_tmp = L_mult0( tmp16, tmp16 ); pt_res++; Loading @@ -1302,12 +1339,22 @@ Word16 cng_energy_ivas_fx( L_tmp = L_mac0( L_tmp, tmp16, tmp16 ); /* 2*(Q_new+scale) + 7 */ pt_res++; L_ener = L_add( L_ener, L_tmp ); /* 2*(Q_new+scale)+1, divide by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ { FOR( i = 0; i < 160; i++ ) { #ifdef HARMONIZE_2539_cng_energy tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mult0( tmp16, tmp16 ); pt_res++; tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mac0_sat( L_tmp, tmp16, tmp16 ); pt_res++; W_ener = W_msu0_32_32( W_ener, Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), scale_tmp32 ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */ #else tmp16 = shl( *pt_res, sub( scale, 4 ) ); // Q_new + scale - 4 L_tmp = L_mult( tmp16, tmp16 ); pt_res++; Loading @@ -1315,8 +1362,21 @@ Word16 cng_energy_ivas_fx( L_tmp = L_mac( L_tmp, tmp16, tmp16 ); /* 2*(Q_new+scale) - 7 */ pt_res++; L_ener = L_add( L_ener, Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ) ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */ #endif } } #ifdef HARMONIZE_2539_cng_energy L_ener = L_shl( W_extract_h( W_ener ), 1 ); if ( EQ_16( element_mode, EVS_MONO ) ) { L_ener = L_negate( L_ener ); } test(); if ( GT_16( element_mode, EVS_MONO ) && NE_16( len, L_FRAME ) ) { L_ener = L_shl( L_ener, 1 ); } #endif hi = norm_l( L_ener ); lo = Log2_norm_lc( L_shl( L_ener, hi ) ); Loading lib_enc/prot_fx_enc.h +2 −2 Original line number Diff line number Diff line Loading @@ -3952,7 +3952,7 @@ void writeLPCparam_fx( const Word16 no_param_lpc, /* i : number of LPC parameters */ Word16 *nbits_lpc /* o : LPC bits written */ ); #ifndef HARMONIZE_2539_cng_energy Word16 cng_energy_ivas_fx( const Word16 element_mode, /* i : element mode */ const Word16 bwidth, /* i : audio bandwidh */ Loading @@ -3962,7 +3962,7 @@ Word16 cng_energy_ivas_fx( const Word16 len, /* i : vector length */ const Word16 Q_new /* i : Input scaling */ ); #endif void SynthesisSTFT_enc_ivas_fx( Word32 *fftBuffer, /* i : pointer to FFT bins */ Loading Loading
lib_com/options.h +3 −1 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ #define FIX_2346_DUPLICATED_IGF_FUNCTIONS_2 /* FhG: part 2 of basop issue 2346: Review potentially duplicated IGF functions */ #define FIX_2095_REMOVE_UNUSED_ISAR_TABLES /* Dolby: remove unused ISAR */ #define FIX_BASOP_2560_STEREO_DFT_DEC_RESET /* FhG: BASOP issue 2560: align reset of hStereoDft->res_gains_ind_fx[][] between BASOP and float */ #define HARMONIZE_2539_cng_energy /* FhG: basop issue 2539: harmonize cng_energy with its ivas derivate */ /* #################### End BE switches ################################## */ Loading Loading @@ -145,6 +146,7 @@ #define FIX_FMSW_DEC_2 /* float issue 1575: fix crash for format switching when bitsream starts with EVS */ #define FIX_BASOP_2561_STEREO_DFT_ENC_COMPUTE_ITD /* BASOP issue 2561: fix diffs in stereo_dft_enc_compute_itd() between float and BASOP */ #define FIX_BASOP_2517_CLICK_IN_OMASA_LTV /* FhG: BASOP #2517: preserve precision by removing one-bit headroom from Q_min and allowing saturation during buffer scaling */ #define FIX_BASOP_2559_Q_SYNTH_HISTORY_RESET /* FhG: BASOP issue 2559: reset hTcxDec->q_synth_history_fx in allocate_CoreCoder_TCX_fx() */ /* ##################### End NON-BE switches ########################### */ Loading
lib_dec/ivas_stereo_switching_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,10 @@ static ivas_error allocate_CoreCoder_TCX_fx( st->hTcxDec->q_old_synth = 0; move16(); set16_fx( st->hTcxDec->synth_history_fx, 0, L_PROT48k + L_FRAME48k ); #ifdef FIX_BASOP_2559_Q_SYNTH_HISTORY_RESET st->hTcxDec->q_synth_history_fx = 0; move16(); #endif } IF( st->hTcxCfg == NULL ) Loading
lib_enc/acelp_core_enc_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -434,7 +434,11 @@ ivas_error acelp_core_enc_fx( { IF( st->hTdCngEnc != NULL ) { #ifdef HARMONIZE_2539_cng_energy enr = cng_energy_fx( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att_fx, exc_fx, st->L_frame, Q_new ); /* Q8 */ #else enr = cng_energy_ivas_fx( st->element_mode, st->bwidth, st->hDtxEnc->CNG_mode, st->hTdCngEnc->CNG_att_fx, exc_fx, st->L_frame, Q_new ); /* Q8 */ #endif /* calculate the energy quantization index */ enr_index = add( enr, 512 /* Q8(2.0) */ ); /* enr + 2.0 */ Loading
lib_enc/fd_cng_enc_fx.c +61 −1 Original line number Diff line number Diff line Loading @@ -1163,7 +1163,7 @@ void generate_comfort_noise_enc_fx( return; } #ifndef HARMONIZE_2539_cng_energy /*-------------------------------------------------------------------* * cng_energy_fx() * Loading Loading @@ -1259,6 +1259,7 @@ Word16 cng_energy_fx( return enr; } #endif /*-------------------------------------------------------------------* * cng_energy_ivas_fx() Loading @@ -1267,7 +1268,11 @@ Word16 cng_energy_fx( *-------------------------------------------------------------------*/ /*! r: CNG energy */ #ifdef HARMONIZE_2539_cng_energy Word16 cng_energy_fx( #else Word16 cng_energy_ivas_fx( #endif const Word16 element_mode, /* i : element mode Q0*/ const Word16 bwidth, /* i : audio bandwidh Q0*/ const Word16 CNG_mode, /* i : mode for DTX configuration Q0*/ Loading @@ -1281,6 +1286,13 @@ Word16 cng_energy_ivas_fx( Word16 hi, lo, enr, tmp16, att; const Word16 *pt_res; Word32 L_ener, L_tmp; #ifdef HARMONIZE_2539_cng_energy Word64 W_ener = W_shr( W_deposit32_h( 1 ), 1 ); if ( EQ_16( element_mode, EVS_MONO ) ) { W_ener = W_neg( W_ener ); } #endif maxv = 0; move16(); Loading @@ -1291,10 +1303,35 @@ Word16 cng_energy_ivas_fx( scale = norm_s( maxv ); pt_res = exc; L_ener = L_deposit_l( 1 ); #ifdef HARMONIZE_2539_cng_energy Word16 scale_tmp; Word32 scale_tmp32; scale_tmp = sub( scale, 4 ); scale_tmp32 = 0x80000000; move32(); IF( EQ_16( element_mode, EVS_MONO ) ) { scale_tmp = scale; move16(); scale_tmp32 = L_shr( 0x40000000, 7 - 1 ); } #endif IF( EQ_16( len, L_FRAME ) ) { FOR( i = 0; i < 128; i++ ) { #ifdef HARMONIZE_2539_cng_energy tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mult0( tmp16, tmp16 ); pt_res++; tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mac0_sat( L_tmp, tmp16, tmp16 ); pt_res++; W_ener = W_msu0_32_32( W_ener, L_tmp, scale_tmp32 ); /* 2*(Q_new+scale)+1, divide by L_frame done here */ #else tmp16 = shl( *pt_res, sub( scale, 4 ) ); // Q_new + scale - 4 L_tmp = L_mult0( tmp16, tmp16 ); pt_res++; Loading @@ -1302,12 +1339,22 @@ Word16 cng_energy_ivas_fx( L_tmp = L_mac0( L_tmp, tmp16, tmp16 ); /* 2*(Q_new+scale) + 7 */ pt_res++; L_ener = L_add( L_ener, L_tmp ); /* 2*(Q_new+scale)+1, divide by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ { FOR( i = 0; i < 160; i++ ) { #ifdef HARMONIZE_2539_cng_energy tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mult0( tmp16, tmp16 ); pt_res++; tmp16 = shl( *pt_res, scale_tmp ); L_tmp = L_mac0_sat( L_tmp, tmp16, tmp16 ); pt_res++; W_ener = W_msu0_32_32( W_ener, Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), scale_tmp32 ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */ #else tmp16 = shl( *pt_res, sub( scale, 4 ) ); // Q_new + scale - 4 L_tmp = L_mult( tmp16, tmp16 ); pt_res++; Loading @@ -1315,8 +1362,21 @@ Word16 cng_energy_ivas_fx( L_tmp = L_mac( L_tmp, tmp16, tmp16 ); /* 2*(Q_new+scale) - 7 */ pt_res++; L_ener = L_add( L_ener, Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ) ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */ #endif } } #ifdef HARMONIZE_2539_cng_energy L_ener = L_shl( W_extract_h( W_ener ), 1 ); if ( EQ_16( element_mode, EVS_MONO ) ) { L_ener = L_negate( L_ener ); } test(); if ( GT_16( element_mode, EVS_MONO ) && NE_16( len, L_FRAME ) ) { L_ener = L_shl( L_ener, 1 ); } #endif hi = norm_l( L_ener ); lo = Log2_norm_lc( L_shl( L_ener, hi ) ); Loading
lib_enc/prot_fx_enc.h +2 −2 Original line number Diff line number Diff line Loading @@ -3952,7 +3952,7 @@ void writeLPCparam_fx( const Word16 no_param_lpc, /* i : number of LPC parameters */ Word16 *nbits_lpc /* o : LPC bits written */ ); #ifndef HARMONIZE_2539_cng_energy Word16 cng_energy_ivas_fx( const Word16 element_mode, /* i : element mode */ const Word16 bwidth, /* i : audio bandwidh */ Loading @@ -3962,7 +3962,7 @@ Word16 cng_energy_ivas_fx( const Word16 len, /* i : vector length */ const Word16 Q_new /* i : Input scaling */ ); #endif void SynthesisSTFT_enc_ivas_fx( Word32 *fftBuffer, /* i : pointer to FFT bins */ Loading