diff --git a/lib_com/options.h b/lib_com/options.h index 10396a5c34071df32d355449d6e62d8717e547a8..d65d8932893bcaa942f772ab6b6d5b5838aa7f3e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -108,6 +108,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_FLOAT_1518 /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index 45007974483505fb416b1075b6e00456be83df21..25928f6ffdf232c30ece923800f8c70af2d0c586 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -663,7 +663,15 @@ ivas_error ivas_cpe_dec_fx( test(); IF( EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) && EQ_16( hCPE->nchan_out, 1 ) && ( is_DTXrate( ivas_total_brate ) == 0 || ( EQ_16( is_DTXrate( ivas_total_brate ), 1 ) && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) ) { - applyDmxMdctStereo_fx( hCPE, output, output_frame ); +#ifdef FIX_FLOAT_1518 + test(); + IF( !( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_16( st_ivas->ism_mode, ISM_MODE_NONE ) ) ) + { +#endif + applyDmxMdctStereo_fx( hCPE, output, output_frame ); +#ifdef FIX_FLOAT_1518 + } +#endif } /*----------------------------------------------------------------* diff --git a/lib_dec/ivas_dec_fx.c b/lib_dec/ivas_dec_fx.c index bd3eab3e4feb8c9131b76321da996b6d835e91f4..d95c010c8eaf7be6fa17e7b68ca97d14c267c636 100644 --- a/lib_dec/ivas_dec_fx.c +++ b/lib_dec/ivas_dec_fx.c @@ -574,6 +574,12 @@ ivas_error ivas_dec_fx( ivas_sba_dirac_stereo_dec_fx( st_ivas, &p_output_fx[sba_ch_idx], output_frame ); } +#ifdef FIX_FLOAT_1518 + ELSE IF( EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) && EQ_16( st_ivas->ism_mode, ISM_MODE_NONE ) ) + { + v_shr( p_output_fx[0], -1, p_output_fx[0], output_frame ); + } +#endif /* HP filtering */ FOR( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) diff --git a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c index 0f18a6eab2a1fd0b39eb0bded7cfc7f5d1580e29..502550d3b4dab987a4ad8a6ac957e2c928259ada 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c @@ -1502,7 +1502,12 @@ void ivas_sba_dirac_stereo_dec_fx( synchro_synthesis_fx( st_ivas->hDecoderConfig->ivas_total_brate, hCPE, output, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/, q_dft[0] ); /* output scaling */ +#ifdef FIX_FLOAT_1518 + test(); + IF( !sba_mono_flag && !( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_16( st_ivas->ism_mode, ISM_MODE_NONE ) ) ) +#else IF( !sba_mono_flag ) +#endif { v_shr( output[0], 1, output[0], output_frame ); /*0.5f*/ v_shr( output[1], 1, output[1], output_frame ); /*0.5f*/ diff --git a/lib_dec/ivas_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index 8df5a33faf571f9672c4a544f314d51cd86dba07..2b4e575960551168324d36eebd1d2863afd92437 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_core_dec_fx.c @@ -464,7 +464,13 @@ void stereo_mdct_core_dec_fx( test(); test(); test(); + +#ifdef FIX_FLOAT_1518 + test(); + IF( hCPE->nchan_out == 1 && ( bfi == 0 || ( bfi != 0 && sts[0]->core != ACELP_CORE && sts[1]->core != ACELP_CORE ) ) && !( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_16( st_ivas->ism_mode, ISM_MODE_NONE ) ) ) +#else IF( hCPE->nchan_out == 1 && ( bfi == 0 || ( bfi != 0 && sts[0]->core != ACELP_CORE && sts[1]->core != ACELP_CORE ) ) ) +#endif { apply_dmx_weights_fx( hCPE, x_fx, sts[0]->transform_type, sts[1]->transform_type ); }