From 674db435169d52c6696e8a6a881d81e3e73852ce Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 21 Jan 2026 13:19:50 -0500 Subject: [PATCH 1/3] merging IVAS and ESV 0b BWE --- lib_com/options.h | 1 + lib_com/prot_fx.h | 18 ++- lib_dec/acelp_core_dec_fx.c | 8 ++ lib_dec/hf_synth_fx.c | 221 ++++++++++++++++++++++++++---------- 4 files changed, 185 insertions(+), 63 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a1ac29acd..b1ca3e5a7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -116,6 +116,7 @@ #define FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND /* Nokia: basop issue 2332: Uses predefined memory sizes instead computing wrong */ #define FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK /* Nokia: basop issue 2333: Add missing free for direction_vector_e to ivas_mcmasa_ana_fx.c */ #define HARM_COREDECODER_FUNCTIONS /* VA: basop issue 2347: Remove various duplicated code in core-decoder */ +#define FIX_BASOP_2350_HARM_0B_BWE /* VA: basop issue 2350: harmonization of the 0b BWE */ /* #################### End BE switches ################################## */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index fac7485fb..08da961c1 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6492,6 +6492,7 @@ void hf_synth_reset_fx( ZERO_BWE_DEC_HANDLE hBWE_zero /* o : zero BWE decoder handle */ ); +#ifndef FIX_BASOP_2350_HARM_0B_BWE void hf_synth_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */ const Word32 core_brate, /* i : core bitrate Q0*/ @@ -6503,7 +6504,6 @@ void hf_synth_fx( const Word16 Q_exc, /* i : excitation scaling */ const Word16 Q_syn2 /* i : synthesis scaling */ ); - void hf_synth_ivas_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */ const Word32 core_brate, /* i : core bitrate Q0*/ @@ -6515,7 +6515,23 @@ void hf_synth_ivas_fx( const Word16 Q_exc, /* i : excitation scaling */ const Word16 Q_syn2 /* i : synthesis scaling */ ); +#else +void hf_synth_fx( + ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */ +#ifdef FIX_BASOP_2350_HARM_0B_BWE + const Word16 element_mode, /* i : element mode Q0*/ +#endif + const Word32 core_brate, /* i : core bitrate Q0*/ + const Word16 output_frame, /* i : output frame length Q0*/ + const Word16 *Aq, /* i : quantized Az Q12*/ + const Word16 *exc, /* i : excitation at 12.8 kHz Q_exc*/ + Word16 *synth, /* i : 12.8kHz synthesis signal Q_syn2*/ + Word16 *synth16k, /* o : 16kHz synthesis signal Q_syn2*/ + const Word16 Q_exc, /* i : excitation scaling */ + const Word16 Q_syn2 /* i : synthesis scaling */ +); +#endif void hf_synth_amr_wb_init_fx( AMRWB_IO_DEC_HANDLE hAmrwb_IO /* i/o: AMR-WB IO data handle */ ); diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index b65b49a42..bd5cbf5ad 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -2223,12 +2223,20 @@ ivas_error acelp_core_dec_fx( { IF( EQ_16( st->element_mode, EVS_MONO ) ) { +#ifndef FIX_BASOP_2350_HARM_0B_BWE hf_synth_fx( st->hBWE_zero, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); +#else + hf_synth_fx( st->hBWE_zero, EVS_MONO, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); +#endif } ELSE { Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q0 +#ifndef FIX_BASOP_2350_HARM_0B_BWE hf_synth_ivas_fx( st->hBWE_zero, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); +#else + hf_synth_fx( st->hBWE_zero, st->element_mode, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); +#endif Copy_Scale_sig_16_32_DEPREC( synth_fx16, synth_fx, output_frame, 0 ); } } diff --git a/lib_dec/hf_synth_fx.c b/lib_dec/hf_synth_fx.c index 87e8b1fd7..dde0d717a 100644 --- a/lib_dec/hf_synth_fx.c +++ b/lib_dec/hf_synth_fx.c @@ -20,8 +20,12 @@ *---------------------------------------------------------------------*/ static void filt_6k_7k_scale_fx( Word16 signal[], Word16 lg, Word16 mem[], Word16 fact, Word16 exp ); +#ifdef FIX_BASOP_2350_HARM_0B_BWE +static void hf_synthesis_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, const Word16 element_mode, const Word32 core_brate, const Word16 output_subfr, const Word16 Aq[], const Word16 exc[], const Word16 Q_exc, Word16 synth[], Word16 synth16k[], const Word16 Q_syn ); +#else static void hf_synthesis_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, const Word32 core_brate, const Word16 output_subfr, const Word16 Aq[], const Word16 exc[], const Word16 Q_exc, Word16 synth[], Word16 synth16k[], const Word16 Q_syn ); static void hf_synthesis_ivas_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, const Word32 core_brate, const Word16 output_subfr, const Word16 Aq[], const Word16 exc[], const Word16 Q_exc, Word16 synth[], Word16 synth16k[], const Word16 Q_syn ); +#endif static void hf_synthesis_amr_wb_fx( const Word32 core_brate, const Word16 output_subfr, const Word16 Ap[], Word16 exc16k[], Word16 synth_out[], Word16 *mem_syn_hf, Word16 *delay_syn_hf, Word16 *mem_hp_interp, Word16 p_r, Word16 HF_corr_gain, Word16 til, Word16 voice_factors, const Word16 exc[], const Word16 Q_exc, const Word16 Q_out, Word16 qhf ); static void envelope_fx( AMRWB_IO_DEC_HANDLE hAmrwb_IO, const Word32 core_brate, const Word16 Aq[], Word16 Ap[], Word16 *r, Word16 tilt0, Word16 tilt, Word16 voice_factor ); static void AdaptiveStartBand_fx( Word16 *start_band, const Word32 rate, const Word16 *lsf, const Word16 voicing_fac, const Word16 clas, Word16 *voicing_flag, Word16 *start_band_old, Word32 *OptCrit_old ); @@ -80,7 +84,10 @@ void hf_synth_reset_fx( void hf_synth_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */ - const Word32 core_brate, /* i : core bitrate Q0*/ +#ifdef FIX_BASOP_2350_HARM_0B_BWE + const Word16 element_mode, /* i : element mode Q0*/ +#endif + const Word32 core_brate, /* i : core bitrate Q0*/ const Word16 output_frame, /* i : output frame length Q0*/ const Word16 *Aq, /* i : quantized Az Q12*/ const Word16 *exc, /* i : excitation at 12.8 kHz Q_exc*/ @@ -99,8 +106,11 @@ void hf_synth_fx( p_Aq = Aq; /* Q12 */ FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { - hf_synthesis_fx( hBWE_zero, core_brate, output_subfr, p_Aq, &exc[i_subfr], Q_exc, &synth[i_subfr], &synth16k[imult3216( (Word32) i_subfr, output_subfr ) / L_SUBFR], Q_syn2 ); - +#ifdef FIX_BASOP_2350_HARM_0B_BWE + hf_synthesis_fx( hBWE_zero, element_mode, core_brate, output_subfr, p_Aq, &exc[i_subfr], Q_exc, &synth[i_subfr], &synth16k[i_subfr * output_subfr / L_SUBFR], Q_syn2 ); +#else + hf_synthesis_fx( hBWE_zero, core_brate, output_subfr, p_Aq, &exc[i_subfr], Q_exc, &synth[i_subfr], &synth16k[i_subfr * output_subfr / L_SUBFR], Q_syn2 ); +#endif p_Aq += ( M + 1 ); /* Q12 */ } @@ -120,6 +130,9 @@ void hf_synth_fx( static void hf_synthesis_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, +#ifdef FIX_BASOP_2350_HARM_0B_BWE + const Word16 element_mode, /* i : element mode Q0*/ +#endif const Word32 core_brate, /* i : core bitrate Q0*/ const Word16 output_subfr, /* i : output sub-frame length Q0*/ const Word16 Aq[], /* i : quantized Az Q12*/ @@ -135,6 +148,11 @@ static void hf_synthesis_fx( Word16 HF_exc[L_SUBFR16k]; Word16 tmp, ener, exp1, exp2, scale; Word32 L_tmp; +#ifdef FIX_BASOP_2350_HARM_0B_BWE + Word16 Q_tmp, Q_ener, sft; + Word32 ONE, P_ONE; + Word64 prod; +#endif Word16 Ap[M16k + 1]; /*-----------------------------------------------------------------* @@ -157,75 +175,154 @@ static void hf_synthesis_fx( /*tmp = round_fx(Dot_product12(HF_exc, HF_exc, output_subfr, &exp1)); */ L_tmp = Dot_product12( HF_exc, HF_exc, L_SUBFR16k, &exp1 ); tmp = round_fx( L_tmp ); /* Q15 */ - /* tmp = (float)(sqrt(ener/tmp)) */ - /* scale is -1 if tmp > ener */ - scale = shr( sub( ener, tmp ), 15 ); /* Q0 */ - tmp = shl( tmp, scale ); /* Q15 + scale*/ - exp1 = sub( exp1, scale ); - tmp = div_s( tmp, ener ); /* Q15 */ - exp1 = sub( exp1, exp2 ); + IF( element_mode == EVS_MONO ) + { - L_tmp = L_deposit_h( tmp ); /* Q31 */ + /* tmp = (float)(sqrt(ener/tmp)) */ + /* scale is -1 if tmp > ener */ + scale = shr( sub( ener, tmp ), 15 ); /* Q0 */ + tmp = shl( tmp, scale ); /* Q15 + scale*/ + exp1 = sub( exp1, scale ); - L_tmp = Isqrt_lc( L_tmp, &exp1 ); - scale = round_fx( L_tmp ); /* Q18 when Q_exc=-1, HF_exc in Q-3 */ + tmp = div_s( tmp, ener ); /* Q15 */ + exp1 = sub( exp1, exp2 ); - exp2 = sub( hBWE_zero->memExp1, exp1 ); - hBWE_zero->memExp1 = exp1; - move16(); + L_tmp = L_deposit_h( tmp ); /* Q31 */ - /*-----------------------------------------------------------------* - * calculate energy scaling factor to respect tilt of synth12k8 - * (tilt: 1=voiced, -1=unvoiced) - *-----------------------------------------------------------------*/ - hp400_12k8_fx( synth, L_SUBFR, hBWE_zero->mem_hp400_fx ); - /* i: mem_hp400 in Q_syn */ - /* i: synth in Q_syn */ - /* o: synth in Q_syn-3 */ + L_tmp = Isqrt_lc( L_tmp, &exp1 ); + scale = round_fx( L_tmp ); /* Q18 when Q_exc=-1, HF_exc in Q-3 */ - L_tmp = L_mac( 1L, synth[0], synth[0] ); /* 2*(Q_syn-3)+1 */ - FOR( i = 1; i < L_SUBFR; i++ ) - { - L_tmp = L_mac_sat( L_tmp, synth[i], synth[i] ); /* 2*(Q_syn-3)+1 */ - } - tmp = norm_l( L_tmp ); - ener = extract_h( L_shl( L_tmp, tmp ) ); /* ener = r[0] */ - /*ener in Q = 2*(Q_syn-3)+1 = Q-5 when Q_syn=0*/ + exp2 = sub( hBWE_zero->memExp1, exp1 ); + hBWE_zero->memExp1 = exp1; + move16(); - L_tmp = L_mac( 1L, synth[1], synth[0] ); /* 2*(Q_syn-3)+1 */ - FOR( i = 2; i < L_SUBFR; i++ ) - { - L_tmp = L_mac_sat( L_tmp, synth[i], synth[i - 1] ); /* 2*(Q_syn-3)+1 */ - } - tmp = extract_h( L_shl( L_tmp, tmp ) ); /* tmp = r[1] */ - /*tmp in Q = 2*(Q_syn-3)+1 = Q-5 when Q_syn=0 */ - /*we use the same normalization factor for both ener and tmp, */ - /*if the headroom in "tmp" is less than "ener", tmp can saturate */ - /*but this is ok since below we apply some thresholds to tmp */ + /*-----------------------------------------------------------------* + * calculate energy scaling factor to respect tilt of synth12k8 + * (tilt: 1=voiced, -1=unvoiced) + *-----------------------------------------------------------------*/ + hp400_12k8_fx( synth, L_SUBFR, hBWE_zero->mem_hp400_fx ); + /* i: mem_hp400 in Q_syn */ + /* i: synth in Q_syn */ + /* o: synth in Q_syn-3 */ + + L_tmp = L_mac( 1L, synth[0], synth[0] ); /* 2*(Q_syn-3)+1 */ + FOR( i = 1; i < L_SUBFR; i++ ) + { + L_tmp = L_mac_sat( L_tmp, synth[i], synth[i] ); /* 2*(Q_syn-3)+1 */ + } + tmp = norm_l( L_tmp ); + ener = extract_h( L_shl( L_tmp, tmp ) ); /* ener = r[0] */ + /*ener in Q = 2*(Q_syn-3)+1 = Q-5 when Q_syn=0*/ - tmp = s_max( 0, tmp ); - if ( tmp > 0 ) - { - tmp = div_s( tmp, ener ); /* Q15 */ - } + L_tmp = L_mac( 1L, synth[1], synth[0] ); /* 2*(Q_syn-3)+1 */ + FOR( i = 2; i < L_SUBFR; i++ ) + { + L_tmp = L_mac_sat( L_tmp, synth[i], synth[i - 1] ); /* 2*(Q_syn-3)+1 */ + } + tmp = extract_h( L_shl( L_tmp, tmp ) ); /* tmp = r[1] */ + /*tmp in Q = 2*(Q_syn-3)+1 = Q-5 when Q_syn=0 */ + /*we use the same normalization factor for both ener and tmp, */ + /*if the headroom in "tmp" is less than "ener", tmp can saturate */ + /*but this is ok since below we apply some thresholds to tmp */ + tmp = s_max( 0, tmp ); + if ( tmp > 0 ) + { + tmp = div_s( tmp, ener ); /* Q15 */ + } - /*-----------------------------------------------------------------* - * modify energy of white noise according to synthesis tilt - *-----------------------------------------------------------------*/ - /* tmp = 1.0 - fac */ - tmp = add_sat( 1, sub( 32767 /* 1 in Q15 */, tmp ) ); - test(); - if ( core_brate == FRAME_NO_DATA || EQ_32( core_brate, SID_2k40 ) ) + /*-----------------------------------------------------------------* + * modify energy of white noise according to synthesis tilt + *-----------------------------------------------------------------*/ + /* tmp = 1.0 - fac */ + tmp = add_sat( 1, sub( 32767 /* 1 in Q15 */, tmp ) ); + test(); + if ( core_brate == FRAME_NO_DATA || EQ_32( core_brate, SID_2k40 ) ) + { + /* emphasize HF noise in CNG */ + /*fac *= 2.0f;*/ + tmp = add_sat( tmp, tmp ); /* Q15 */ + } + tmp = s_max( tmp, 3277 ); /* 0.1 in Q15 */ + + /*scale *= fac;*/ + tmp = mult_r( scale, tmp ); + } + ELSE { - /* emphasize HF noise in CNG */ - /*fac *= 2.0f;*/ - tmp = add_sat( tmp, tmp ); /* Q15 */ + exp1 = add( exp1, 6 ); /* tmp exponent */ + + ener = shr( ener, 1 ); /* to avoid the assertion in div_s() further*/ + exp2 = add( exp2, 1 ); + + tmp = div_s( ener, tmp ); + exp1 = sub( exp2, exp1 ); + + scale = Sqrt16( tmp, &exp1 ); /* scale exponent = exp1 */ + + /*-----------------------------------------------------------------* + * calculate energy scaling factor to respect tilt of synth12k8 + * (tilt: 1=voiced, -1=unvoiced) + *-----------------------------------------------------------------*/ + + hp400_12k8_ivas_fx( synth, L_SUBFR, hBWE_zero->mem_hp400_fx ); + + /* i: mem_hp400 in Q_syn */ + /* i: synth in Q_syn */ + /* o: synth in Q_syn-3 */ + prod = W_mac0_16_16( 1L, synth[0], synth[0] ); /* 2*(Q_syn-3) */ + FOR( i = 1; i < L_SUBFR; i++ ) + { + prod = W_mac0_16_16( prod, synth[i], synth[i] ); /* 2*(Q_syn-3) */ + } + sft = W_norm( prod ); + ener = extract_h( W_extract_h( W_shl( prod, sft ) ) ); + Q_ener = sub( add( shl( sub( Q_syn, 3 ), 1 ), sft ), 48 ); + + prod = W_mac0_16_16( 1L, synth[1], synth[0] ); /* 2*(Q_syn-3) */ + FOR( i = 2; i < L_SUBFR; i++ ) + { + prod = W_mac0_16_16( prod, synth[i], synth[i - 1] ); /* 2*(Q_syn-3) */ + } + sft = sub( W_norm( prod ), 1 ); + tmp = extract_h( W_extract_h( W_shl( prod, sft ) ) ); + Q_tmp = sub( add( shl( sub( Q_syn, 3 ), 1 ), sft ), 48 ); + + tmp = s_max( 0, tmp ); + IF( tmp > 0 ) + { + tmp = div_s( tmp, ener ); + Q_tmp = add( 15, sub( Q_tmp, Q_ener ) ); + } + + /*-----------------------------------------------------------------* + * modify energy of white noise according to synthesis tilt + *-----------------------------------------------------------------*/ + /* tmp = 1.0 - fac */ + ONE = L_shl( 1, Q_tmp ); + P_ONE = L_shl( 3277 /* 0.1 in Q15 */, sub( Q_tmp, 15 ) ); + L_tmp = L_msu0( ONE, tmp, 1 ); + test(); + if ( core_brate == FRAME_NO_DATA || EQ_32( core_brate, SID_2k40 ) ) + { + /* emphasize HF noise in CNG */ + /*fac *= 2.0f;*/ + L_tmp = L_add( L_tmp, L_tmp ); + } + L_tmp = L_max( L_tmp, P_ONE ); + L_tmp = L_min( L_tmp, ONE ); + + sft = norm_l( L_tmp ); + L_tmp = L_shl( L_tmp, sft ); + + tmp = round_fx( L_tmp ); + Q_tmp = sub( add( Q_tmp, sft ), 16 ); + + /*scale *= fac;*/ + tmp = mult_r( scale, tmp ); /* Q = (15 - exp1) + Q_tmp - 15 */ + Q_tmp = sub( Q_tmp, exp1 ); } - tmp = s_max( tmp, 3277 ); /* 0.1 in Q15 */ - /*scale *= fac;*/ - tmp = mult_r( scale, tmp ); /*-----------------------------------------------------------------* * modify HF excitation according to both calculated scaling factors * high pass filtering (0.94ms of delay) @@ -291,7 +388,7 @@ static void hf_synthesis_fx( return; } - +#ifndef FIX_BASOP_2350_HARM_0B_BWE void hf_synth_ivas_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, /* i/o: handle to 0 bit BWE parameters */ const Word32 core_brate, /* i : core bitrate Q0*/ @@ -319,7 +416,6 @@ void hf_synth_ivas_fx( return; } - static void hf_synthesis_ivas_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, const Word32 core_brate, /* i : core bitrate Q0*/ @@ -498,6 +594,7 @@ static void hf_synthesis_ivas_fx( return; } +#endif /*-------------------------------------------------------------------* * filt_6k_7k: -- GitLab From 3caa68324f4136bbc5641d026c7f40af6fcc119a Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 21 Jan 2026 13:56:18 -0500 Subject: [PATCH 2/3] fix --- lib_dec/hf_synth_fx.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib_dec/hf_synth_fx.c b/lib_dec/hf_synth_fx.c index dde0d717a..20a3d6323 100644 --- a/lib_dec/hf_synth_fx.c +++ b/lib_dec/hf_synth_fx.c @@ -176,9 +176,10 @@ static void hf_synthesis_fx( L_tmp = Dot_product12( HF_exc, HF_exc, L_SUBFR16k, &exp1 ); tmp = round_fx( L_tmp ); /* Q15 */ +#ifdef FIX_BASOP_2350_HARM_0B_BWE IF( element_mode == EVS_MONO ) { - +#endif /* tmp = (float)(sqrt(ener/tmp)) */ /* scale is -1 if tmp > ener */ scale = shr( sub( ener, tmp ), 15 ); /* Q0 */ @@ -193,10 +194,10 @@ static void hf_synthesis_fx( L_tmp = Isqrt_lc( L_tmp, &exp1 ); scale = round_fx( L_tmp ); /* Q18 when Q_exc=-1, HF_exc in Q-3 */ - exp2 = sub( hBWE_zero->memExp1, exp1 ); - hBWE_zero->memExp1 = exp1; - move16(); - + /* moved after the else */ + /* exp2 = sub( hBWE_zero->memExp1, exp1 ); + hBWE_zero->memExp1 = exp1; + move16(); */ /*-----------------------------------------------------------------* * calculate energy scaling factor to respect tilt of synth12k8 * (tilt: 1=voiced, -1=unvoiced) @@ -247,6 +248,7 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); +#ifdef FIX_BASOP_2350_HARM_0B_BWE } ELSE { @@ -321,12 +323,17 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); /* Q = (15 - exp1) + Q_tmp - 15 */ Q_tmp = sub( Q_tmp, exp1 ); - } + + } +#endif /*-----------------------------------------------------------------* * modify HF excitation according to both calculated scaling factors * high pass filtering (0.94ms of delay) *-----------------------------------------------------------------*/ + exp2 = sub( hBWE_zero->memExp1, exp1 ); + hBWE_zero->memExp1 = exp1; + move16(); filt_6k_7k_scale_fx( HF_exc, L_SUBFR16k, hBWE_zero->mem_hf_fx, tmp, exp2 ); /* i: input HF_exc is scaled in float, here scaling is done inside this filter */ -- GitLab From fc9cc6b74a97c77e8fb68af149c7fe9e0da060e8 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 21 Jan 2026 14:19:21 -0500 Subject: [PATCH 3/3] fix clang-format --- lib_dec/hf_synth_fx.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib_dec/hf_synth_fx.c b/lib_dec/hf_synth_fx.c index 20a3d6323..8466a5f43 100644 --- a/lib_dec/hf_synth_fx.c +++ b/lib_dec/hf_synth_fx.c @@ -88,13 +88,13 @@ void hf_synth_fx( const Word16 element_mode, /* i : element mode Q0*/ #endif const Word32 core_brate, /* i : core bitrate Q0*/ - const Word16 output_frame, /* i : output frame length Q0*/ - const Word16 *Aq, /* i : quantized Az Q12*/ - const Word16 *exc, /* i : excitation at 12.8 kHz Q_exc*/ - Word16 *synth, /* i : 12.8kHz synthesis signal Q_syn2*/ - Word16 *synth16k, /* o : 16kHz synthesis signal Q_syn2*/ - const Word16 Q_exc, /* i : excitation scaling */ - const Word16 Q_syn2 /* i : synthesis scaling */ + const Word16 output_frame, /* i : output frame length Q0*/ + const Word16 *Aq, /* i : quantized Az Q12*/ + const Word16 *exc, /* i : excitation at 12.8 kHz Q_exc*/ + Word16 *synth, /* i : 12.8kHz synthesis signal Q_syn2*/ + Word16 *synth16k, /* o : 16kHz synthesis signal Q_syn2*/ + const Word16 Q_exc, /* i : excitation scaling */ + const Word16 Q_syn2 /* i : synthesis scaling */ ) { const Word16 *p_Aq; @@ -131,7 +131,7 @@ void hf_synth_fx( static void hf_synthesis_fx( ZERO_BWE_DEC_HANDLE hBWE_zero, #ifdef FIX_BASOP_2350_HARM_0B_BWE - const Word16 element_mode, /* i : element mode Q0*/ + const Word16 element_mode, /* i : element mode Q0*/ #endif const Word32 core_brate, /* i : core bitrate Q0*/ const Word16 output_subfr, /* i : output sub-frame length Q0*/ @@ -322,9 +322,7 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); /* Q = (15 - exp1) + Q_tmp - 15 */ - Q_tmp = sub( Q_tmp, exp1 ); - - + Q_tmp = sub( Q_tmp, exp1 ); } #endif /*-----------------------------------------------------------------* -- GitLab