From d271ebe49edb4660e1bd346c3a4ddf5606fdedf6 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 22 Feb 2024 07:37:55 +0100 Subject: [PATCH] fix for #1009, fix ISM1 non-diegetic rendering, use the correct offset and buffer for rendering the non-diegetic object, under define FIX_1009_ISM_NONDIEGETIC_PANNING, active --- lib_com/ivas_prot.h | 5 ++++- lib_com/options.h | 2 +- lib_dec/ivas_jbm_dec.c | 4 ++++ lib_dec/ivas_mono_dmx_renderer.c | 11 +++++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d0c797e27d..e091ce7305 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -769,7 +769,10 @@ void dtx_read_padding_bits( ); void ivas_apply_non_diegetic_panning( - float *output_f[], /* i/o: core-coder transport mono channel/stereo output */ +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + float *input_f, /* i : non-diegetic object */ +#endif + float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 49d3c4b0fb..28fa2ff746 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ - +#define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 89aa3f8d4c..6f4fb2f1cc 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1120,7 +1120,11 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + ivas_apply_non_diegetic_panning( p_tc[0], p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); +#else ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); +#endif } #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index ffe5cb54be..7b6552707a 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -221,7 +221,10 @@ void ivas_mono_stereo_downmix_mcmasa( *------------------------------------------------------------------------*/ void ivas_apply_non_diegetic_panning( - float *output_f[], /* i/o: core-coder transport mono channel/stereo output */ +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + float *input_f, /* i : non-diegetic object */ +#endif + float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ ) @@ -230,9 +233,13 @@ void ivas_apply_non_diegetic_panning( pan_left = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_right = 1.f - pan_left; - +#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING + v_multc( input_f, pan_right, output_f[1], output_frame ); + v_multc( input_f, pan_left, output_f[0], output_frame ); +#else v_multc( output_f[0], pan_right, output_f[1], output_frame ); v_multc( output_f[0], pan_left, output_f[0], output_frame ); +#endif return; } -- GitLab