From 04b3458384cf60f80144feca99346fc7f0448479 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 1 Feb 2024 14:53:01 +0100 Subject: [PATCH 1/3] fix #979, fixes offsets into shared buffers for OSBA and stereo with LS conversion decoding, fixes a small bug in the ISM TC digest function. --- lib_com/options.h | 2 +- lib_dec/ivas_ism_param_dec.c | 4 ++++ lib_dec/ivas_jbm_dec.c | 4 ++++ lib_dec/ivas_osba_dec.c | 15 ++++++++++++++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 73710db2b0..481a3c9c58 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,7 +173,7 @@ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #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 NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ - +#define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index da12741551..23ade739ce 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -1029,7 +1029,11 @@ void ivas_ism_dec_digest_tc( } /* also get the gains here */ +#ifdef NONBE_FIX_979_OSBA_STEREO_5MS + num_objects = st_ivas->nchan_ism; +#else num_objects = st_ivas->nchan_transport; +#endif for ( i = 0; i < num_objects; i++ ) { mvr2r( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmRendererData->prev_gains[i], MAX_OUTPUT_CHANNELS ); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index dc394dda02..b6bcc2f450 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -984,7 +984,11 @@ ivas_error ivas_jbm_dec_render( { for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) { +#ifdef NONBE_FIX_979_OSBA_STEREO_5MS + p_tc[n] = &p_output[n][st_ivas->hTcBuffer->n_samples_rendered]; +#else p_tc[n] = p_output[n]; +#endif } for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 32c8b0fef8..6151f1e662 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -267,10 +267,23 @@ ivas_error ivas_osba_render_sf( p_output_ism[n] = &output_ism[n][0]; } - for ( n = 0; n < st_ivas->nchan_ism; n++ ) +#ifdef NONBE_FIX_979_OSBA_STEREO_5MS + if ( !st_ivas->hDecoderConfig->Opt_tsm ) { + int16_t tc_offset; + tc_offset = st_ivas->hTcBuffer->n_samples_rendered; +#endif + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { +#ifdef NONBE_FIX_979_OSBA_STEREO_5MS + mvr2r( &p_output[n][tc_offset], &output_ism[n][tc_offset], nSamplesAsked ); +#else mvr2r( p_output[n], output_ism[n], nSamplesAsked ); +#endif + } +#ifdef NONBE_FIX_979_OSBA_STEREO_5MS } +#endif if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) { -- GitLab From 23a1a62f4e989893173b7020582c79fec2b06d07 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 2 Feb 2024 08:54:32 +0100 Subject: [PATCH 2/3] fix a small inconsistency between number of TC init and number of common buffer channels init for BINUARAL/STEREO output and OMASA --- lib_rend/ivas_output_init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 78db534f79..088c99bde2 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -345,6 +345,12 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } +#ifdef NONBE_FIX_979_OSBA_STEREO_5MS + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { + nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); + } +#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); -- GitLab From 80fdc7cf5824ca4602822a47bb10ee2a6b81019e Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 6 Feb 2024 09:31:45 +0100 Subject: [PATCH 3/3] remove a fix not directly related to #issue #979, will be handled with a distinct issue and MR --- lib_dec/ivas_ism_param_dec.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 23ade739ce..da12741551 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -1029,11 +1029,7 @@ void ivas_ism_dec_digest_tc( } /* also get the gains here */ -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS - num_objects = st_ivas->nchan_ism; -#else num_objects = st_ivas->nchan_transport; -#endif for ( i = 0; i < num_objects; i++ ) { mvr2r( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmRendererData->prev_gains[i], MAX_OUTPUT_CHANNELS ); -- GitLab