From 6a000e0e297d47f1a7c450dfaa21c96676b91bac Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 7 May 2025 12:40:03 +0200 Subject: [PATCH 1/4] port FIX_1043_JBM_MD_BUFFER --- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 7 ++++++- lib_dec/ivas_jbm_dec_fx.c | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index c568a52fa..fccfc37f5 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,6 +101,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_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 ba4905189..5c19bdad1 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2583,7 +2583,6 @@ ivas_error ivas_init_decoder_fx( *-----------------------------------------------------------------*/ IF( st_ivas->hTcBuffer == NULL ) - { /* no module has yet open the TC buffer, open a default one */ n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels_fx( st_ivas ); @@ -2603,7 +2602,12 @@ ivas_error ivas_init_decoder_fx( } } +#ifdef FIX_1043_JBM_MD_BUFFER + test(); + if ( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm ) +#else IF( st_ivas->hJbmMetadata == NULL ) +#endif { IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { @@ -2617,6 +2621,7 @@ ivas_error ivas_init_decoder_fx( /*-----------------------------------------------------------------* * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ + st_ivas->p_out_len = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); FOR( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 246befb84..af70ed8c9 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -309,7 +309,12 @@ ivas_error ivas_jbm_dec_tc_fx( return error; } +#ifdef FIX_1043_JBM_MD_BUFFER + test(); + IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && st_ivas->hDecoderConfig->Opt_tsm ) +#else IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#endif { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } @@ -1592,7 +1597,12 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( test(); test(); +#ifdef FIX_1043_JBM_MD_BUFFER + test(); + IF( ( EQ_16( st_ivas->ivas_format, MASA_FORMAT ) || EQ_16( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) && EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && st_ivas->hDecoderConfig->Opt_tsm ) +#else IF( ( EQ_16( st_ivas->ivas_format, MASA_FORMAT ) || EQ_16( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) && EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) +#endif { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); } -- GitLab From 9541fe0cddd382d5c39f567d242f9f570c7e3d96 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 1 Aug 2025 08:41:44 -0400 Subject: [PATCH 2/4] adding missing FIX_1043_JBM_MD_BUFFER --- lib_dec/ivas_jbm_dec_fx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 851f8fb71..a3b153f91 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -835,8 +835,12 @@ ivas_error ivas_jbm_dec_tc_fx( ivas_omasa_rearrange_channels_fx( p_output_fx, nchan_transport_ism, output_frame ); #endif - - 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 ); + } } IF( NE_16( output_q, Q11 ) ) { @@ -1749,7 +1753,12 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) || EQ_32( 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 From 6937609d118a35e526cb988a84dacf70da2224f5 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 1 Aug 2025 08:45:18 -0400 Subject: [PATCH 3/4] fix clang --- lib_dec/ivas_jbm_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a3b153f91..7521cb8de 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1754,7 +1754,7 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); #ifdef FIX_1043_JBM_MD_BUFFER - IF ( st_ivas->hDecoderConfig->Opt_tsm ) + IF( st_ivas->hDecoderConfig->Opt_tsm ) #endif { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); -- GitLab From 2914a33356ca2affccece7031fe605d9d63c37b7 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 1 Aug 2025 13:47:39 -0400 Subject: [PATCH 4/4] typo --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3fe810fa8..42c8854ae 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,7 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#define FIX_1043_JBM_MD_BUFFER /* VA: issue 1043: JBM MD handle allocation is avoided in non-JBM EXT operations */ +#define FIX_1043_JBM_MD_BUFFER /* VA: issue 1043: JBM MD handle allocation is avoided in non-JBM EXT operations */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ -- GitLab