diff --git a/lib_com/options.h b/lib_com/options.h index b9dbd6e1f90c48e9be52848dec52eaeb49c78b3a..396d080b987e53349651476efc9c2f3084e60962 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define FIX_427_MAXIMUM_S_INDEX /* VA: issue 427: fix return index of function maximum_s() */ #define FIX_431_PARAMMC_PLC_INTERPOLATOR /* FhG: Issue 431: fix missing interpolator reset for ParamMC PCL */ #define FIX_391_SBA /* Dlb: Fix for issue 391 for SBA */ +#define LBR_ADAP_SMOOTHING_OPT /* FhG: Issue 436: complexity optimization of adaptive smoothing in low-bitrate SBA */ #define FIX_425_MASA_BRSW_RENDERER /* Nokia: Issue 425: renderer not reconfigure in MASA bitrate switching */ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c old mode 100644 new mode 100755 index 6f917a6f412b442c6582a1bc95145b6ec5316177..154d8c41f811272478dbf948f151c026d118b2a5 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1315,10 +1315,14 @@ void ivas_spar_dec_upmixer( if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) ) { +#ifdef LBR_ADAP_SMOOTHING_OPT + ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); +#else for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { ivas_spar_calc_smooth_facs( cldfb_in_ts_re[in_ch], cldfb_in_ts_im[in_ch], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac[in_ch], hSpar->hMdDec->smooth_buf[in_ch] ); } +#endif } for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) @@ -1334,7 +1338,11 @@ void ivas_spar_dec_upmixer( { for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { +#ifdef LBR_ADAP_SMOOTHING_OPT + mixer_mat[out_ch][in_ch][spar_band] = ( 1 - hSpar->hMdDec->smooth_fac[spar_band] ) * mixer_mat[out_ch][in_ch][spar_band] + hSpar->hMdDec->smooth_fac[spar_band] * hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band]; +#else mixer_mat[out_ch][in_ch][spar_band] = ( 1 - hSpar->hMdDec->smooth_fac[in_ch][spar_band] ) * mixer_mat[out_ch][in_ch][spar_band] + hSpar->hMdDec->smooth_fac[in_ch][spar_band] * hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band]; +#endif hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band] = mixer_mat[out_ch][in_ch][spar_band]; } } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c old mode 100644 new mode 100755 index 9475c2f0264fa701d256a343438dbf5aad4bdef0..69f3754e5cafcc691af023f1408fbfc6ff0632b7 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -618,6 +618,13 @@ ivas_error ivas_spar_md_dec_init( set_f( hMdDec->spar_md.en_ratio_slow, 0.0f, IVAS_MAX_NUM_BANDS ); set_f( hMdDec->spar_md.ref_pow_slow, 0.0f, IVAS_MAX_NUM_BANDS ); +#ifdef LBR_ADAP_SMOOTHING_OPT + set_zero( hMdDec->smooth_fac, IVAS_MAX_NUM_BANDS ); + for ( i = 0; i < IVAS_MAX_NUM_BANDS; i++ ) + { + set_zero( hMdDec->smooth_buf[i], 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); + } +#else for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ ) { set_zero( hMdDec->smooth_fac[i], IVAS_MAX_NUM_BANDS ); @@ -629,6 +636,7 @@ ivas_error ivas_spar_md_dec_init( set_zero( hMdDec->smooth_buf[i][j], 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); } } +#endif for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ ) { for ( j = 0; j < IVAS_SPAR_MAX_CH; j++ ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h old mode 100644 new mode 100755 index 4174b2772b639f23dd900de43dde42543cae9127..69d03c03c52bd172deff5b584b910b18fd4175f1 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -809,14 +809,17 @@ typedef struct ivas_spar_md_dec_state_t int16_t table_idx; int16_t dtx_vad; int16_t spar_hoa_md_flag; - #ifdef SPAR_TUNING int16_t spar_hoa_dirac2spar_md_flag; int16_t HOA_md_ind[IVAS_SPAR_MAX_CH]; #endif - +#ifdef LBR_ADAP_SMOOTHING_OPT + float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; + float smooth_fac[IVAS_MAX_NUM_BANDS]; +#else float smooth_buf[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; +#endif float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; } ivas_spar_md_dec_state_t;