From 86df3c3d2fd583636cad66804c676d9948310497 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 7 May 2025 10:38:23 +0530 Subject: [PATCH 1/2] Q fixes in inov_encode function --- lib_enc/acelp_core_switch_enc_fx.c | 3 +- lib_enc/corr_xh_fx.c | 14 +-- lib_enc/enc_gen_voic_fx.c | 2 +- lib_enc/enc_pit_exc_fx.c | 2 +- lib_enc/enc_tran_fx.c | 3 +- lib_enc/find_tar_fx.c | 135 ----------------------------- lib_enc/inov_enc_fx.c | 37 +++++--- lib_enc/prot_fx_enc.h | 16 +--- 8 files changed, 39 insertions(+), 173 deletions(-) diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index 854f0ff67..4852cb567 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -6,7 +6,6 @@ #include "options.h" #include "cnst.h" #include "rom_com_fx.h" -//#include "prot_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -630,7 +629,7 @@ static void encod_gen_voic_core_switch_ivas_fx( ELSE { weight_a_fx( A, Ap, GAMMA1, M ); /* Bandwidth expansion of A(z) filter coefficients */ - find_targets_ivas_fx( inp, hLPDmem->mem_syn, 0, &( hLPDmem->mem_w0 ), Aq, res, L_SUBFR, Ap, TILT_FAC_FX, xn, cn, h1 ); + find_targets_ivas_fx( inp, hLPDmem->mem_syn, 0, &( hLPDmem->mem_w0 ), Aq, res, L_SUBFR, Ap, TILT_FAC_FX, xn, cn, h1 ); } q_h1 = sub( 14, norm_s( h1[0] ) ); diff --git a/lib_enc/corr_xh_fx.c b/lib_enc/corr_xh_fx.c index 51165d141..5fb7c628a 100644 --- a/lib_enc/corr_xh_fx.c +++ b/lib_enc/corr_xh_fx.c @@ -133,7 +133,7 @@ void corr_xh_ivas_fx( const Word16 Qx, Word16 dn[], /* o : correlation between x[] and h[] Qdn*/ Word16 *Qdn, - const Word16 h[], /* i : impulse response (of weighted synthesis filter) (Q15 - norm_s(h[0]))*/ + const Word16 h[], /* i : impulse response (of weighted synthesis filter) (Q14 - norm_s(h[0]))*/ const Word16 L_subfr /* i : length of the subframe Q0*/ ) { @@ -152,16 +152,16 @@ void corr_xh_ivas_fx( L_maxloc = L_deposit_l( 0 ); FOR( i = k; i < L_subfr; i += STEP ) { - L_tmp = L_mac( 0, x[i], h[0] ); // Qx+(15 - norm_s(h[0])) + L_tmp = L_mac( 0, x[i], h[0] ); // Qx+(14 - norm_s(h[0])) + 1 FOR( j = i; j < L_subfr - 1; j++ ) { - L_tmp = L_mac_o( L_tmp, x[j + 1], h[j + 1 - i], &Overflow ); // Qx+(15 - norm_s(h[0])) + L_tmp = L_mac_o( L_tmp, x[j + 1], h[j + 1 - i], &Overflow ); // Qx+(14 - norm_s(h[0])) + 1 } - y32[i] = L_tmp; // Qx+(15 - norm_s(h[0])) + y32[i] = L_tmp; // Qx+(14 - norm_s(h[0])) + 1 move32(); L_tmp = L_abs( L_tmp ); - L_maxloc = L_max( L_tmp, L_maxloc ); // Qx+(15 - norm_s(h[0])) + L_maxloc = L_max( L_tmp, L_maxloc ); // Qx+(14 - norm_s(h[0])) +1 } /* tot += 3*max / 8 */ L_maxloc = L_shr( L_maxloc, 2 ); @@ -176,11 +176,11 @@ void corr_xh_ivas_fx( FOR( i = 0; i < L_subfr; i++ ) { - dn[i] = round_fx( L_shl( y32[i], j ) ); // Qx+(15 - norm_s(h[0])) +j - 16 + dn[i] = round_fx( L_shl( y32[i], j ) ); // Qx+(14 - norm_s(h[0])) + 1 +j - 16 move16(); } - *Qdn = sub( add( add( Qx, sub( 15, norm_s( h[0] ) ) ), j ), 16 ); + *Qdn = sub( add( add( Qx, add( sub( 14, norm_s( h[0] ) ), 1 ) ), j ), 16 ); move16(); return; } diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index a60828a94..bb305e9c9 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -562,7 +562,7 @@ void encod_gen_voic_ivas_fx( Copy( &res_fx[i_subfr_fx], &exc_fx[i_subfr_fx], L_SUBFR ); /*Q_new*/ - find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx, + find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx, res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx ); q_h1 = sub( 14, norm_s( h1_fx[0] ) ); diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index f16dd80cb..e87462988 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -721,7 +721,7 @@ void enc_pit_exc_ivas_fx( Copy( &res[i_subfr], &exc[i_subfr], L_subfr ); /* Q_new */ /* condition on target (compared to float) has been put outside the loop */ - find_targets_ivas_new_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq, + find_targets_ivas_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq, res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); q_h1 = sub( 14, norm_s( h1[0] ) ); diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 865972819..c92e1b6db 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -545,7 +545,8 @@ Word16 encod_tran_ivas_fx( Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */ - find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, + + find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); q_h1 = sub( 14, norm_s( h1[0] ) ); diff --git a/lib_enc/find_tar_fx.c b/lib_enc/find_tar_fx.c index 4f24ec39f..8d3efb834 100644 --- a/lib_enc/find_tar_fx.c +++ b/lib_enc/find_tar_fx.c @@ -173,141 +173,6 @@ void find_targets_ivas_fx( Word16 *cn, /* o : target vector in residual domain Q_new*/ Word16 *h1 /* o : impulse response of weighted synthesis filter Q(14 - norm_s(h1[0]))*/ ) -{ - Word16 i; - Word16 temp[M + 6 * L_SUBFR]; /* error of quantization */ - Word16 scale, scaleq, j, d, s, s2, tmp; - Word16 Aqs[M + 1]; - Word32 h1_32[6 * L_SUBFR]; - Word16 sf; - Word64 Ltmp64; -#ifdef BASOP_NOGLOB_DECLARE_LOCAL - Flag Overflow = 0; - move16(); -#endif - /*------------------------------------------------------------------------* - * Find the target vector for excitation search: - * - * |------| res[n] - * speech[n]---| A(z) |-------- - * |------| | |--------| error[n] |------| - * zero -- (-)--| 1/A(z) |-----------| W(z) |-- target - * exc |--------| |------| - * - * Instead of subtracting the zero-input response of filters from - * the weighted input speech, the above configuration is used to - * compute the target vector. - *-----------------------------------------------------------------------*/ - FOR( i = 0; i < M; i++ ) - { - temp[i] = sub_sat( speech[i + i_subfr - M], mem_syn[i] ); /* Q_new - 1 */ - move16(); - } - Scale_sig( temp, M, 1 ); // scaling to make belong function output alligned //Qnew - - syn_filt_fx( 0, p_Aq, M, &res[i_subfr], temp + M, L_subfr, temp, 0 ); - - Residu3_fx( Ap, temp + M, xn, L_subfr, 0 ); /* xn in Q_new */ - - deemph_fx( xn, tilt_fac, L_subfr, mem_w0 ); /* xn in Q_new */ - - *mem_w0 = shr( *mem_w0, 1 ); // Q_new - 1 - - /*-----------------------------------------------------------------* - * Find target in residual domain (cn[]) for innovation search - *--------------------------------------------------------------*/ - IF( cn != NULL ) - { - /* first half: xn[] --> cn[] */ - temp[0] = 0; - move16(); - preemph_copy_fx( xn, cn, tilt_fac, shr( L_subfr, 1 ), temp ); - syn_filt_s_lc_fx( 1, Ap, cn, temp, shr( L_subfr, 1 ) ); /* Q_new -> Q_new - 1 */ - Residu3_lc_fx( p_Aq, M, temp, cn, shr( L_subfr, 1 ), 1 ); /* Q_new - 1 -> Q_new */ - - /* second half: res[] --> cn[] (approximated and faster) */ - Copy( &res[i_subfr + shr( L_subfr, 1 )], cn + shr( L_subfr, 1 ), shr( L_subfr, 1 ) ); /* Q_new */ - } - scale_sig( xn, L_subfr, -1 ); // Q_new - 1 - - /*---------------------------------------------------------------* - * Compute impulse response, h1[], of weighted synthesis filter * - *---------------------------------------------------------------*/ - - scale = norm_s( Ap[0] ); - scaleq = norm_s( p_Aq[0] ); - d = sub( scaleq, scale ); - IF( d >= 0 ) - { - Copy( p_Aq, Aqs, M + 1 ); /* Q12 */ - s = add( scaleq, 1 ); - s2 = shr( 16384, d ); - } - ELSE - { - Copy_Scale_sig( p_Aq, Aqs, M + 1, d ); /* Q12 */ - s = add( scale, 1 ); - s2 = 16384; - move16(); - } - - set32_fx( h1_32, 0, L_subfr ); - Overflow = 0; - move16(); - FOR( i = 0; i < M; i++ ) - { - Ltmp64 = W_mult_16_16( Ap[i], s2 ); /* Q27 */ - FOR( j = 1; j <= i; j++ ) - { - Ltmp64 = W_msu_16_16( Ltmp64, Aqs[j], extract_h( L_shl_o( h1_32[i - j], s, &Overflow ) ) ); /* Q27 */ - } - h1_32[i] = W_extract_l( Ltmp64 ); /* Q27 */ - move32(); - } - - Ltmp64 = W_mult_16_16( Ap[i], s2 ); /* Q27 */ - FOR( j = 1; j <= M; j++ ) - { - Ltmp64 = W_msu_16_16( Ltmp64, Aqs[j], extract_h( L_shl_o( h1_32[i - j], s, &Overflow ) ) ); /* Q27 */ - } - h1_32[M] = W_extract_l( Ltmp64 ); /* Q27 */ - move32(); - - FOR( i = M + 1; i < L_subfr; i++ ) - { - Ltmp64 = W_msu_16_16( 0, Aqs[1], extract_h( L_shl_o( h1_32[i - 1], s, &Overflow ) ) ); /* Q27 */ - FOR( j = 2; j <= M; j++ ) - { - Ltmp64 = W_msu_16_16( Ltmp64, Aqs[j], extract_h( L_shl_o( h1_32[i - j], s, &Overflow ) ) ); /* Q27 */ - } - h1_32[i] = W_extract_l( Ltmp64 ); /* Q27 */ - move32(); - } - - sf = sub( L_norm_arr( h1_32, L_subfr ), 1 ); - Copy_Scale_sig32_16( h1_32, h1, L_subfr, sf ); // Q11 + sf - - tmp = 0; - move16(); - Deemph2( h1, tilt_fac, L_subfr, &tmp ); // Q11 + sf - 1 - - return; -} - -void find_targets_ivas_new_fx( - const Word16 *speech, /* i : pointer to the speech frame Q_new-1*/ - const Word16 *mem_syn, /* i : memory of the synthesis filter Q_new-1*/ - const Word16 i_subfr, /* i : subframe index Q0*/ - Word16 *mem_w0, /* i/o: weighting filter denominator memory Q_new-1*/ - const Word16 *p_Aq, /* i : interpolated quantized A(z) filter Q12*/ - const Word16 *res, /* i : residual signal Q_new*/ - const Word16 L_subfr, /* i : length of vectors for gain quantization Q0*/ - const Word16 *Ap, /* i : unquantized A(z) filter with bandwidth expansion Q12*/ - Word16 tilt_fac, /* i : tilt factor Q15*/ - Word16 *xn, /* o : Close-loop Pitch search target vector Q_new-1*/ - Word16 *cn, /* o : target vector in residual domain Q_new*/ - Word16 *h1 /* o : impulse response of weighted synthesis filter Q(14 - norm_s(h1[0]))*/ -) { Word16 i; Word16 temp[M + 6 * L_SUBFR]; /* error of quantization */ diff --git a/lib_enc/inov_enc_fx.c b/lib_enc/inov_enc_fx.c index fe22ee398..62ea723a3 100644 --- a/lib_enc/inov_enc_fx.c +++ b/lib_enc/inov_enc_fx.c @@ -370,7 +370,7 @@ Word16 inov_encode_ivas_fx( Word16 shift, Word16 Q_new ) { - Word16 dn[2 * L_SUBFR], Qdn; + Word16 dn[2 * L_SUBFR], Qdn, Qcn; Word16 nBits, cmpl_flag; Word16 stack_pulses; Word16 g1, g2; @@ -378,7 +378,7 @@ Word16 inov_encode_ivas_fx( Word16 acelpautoc; BSTR_ENC_HANDLE hBstr = st_fx->hBstr; Word16 i, k; - Word16 Qxn, Rw_q, j, max_xn2; + Word16 Qxn, max_xn2; stack_pulses = 0; move16(); @@ -416,20 +416,22 @@ Word16 inov_encode_ivas_fx( test(); test(); + Qcn = Q_new; + move16(); IF( GT_32( core_brate, ACELP_13k20 ) && !Opt_AMR_WB && EQ_16( L_subfr, L_SUBFR ) ) { acelpautoc = 1; move16(); - Word16 q_h1 = sub( 14, norm_s( h2[0] ) ); - Scale_sig( h2, L_SUBFR, sub( 11, q_h1 ) ); /* set h2[] in Q11*/ - cb_shape_fx( 1, 1, 0, sharpFlag, 0, g1, g2, p_Aq, h2, tilt_code, shr( add( pt_pitch, 26 ), 6 ), 0, L_SUBFR ); + cb_shape_fx(1, 1, 0, sharpFlag, 0, g1, g2, p_Aq, h2, tilt_code, shr(add(pt_pitch, 26), 6), 0, L_SUBFR); /* h2: Q11, Rw: (Rw_e)Q */ - corr_hh_ivas_fx( h2, Rw, &Rw_q, L_subfr ); // Q(Rw) = Q11-2 - E_ACELP_conv_ivas_fx( xn2, h2, cn ); // Qcn = Qxn2 + /* Rw_e = */ E_ACELP_hh_corr(h2, Rw, L_SUBFR, 3); + + E_ACELP_conv(xn2, h2, cn); /* dn_e -> Rw_e*Q_xn */ - j = E_ACELP_toeplitz_mul_fx( Rw, cn, dn, L_SUBFR, 1 ); - Qdn = add( add( Qxn, Rw_q ), add( j, 1 ) ); + /*dn_e = */ E_ACELP_toeplitz_mul_fx(Rw, cn, dn, L_SUBFR, 1); + Qdn = Qcn; + move16(); } ELSE { @@ -442,6 +444,19 @@ Word16 inov_encode_ivas_fx( Scale_sig( h2, L_SUBFR, sub( 11, q_h1 ) ); /* set h2[] in Q11*/ cb_shape_fx( 1, 1, 0, sharpFlag, 0, g1, g2, p_Aq, h2, tilt_code, shr( add( pt_pitch, 26 ), 6 ), 0, L_subfr ); corr_xh_ivas_fx( xn2, Qxn, dn, &Qdn, h2, L_subfr ); // Q(dn) = Q_new+1 + IF( LT_16( Qdn, Qcn ) ) + { + scale_sig( cn, L_subfr, sub(Qdn, Qcn) ); + Qcn = Qdn; + move16(); + } + ELSE + { + scale_sig( dn, L_subfr, sub(Qcn, Qdn) ); + Qdn = Qcn; + move16(); + } + } /*-----------------------------------------------------------------* @@ -607,7 +622,7 @@ Word16 inov_encode_ivas_fx( } ELSE { - acelp_fast_fx( hBstr, nBits, dn, Qdn, cn, Q_new, h2, code, y2, L_subfr ); + acelp_fast_fx( hBstr, nBits, dn, Qdn, cn, Qcn, h2, code, y2, L_subfr ); } } ELSE IF( ( EQ_16( st_fx->idchan, 1 ) && LE_16( st_fx->acelp_cfg.fixed_cdk_index[idx2], 7 ) ) || ( st_fx->idchan == 0 && LE_16( st_fx->acelp_cfg.fixed_cdk_index[idx2], 3 ) ) ) @@ -618,7 +633,7 @@ Word16 inov_encode_ivas_fx( } ELSE { - acelp_fast_fx( hBstr, st_fx->acelp_cfg.fixed_cdk_index[idx2], dn, Qdn, cn, Q_new, h2, code, y2, L_SUBFR ); + acelp_fast_fx( hBstr, st_fx->acelp_cfg.fixed_cdk_index[idx2], dn, Qdn, cn, Qcn, h2, code, y2, L_SUBFR ); } } ELSE diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 2d7e708bb..05bb16832 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -2334,22 +2334,8 @@ void find_targets_fx( Word16 *cn, /* o : target vector in residual domain Q_new*/ Word16 *h1 /* o : impulse response of weighted synthesis filter Q14*/ ); -void find_targets_ivas_fx( - const Word16 *speech, /* i : pointer to the speech frame Q_new-1*/ - const Word16 *mem_syn, /* i : memory of the synthesis filter Q_new-1*/ - const Word16 i_subfr, /* i : subframe index Q0*/ - Word16 *mem_w0, /* i/o: weighting filter denominator memory Q_new-1*/ - const Word16 *p_Aq, /* i : interpolated quantized A(z) filter Q12*/ - const Word16 *res, /* i : residual signal Q_new*/ - const Word16 L_subfr, /* i : length of vectors for gain quantization Q0*/ - const Word16 *Ap, /* i : unquantized A(z) filter with bandwidth expansion Q12*/ - Word16 tilt_fac, /* i : tilt factor Q15*/ - Word16 *xn, /* o : Close-loop Pitch search target vector Q_new-1*/ - Word16 *cn, /* o : target vector in residual domain Q_new*/ - Word16 *h1 /* o : impulse response of weighted synthesis filter Q(14 - norm_s(h1[0]))*/ -); -void find_targets_ivas_new_fx( +void find_targets_ivas_fx( const Word16 *speech, /* i : pointer to the speech frame Q_new-1*/ const Word16 *mem_syn, /* i : memory of the synthesis filter Q_new-1*/ const Word16 i_subfr, /* i : subframe index Q0*/ -- GitLab From 89c0af8f9c3de8b0fa689f96e4280438f1cc066b Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 7 May 2025 10:48:05 +0530 Subject: [PATCH 2/2] Clang formatting changes --- lib_enc/acelp_core_switch_enc_fx.c | 2 +- lib_enc/corr_xh_fx.c | 2 +- lib_enc/enc_gen_voic_fx.c | 2 +- lib_enc/enc_pit_exc_fx.c | 2 +- lib_enc/enc_tran_fx.c | 2 +- lib_enc/inov_enc_fx.c | 13 ++++++------- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index 4852cb567..bad70b08c 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -629,7 +629,7 @@ static void encod_gen_voic_core_switch_ivas_fx( ELSE { weight_a_fx( A, Ap, GAMMA1, M ); /* Bandwidth expansion of A(z) filter coefficients */ - find_targets_ivas_fx( inp, hLPDmem->mem_syn, 0, &( hLPDmem->mem_w0 ), Aq, res, L_SUBFR, Ap, TILT_FAC_FX, xn, cn, h1 ); + find_targets_ivas_fx( inp, hLPDmem->mem_syn, 0, &( hLPDmem->mem_w0 ), Aq, res, L_SUBFR, Ap, TILT_FAC_FX, xn, cn, h1 ); } q_h1 = sub( 14, norm_s( h1[0] ) ); diff --git a/lib_enc/corr_xh_fx.c b/lib_enc/corr_xh_fx.c index 5fb7c628a..56b22c206 100644 --- a/lib_enc/corr_xh_fx.c +++ b/lib_enc/corr_xh_fx.c @@ -161,7 +161,7 @@ void corr_xh_ivas_fx( y32[i] = L_tmp; // Qx+(14 - norm_s(h[0])) + 1 move32(); L_tmp = L_abs( L_tmp ); - L_maxloc = L_max( L_tmp, L_maxloc ); // Qx+(14 - norm_s(h[0])) +1 + L_maxloc = L_max( L_tmp, L_maxloc ); // Qx+(14 - norm_s(h[0])) +1 } /* tot += 3*max / 8 */ L_maxloc = L_shr( L_maxloc, 2 ); diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index bb305e9c9..3ff99812f 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -563,7 +563,7 @@ void encod_gen_voic_ivas_fx( Copy( &res_fx[i_subfr_fx], &exc_fx[i_subfr_fx], L_SUBFR ); /*Q_new*/ find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx, - res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx ); + res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx ); q_h1 = sub( 14, norm_s( h1_fx[0] ) ); Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/ diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index e87462988..bfdf46ea0 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -722,7 +722,7 @@ void enc_pit_exc_ivas_fx( /* condition on target (compared to float) has been put outside the loop */ find_targets_ivas_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq, - res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); + res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); q_h1 = sub( 14, norm_s( h1[0] ) ); Copy_Scale_sig( h1, h2, L_subfr, sub( 11, q_h1 ) ); /*Q11*/ diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index c92e1b6db..dde834b2b 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -547,7 +547,7 @@ Word16 encod_tran_ivas_fx( find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, - res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); + res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); q_h1 = sub( 14, norm_s( h1[0] ) ); Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/ diff --git a/lib_enc/inov_enc_fx.c b/lib_enc/inov_enc_fx.c index 62ea723a3..d019bf474 100644 --- a/lib_enc/inov_enc_fx.c +++ b/lib_enc/inov_enc_fx.c @@ -422,14 +422,14 @@ Word16 inov_encode_ivas_fx( { acelpautoc = 1; move16(); - cb_shape_fx(1, 1, 0, sharpFlag, 0, g1, g2, p_Aq, h2, tilt_code, shr(add(pt_pitch, 26), 6), 0, L_SUBFR); + cb_shape_fx( 1, 1, 0, sharpFlag, 0, g1, g2, p_Aq, h2, tilt_code, shr( add( pt_pitch, 26 ), 6 ), 0, L_SUBFR ); /* h2: Q11, Rw: (Rw_e)Q */ - /* Rw_e = */ E_ACELP_hh_corr(h2, Rw, L_SUBFR, 3); + /* Rw_e = */ E_ACELP_hh_corr( h2, Rw, L_SUBFR, 3 ); - E_ACELP_conv(xn2, h2, cn); + E_ACELP_conv( xn2, h2, cn ); /* dn_e -> Rw_e*Q_xn */ - /*dn_e = */ E_ACELP_toeplitz_mul_fx(Rw, cn, dn, L_SUBFR, 1); + /*dn_e = */ E_ACELP_toeplitz_mul_fx( Rw, cn, dn, L_SUBFR, 1 ); Qdn = Qcn; move16(); } @@ -446,17 +446,16 @@ Word16 inov_encode_ivas_fx( corr_xh_ivas_fx( xn2, Qxn, dn, &Qdn, h2, L_subfr ); // Q(dn) = Q_new+1 IF( LT_16( Qdn, Qcn ) ) { - scale_sig( cn, L_subfr, sub(Qdn, Qcn) ); + scale_sig( cn, L_subfr, sub( Qdn, Qcn ) ); Qcn = Qdn; move16(); } ELSE { - scale_sig( dn, L_subfr, sub(Qcn, Qdn) ); + scale_sig( dn, L_subfr, sub( Qcn, Qdn ) ); Qdn = Qcn; move16(); } - } /*-----------------------------------------------------------------* -- GitLab