diff --git a/lib_com/options.h b/lib_com/options.h index b921da1421f18e3ce50b2a554e50a0d4326b9709..20cc81e20895950369ff4086a5dca38a4b0be438 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -110,6 +110,7 @@ #define FIX_2283_ISM_MD_DELAY /* Dolby: Fix ISM metadata delay round-off */ #define FIX_2283_Q_CLDFB /* FhG: Fix Q format issue in CLDFB */ #define FIX_2283_ACCU_CLDFB /* FhG: Fix to consider Q-format differences in accumulateCLDFBArrayToBuffer_fx() */ +#define FIX_1530_Codec_Level_Harmonization_Non_diegetic_panning /* FhG: Adjust non-diegetic panning law to harmonize codec levels with 3GPP reference software */ #define FIX_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ #define FIX_FLOAT_1533_BLEND_SUBFR2 /* FhG: float issue 1533: correct blending in blend_subfr2() */ diff --git a/lib_dec/ivas_mono_dmx_renderer_fx.c b/lib_dec/ivas_mono_dmx_renderer_fx.c index eedd4b48dea32c929bb42ea658e87d8a2167a297..97ed332be0893219907a8eec750c5c898581d1e8 100644 --- a/lib_dec/ivas_mono_dmx_renderer_fx.c +++ b/lib_dec/ivas_mono_dmx_renderer_fx.c @@ -35,6 +35,9 @@ #include "prot_fx.h" #include "ivas_prot_fx.h" #include "ivas_cnst.h" +#ifdef FIX_1530_Codec_Level_Harmonization_Non_diegetic_panning +#include "rom_com.h" +#endif #include "wmc_auto.h" @@ -319,6 +322,12 @@ void ivas_apply_non_diegetic_panning_fx( const Word16 output_frame /* i : output frame length per channel */ ) { + +#ifdef FIX_1530_Codec_Level_Harmonization_Non_diegetic_panning + Word16 pan = add( mult_r( non_diegetic_pan_gain_fx, 32 ), 32 ); // 0.5.Q15 = 16384 // Q15 + v_multc_fx_16( input_f_fx, cos_table_129[pan], output_fx[1], output_frame ); + v_multc_fx_16( input_f_fx, cos_table_129[64 - pan], output_fx[0], output_frame ); +#else Word16 pan_left_fx, pan_right_fx; pan_left_fx = add( mult( non_diegetic_pan_gain_fx, 16384 ), 16384 ); // 0.5.Q15 = 16384 @@ -326,6 +335,8 @@ void ivas_apply_non_diegetic_panning_fx( v_multc_fx( input_f_fx, L_shl( L_deposit_l( pan_right_fx ), 16 ), output_fx[1], output_frame ); v_multc_fx( input_f_fx, L_shl( L_deposit_l( pan_left_fx ), 16 ), output_fx[0], output_frame ); +#endif + return; }