Commit f80e08d7 authored by bayers's avatar bayers
Browse files

Merge branch...

Merge branch '591-paramism-tc-energy-compensation-in-the-jbm-working-on-false-number-of-samples' into 'main'

[Non-BE] Resolve "ParamISM: TC energy compensation in the JBM working on false number of samples"

See merge request !972
parents 6d062dd2 6c75101c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@
#define FIX_691_OSBA_CRASH                              /* FhG: Fix for issue 691: Crash for OSBA Stereo out */
#define FIX_694_OMASA_EXTREME                           /* Nokia: fix for crash in OMASA on extreme sample */
#define FIX_679_JBM_MC2SBA                              /* FhG: fix issue 679: check for transport vs. internal channel count in JBM prior to ivas_mc2sba() */
#define FIX_591_PARAMISM_JBM_ENER_CORRECTION            /* FhG: fix energy correction in ParamISM rendering */

#define FIX_LARGE_RENDERER_DELAY_COMP                   /* Fix renderer delay compensation with delays greater than 1 frame */

+14 −2
Original line number Diff line number Diff line
@@ -1124,6 +1124,9 @@ void ivas_param_ism_dec_digest_tc(
    float direct_response[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN];
    DIRAC_DEC_HANDLE hDirAC;
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION
    int16_t fade_len;
#endif

    /* Initialization */
    hDirAC = st_ivas->hDirAC;
@@ -1133,7 +1136,12 @@ void ivas_param_ism_dec_digest_tc(
    ene_tc = 0.0f;
    ene_sum = 0.0f;
    last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain;
#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION
    output_frame = nCldfbSlots * hSpatParamRendCom->num_freq_bands;
    fade_len = output_frame / 2;
#else
    output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC );
#endif

    nchan_transport = st_ivas->nchan_transport;
    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
@@ -1238,9 +1246,13 @@ void ivas_param_ism_dec_digest_tc(
    {
        /* Smoothing */
        gain = 0.75f * gain + 0.25f * last_gain;
        /* 10ms ramp */
#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION
        grad = ( gain - last_gain ) / (float) fade_len; /* slope between two consecutive gains, 480 samples length */
        for ( i = 0; i < fade_len; i++ )
#else
        grad = ( gain - last_gain ) * 2.0f / (float) output_frame; /* slope between two consecutive gains, 480 samples length */
        for ( i = 0; i < ( output_frame / 2 ); i++ )
        for ( i = 0; i < output_frame / 2; i++ )
#endif
        {
            transport_channels_f[0][i] *= ( last_gain + i * grad );
            transport_channels_f[1][i] *= ( last_gain + i * grad );
+7 −0
Original line number Diff line number Diff line
@@ -207,6 +207,13 @@ ivas_error ivas_jbm_dec_tc(
        {
            ivas_mono_downmix_render_passive( st_ivas, output, output_frame );
        }
#ifdef FIX_591_PARAMISM_JBM_ENER_CORRECTION
        else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) )
        {
            /* loudness correction */
            ivas_dirac_dec_binaural_sba_gain( output, st_ivas->nchan_transport, output_frame );
        }
#endif
    }
    else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT )
    {