diff --git a/lib_com/options.h b/lib_com/options.h index 2c70dd14f900bcf3ae42a391332364aa639d8451..41376545eba3b0e8f95825c23be18df54704e6dd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -119,6 +119,7 @@ #define FIX_1466_EXTREND /* FhG: float issue 1466: enable rendering of mono/stereo to other formats in the external renderer */ #define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ #define FIX_2285_CODE_DECODER_INIT_BW /* VA: basop issue 2285: fix core-decoder initialization bandwidth */ +#define FIX_2297_SBA_SCALING_32KHZ /* VA: basop issue 2297: Fix scaling factor before the SBA decoder for output_Fs = 32 or 16 */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index ece09b600313bbbeda9d421866e6ab4ca72a12fe..4433fc5d7287d47588220c5e68218e2319b2dc5f 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -372,7 +372,11 @@ ivas_error ivas_jbm_dec_tc_fx( move16(); FOR( i = 0; i < 2; i++ ) { +#ifdef FIX_2297_SBA_SCALING_32KHZ + s = s_min( s, L_norm_arr( p_output_fx[i], output_frame ) - 11 ) /* Guard bits */; // L_frame should be used instead of L_FRAME48k */ +#else s = s_min( s, L_norm_arr( p_output_fx[i], L_FRAME48k ) - 11 ) /* Guard bits */; // L_frame should be used instead of L_FRAME48k */ +#endif } FOR( i = 0; i < 2; i++ ) { @@ -904,7 +908,11 @@ ivas_error ivas_jbm_dec_tc_fx( move16(); FOR( i = 0; i < 2; i++ ) { +#ifdef FIX_2297_SBA_SCALING_32KHZ + s = s_min( s, L_norm_arr( p_output_fx[sba_ch_idx + i], output_frame ) - 11 /* Guard bits */ ); +#else s = s_min( s, L_norm_arr( p_output_fx[sba_ch_idx + i], L_FRAME48k ) - 11 /* Guard bits */ ); +#endif } FOR( i = 0; i < 2; i++ ) { @@ -1343,7 +1351,11 @@ ivas_error ivas_jbm_dec_tc_fx( move16(); FOR( i = 0; i < 2; i++ ) { +#ifdef FIX_2297_SBA_SCALING_32KHZ + s = s_min( s, L_norm_arr( p_output_fx[i], output_frame ) - 11 /* Guard bits */ ); +#else s = s_min( s, L_norm_arr( p_output_fx[i], L_FRAME48k ) - 11 /* Guard bits */ ); +#endif } FOR( i = 0; i < 2; i++ ) {