Commit 1c58160c authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'fhg/fix-missing-gain-bed-application-in-osba-with-object-editing' into 'main'

[NON-BE] [allow-regression] fix missing gain bed application in osba with object editing

See merge request !2463
parents 2b4433e8 3be6cced
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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,7 +353,8 @@ 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
                    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
                }
+22 −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"
@@ -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*/