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

align between different occurences of (O)SBA bed gain application

parent b0f985c5
Loading
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
                }
+5 −1
Original line number Diff line number Diff line
@@ -941,6 +941,8 @@ ivas_error ivas_sba_dec_render_fx(
        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 ) )
            {
@@ -948,7 +950,9 @@ ivas_error ivas_sba_dec_render_fx(
                {
                    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
                        Word32 tmp1;
                        tmp1 = Mpy_32_32( output_fx_local[ch][i], gain ); // Q11 + Q29 - 31 = Q9
                        output_fx_local = L_shl( tmp1, 2 );               // Q9 --> Q11
                    }
                }
            }