Loading lib_com/bits_alloc_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -823,7 +823,7 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) { bits -= TDM_IC_LSF_PRED_BITS; Loading Loading @@ -1384,7 +1384,7 @@ ivas_error config_acelp1( { if ( idchan > 0 && element_mode == IVAS_CPE_TD ) { #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE if ( !tdm_lp_reuse_flag ) { acelp_cfg->lsf_bits += bits; /* increase LSF Q bits */ Loading lib_com/ivas_stereo_td_bit_alloc.c +18 −1 Original line number Diff line number Diff line Loading @@ -893,7 +893,24 @@ void td_stereo_param_updt_fx( Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); Copy( lsf_old_PCh_fx, tdm_lsfQ_PCh_fx, M ); } #ifdef FIX_798_WRONG_CPY_OF_PITCH IF( EQ_16( flag_ACELP16k , 1 ) ) { Word16 tmp16; Word16 mult_factor = 26214 /*0.8f in Q15*/; FOR( i = 0; i < NB_SUBFR; i++ ) { tmp16 = mult_r( pitch_buf_PCh_fx[i], mult_factor ); /* Convert 16kHz to 12.8 kHz pitch values */ tdm_Pri_pitch_buf_fx[i] = s_max( tmp16, PIT_MIN << 6 ); /* pitch is represented in Q6*/ move16(); } } ELSE { Copy( pitch_buf_PCh_fx, tdm_Pri_pitch_buf_fx, NB_SUBFR ); } #else /* This is only to keep the buffer up-to-date */ Word16 mult_factor = 26214 /*0.8f in Q15*/; Word16 min_tdm_Pri_pitch_buf_fx = 0; Loading @@ -919,7 +936,7 @@ void td_stereo_param_updt_fx( { Copy( pitch_buf_PCh_fx, tdm_Pri_pitch_buf_fx, NB_SUBFR ); } #endif return; } #endif Loading lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,8 @@ #define FIX_778_STEREO_BRATE_SWITCHING #define FIX_774_ENERGY_BURST /* Fix 0 bit BWE */ #define FIX_729_MISSING_RESCALING #define FIX_798_LSF_SECONDARY_CH_MISSING_CODE /* Adding the missing code to properly render the secondary channel of TD stereo*/ #define FIX_798_WRONG_CPY_OF_PITCH /* The copy of the pitch from primary to secondary channel was wrong AND safety check was really wrong */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading lib_com/prot_fx2.h +3 −3 Original line number Diff line number Diff line Loading @@ -5501,7 +5501,7 @@ void lsf_dec_fx( Word16 *lsp_new, /* o : de-quantized LSP vector */ Word16 *lsp_mid, /* o : de-quantized mid-frame LSP vector */ const Word16 tdm_low_rate_mode /* i : secondary channel low rate mode flag */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE , const Word16 tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ #endif Loading Loading @@ -5615,9 +5615,9 @@ void lsf_end_dec_fx( Word16 *lpc_param, Word16 *LSF_Q_prediction, /* o : LSF prediction mode */ Word16 *nb_indices #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE , const float tdm_lsfQ_PCh[M] const Word16 tdm_lsfQ_PCh[M] #endif ); Loading lib_dec/acelp_core_dec_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -801,7 +801,7 @@ ivas_error acelp_core_dec_fx( #endif { lsf_dec_fx( st_fx, tc_subfr_fx, Aq_fx, &LSF_Q_prediction, lsf_new_fx, lsp_new_fx, lsp_mid_fx, tdm_low_rate_mode #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE , tdm_lsfQ_PCh #endif Loading Loading
lib_com/bits_alloc_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -823,7 +823,7 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) { bits -= TDM_IC_LSF_PRED_BITS; Loading Loading @@ -1384,7 +1384,7 @@ ivas_error config_acelp1( { if ( idchan > 0 && element_mode == IVAS_CPE_TD ) { #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE if ( !tdm_lp_reuse_flag ) { acelp_cfg->lsf_bits += bits; /* increase LSF Q bits */ Loading
lib_com/ivas_stereo_td_bit_alloc.c +18 −1 Original line number Diff line number Diff line Loading @@ -893,7 +893,24 @@ void td_stereo_param_updt_fx( Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); Copy( lsf_old_PCh_fx, tdm_lsfQ_PCh_fx, M ); } #ifdef FIX_798_WRONG_CPY_OF_PITCH IF( EQ_16( flag_ACELP16k , 1 ) ) { Word16 tmp16; Word16 mult_factor = 26214 /*0.8f in Q15*/; FOR( i = 0; i < NB_SUBFR; i++ ) { tmp16 = mult_r( pitch_buf_PCh_fx[i], mult_factor ); /* Convert 16kHz to 12.8 kHz pitch values */ tdm_Pri_pitch_buf_fx[i] = s_max( tmp16, PIT_MIN << 6 ); /* pitch is represented in Q6*/ move16(); } } ELSE { Copy( pitch_buf_PCh_fx, tdm_Pri_pitch_buf_fx, NB_SUBFR ); } #else /* This is only to keep the buffer up-to-date */ Word16 mult_factor = 26214 /*0.8f in Q15*/; Word16 min_tdm_Pri_pitch_buf_fx = 0; Loading @@ -919,7 +936,7 @@ void td_stereo_param_updt_fx( { Copy( pitch_buf_PCh_fx, tdm_Pri_pitch_buf_fx, NB_SUBFR ); } #endif return; } #endif Loading
lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,8 @@ #define FIX_778_STEREO_BRATE_SWITCHING #define FIX_774_ENERGY_BURST /* Fix 0 bit BWE */ #define FIX_729_MISSING_RESCALING #define FIX_798_LSF_SECONDARY_CH_MISSING_CODE /* Adding the missing code to properly render the secondary channel of TD stereo*/ #define FIX_798_WRONG_CPY_OF_PITCH /* The copy of the pitch from primary to secondary channel was wrong AND safety check was really wrong */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading
lib_com/prot_fx2.h +3 −3 Original line number Diff line number Diff line Loading @@ -5501,7 +5501,7 @@ void lsf_dec_fx( Word16 *lsp_new, /* o : de-quantized LSP vector */ Word16 *lsp_mid, /* o : de-quantized mid-frame LSP vector */ const Word16 tdm_low_rate_mode /* i : secondary channel low rate mode flag */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE , const Word16 tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel */ #endif Loading Loading @@ -5615,9 +5615,9 @@ void lsf_end_dec_fx( Word16 *lpc_param, Word16 *LSF_Q_prediction, /* o : LSF prediction mode */ Word16 *nb_indices #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE , const float tdm_lsfQ_PCh[M] const Word16 tdm_lsfQ_PCh[M] #endif ); Loading
lib_dec/acelp_core_dec_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -801,7 +801,7 @@ ivas_error acelp_core_dec_fx( #endif { lsf_dec_fx( st_fx, tc_subfr_fx, Aq_fx, &LSF_Q_prediction, lsf_new_fx, lsp_new_fx, lsp_mid_fx, tdm_low_rate_mode #ifdef LSF_RE_USE_SECONDARY_CHANNEL #if defined LSF_RE_USE_SECONDARY_CHANNEL || defined FIX_798_LSF_SECONDARY_CH_MISSING_CODE , tdm_lsfQ_PCh #endif Loading