From c501f1f5044db13c8128677e85749f508ed6ef31 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 23 May 2025 10:14:30 +0200 Subject: [PATCH 1/2] port NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER --- lib_com/options.h | 3 ++- lib_dec/ivas_jbm_dec_fx.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 91172d59a..09c753209 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -128,7 +128,8 @@ #define NONBE_FIX_947_STEREO_DMX_EVS_PHA /* Orange: Fix issues on PHA */ #ifdef NONBE_FIX_947_STEREO_DMX_EVS_PHA #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ -#endif +#endif +#define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index c85e36d8e..d402fb1e3 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2668,8 +2668,12 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( Word16 n_slots_still_available; Word16 n_samples_to_render; DECODER_TC_BUFFER_HANDLE hTcBuffer; +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + Word32 *p_output_fx[MAX_CICP_CHANNELS + MAX_NUM_OBJECTS]; +#else Word32 output_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; Word32 *p_output_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; +#endif Word16 nchan_in, nchan_out; IF( !st_ivas->hDecoderConfig->Opt_tsm ) { @@ -2729,10 +2733,17 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( move16(); move16(); +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + FOR( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) + { + p_output_fx[ch_idx] = st_ivas->p_output_fx[ch_idx]; + } +#else FOR( ch_idx = 0; ch_idx < MAX_CICP_CHANNELS; ch_idx++ ) { p_output_fx[ch_idx] = output_fx[ch_idx]; } +#endif test(); IF( EQ_16( st_ivas->ivas_format, ISM_FORMAT ) ) -- GitLab From e441a50059df28bd8452386c75a1ccd18d3f0911 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 13 Jun 2025 10:18:08 +0200 Subject: [PATCH 2/2] [fix] apply same fix under DISABLE_LIMITER --- lib_dec/ivas_jbm_dec_fx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index e6f94c889..f2a7f6549 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2991,9 +2991,15 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( #ifndef DISABLE_LIMITER Word16 ch_idx, exp = 11; move16(); +#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER + FOR( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) + { + p_output_fx[ch_idx] = st_ivas->p_output_fx[ch_idx]; +#else FOR( ch_idx = 0; ch_idx < MAX_CICP_CHANNELS; ch_idx++ ) { p_output_fx[ch_idx] = output_fx[ch_idx]; +#endif } ivas_limiter_dec_fx( st_ivas->hLimiter, p_output_fx, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, exp ); #endif -- GitLab