Commit 23aa3be1 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] apply scaling factor to OSBA stereo output and remove redundant code

parent eae9faa0
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@
#define NONBE_1217_OBJ_EDIT_FOA                         /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */
#define NONBE_1215_FIX_JBM_MAX_SCALING                  /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */
#define NONBE_FIX_1255_OBJ_EDIT_JBM                     /* VA: issue 1255: restore object editing in JBM */
#define NONBE_FIX_1262_OSBA_STEREO                      /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */


/* ##################### End NON-BE switches ########################### */
+11 −0
Original line number Diff line number Diff line
@@ -320,8 +320,10 @@ void ivas_osba_stereo_add_channels(
{
    int16_t n;

#ifndef NONBE_FIX_1262_OSBA_STEREO
    if ( ism_mode == ISM_SBA_MODE_DISC )
    {
#endif
        if ( gain != 1.0f && gain >= 0.0f )
        {
            int16_t i;
@@ -340,6 +342,7 @@ void ivas_osba_stereo_add_channels(
                v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render );
            }
        }
#ifndef NONBE_FIX_1262_OSBA_STEREO
    }
    else
    {
@@ -348,6 +351,14 @@ void ivas_osba_stereo_add_channels(
            v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render );
        }
    }
#endif
#ifdef NONBE_FIX_1262_OSBA_STEREO

    for ( n = 0; n < nchan_out; n++ )
    {
        v_multc( output_f[n], 0.5f, output_f[n], n_samples_to_render );
    }
#endif

    return;
}