diff --git a/lib_com/options.h b/lib_com/options.h index f37a0c7a82b280393c4cc064b7838f64e3df17c0..05485536d98dcbcb9875fbd7852003bf9ba19ffe 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,6 +100,8 @@ #define NONBE_FIX2614_LP_CNG_ASSERT /* FhG: */ #define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */ #define FIX_BASOP_1765_MASA1TC_CNG_MISMATCH /* Nokia: BASOP issue 1765: Improve accuracy of FD CNG noise estimation */ +#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 */ +#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 */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index 27a95190f8013bf9531eeae20dde0c613436e842..b36a439f557e3b7c5a5e32eb8a36c51430cba294 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -522,6 +522,11 @@ void ivas_dirac_dec_output_synthesis_init_fx( } h_dirac_output_synthesis_state->proto_power_diff_smooth_prev_q = Q31; move16(); +#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED + + h_dirac_output_synthesis_state->first_sf_after_reset = 1; + move16(); +#endif return; } @@ -2001,6 +2006,17 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( move32(); b = L_sub( ONE_IN_Q31, 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 = ONE_IN_Q31; + move32(); + b = 0; + move32(); + } +#endif + q_com = s_min( exp, masa_stereo_type_detect->q_target_power_y_smooth ); target_power_y = L_shl( target_power_y, sub( q_com, exp ) ); masa_stereo_type_detect->target_power_y_smooth_fx = L_shl( masa_stereo_type_detect->target_power_y_smooth_fx, @@ -2142,6 +2158,14 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( move32(); } +#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 */ + set32_fx( alpha, ONE_IN_Q31, num_freq_bands ); + } +#endif + /*-----------------------------------------------------------------* * compute gains *-----------------------------------------------------------------*/ @@ -2500,6 +2524,16 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( p_gains_diff++; } } +#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED + + IF( h_dirac_output_synthesis_state->first_sf_after_reset ) + { + Copy32( gains_dir, h_dirac_output_synthesis_state->gains_dir_prev_fx, imult1616( num_freq_bands, nchan_out_woLFE ) ); + Copy32( gains_diff, h_dirac_output_synthesis_state->gains_diff_prev_fx, imult1616( num_freq_bands, nchan_out_woLFE ) ); + h_dirac_output_synthesis_state->first_sf_after_reset = 0; + move16(); + } +#endif /*-----------------------------------------------------------------* * gain interpolation and output streams diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index aa224aee1a8edc34a8e3da2d075f87b73a9f96f2..79f8d12384107484bfd1cd711347dd0535088584 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -342,6 +342,10 @@ typedef struct dirac_output_synthesis_state_structure Word16 cy_cross_dir_smooth_prev_len; /* Target cross PSD of direct sound. Size: num_freq_bands*num_channels. */ Word16 cy_auto_diff_smooth_prev_len; /* Target auto PSD of diffuse sound. Size: num_freq_bands*num_channels. */ +#ifdef FIX_FLOAT_1601_DIRAC_REND_ON_RESET_PREV_SEED + Word16 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 */