diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 67908e99647bce09865d9790b89ad4eee6e18508..67d60c65b2a8b332453d28bc88c35276ec67fb3a 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -344,9 +344,8 @@ void ivas_osba_stereo_add_channels_fx( IF( EQ_16( ism_mode, ISM_SBA_MODE_DISC ) ) { Word32 gain = gain_bed_fx; - test(); + move32(); - // TODO: Enable gain editing feature (NE_32 ( gain, ONE_IN_Q_gain ) ) test(); IF( NE_32( gain, ONE_IN_Q29 ) && GT_32( gain, 0 ) ) { @@ -354,9 +353,10 @@ void ivas_osba_stereo_add_channels_fx( { FOR( i = 0; i < n_samples_to_render; i++ ) { - Word32 tmp1 = Mpy_32_32( tc_fx[n + nchan_ism][i], gain ); // Q11 + Q29 - 31 = Q9 - tmp1 = L_shl( tmp1, 2 ); // Q9 --> Q11 - output_fx[n][i] = L_add_sat( output_fx[n][i], tmp1 ); // Q11 + Word32 tmp1; + tmp1 = Mpy_32_32( tc_fx[n + nchan_ism][i], gain ); // Q11 + Q29 - 31 = Q9 + tmp1 = L_shl( tmp1, 2 ); // Q9 --> Q11 + output_fx[n][i] = L_add_sat( output_fx[n][i], tmp1 ); // Q11 } } } diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index ebaadb47cb122c332248b66801430b7e6f3a5b3d..374547b7fcc3e7ac487749f79fb0202d3d7164bb 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -30,6 +30,7 @@ *******************************************************************************************************/ +#include "enh32.h" #include #include #include "options.h" @@ -886,6 +887,27 @@ ivas_error ivas_sba_dec_render_fx( ivas_spar_dec_upmixer_sf_fx( st_ivas, output_fx_local, nchan_internal ); + test(); + IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) + { + Word32 gain = st_ivas->hSbaIsmData->gain_bed_fx; // Q29 + move32(); + + test(); + IF( NE_32( gain, ONE_IN_Q29 ) && NE_32( gain, 0 ) ) + { + FOR( ch = 0; ch < nchan_out; ch++ ) + { + FOR( Word16 i = 0; i < n_samples_sf; i++ ) + { + Word32 tmp1; + tmp1 = Mpy_32_32( output_fx_local[ch][i], gain ); // Q11 + Q29 - 31 = Q9 + output_fx_local[ch][i] = L_shl( tmp1, 2 ); // Q9 --> Q11 + } + } + } + } + FOR( ch = 0; ch < nchan_out; ch++ ) { output_fx_local[ch] = output_fx_local[ch] + n_samples_sf; /*Q11*/