From 1e6af8792e8b48d921a077b71c59823d99ec3915 Mon Sep 17 00:00:00 2001 From: gerstack Date: Thu, 12 Feb 2026 17:47:22 +0100 Subject: [PATCH 1/7] exchanged post_decoder() to post_decoder_ivas_ix --- lib_com/options.h | 1 + lib_dec/dec_LPD_fx.c | 4 ++++ lib_dec/ivas_mdct_core_dec_fx.c | 4 ++++ lib_dec/ivas_tcx_core_dec_fx.c | 4 ++++ lib_dec/post_dec_fx.c | 2 ++ lib_dec/updt_dec_fx.c | 4 ++++ 6 files changed, 19 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 6f0d8e55e..08d0163ca 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -92,6 +92,7 @@ #define HARM_FD_BWE /* VA: harmonize core-coder FD BWE function duplications */ #define FIX_2411_Harmonize_TNSANALYSIS_DETECTTNSFILT /* FhG: basop issue 2411: harmonize TNSAnalysis*_fx(), DetectTnsFilt*_fx()*/ #define HARMONIZE_READ_DECODE_TNS /* FhG basop 2389: Harm between two pairs of functions. */ +#define FIX_2429_POST_DECODER /* #################### End BE switches ################################## */ diff --git a/lib_dec/dec_LPD_fx.c b/lib_dec/dec_LPD_fx.c index 0bc96a369..a4b13c91a 100644 --- a/lib_dec/dec_LPD_fx.c +++ b/lib_dec/dec_LPD_fx.c @@ -954,7 +954,11 @@ void decoder_LPD_fx( st->last_is_cng = 0; /* Postfiltering */ +#ifdef FIX_2429_POST_DECODER + post_decoder_ivas_fx( st, synth_buf, pit_gain, pitch, signal_out, bpf_noise_buf ); +#else post_decoder( st, synth_buf, pit_gain, pitch, signal_out, bpf_noise_buf ); +#endif IF( signal_outFB ) { diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index c085d5674..329767bea 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1399,7 +1399,11 @@ void ivas_mdct_core_reconstruct_fx( Copy_Scale_sig_32_16( st->p_bpf_noise_buf_32, st->p_bpf_noise_buf, st->L_frame, -Q11 ); // Q11 -> Q0 } +#ifdef FIX_2429_POST_DECODER post_decoder_ivas_fx( st, synth_buf_fx, pit_gain_fx[ch], pitch[ch], x_fx_16, st->p_bpf_noise_buf ); +#else + post_decoder_ivas_fx( st, synth_buf_fx, pit_gain_fx[ch], pitch[ch], x_fx_16, st->p_bpf_noise_buf ); +#endif IF( st->p_bpf_noise_buf_32 ) { diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index 4a57618e5..e09f4119d 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -783,7 +783,11 @@ void stereo_tcx_core_dec_fx( /* Postfiltering */ +#ifdef FIX_2429_POST_DECODER + post_decoder_ivas_fx( st, synth_buf_fx, pit_gain_fx, pitch, signal_out_fx, st->p_bpf_noise_buf ); +#else post_decoder( st, synth_buf_fx, pit_gain_fx, pitch, signal_out_fx, st->p_bpf_noise_buf ); +#endif test(); IF( st->p_bpf_noise_buf_32 && st->tcxonly == 0 ) diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 8bf9380b3..3954e6692 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -41,6 +41,7 @@ void post_decoder( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; + printf("post_decoder()\n"); move16(); hBPF = st->hBPF; L_frame = st->L_frame; @@ -193,6 +194,7 @@ void post_decoder_ivas_fx( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; + printf("post_decoder_ivas_fx()\n"); move16(); hBPF = st->hBPF; L_frame = st->L_frame; diff --git a/lib_dec/updt_dec_fx.c b/lib_dec/updt_dec_fx.c index 27983b42e..36f8ffba2 100644 --- a/lib_dec/updt_dec_fx.c +++ b/lib_dec/updt_dec_fx.c @@ -1028,7 +1028,11 @@ void update_decoder_LPD_cng( st->bpf_gain_param = 0; move16(); +#ifdef FIX_2429_POST_DECODER + post_decoder_ivas_fx( st, buf_synth, pf_gain, pf_pitch, timeDomainBuffer, bpf_noise_buf ); +#else post_decoder( st, buf_synth, pf_gain, pf_pitch, timeDomainBuffer, bpf_noise_buf ); +#endif return; } -- GitLab From e6ad0f69aa7012b76a1d01dfed4963b607d1b78d Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 13 Feb 2026 08:27:25 +0100 Subject: [PATCH 2/7] clang format --- lib_dec/post_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 3954e6692..07f345f9b 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -41,7 +41,7 @@ void post_decoder( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; - printf("post_decoder()\n"); + //printf( "post_decoder()\n" ); move16(); hBPF = st->hBPF; L_frame = st->L_frame; @@ -194,7 +194,7 @@ void post_decoder_ivas_fx( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; - printf("post_decoder_ivas_fx()\n"); + //printf( "post_decoder_ivas_fx()\n" ); move16(); hBPF = st->hBPF; L_frame = st->L_frame; -- GitLab From c25b7c12fe35eb7062d87f27bb9f4b9d992a342e Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 13 Feb 2026 08:30:33 +0100 Subject: [PATCH 3/7] clang format --- lib_dec/post_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 07f345f9b..5aa12fd98 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -41,7 +41,7 @@ void post_decoder( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; - //printf( "post_decoder()\n" ); + // printf( "post_decoder()\n" ); move16(); hBPF = st->hBPF; L_frame = st->L_frame; @@ -194,7 +194,7 @@ void post_decoder_ivas_fx( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; - //printf( "post_decoder_ivas_fx()\n" ); + // printf( "post_decoder_ivas_fx()\n" ); move16(); hBPF = st->hBPF; L_frame = st->L_frame; -- GitLab From 54bcf196e16d48657b8d4641cd0a4756191eef4d Mon Sep 17 00:00:00 2001 From: gerstack Date: Wed, 25 Feb 2026 11:56:14 +0100 Subject: [PATCH 4/7] FIX_2429 inside post_decoder_ivas_fx(), a special code is called for EVS_MONO, using L_SUBFR instead of L_subfr --- lib_dec/post_dec_fx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 5aa12fd98..3fa587409 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -236,11 +236,27 @@ void post_decoder_ivas_fx( IF( pfstat_on_previous ) { Copy( st->hPFstat->mem_pf_in + L_SYN_MEM - M, synth - M, M ); +#ifdef FIX_2429_POST_DECODER + IF ( EQ_16( st->element_mode, EVS_MONO ) ) { + Residu3_fx( st->old_Aq_12_8_fx, synth, synth_buf, L_SUBFR, 1 ); + E_UTIL_synthesis( 1, st->old_Aq_12_8_fx, synth_buf, synth2, L_SUBFR, st->hPFstat->mem_stp + L_SYN_MEM - M, 0, M ); + scale_st_fx( synth, synth2, &st->hPFstat->gain_prec, L_SUBFR ); + blend_subfr2_fx( synth2 + L_SUBFR / 2, synth + L_SUBFR / 2, synth2 + L_SUBFR / 2 ); + } + ELSE { + Word16 L_subfr = idiv1616( st->L_frame, st->nb_subfr ); + Residu3_fx( st->old_Aq_12_8_fx, synth, synth_buf, L_subfr, 1 ); + E_UTIL_synthesis( 1, st->old_Aq_12_8_fx, synth_buf, synth2, L_subfr, st->hPFstat->mem_stp + L_SYN_MEM - M, 0, M ); + scale_st_fx( synth, synth2, &st->hPFstat->gain_prec, L_subfr ); + blend_subfr2_fx( synth2 + shr( L_subfr, 1 ), synth + shr( L_subfr, 1 ), synth2 + shr( L_subfr, 1 ) ); + } +#else Word16 L_subfr = idiv1616( st->L_frame, st->nb_subfr ); Residu3_fx( st->old_Aq_12_8_fx, synth, synth_buf, L_subfr, 1 ); E_UTIL_synthesis( 1, st->old_Aq_12_8_fx, synth_buf, synth2, L_subfr, st->hPFstat->mem_stp + L_SYN_MEM - M, 0, M ); scale_st_fx( synth, synth2, &st->hPFstat->gain_prec, L_subfr ); blend_subfr2_fx( synth2 + shr( L_subfr, 1 ), synth + shr( L_subfr, 1 ), synth2 + shr( L_subfr, 1 ) ); +#endif } } ELSE -- GitLab From 32db197b42fed6e4dfb7266bb28b7158c314009a Mon Sep 17 00:00:00 2001 From: gerstack Date: Wed, 25 Feb 2026 12:35:02 +0100 Subject: [PATCH 5/7] clang format --- lib_dec/post_dec_fx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 3fa587409..3442c8d3b 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -237,13 +237,15 @@ void post_decoder_ivas_fx( { Copy( st->hPFstat->mem_pf_in + L_SYN_MEM - M, synth - M, M ); #ifdef FIX_2429_POST_DECODER - IF ( EQ_16( st->element_mode, EVS_MONO ) ) { + IF( EQ_16( st->element_mode, EVS_MONO ) ) + { Residu3_fx( st->old_Aq_12_8_fx, synth, synth_buf, L_SUBFR, 1 ); E_UTIL_synthesis( 1, st->old_Aq_12_8_fx, synth_buf, synth2, L_SUBFR, st->hPFstat->mem_stp + L_SYN_MEM - M, 0, M ); scale_st_fx( synth, synth2, &st->hPFstat->gain_prec, L_SUBFR ); blend_subfr2_fx( synth2 + L_SUBFR / 2, synth + L_SUBFR / 2, synth2 + L_SUBFR / 2 ); } - ELSE { + ELSE + { Word16 L_subfr = idiv1616( st->L_frame, st->nb_subfr ); Residu3_fx( st->old_Aq_12_8_fx, synth, synth_buf, L_subfr, 1 ); E_UTIL_synthesis( 1, st->old_Aq_12_8_fx, synth_buf, synth2, L_subfr, st->hPFstat->mem_stp + L_SYN_MEM - M, 0, M ); -- GitLab From ba7fd0997c989f3588ff74d06ac696a6c4aa6967 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 25 Feb 2026 16:19:29 +0100 Subject: [PATCH 6/7] empty commit -- GitLab From 562ee1919f6ccc788b62871b430cb86940a48e0c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 25 Feb 2026 20:49:45 +0100 Subject: [PATCH 7/7] remove debug code, rename post_decoder_ivas_fx() to post_decoder_fx() --- lib_com/prot_fx.h | 4 ++++ lib_dec/dec_LPD_fx.c | 2 +- lib_dec/ivas_mdct_core_dec_fx.c | 2 +- lib_dec/ivas_tcx_core_dec_fx.c | 2 +- lib_dec/post_dec_fx.c | 6 ++++-- lib_dec/updt_dec_fx.c | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index a4a32366e..82ae1aed8 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -7412,6 +7412,7 @@ Word16 FEC_pos_dec_fx( const Word16 nBits_es_Pred /* i : number of bits for Es_pred Q */ ); +#ifndef FIX_2429_POST_DECODER void post_decoder( Decoder_State *st, Word16 synth_buf[], /* Q0 */ @@ -7422,6 +7423,9 @@ void post_decoder( ); void post_decoder_ivas_fx( +#else +void post_decoder_fx( +#endif Decoder_State *st, Word16 synth_buf[], // Q0 Word16 pit_gain[], // Q14 diff --git a/lib_dec/dec_LPD_fx.c b/lib_dec/dec_LPD_fx.c index a4b13c91a..d8eb395c5 100644 --- a/lib_dec/dec_LPD_fx.c +++ b/lib_dec/dec_LPD_fx.c @@ -955,7 +955,7 @@ void decoder_LPD_fx( /* Postfiltering */ #ifdef FIX_2429_POST_DECODER - post_decoder_ivas_fx( st, synth_buf, pit_gain, pitch, signal_out, bpf_noise_buf ); + post_decoder_fx( st, synth_buf, pit_gain, pitch, signal_out, bpf_noise_buf ); #else post_decoder( st, synth_buf, pit_gain, pitch, signal_out, bpf_noise_buf ); #endif diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 5b478f227..39694bdcb 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1403,7 +1403,7 @@ void ivas_mdct_core_reconstruct_fx( } #ifdef FIX_2429_POST_DECODER - post_decoder_ivas_fx( st, synth_buf_fx, pit_gain_fx[ch], pitch[ch], x_fx_16, st->p_bpf_noise_buf ); + post_decoder_fx( st, synth_buf_fx, pit_gain_fx[ch], pitch[ch], x_fx_16, st->p_bpf_noise_buf ); #else post_decoder_ivas_fx( st, synth_buf_fx, pit_gain_fx[ch], pitch[ch], x_fx_16, st->p_bpf_noise_buf ); #endif diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index ec01deb27..19025b403 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -789,7 +789,7 @@ void stereo_tcx_core_dec_fx( /* Postfiltering */ #ifdef FIX_2429_POST_DECODER - post_decoder_ivas_fx( st, synth_buf_fx, pit_gain_fx, pitch, signal_out_fx, st->p_bpf_noise_buf ); + post_decoder_fx( st, synth_buf_fx, pit_gain_fx, pitch, signal_out_fx, st->p_bpf_noise_buf ); #else post_decoder( st, synth_buf_fx, pit_gain_fx, pitch, signal_out_fx, st->p_bpf_noise_buf ); #endif diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 3442c8d3b..6d89900c2 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -20,6 +20,7 @@ static void bass_pf_1sf_delay( Word16 *syn, Word16 *T_sf, Word16 *gainT_sf, Word * Perform post-processing *---------------------------------------------------------------------*/ +#ifndef FIX_2429_POST_DECODER void post_decoder( Decoder_State *st, Word16 synth_buf[], /* Q0 */ @@ -41,7 +42,6 @@ void post_decoder( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; - // printf( "post_decoder()\n" ); move16(); hBPF = st->hBPF; L_frame = st->L_frame; @@ -174,6 +174,9 @@ void post_decoder( void post_decoder_ivas_fx( +#else +void post_decoder_fx( +#endif Decoder_State *st, Word16 synth_buf[], // Q0 Word16 pit_gain[], // Q14 @@ -194,7 +197,6 @@ void post_decoder_ivas_fx( BPF_DEC_HANDLE hBPF; Word16 coder_type = st->coder_type; - // printf( "post_decoder_ivas_fx()\n" ); move16(); hBPF = st->hBPF; L_frame = st->L_frame; diff --git a/lib_dec/updt_dec_fx.c b/lib_dec/updt_dec_fx.c index 36f8ffba2..613038875 100644 --- a/lib_dec/updt_dec_fx.c +++ b/lib_dec/updt_dec_fx.c @@ -1029,7 +1029,7 @@ void update_decoder_LPD_cng( move16(); #ifdef FIX_2429_POST_DECODER - post_decoder_ivas_fx( st, buf_synth, pf_gain, pf_pitch, timeDomainBuffer, bpf_noise_buf ); + post_decoder_fx( st, buf_synth, pf_gain, pf_pitch, timeDomainBuffer, bpf_noise_buf ); #else post_decoder( st, buf_synth, pf_gain, pf_pitch, timeDomainBuffer, bpf_noise_buf ); #endif -- GitLab