From 794dd47a2890fac8d814cb144925fba375138fa7 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 27 Sep 2023 11:07:26 +0200 Subject: [PATCH] fix #833, ensure the discrete object gains are computed correctly in OSBA JBM decoding --- lib_com/options.h | 2 +- lib_dec/ivas_ism_param_dec.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ef136cb6be..d1c64be187 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -221,7 +221,7 @@ #define NONBE_FIX_806_OMASA_ONE_SEP_TRANSPORT_MIX /* Nokia: issue 806: fix one separated object mode transport mix of the separated object */ #define NONBE_FIX_809_EXTERNAL_TARGET_INTERPOLATION /* FhG: issue 809: unify external target interpolation inter and intra frame behaviour */ #define NONBE_FIX_775_OSBA_BR_SWITCHING_CRASH /* FhG: issue 775: fix crash in OSBA with bitrate switching and output order lower than input order */ - +#define NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS /* Fhg: issue #833: Resolve "JBM OSBA: the gains for the discrete objects are not computed" */ #define JBM_FOR_OSBA /* FhG: implement OSBA format in the JBM path */ #ifdef JBM_FOR_OSBA diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 38bedac3ae..ec34840680 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -2594,6 +2594,11 @@ void ivas_ism_dec_digest_tc( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || +#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS + st_ivas->renderer_type == RENDERER_OSBA_AMBI || + st_ivas->renderer_type == RENDERER_OSBA_LS || + st_ivas->renderer_type == RENDERER_OSBA_STEREO || +#endif ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { int16_t i, num_objects; @@ -2604,7 +2609,11 @@ void ivas_ism_dec_digest_tc( if ( ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) == st_ivas->hTcBuffer->n_samples_available ) { int16_t interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) + if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || +#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS + st_ivas->renderer_type == RENDERER_OSBA_AMBI || +#endif + st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { st_ivas->hIsmRendererData->interpolator[0] = 0.0f; for ( i = 1; i < interpolator_length; i++ ) @@ -2641,7 +2650,11 @@ void ivas_ism_dec_digest_tc( azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->azimuth + 0.5f ); elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->elevation + 0.5f ); - if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) && + if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || +#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS + st_ivas->renderer_type == RENDERER_OSBA_LS || +#endif + st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) && st_ivas->hCombinedOrientationData == NULL ) { if ( st_ivas->hIntSetup.is_planar_setup ) @@ -2655,7 +2668,11 @@ void ivas_ism_dec_digest_tc( efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); } } - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) + else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || +#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS + st_ivas->renderer_type == RENDERER_OSBA_AMBI || +#endif + st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { /*get HOA gets for direction (ACN/SN3D)*/ ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order ); -- GitLab