Commit 6ee6d35e authored by multrus's avatar multrus
Browse files

Merge branch '1165-static-scaling-for-downmixes' of...

Merge branch '1165-static-scaling-for-downmixes' of forge.3gpp.org:ivas-codec-pc/ivas-codec into 1165-static-scaling-for-downmixes
parents e9175ff1 5f67b402
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -195,8 +195,10 @@ int main(
#ifdef DEBUG_SBA
    int16_t numTransportChannels = 1;
#endif
#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX
    int32_t cnt_frames_limited, noClipping;
#endif
#endif

#ifdef DEBUGGING
    dbgargs( &argc, argv );
@@ -793,6 +795,7 @@ int main(
    }

#ifdef DEBUGGING
#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX
    if ( ( cnt_frames_limited = IVAS_ENC_GetCntFramesLimited( hIvasEnc ) ) > 0 )
    {
        fprintf( stdout, "\nLimiter applied in %d frames.\n\n", cnt_frames_limited );
@@ -801,6 +804,7 @@ int main(
    {
        fprintf( stdout, "Clipping (saturation) detected: %d samples clipped!!!\n\n", noClipping );
    }
#endif

    print_snr();
#endif
+1 −0
Original line number Diff line number Diff line
@@ -1835,5 +1835,6 @@ typedef enum
#define ivas_omasa_dmx_scal_fac_5ch_static_inv ( 1.0f / ivas_omasa_dmx_scal_fac_5ch_static )

#endif

/* clang-format on */
/* IVAS_CNST_H  */
+3 −1
Original line number Diff line number Diff line
@@ -181,12 +181,14 @@

#define NONBE_FIX_1165_STATIC_SCAL_MCMASA               /* Nok: add static scaling to McMASA DMX */
#define NONBE_FIX_1165_STATIC_SCAL_OMASA                /* Nok: add static scaling to OMASA DMX */

#define NONBE_FIX_1165_STATIC_SCAL_OSBA_PREREND         /* FhG: static scaling factor for pre-rendered OSBA modes */

#define NONBE_FIX_1165_STATIC_SCAL_PARAMMC              /* FhG: add static scaling to ParamMC DMX */
/*#define NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX*/     /* FhG: apply the limiter before the core encoder for formats with downmixing where the signal could exceed the 16-bit value range */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */



/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+12 −0
Original line number Diff line number Diff line
@@ -1340,6 +1340,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_FIX_1165_STATIC_SCAL_OSBA_PREREND
            for ( n = 0; n < nchan_out; n++ )
            {
                v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered );
            }
#endif
        }
        else
        {
@@ -1347,6 +1353,12 @@ ivas_error ivas_jbm_dec_render(
            {
                return error;
            }
#ifdef NONBE_FIX_1165_STATIC_SCAL_OSBA_PREREND
            for ( n = 0; n < nchan_out; n++ )
            {
                v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered );
            }
#endif

            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
            {
+4 −0
Original line number Diff line number Diff line
@@ -72,7 +72,11 @@ static void ivas_merge_sba_transports(
    {
        for ( j = 0; j < input_frame; j++ )
        {
#ifdef NONBE_FIX_1165_STATIC_SCAL_OSBA_PREREND
            data_out_f[i][j] = 0.25f * ( 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
        }
    }

Loading