diff --git a/lib_com/options.h b/lib_com/options.h index 56fb39564a2467ca315c6d8e7611c62334cb8a4e..be6908abd70d7465795ee67984a85f9c3a301a23 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 ########################### */ diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index d4b4eaf096d003ddf06ea2779486589774134610..dee0e8beb09f6dd0376f73e1d97cd9d7c4db42a5 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -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 *-----------------------------------------------------------------*/ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 9bff1d4945383427e1defd23dd9e62d96bbe5a06..7467b07ef45c54926e09b6a7416992dbcd390389 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -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 */