From a68981d1ac09c6fca1b16f80f07d801399831d65 Mon Sep 17 00:00:00 2001 From: mave2802 <59919483+mave2802@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:59:56 +0100 Subject: [PATCH 1/3] fixed scaling of x_fx after noise generation and scale xn_buf_fx correctly to Q(-2) --- lib_com/options.h | 2 +- lib_dec/dec_tcx_fx.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index bf55847d1..1a7b596d5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,7 +95,7 @@ #define FIX_1454_FIX_STEREO_TO_FOA_JBM /* VA: issue 1454: fix buggy stereo to FOA in JBM */ #define FIX_2015_PREMPH_SAT_ALT_PART2 /* VA: Add missing scaling factor to be passed to AVQ_cod() */ #define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */ - +#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index f9377d53f..02e82fc6a 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -4044,7 +4044,11 @@ void decoder_tcx_ivas_fx( decoder_tcx_tns_fx( st, L_frame_glob, L_spec, L_frame, L_frameTCX, x_fx, fUseTns, &tnsData, bfi, frame_cnt, 0, NULL ); Scale_sig32( x_fx, N_MAX, sub( x_e, 20 ) ); // Scaling x_fx to Q11 +#ifdef NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES + Scale_sig( xn_buf_fx, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX, -( Q14 - 2 ) ); // Scaling xn_buf_fx to Q(-2) +#else Scale_sig( xn_buf_fx, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX, sub( st->Q_syn, 14 ) ); // Scaling xn_buf_fx to Q_syn +#endif x_e = sub( 31, 11 ); IF( st->igf != 0 ) @@ -5645,7 +5649,11 @@ void decoder_tcx_imdct_fx( generate_masking_noise_mdct_ivas_fx( x_fx, &x_e, st->hFdCngDec->hFdCngCom ); FOR( Word16 ind = 0; ind < L_frame; ind++ ) { +#ifdef NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES + x_fx[ind] = L_shl( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x +#else x_fx[ind] = L_shr( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x +#endif } } -- GitLab From f0a166ca950c384287772d29568f0ee317246968 Mon Sep 17 00:00:00 2001 From: mave2802 <59919483+mave2802@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:03:48 +0100 Subject: [PATCH 2/3] clang format --- lib_dec/dec_tcx_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 02e82fc6a..36385ae3b 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -4043,7 +4043,7 @@ void decoder_tcx_ivas_fx( decoder_tcx_tns_fx( st, L_frame_glob, L_spec, L_frame, L_frameTCX, x_fx, fUseTns, &tnsData, bfi, frame_cnt, 0, NULL ); - Scale_sig32( x_fx, N_MAX, sub( x_e, 20 ) ); // Scaling x_fx to Q11 + Scale_sig32( x_fx, N_MAX, sub( x_e, 20 ) ); // Scaling x_fx to Q11 #ifdef NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES Scale_sig( xn_buf_fx, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX, -( Q14 - 2 ) ); // Scaling xn_buf_fx to Q(-2) #else -- GitLab From 64ce086d29e14b525ce2fc51bb9e74cc2fab1948 Mon Sep 17 00:00:00 2001 From: mave2802 <59919483+mave2802@users.noreply.github.com> Date: Wed, 3 Dec 2025 08:37:22 +0100 Subject: [PATCH 3/3] clang format --- lib_dec/dec_tcx_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 36385ae3b..3cb3a6d15 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -5652,7 +5652,7 @@ void decoder_tcx_imdct_fx( #ifdef NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES x_fx[ind] = L_shl( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x #else - x_fx[ind] = L_shr( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x + x_fx[ind] = L_shr( x_fx[ind], sub( 31, add( x_e, q_x ) ) ); // q_x #endif } } -- GitLab