From 6e2d5b22703597a8c307e6635ba81d80731d620d Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 3 Apr 2024 15:15:59 +0200 Subject: [PATCH 1/2] fix for #1056, fix the condition for updating the TC buffer sub frame info from the common spatial rendering info at a rate switch --- lib_com/options.h | 4 +++- lib_dec/ivas_ism_dec.c | 5 +++++ lib_dec/ivas_jbm_dec.c | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 34c6f7410a..f9beef73a6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -48,7 +48,7 @@ /* ################### Start DEBUGGING switches ########################### */ #ifndef RELEASE -/*#define DEBUGGING*/ /* Activate debugging part of the code */ +/*#define DEBUGGING*/ /* Activate debugging part of the code */ #endif /*#define WMOPS*/ /* Activate complexity and memory counters */ /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ @@ -166,6 +166,8 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ +#define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ + /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index b23b16ca63..52923656ed 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -130,7 +130,12 @@ static ivas_error ivas_ism_bitrate_switching_dec( { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ +#ifdef NONBE_FIX_1056_ISM_RATE_SWITCH + /* only do this if we are not having done everything alredy in the TC decoding part and having only played out from the TC buffer */ + if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) +#else if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) ) +#endif { st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index e6a2ee3194..a4d760fbbd 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -2585,6 +2585,9 @@ static void ivas_jbm_dec_tc_buffer_playout( slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } +#ifdef DEBUGGING + assert( slots_to_render == 0 ); +#endif for ( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ ) { -- GitLab From 4683a7d767868fa9d8bc9ca17db9503ea1bbbd15 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 9 Apr 2024 08:00:05 +0200 Subject: [PATCH 2/2] fix for #1056, fix typo in comment --- lib_dec/ivas_ism_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 52923656ed..b265faa3f0 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -131,7 +131,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ #ifdef NONBE_FIX_1056_ISM_RATE_SWITCH - /* only do this if we are not having done everything alredy in the TC decoding part and having only played out from the TC buffer */ + /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) #else if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) ) -- GitLab