Commit 1ed0162c authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Fix float 1601 by updating IIR state faster on renderer reset.

parent a2c05c47
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -172,6 +172,10 @@
#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI         /* Nokia: BASOP issue 2442: Aligns float with identical diffuse gain limitation to minimize diff */
#define FIX_FMSW_DEC_EXT                                /* float issue 1566: fix EXT output in format switching */
#define FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED    /* Nokia: float issue 1601: Improve DirAC renderer on rate switching by seeding prev values on first subframe after reset */
#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED
#define FIX_FLOAT_1601_STEREO_TYPE_ON_RESET_PREV_SEED   /* Nokia: float issue 1601: Improve stereo type detection on rate switching by seeding prev values on first subframe after reset */
#endif

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

+29 −0
Original line number Diff line number Diff line
@@ -426,6 +426,10 @@ void ivas_dirac_dec_output_synthesis_init(
    {
        set_zero( h_dirac_output_synthesis_state->proto_power_diff_smooth_prev, h_dirac_output_synthesis_params->max_band_decorr * nchan_out_woLFE );
    }
#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED

    h_dirac_output_synthesis_state->first_sf_after_reset = 1;
#endif

    return;
}
@@ -1325,6 +1329,14 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
        a = 0.0004f;  /* Temporal smoothing coefficient */
        b = 1.0f - a; /* Temporal smoothing coefficient */

#ifdef FIX_FLOAT_1601_STEREO_TYPE_ON_RESET_PREV_SEED
        if ( h_dirac_output_synthesis_state->first_sf_after_reset )
        {
            /* Do not smooth with zero history value after reset */
            a = 1.0f;
            b = 0.0f;
        }
#endif
        masa_stereo_type_detect->target_power_y_smooth = a * target_power_y + b * masa_stereo_type_detect->target_power_y_smooth;
        masa_stereo_type_detect->subtract_power_y_smooth = a * subtract_power_y + b * masa_stereo_type_detect->subtract_power_y_smooth;

@@ -1376,6 +1388,14 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
        alpha[l] = qualityBasedSmFactor * alpha[l] + ( 1.0f - qualityBasedSmFactor ) * alpha_quality_based;
    }

#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED
    if ( h_dirac_output_synthesis_state->first_sf_after_reset )
    {
        /* Do not smooth with zero history value after reset */
        set_f( alpha, 1.0f, num_freq_bands );
    }
#endif

    /*-----------------------------------------------------------------*
     * compute gains
     *-----------------------------------------------------------------*/
@@ -1505,6 +1525,15 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
        }
    }

#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED
    if ( h_dirac_output_synthesis_state->first_sf_after_reset )
    {
        mvr2r( gains_dir, h_dirac_output_synthesis_state->gains_dir_prev, num_freq_bands * nchan_out_woLFE );
        mvr2r( gains_diff, h_dirac_output_synthesis_state->gains_diff_prev, num_freq_bands * nchan_out_woLFE );
        h_dirac_output_synthesis_state->first_sf_after_reset = 0;
    }

#endif
    /*-----------------------------------------------------------------*
     * gain interpolation and output streams
     *-----------------------------------------------------------------*/
+4 −0
Original line number Diff line number Diff line
@@ -279,6 +279,10 @@ typedef struct dirac_output_synthesis_state_structure
    float *reference_power_smooth_prev;
    float *direction_smoothness_prev;

#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED
    int16_t first_sf_after_reset; /* Flag for different prev value handling after renderer reset */

#endif
} DIRAC_OUTPUT_SYNTHESIS_STATE;

/* MASA stereo transport signal type detection structure */