From e2ef5abaf085773acc2c01d86d3ebdd0bbf70755 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 20 Jan 2026 10:04:32 -0500 Subject: [PATCH 1/3] replace FEC_encode_ivas_fx with FEC_encode_fx --- lib_com/options.h | 1 + lib_com/prot_fx.h | 4 ++-- lib_enc/FEC_enc_fx.c | 3 ++- lib_enc/acelp_core_enc_fx.c | 5 ++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1b811a39f..103a2a984 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,6 +124,7 @@ #define FIX_2261_REMOVE_LP_RESCALING /* VA: Remove of unnecessary lpc coefficient rescaling */ #define FIX_2320_OOB_SCE_SWITCHING /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */ #define FIX_2302_LSF_CDBK_THRESHOLD /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision */ +#define FIX_2348_REPLACE_FEC_ENC /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index d141a9802..949fc05ab 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -10827,7 +10827,7 @@ Word16 msvq_stage1_dct_recalc_candidates_fdcng_wb_fx( Word32 *dist_ptr_fx, /* i/o: updated MSE vector for stage1 */ Word16 *dist_ptr_e /* i/o: exp for updated MSE vector for stage1 */ ); - +#ifndef FIX_2348_REPLACE_FEC_ENC void FEC_encode_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const ACELP_config acelp_cfg, /* i/o: configuration of the ACELP */ @@ -10841,7 +10841,7 @@ void FEC_encode_ivas_fx( const Word32 total_brate, /* i : total codec bitrate Q0*/ const Word16 Q_synth /* i : input scaling */ ); - +#endif ivas_error IGF_Reconfig_fx( IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ const Word16 igf, /* i : IGF on/off */ diff --git a/lib_enc/FEC_enc_fx.c b/lib_enc/FEC_enc_fx.c index d6db81232..d5c9f8913 100644 --- a/lib_enc/FEC_enc_fx.c +++ b/lib_enc/FEC_enc_fx.c @@ -292,7 +292,7 @@ void FEC_lsf_estim_enc_fx( return; } - +#ifndef FIX_2348_REPLACE_FEC_ENC /*-------------------------------------------------------------------* * FEC_encode() * @@ -464,3 +464,4 @@ void FEC_encode_ivas_fx( return; } +#endif \ No newline at end of file diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index 104e9bc96..09d6c3da6 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -1402,10 +1402,13 @@ ivas_error acelp_core_enc_ivas_fx( /*-----------------------------------------------------------------* * Encode supplementary information for Frame Error Concealment *-----------------------------------------------------------------*/ - +#ifndef FIX_2348_REPLACE_FEC_ENC Scale_sig( syn_fx, L_FRAME, sub( s_min( st->Q_syn, Q_new ), st->Q_syn ) ); // min( st->Q_syn, Q_new ) Scale_sig( res_fx, st->L_frame, sub( s_min( st->Q_syn, Q_new ), Q_new ) ); // min( st->Q_syn, Q_new ) FEC_encode_ivas_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, s_min( st->Q_syn, Q_new ) ); +#else + FEC_encode_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, add( st->Q_syn, 1), 0 ); +#endif IF( st->hBWE_TD != NULL ) { IF( EQ_16( st->L_frame, L_FRAME ) ) -- GitLab From f6358e0a16c422a3b543d80b656f77d50d33bbdb Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 20 Jan 2026 10:06:37 -0500 Subject: [PATCH 2/3] Fix clang --- lib_enc/FEC_enc_fx.c | 2 +- lib_enc/acelp_core_enc_fx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/FEC_enc_fx.c b/lib_enc/FEC_enc_fx.c index d5c9f8913..c47527f3a 100644 --- a/lib_enc/FEC_enc_fx.c +++ b/lib_enc/FEC_enc_fx.c @@ -464,4 +464,4 @@ void FEC_encode_ivas_fx( return; } -#endif \ No newline at end of file +#endif diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index 09d6c3da6..1c1e95437 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -1407,7 +1407,7 @@ ivas_error acelp_core_enc_ivas_fx( Scale_sig( res_fx, st->L_frame, sub( s_min( st->Q_syn, Q_new ), Q_new ) ); // min( st->Q_syn, Q_new ) FEC_encode_ivas_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, s_min( st->Q_syn, Q_new ) ); #else - FEC_encode_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, add( st->Q_syn, 1), 0 ); + FEC_encode_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, add( st->Q_syn, 1 ), 0 ); #endif IF( st->hBWE_TD != NULL ) { -- GitLab From f8f7d9444d10966158571dac506df740fefe1502 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 22 Jan 2026 20:47:31 +0100 Subject: [PATCH 3/3] clang-format --- lib_enc/FEC_enc_fx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_enc/FEC_enc_fx.c b/lib_enc/FEC_enc_fx.c index c675797d5..2cbb7da22 100644 --- a/lib_enc/FEC_enc_fx.c +++ b/lib_enc/FEC_enc_fx.c @@ -3,11 +3,11 @@ ====================================================================================*/ #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com.h" /* Static table prototypes */ -#include "prot_fx.h" /* Function prototypes */ -#include "prot_fx_enc.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ +#include "prot_fx.h" /* Function prototypes */ +#include "prot_fx_enc.h" /* Function prototypes */ /*============================================================================*/ @@ -70,7 +70,7 @@ void FEC_encode_fx( /*-----------------------------------------------------------------* * encode signal class (not needed for VC mode since it is clearly voiced) (2 bits) *-----------------------------------------------------------------*/ - + IF( NE_16( coder_type, VOICED ) ) { /* encode signal clas with 2 bits */ @@ -117,7 +117,7 @@ void FEC_encode_fx( Ltmp = Mpy_32_16( enr_lg_ent, enr_lg_frac, LG10_s3_0 ); /* Q14 */ tmpS = extract_h( L_shl( Ltmp, 1 ) ); /* Q15 + 1 -> Q0*/ - tmpS = s_min( tmpS, FEC_ENR_QLIMIT ); + tmpS = s_min( tmpS, FEC_ENR_QLIMIT ); tmpS = s_max( tmpS, 0 ); push_indice( hBstr, IND_FEC_ENR, tmpS, FEC_BITS_ENR ); -- GitLab