Commit b0f985c5 authored by Jan Kiene's avatar Jan Kiene
Browse files

add missing gain_bed application in sba decoding

parent 559d4f54
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

*******************************************************************************************************/

#include "enh32.h"
#include <assert.h>
#include <stdint.h>
#include "options.h"
@@ -936,6 +937,23 @@ 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
            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++ )
                    {
                        output_fx_local[ch][i] = L_shl( Mpy_32_32( output_fx_local[ch][i], gain ), 2 ); // Q11
                    }
                }
            }
        }

        FOR( ch = 0; ch < nchan_out; ch++ )
        {
            output_fx_local[ch] = output_fx_local[ch] + n_samples_sf; /*Q11*/