From ed10ba4188839281ebaf44e285ca21e2f186e093 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 6 Aug 2025 17:53:19 +0200 Subject: [PATCH] port MR --- lib_com/options.h | 1 + lib_dec/ivas_masa_dec_fx.c | 4 ++++ .../ivas_dirac_dec_binaural_functions_fx.c | 4 ++++ lib_rend/ivas_output_init_fx.c | 20 +++++++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index a8301f74b..27e0d35eb 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -116,6 +116,7 @@ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ /*#define NONBE_FIX_MC_LFE_LPF */ /* Dlb: Adding the LFE LPF filter back for MC content. */ +#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index a6ab0ab41..af9099624 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1967,7 +1967,11 @@ ivas_error ivas_masa_dec_reconfigure_fx( { IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { +#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS + tc_nchan_to_allocate = add( BINAURAL_CHANNELS, st_ivas->nchan_ism ); +#else tc_nchan_to_allocate = add( shl( BINAURAL_CHANNELS, 1 ), 2 ); +#endif } ELSE { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 80a114052..648531317 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -406,8 +406,12 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( move16(); if ( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { +#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS + nchan_to_allocate = add( BINAURAL_CHANNELS, st_ivas->nchan_ism ); +#else nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; move16(); +#endif } n_samples_granularity = NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index fba20ff70..c74b03940 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -389,10 +389,20 @@ Word16 ivas_get_nchan_buffers_dec( { nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); +#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS + test(); + test(); +#endif IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) { nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); } +#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS + ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) + { + nchan_out_buff = s_max( nchan_out_buff, add( BINAURAL_CHANNELS, st_ivas->nchan_ism ) ); + } +#endif ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); @@ -552,10 +562,20 @@ Word16 ivas_get_nchan_buffers_dec_ivas_fx( { nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); +#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS + test(); + test(); +#endif IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) { nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); } +#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS + ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) + { + nchan_out_buff = s_max( nchan_out_buff, add( BINAURAL_CHANNELS, st_ivas->nchan_ism ) ); + } +#endif ELSE IF( NE_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); -- GitLab