From 110c02030a22679b7b05fecc61a2edb2afb68ea3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 7 May 2025 12:30:54 +0200 Subject: [PATCH 1/4] port FIX_1043_JBM_MD_BUFFER --- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 5 +++++ lib_dec/ivas_jbm_dec.c | 11 ++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2d952edea..60866e1c9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -188,6 +188,7 @@ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ +#define FIX_1043_JBM_MD_BUFFER /* VA: issue 1043: JBM MD handle allocation is avoided in non-JBM EXT operations */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d07eacc98..8581c6f2b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2178,7 +2178,12 @@ ivas_error ivas_init_decoder( } } + +#ifdef FIX_1043_JBM_MD_BUFFER + if ( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm ) +#else if ( st_ivas->hJbmMetadata == NULL ) +#endif { if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 290118cc5..6207d8ee8 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -408,7 +408,12 @@ ivas_error ivas_jbm_dec_tc( ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); - ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); +#ifdef FIX_1043_JBM_MD_BUFFER + if ( st_ivas->hDecoderConfig->Opt_tsm ) +#endif + { + ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); + } } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -811,7 +816,11 @@ void ivas_jbm_dec_feed_tc_to_renderer( { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); +#ifdef FIX_1043_JBM_MD_BUFFER + if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hDecoderConfig->Opt_tsm ) +#else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) +#endif { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); } -- GitLab From 284b11b3aa7fda20f26c59f8bd390c3e1e049865 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 8 Jul 2025 13:02:48 -0400 Subject: [PATCH 2/4] temporay addition, waiting for OMASA fix --- lib_dec/ivas_jbm_dec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index bbc40970e..8c77b69ec 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -879,6 +879,13 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { +#ifdef FIX_1043_JBM_MD_BUFFER + if ( st_ivas->hDecoderConfig->Opt_tsm ) + { + ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); + } +#endif + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); -- GitLab From 05a6ad50a196b9b68da64faf5a81781e980419ae Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 8 Jul 2025 13:11:47 -0400 Subject: [PATCH 3/4] temporay addition, waiting for OMASA fix --- lib_dec/ivas_jbm_dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8c77b69ec..fde253b91 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -879,7 +879,8 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1043_JBM_MD_BUFFER +#ifdef FIX_1043_JBM_MD_BUFFER /* TODO: To be reviewed with OMASA */ + ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); if ( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); -- GitLab From c2e3a9162e08f108780f17e7ad7fdc706a0ec8ac Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 1 Aug 2025 08:13:48 -0400 Subject: [PATCH 4/4] adding missing FIX_1043_JBM_MD_BUFFER --- lib_dec/ivas_jbm_dec.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index ec9c3b385..3110fc31c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -214,7 +214,11 @@ ivas_error ivas_jbm_dec_tc( return error; } +#ifdef FIX_1043_JBM_MD_BUFFER + if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hDecoderConfig->Opt_tsm ) +#else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) +#endif { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } @@ -911,7 +915,13 @@ void ivas_jbm_dec_feed_tc_to_renderer( if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); + +#ifdef FIX_1043_JBM_MD_BUFFER + if ( st_ivas->hDecoderConfig->Opt_tsm ) +#endif + { + ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); + } } else { -- GitLab