From db79a18bd3732a34f1d89599d98d799e4ef1133f Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Fri, 16 May 2025 15:03:48 +0300 Subject: [PATCH 1/6] test 1 fix for 1325 --- lib_com/bits_alloc.c | 4 ++++ lib_com/options.h | 1 + lib_dec/acelp_core_dec.c | 6 ++++-- lib_enc/acelp_core_enc.c | 6 ++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 7f7e34b3f5..1a6cb56bfe 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -770,7 +770,11 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST + else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) +#else else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) +#endif { bits -= TDM_IC_LSF_PRED_BITS; } diff --git a/lib_com/options.h b/lib_com/options.h index 3783d86426..8e299bf831 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,7 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ +#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST /* Nokia: test one solution for usage of active_cnt variable*/ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 46a3ec3014..eb3c6c74a2 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -654,20 +654,22 @@ ivas_error acelp_core_dec( else { const float *pt_interp_2; - +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST if ( st->active_cnt != 1 ) { +#endif int16_t beta_index; beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST } else { mvr2r( tdm_lspQ_PCh, lsp_new, M ); mvr2r( tdm_lsfQ_PCh, lsf_new, M ); } - +#endif if ( st->rate_switching_reset ) { /* extrapolation in case of unstable LSF convert */ diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index cf43042ce0..9ab829e3ba 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -416,9 +416,10 @@ ivas_error acelp_core_enc( else { const float *pt_interp_2; - +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST if ( st->active_cnt != 1 ) { +#endif int16_t beta_index; float lsf_wgts[M]; @@ -430,8 +431,9 @@ ivas_error acelp_core_enc( tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST } - +#endif pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) { -- GitLab From 0c17294cd4f5a21426cd569b7b80221eb7188640 Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Fri, 16 May 2025 15:14:09 +0300 Subject: [PATCH 2/6] fix Linux compile in 1325 --- lib_com/bits_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 1a6cb56bfe..3d983f04e1 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -771,7 +771,7 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) + else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt > -1 ) /* active_cnt should actually be removed from header as well*/ #else else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) #endif -- GitLab From 2414cd1160eda89163f210f43aa729f886855526 Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Mon, 19 May 2025 11:59:07 +0300 Subject: [PATCH 3/6] fix warnings --- lib_com/prot.h | 2 ++ lib_dec/acelp_core_dec.c | 2 ++ lib_dec/evs_dec.c | 6 +++++- lib_dec/ivas_core_dec.c | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib_com/prot.h b/lib_com/prot.h index 18b6c30c5c..f2d4dc8a9e 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4551,7 +4551,9 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ +#endif const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ const int16_t last_element_mode, /* i : last element mode */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index eb3c6c74a2..2e97e20418 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -67,7 +67,9 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ +#endif const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ const int16_t last_element_mode, /* i : last element mode */ diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index c5bbddd060..75600a01e7 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -259,7 +259,11 @@ ivas_error evs_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ - if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST + NULL, + #endif + NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index eb961c38dc..5290573a14 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -348,7 +348,11 @@ ivas_error ivas_core_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ - if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) + if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, + #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST + tdm_lspQ_PCh, + #endif + tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 5496d199abd318de678933694339182ecca72dbb Mon Sep 17 00:00:00 2001 From: Adriana Vasilache Date: Mon, 19 May 2025 12:02:44 +0300 Subject: [PATCH 4/6] fix clang --- lib_com/prot.h | 18 +++++++++--------- lib_dec/acelp_core_dec.c | 18 +++++++++--------- lib_dec/evs_dec.c | 6 +++--- lib_dec/ivas_core_dec.c | 10 +++++----- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lib_com/prot.h b/lib_com/prot.h index f2d4dc8a9e..f94966abb2 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4552,16 +4552,16 @@ ivas_error acelp_core_dec( int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ + const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ #endif - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ); void bass_psfilter_init( diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 2e97e20418..75a22e9c38 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -68,16 +68,16 @@ ivas_error acelp_core_dec( int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ + const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ #endif - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ) { float old_exc[L_EXC_DEC], *exc; /* excitation signal buffer */ diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index 75600a01e7..633967efab 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -261,9 +261,9 @@ ivas_error evs_dec( /* ACELP core decoder */ if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - NULL, - #endif - NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) + NULL, +#endif + NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 5290573a14..91fd5db4b6 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -348,11 +348,11 @@ ivas_error ivas_core_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ - if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, - #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - tdm_lspQ_PCh, - #endif - tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) + if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST + tdm_lspQ_PCh, +#endif + tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 632456117cc06ea7d928153d5344339bcd7cc57b Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 21 May 2025 14:58:43 +0200 Subject: [PATCH 5/6] formal improvements within NONBE_1325_TD_STEREO_QUANT_LSF_SEC --- lib_com/bits_alloc.c | 14 ++++++++------ lib_com/ivas_prot.h | 2 ++ lib_com/ivas_stereo_td_bit_alloc.c | 18 ++++++++++++++---- lib_com/options.h | 2 +- lib_com/prot.h | 12 +++++++----- lib_dec/acelp_core_dec.c | 14 +++++++++++--- lib_dec/acelp_core_switch_dec.c | 4 ++++ lib_dec/evs_dec.c | 8 ++++---- lib_dec/gs_dec.c | 4 ++++ lib_dec/ivas_core_dec.c | 10 +++++++++- lib_enc/acelp_core_enc.c | 20 +++++++++++++++----- lib_enc/acelp_core_switch_enc.c | 4 ++++ lib_enc/ivas_core_enc.c | 4 ++++ lib_enc/transition_enc.c | 8 ++++++++ 14 files changed, 95 insertions(+), 29 deletions(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 3d983f04e1..718b8a240e 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -552,10 +552,12 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ - const int16_t active_cnt, /* i : Active frame counter */ - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + const int16_t active_cnt, /* i : Active frame counter */ +#endif + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ) { int16_t i, bits, nb_subfr; @@ -770,8 +772,8 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt > -1 ) /* active_cnt should actually be removed from header as well*/ +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) #else else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) #endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f3366e08a8..9e73c6ef1e 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2103,7 +2103,9 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ +#endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index c96ff4db30..65f3f4d099 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -440,10 +440,12 @@ void tdm_bit_alloc( *-------------------------------------------------------------------*/ void td_stereo_param_updt( - const float lsp_old_PCh[], /* i : primary channel old LSPs */ - const float lsf_old_PCh[], /* i : primary channel old LSFs */ - const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ + const float lsp_old_PCh[], /* i : primary channel old LSPs */ + const float lsf_old_PCh[], /* i : primary channel old LSFs */ + const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ +#endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ @@ -456,14 +458,17 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( tdm_lspQ_PCh != NULL ) { lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); } +#endif } else if ( flag_ACELP16k == 1 ) { +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); @@ -472,18 +477,23 @@ void td_stereo_param_updt( } else { +#endif float lsp_temp[M]; mvr2r( lsp_old_PCh, lsp_temp, M ); lsp_convert_poly( lsp_temp, L_FRAME, 0 ); lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } +#endif } else { +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); } +#endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } diff --git a/lib_com/options.h b/lib_com/options.h index 8e299bf831..add1071270 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,8 +171,8 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ +#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ -#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST /* Nokia: test one solution for usage of active_cnt variable*/ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index f94966abb2..fe84276009 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4551,7 +4551,7 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ #endif const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ @@ -9115,10 +9115,12 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const int16_t idchan, /* i : channel id */ - const int16_t active_cnt, /* i : Active frame counter */ - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + const int16_t active_cnt, /* i : Active frame counter */ +#endif + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ); /*! r: ACELP16k flag */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 75a22e9c38..a5f6b0d784 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -67,7 +67,7 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ #endif const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ @@ -615,11 +615,19 @@ ivas_error acelp_core_dec( nb_bits = -1; } +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) { +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif } } @@ -656,7 +664,7 @@ ivas_error acelp_core_dec( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( st->active_cnt != 1 ) { #endif @@ -664,7 +672,7 @@ ivas_error acelp_core_dec( beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } else { diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index cedc755794..762de6e65e 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -158,7 +158,11 @@ ivas_error acelp_core_switch_dec( * Excitation decoding *----------------------------------------------------------------*/ +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); +#else config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); +#endif decod_gen_voic_core_switch( st, L_frame_for_cs, 0, Aq, exc, cbrate ); diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index 633967efab..a1b790df81 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -259,11 +259,11 @@ ivas_error evs_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ - if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST - NULL, +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) #endif - NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index a04a8c6837..2902b4daba 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,7 +111,11 @@ void decod_audio( } /* set bit-allocation */ +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 91fd5db4b6..c6295686c9 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -84,7 +84,11 @@ ivas_error ivas_core_dec( int16_t unbits[CPE_CHANNELS]; int16_t sid_bw[CPE_CHANNELS]; FRAME_MODE frameMode[CPE_CHANNELS]; +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + float tdm_lsfQ_PCh[M]; +#else float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; +#endif int16_t tdm_LRTD_flag; int32_t element_brate, output_Fs; int32_t last_element_brate; @@ -349,7 +353,7 @@ ivas_error ivas_core_dec( { /* ACELP core decoder */ if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC tdm_lspQ_PCh, #endif tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) @@ -376,7 +380,11 @@ ivas_error ivas_core_dec( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); +#else td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); +#endif } } /* n_channels loop */ diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 9ab829e3ba..e0e7b1be03 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -375,7 +375,11 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif } /*-----------------------------------------------------------------* @@ -416,7 +420,7 @@ ivas_error acelp_core_enc( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( st->active_cnt != 1 ) { #endif @@ -425,15 +429,13 @@ ivas_error acelp_core_enc( /* intra_frame prediction for the LSFs */ lsp2lsf( lsp_new, lsf_new, M, 12800 ); - Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); - tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); - push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC_TEST +#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } #endif + pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) { @@ -497,7 +499,11 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif } /*---------------------------------------------------------------* @@ -555,7 +561,11 @@ ivas_error acelp_core_enc( lsf_syn_mem_restore( st, tilt_code_bck, gc_threshold_bck, clip_var_bck, next_force_sf_bck, lsp_new, lsp_mid, clip_var, mem_AR, mem_MA, lsp_new_bck, lsp_mid_bck, Bin_E, Bin_E_old, mem_syn_bck, mem_w0_bck, streaklimit, pstreaklen ); /* Configure ACELP bit allocation */ +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); +#endif /* redo LSF quantization */ lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index b169adc8fb..ce178ac43e 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -153,7 +153,11 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); +#else config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); +#endif encod_gen_voic_core_switch( st, st->last_L_frame, inp, Aq, A, T_op, st->voicing, exc, cbrate ); diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 53669f7b65..afc9b7ca28 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -266,7 +266,11 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); +#else td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); +#endif } } diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index 016f5ba0fa..804e9c0a48 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -178,7 +178,11 @@ void transition_enc( if ( *tc_subfr == TC_0_0 ) { /* this is called only to compute unused bits */ +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#endif } *clip_gain = gp_clip( st->element_mode, st->core_brate, st->voicing, i_subfr, TRANSITION, xn, gp_cl ); @@ -274,7 +278,11 @@ void transition_enc( if ( i_subfr - *tc_subfr <= L_SUBFR ) { +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#else config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); +#endif } /*-----------------------------------------------------------------* -- GitLab From 5ccd2a219918d19fee8949a2e6beddb416026a6f Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 21 May 2025 15:18:28 +0200 Subject: [PATCH 6/6] Port fixes from MR 2061 --- lib_dec/init_dec.c | 4 ++++ lib_dec/ivas_cpe_dec.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 1a37f7e02c..9451b41653 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -294,7 +294,11 @@ ivas_error init_decoder( st->last_active_brate = ACELP_7k20; st->last_CNG_L_frame = L_FRAME; +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + st->active_cnt = CNG_TYPE_HO; +#else st->active_cnt = 20; +#endif if ( idchan == 0 && ( st->element_mode == EVS_MONO || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) ) { diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index e9d9a62384..344b1f4357 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -394,13 +394,23 @@ ivas_error ivas_cpe_dec( if ( sts[1] != NULL ) { sts[1]->active_cnt = 0; +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + if ( sts[1]->ini_frame == 0 ) + { + sts[1]->active_cnt = CNG_TYPE_HO; + } +#endif } } else { sts[n]->VAD = 1; sts[n]->active_cnt++; +#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC + sts[n]->active_cnt = min( sts[n]->active_cnt, 200 ); +#else sts[n]->active_cnt = min( sts[n]->active_cnt, 100 ); +#endif } /* set CNA flag */ -- GitLab