Commit 400db3f9 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

move the scaling factor behind the rendering

parent a05d2d90
Loading
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,12 @@ ivas_error ivas_jbm_dec_render(
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
        {
            ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output );
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
            for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )
            {
                v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered );
            }
#endif
        }
        else
        {
@@ -1150,6 +1156,12 @@ ivas_error ivas_jbm_dec_render(
                    set_zero( p_output[n], *nSamplesRendered );
                }
            }
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
            for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )
            {
                v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered );
            }
#endif
        }
    }
    else if ( st_ivas->ivas_format == MC_FORMAT )
+4 −20
Original line number Diff line number Diff line
@@ -747,9 +747,7 @@ ivas_error ivas_sba_dec_render(

        ivas_spar_dec_upmixer_sf( st_ivas, output_f_local, nchan_internal );

        if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
        {
            if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            float gain = st_ivas->hSbaIsmData->gain_bed;
            if ( gain != 1.0f && gain >= 0.0f )
@@ -764,20 +762,6 @@ ivas_error ivas_sba_dec_render(
                }
            }
        }
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
            else
            {
                for ( ch = 0; ch < nchan_out; ch++ )
                {
                    int16_t i;
                    for ( i = 0; i < n_samples_sf; i++ )
                    {
                        output_f_local[ch][i] *= 2.0f;
                    }
                }
            }
#endif
        }

        for ( ch = 0; ch < nchan_out; ch++ )
        {
+0 −4
Original line number Diff line number Diff line
@@ -72,11 +72,7 @@ static void ivas_merge_sba_transports(
    {
        for ( j = 0; j < input_frame; j++ )
        {
#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS
            data_out_f[i][j] = data_in_f1[i][j] + data_in_f2[i][j];
#else
            data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] );
#endif
        }
    }