Commit 33be2f18 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

combine the net changes under the new define NONBE_1894_OSBA_SCALING

parent cd6b12c9
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3911,7 +3911,7 @@ void ivas_osba_stereo_add_channels_fx(
    const Word16 gain,                 /* i  : gain bed value                    */
    const Word16 nchan_out,          /* i  : number of output channels         */
    const Word16 nchan_ism,          /* i  : number of ISM channels            */
#ifndef NONBE_FIX_1262_OSBA_STEREO
#ifndef NONBE_1894_OSBA_SCALING
    const int16_t ism_mode,           /* i  : ISM mode                          */
#endif
    const UWord16 n_samples_to_render /* i  : output frame length per channel   */
+2 −4
Original line number Diff line number Diff line
@@ -131,10 +131,8 @@
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1052_SBA_EXT_FIX                      /* VA: SBA external output support fix - do not overwrite "output_config" parameter */

#define FIX_1849_OBJ_EDITING_API
#define NONBE_FIX_1262_OSBA_STEREO
#define NONBE_1339_FIXOSBA_EXT_LOUDNESS                 /* FhG: issue 1339: apply scaling with EXT output in OSBA high-BR mode */
#define NONBE_1352_HARMONIZE_OSBA_LOUDNESS             /* FhG: do not scale OSBA inputs by 0.5 any more */
#define NONBE_1894_OSBA_SCALING                          /* FhG: do not scale OSBA inputs by 0.5 any more */


/* #################### End BASOP porting switches ############################ */

+3 −9
Original line number Diff line number Diff line
@@ -2232,7 +2232,7 @@ ivas_error ivas_jbm_dec_render_fx(
                /* add already rendered SBA part */
#ifdef FIX_1849_OBJ_EDITING_API

#ifdef NONBE_FIX_1262_OSBA_STEREO
#ifdef NONBE_1894_OSBA_SCALING
                ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, *nSamplesRendered );
#else
                ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, 1, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered );
@@ -2262,12 +2262,6 @@ ivas_error ivas_jbm_dec_render_fx(
                {
                    Copy32( st_ivas->hTcBuffer->tc_fx[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output_fx[n], *nSamplesRendered );
                }
#if defined( NONBE_1339_FIXOSBA_EXT_LOUDNESS ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS )
                for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )
                {
                    scale_sig32( p_output_fx[n], *nSamplesRendered, -1 );
                }
#endif
            }
            ELSE
            {
@@ -2280,7 +2274,7 @@ ivas_error ivas_jbm_dec_render_fx(
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) )
        {
            ivas_dirac_dec_binaural_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output_fx );
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
#ifdef NONBE_1894_OSBA_SCALING
            FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )
            {
                scale_sig32( p_output_fx[n], *nSamplesRendered, 1 );
@@ -2305,7 +2299,7 @@ ivas_error ivas_jbm_dec_render_fx(
                    set32_fx( p_output_fx[n], 0, *nSamplesRendered );
                }
            }
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
#ifdef NONBE_1894_OSBA_SCALING
            FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )
            {
                scale_sig32( p_output_fx[n], *nSamplesRendered, 1 );
+7 −16
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx(
                FOR( b = 0; b < num_cldfb_bands; b++ )
                {
                    st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] =
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
#ifdef NONBE_1894_OSBA_SCALING
                        L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_RealBuffer[b] );
#else
                        L_add( L_shr( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], 1 ),
@@ -212,7 +212,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx(
                    move32();

                    st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] =
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
#ifdef NONBE_1894_OSBA_SCALING
                        L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_ImagBuffer[b] );
#else
                        L_add( L_shr( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], 1 ),
@@ -235,7 +235,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx(
            Word16 i;
            FOR( i = 0; i < nSamplesAsked; i++ )
            {
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
#ifdef NONBE_1894_OSBA_SCALING
                output_fx[n][i] = L_add( output_fx[channel_offset + n][i], p_sepobj_fx[n][i] );
#else
                output_fx[n][i] = L_add( L_shr( output_fx[channel_offset + n][i], 1 ), L_shr( p_sepobj_fx[n][i], 1 ) );
@@ -332,7 +332,7 @@ ivas_error ivas_osba_render_sf_fx(
        {
            v_add_fixed( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered, 1 ); // takes care of downscaling by 0.5f
        }
#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
#ifndef NONBE_1894_OSBA_SCALING
        ELSE
        {
            scale_sig32( p_output[n], *nSamplesRendered, -1 );
@@ -357,7 +357,7 @@ void ivas_osba_stereo_add_channels_fx(
    const Word16 gain,      /* i  : gain bed value                    */
    const Word16 nchan_out, /* i  : number of output channels         */
    const Word16 nchan_ism, /* i  : number of ISM channels            */
#ifndef NONBE_FIX_1262_OSBA_STEREO
#ifndef NONBE_1894_OSBA_SCALING
    const int16_t ism_mode, /* i  : ISM mode                          */
#endif
    const UWord16 n_samples_to_render /* i  : output frame length per channel   */
@@ -365,7 +365,7 @@ void ivas_osba_stereo_add_channels_fx(
{
    int16_t n;

#ifndef NONBE_FIX_1262_OSBA_STEREO
#ifndef NONBE_1894_OSBA_SCALING
    if ( ism_mode == ISM_SBA_MODE_DISC )
    {
#endif
@@ -380,7 +380,7 @@ void ivas_osba_stereo_add_channels_fx(
                v_add_fixed_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render );
            }
        }
#ifndef NONBE_FIX_1262_OSBA_STEREO
#ifndef NONBE_1894_OSBA_SCALING
    }
    else
    {
@@ -391,15 +391,6 @@ void ivas_osba_stereo_add_channels_fx(
    }
#endif


#if defined( NONBE_FIX_1262_OSBA_STEREO ) && !defined( NONBE_1352_HARMONIZE_OSBA_LOUDNESS )
    FOR( n = 0; n < nchan_out; n++ )
    {
        scale_sig32( output_fx[n], n_samples_to_render, -1 );
    }
#endif


    return;
}
#endif