diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index f6b376af3b81af5d7b68878f52849b75a8831c85..7d5d49a0fae484a7ba9cf14e7344a45c1c4f80ff 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2692,7 +2692,7 @@ Word16 ivas_acelp_tcx20_switching_fx( Word16 q_inp, /* i : i/p Q */ Word16 *wsp, /* i : input weighted signal */ #ifdef NONBE_FIX_ISSUE_2206 - Word16 q_wsp, /* i : Q of input weighted signal */ + Word16 q_wsp, /* i : Q of input weighted signal */ #endif Word32 non_staX, /* i : unbound non-stationarity for sp/mu clas */ Word16 *pitch_fr, /* i : fraction pitch values */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 1df94661325ecfc10e10246218d3b7f577e5184d..e5274d802e98b0b5cfbb23661f293ba12aa9b61c 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -8753,7 +8753,7 @@ Word32 dotp_fx( const Word16 x[], /* i : vector x[] */ const Word16 y[], /* i : vector y[] */ const Word16 n, /* i : vector length */ - Word16 *exp /* (o) : exponent of result (0..+30) */ + Word16 *exp /* o : exponent of result (0..+30) */ ); /* o : sum of all squared vector elements Q(2x+1)*/ @@ -8763,52 +8763,52 @@ Word32 sum2_fx_mod( ); void Copy_Scale_sig( - const Word16 x[], /* i : signal to scale i Qx */ - Word16 y[], /* o : scaled signal output Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + const Word16 x[], /* i : signal to scale i Qx */ + Word16 y[], /* o : scaled signal output Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); #ifdef NONBE_FIX_ISSUE_2206 void Copy_Scale_sig_nosat( - const Word16 x[], /* i : signal to scale i Qx */ - Word16 y[], /* o : scaled signal output Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + const Word16 x[], /* i : signal to scale i Qx */ + Word16 y[], /* o : scaled signal output Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); #endif void Scale_sig32( - Word32 x[], /* i/o: signal to scale Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + Word32 x[], /* i/o: signal to scale Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); void Copy_Scale_sig_16_32_DEPREC( - const Word16 x[], /* i : signal to scale i Qx */ - Word32 y[], /* o : scaled signal output Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + const Word16 x[], /* i : signal to scale i Qx */ + Word32 y[], /* o : scaled signal output Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); void Copy_Scale_sig_16_32_r( - const Word16 x[], /* i : signal to scale input Qx */ - Word32 y[], /* o : scaled signal output Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + const Word16 x[], /* i : signal to scale input Qx */ + Word32 y[], /* o : scaled signal output Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); void Copy_Scale_sig_16_32_no_sat( - const Word16 x[], /* i : signal to scale input Qx */ - Word32 y[], /* o : scaled signal output Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + const Word16 x[], /* i : signal to scale input Qx */ + Word32 y[], /* o : scaled signal output Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); void Copy_Scale_sig_32_16( - const Word32 x[], /* i : signal to scale i Qx */ - Word16 y[], /* o : scaled signal output Qx */ - const Word16 lg, /* i : size of x[] Q0 */ + const Word32 x[], /* i : signal to scale i Qx */ + Word16 y[], /* o : scaled signal output Qx */ + const Word16 lg, /* i : size of x[] Q0 */ const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); @@ -8817,7 +8817,7 @@ void Copy_Scale_sig_32_16_nosat( const Word32 x[], /* i : signal to scale input Qx */ Word16 y[], /* o : scaled signal output Qx */ const Word16 lg, /* i : size of x[] Q0 */ - const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ + const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ); #endif diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index c9eb8c9dba74c5dfca11787817d1be5c2c933ed5..89a10b03116198382efbd64437f8cf5cc2fb9f35 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -1260,7 +1260,7 @@ void Copy_Scale_sig_nosat( const Word16 x[], /* i : signal to scale input Qx */ Word16 y[], /* o : scaled signal output Qx */ const Word16 lg, /* i : size of x[] Q0 */ - const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ + const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) { Word16 i; @@ -1466,7 +1466,7 @@ void Copy_Scale_sig_32_16_nosat( const Word32 x[], /* i : signal to scale input Qx */ Word16 y[], /* o : scaled signal output Qx */ const Word16 lg, /* i : size of x[] Q0 */ - const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ + const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) { Word16 i; diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index e9ba5ca8b42e437e234f4677fa9ea90f2988b821..3b2cf0164e2b71337c1c44ea712b3826c02a4b36 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -670,7 +670,6 @@ void core_signal_analysis_high_bitrate_ivas_fx( Scale_sig( &( st->mem_wsp_enc ), 1, Q_exp ); // *Q_new } #endif - IF( EQ_16( hTcxEnc->tcxMode, TCX_10 ) ) { Copy( ¶m_core[1 + NOISE_FILL_RANGES], ¶m_core[NPRM_DIV + 1 + NOISE_FILL_RANGES], LTPSIZE ); // Q0 diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index 70cf534d7a12c9bb4bb772e9e201f00c9eb087bd..4efbfd049b7adc155da5379e01edcd6ac99a2d23 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -77,63 +77,63 @@ static Word16 get_zero_flag( const Word32 arr[], const Word16 len ) *--------------------------------------------------------------------*/ void pre_proc_front_ivas_fx( - SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ - const Word32 element_brate, /* i : SCE/CPE element bitrate Q0*/ - const Word16 nb_bits_metadata, /* i : number of metadata bits Q0*/ - const Word16 input_frame, /* i : frame length Q0*/ - const Word16 n, /* i : channel number Q0*/ + SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + const Word32 element_brate, /* i : SCE/CPE element bitrate Q0*/ + const Word16 nb_bits_metadata, /* i : number of metadata bits Q0*/ + const Word16 input_frame, /* i : frame length Q0*/ + const Word16 n, /* i : channel number Q0*/ Word16 old_inp_12k8_fx[], /* o : buffer of old input signal (st->Q_inp until preemph, then Q_new, then Q_new-1 towards the end)*/ #ifdef NONBE_FIX_ISSUE_2206 Word16 old_inp_16k_fx[], /* o : buffer of old input signal @16kHz (st->Q_inp until preemph, then Q_new, then Q_new-1 towards the end)*/ #else Word16 old_inp_16k_fx[], /* o : buffer of old input signal @16kHz Q_new-1*/ #endif - Word32 *ener_fx, /* o : residual energy from Levinson-Durbin epsP_fx_q*/ - Word16 *relE_fx, /* o : frame relative energy Q8*/ - Word16 A_fx[NB_SUBFR16k * ( M + 1 )], /* o : A(z) unquantized for the 4 subframes Q12*/ - Word16 Aw_fx[NB_SUBFR16k * ( M + 1 )], /* o : weighted A(z) unquantized for subframes Q12*/ - Word32 epsP_fx[M + 1], /* o : LP prediction errors epsP_fx_q*/ - Word16 *epsP_fx_q, /* o : Q factor of LP prediction errors */ - Word16 lsp_new_fx[M], /* o : LSPs at the end of the frame Q15*/ - Word16 lsp_mid_fx[M], /* o : LSPs in the middle of the frame Q15*/ - Word16 *vad_hover_flag, /* o : VAD hangover flag Q0*/ - Word16 *attack_flag, /* o : flag signaling attack Q0*/ - Word32 realBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer Q(q_re_im_buf)*/ - Word32 imagBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer Q(q_re_im_buf)*/ - Word16 *q_re_im_buf, /* i/o: Q-factor of real and imag buffer */ - Word16 old_wsp_fx[], /* o : weighted input signal buffer q_old_wsp*/ - Word16 *q_old_wsp, /* o : Q factor of weighted input signal buffer */ - Word16 pitch_fr_fx[NB_SUBFR], /* o : fractional pitch values Q6*/ - Word16 voicing_fr_fx[NB_SUBFR], /* o : fractional pitch gains Q15*/ - Word16 *loc_harm, /* o : harmonicity flag Q0*/ - Word16 *cor_map_sum_fx, /* o : speech/music clasif. parameter Q8*/ - Word16 *vad_flag_dtx, /* o : HE-SAD flag with additional DTX HO Q0*/ - Word32 enerBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o : energy buffer enerBuffer_fx_exp*/ - Word16 *enerBuffer_fx_exp, /* o : energy buffer */ - Word16 fft_buff_fx[2 * L_FFT], /* o : FFT buffer fft_buff_fx_q*/ - Word16 *fft_buff_fx_q, /* o : FFT buffer */ - const Word16 tdm_A_PCh_fx[M + 1], /* i : unq. LP coeff. of primary channel Q12*/ - const Word16 tdm_lsp_new_PCh_fx[M], /* i : unq. LSPs of primary channel Q15*/ - const Word32 currFlatness_fx, /* i : flatness parameter Q21*/ - const Word16 tdm_ratio_idx, /* i : Current Ratio_L index Q0*/ - Word32 fr_bands_LR_fx[][2 * NB_BANDS], /* i : energy in frequency bands fr_bands_LR_fx_q*/ - Word16 fr_bands_LR_fx_q[CPE_CHANNELS], /* i : Q factors of energy in frequency bands */ - const Word16 Etot_LR_fx[], /* i : total energy Left & Right channel Q8*/ - Word32 lf_E_LR_fx[][2 * VOIC_BINS], /* i : per bin spectrum energy in lf, LR channels lf_E_LR_fx_q*/ - const Word16 lf_E_LR_fx_q, /* i : Q factor of per bin spectrum energy in lf, LR channels */ - const Word16 localVAD_HE_SAD_LR[], /* i : HE-SAD flag without hangover, LR channels Q0*/ - Word32 band_energies_LR_fx[2 * NB_BANDS], /* o : energy in critical bands without minimum noise floor E_MIN band_energies_LR_fx_q*/ + Word32 *ener_fx, /* o : residual energy from Levinson-Durbin epsP_fx_q*/ + Word16 *relE_fx, /* o : frame relative energy Q8*/ + Word16 A_fx[NB_SUBFR16k * ( M + 1 )], /* o : A(z) unquantized for the 4 subframes Q12*/ + Word16 Aw_fx[NB_SUBFR16k * ( M + 1 )], /* o : weighted A(z) unquantized for subframes Q12*/ + Word32 epsP_fx[M + 1], /* o : LP prediction errors epsP_fx_q*/ + Word16 *epsP_fx_q, /* o : Q factor of LP prediction errors */ + Word16 lsp_new_fx[M], /* o : LSPs at the end of the frame Q15*/ + Word16 lsp_mid_fx[M], /* o : LSPs in the middle of the frame Q15*/ + Word16 *vad_hover_flag, /* o : VAD hangover flag Q0*/ + Word16 *attack_flag, /* o : flag signaling attack Q0*/ + Word32 realBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer Q(q_re_im_buf)*/ + Word32 imagBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer Q(q_re_im_buf)*/ + Word16 *q_re_im_buf, /* i/o: Q-factor of real and imag buffer */ + Word16 old_wsp_fx[], /* o : weighted input signal buffer q_old_wsp*/ + Word16 *q_old_wsp, /* o : Q factor of weighted input signal buffer */ + Word16 pitch_fr_fx[NB_SUBFR], /* o : fractional pitch values Q6*/ + Word16 voicing_fr_fx[NB_SUBFR], /* o : fractional pitch gains Q15*/ + Word16 *loc_harm, /* o : harmonicity flag Q0*/ + Word16 *cor_map_sum_fx, /* o : speech/music clasif. parameter Q8*/ + Word16 *vad_flag_dtx, /* o : HE-SAD flag with additional DTX HO Q0*/ + Word32 enerBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o : energy buffer enerBuffer_fx_exp*/ + Word16 *enerBuffer_fx_exp, /* o : energy buffer */ + Word16 fft_buff_fx[2 * L_FFT], /* o : FFT buffer fft_buff_fx_q*/ + Word16 *fft_buff_fx_q, /* o : FFT buffer */ + const Word16 tdm_A_PCh_fx[M + 1], /* i : unq. LP coeff. of primary channel Q12*/ + const Word16 tdm_lsp_new_PCh_fx[M], /* i : unq. LSPs of primary channel Q15*/ + const Word32 currFlatness_fx, /* i : flatness parameter Q21*/ + const Word16 tdm_ratio_idx, /* i : Current Ratio_L index Q0*/ + Word32 fr_bands_LR_fx[][2 * NB_BANDS], /* i : energy in frequency bands fr_bands_LR_fx_q*/ + Word16 fr_bands_LR_fx_q[CPE_CHANNELS], /* i : Q factors of energy in frequency bands */ + const Word16 Etot_LR_fx[], /* i : total energy Left & Right channel Q8*/ + Word32 lf_E_LR_fx[][2 * VOIC_BINS], /* i : per bin spectrum energy in lf, LR channels lf_E_LR_fx_q*/ + const Word16 lf_E_LR_fx_q, /* i : Q factor of per bin spectrum energy in lf, LR channels */ + const Word16 localVAD_HE_SAD_LR[], /* i : HE-SAD flag without hangover, LR channels Q0*/ + Word32 band_energies_LR_fx[2 * NB_BANDS], /* o : energy in critical bands without minimum noise floor E_MIN band_energies_LR_fx_q*/ const Word16 band_energies_LR_fx_q, /* o : Q factors of energy in critical bands without minimum noise floor */ - const Word16 flag_16k_smc, /* i : flag to indicate if the OL SMC is run at 16 kHz Q0*/ - const Word16 front_vad_flag, /* i : front-VAD flag to overwrite VAD decision Q0*/ - const Word16 force_front_vad, /* i : flag to force VAD decision Q0*/ - const Word16 front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision Q0*/ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ - const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ - const Word32 ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX Q0*/ - Word16 *Q_new /* i/o : Q factor of speech buffers */ + const Word16 flag_16k_smc, /* i : flag to indicate if the OL SMC is run at 16 kHz Q0*/ + const Word16 front_vad_flag, /* i : front-VAD flag to overwrite VAD decision Q0*/ + const Word16 force_front_vad, /* i : flag to force VAD decision Q0*/ + const Word16 front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision Q0*/ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ + const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ + const Word32 ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX Q0*/ + Word16 *Q_new /* i/o : Q factor of speech buffers */ ) { Encoder_State *st; @@ -571,6 +571,7 @@ void pre_proc_front_ivas_fx( move16(); #endif } + #ifdef NONBE_FIX_ISSUE_2206 Copy( st->mem_decim_fx_q_inp, st->mem_decim_fx, 2 * L_FILT_MAX ); st->q_mem_decim_fx = st->q_inp; @@ -1615,7 +1616,6 @@ void pre_proc_front_ivas_fx( st->mem_wsp_enc = shl( st->mem_wsp_enc, sub( 0, sub( Q15, st->exp_buf_wspeech_enc ) ) ); // Q0 move16(); #endif - *Q_new = add( *Q_new, Q_inp_const ); // actual Q_new move16(); #ifdef NONBE_FIX_ISSUE_2206 diff --git a/lib_enc/ivas_cpe_enc_fx.c b/lib_enc/ivas_cpe_enc_fx.c index 3943428d137e16412075066eee787398501bb800..68b7f61556d55458e3ba1ba5812ab8e6593b3b42 100644 --- a/lib_enc/ivas_cpe_enc_fx.c +++ b/lib_enc/ivas_cpe_enc_fx.c @@ -828,7 +828,6 @@ ivas_error ivas_cpe_enc_fx( sts[1]->exp_old_inp_12k8 = Q15; move16(); } - #ifndef NONBE_FIX_ISSUE_2206 q_min = sts[1]->q_old_inp; move16(); diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 095b918ef85b6d0a96458616d69cadb16edf9745..83c00ac683ca4abf3bae1a61b7bc35c2e3fa5327 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -1242,7 +1242,6 @@ Word32 stereo_dft_enc_synthesize_fx( Word16 trigo_step; Word16 scal_fac; - /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -1613,10 +1612,8 @@ Word32 stereo_dft_enc_synthesize_fx( FOR( i = 0; i < ovl; i++ ) { - // output[offset + i] = mem[i] + tmp[zp + i] * win[i]; output_fx[offset + i] = L_add( L_shl( mem_fx[i], mem_shift ), Mpy_32_32( tmp_fx[zp + i], win_fx[i] ) ); move32(); - // mem[i] = tmp[zp + N + i] * win[ovl - 1 - i]; mem_fx[i] = Mpy_32_32( tmp_fx[zp + N + i], win_fx[ovl - 1 - i] ); move32(); } @@ -1693,6 +1690,7 @@ Word32 stereo_dft_enc_synthesize_fx( *nrg_out_fx_e = nrg_fx_e; move16(); } + pop_wmops(); return ( nrg_fx ); } diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 9564b5def75edcd08bbe900dd154651d9194c15d..b254fba014e0d17de68acbcc350539dc13d39089 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -614,14 +614,14 @@ static void icbwe_dft_stereo_param_fx( void stereo_icBWE_enc_fx( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ #ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT - const Word16 shb_speech_ref_fx16[], /* i : SHB speech ref channel shb_speech_ref_q*/ + const Word16 shb_speech_ref_fx16[], /* i : SHB speech ref channel shb_speech_ref_q*/ const Word16 shb_speech_ref_q, /* i : SHB speech ref channel Q */ #else const Word16 shb_speech_ref_fx16[], /* i : SHB speech ref channel Q0*/ #endif - Word16 shb_speech_nonref_fx_16[], /* i/o: SHB speech non-ref channel shb_speech_nonref_e*/ + Word16 shb_speech_nonref_fx_16[], /* i/o: SHB speech non-ref channel shb_speech_nonref_e*/ Word16 shb_speech_nonref_e, /* i/o: SHB speech non-ref channel */ - const Word16 *voice_factors_fx16 /* i : voicing factors Q15 */ + const Word16 *voice_factors_fx16 /* i : voicing factors Q15 */ ) { Word16 i, j, k, nbSubFr; diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 2ee4a05f2d81af410b846214b414a897731adbbb..6d6a4620560f28c34908ab1082e0ab1c84372434 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -937,6 +937,7 @@ typedef struct td_bwe_enc_structure Word16 state_ana_filt_shb_fx_Q; #endif Word16 cldfbHBLT; /* Q13 */ + /* states for the filters used in generating SHB excitation from WB excitation*/ Word32 mem_csfilt_fx[2]; /* Q(prev_Q_bwe_exc) */ Word16 mem_shb_res_fx[MAX_LEN_MA_FILTER]; /* old SHB residual signal Q(prev_Q_shb) */