Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ #define NONBE_FIX_897_USAN_WITH_MASA_RENDERING /* Nokia: issue #897: USAN null pointer in MASA external renderer to Ambisonics */ #define NONBE_FIX_903_OSBA_TO_STEREO /* VA: issue 903: fix OSBA to stereo rendering issue */ #define NONBE_FIX_811_DFT_DOUBLE_TO_FLOAT /* FhG: issue 811: change double precision functions to float in DFT Stereo */ #define NONBE_FIX_906_SBA_LBR_SMOOTHING /* FhG: issue #906: fix SBA low bit rate smoothing for HOA2/HOA3 output */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ Loading lib_dec/ivas_spar_decoder.c +36 −6 Original line number Diff line number Diff line Loading @@ -1062,6 +1062,10 @@ static void ivas_spar_calc_smooth_facs( float *cldfb_in_ts_re[CLDFB_NO_COL_MAX], float *cldfb_in_ts_im[CLDFB_NO_COL_MAX], int16_t nbands_spar, #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING const int16_t nSlots, const int16_t isFirstSubframe, #endif ivas_fb_bin_to_band_data_t *bin2band, float *smooth_fac, float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1] ) Loading @@ -1083,15 +1087,30 @@ static void ivas_spar_calc_smooth_facs( subframe_band_nrg[b] = 0.f; while ( bin < CLDFB_NO_CHANNELS_MAX && b == bin2band->p_cldfb_map_to_spar_band[bin] ) { #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING for ( ts = 0; ts < nSlots; ts++ ) #else for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) #endif { subframe_band_nrg[b] += cldfb_in_ts_re[ts][bin] * cldfb_in_ts_re[ts][bin] + cldfb_in_ts_im[ts][bin] * cldfb_in_ts_im[ts][bin]; } bin++; } subframe_band_nrg[b] = sqrtf( subframe_band_nrg[b] ); #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING if ( isFirstSubframe && nSlots < MAX_PARAM_SPATIAL_SUBFRAMES ) { /* fill up to full 5ms subframe */ smooth_buf[b][0] += subframe_band_nrg[b]; } else { #endif smooth_buf[b][0] = subframe_band_nrg[b]; #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING } #endif /* calculate short and long energy averages */ smooth_short_avg[b] = EPSILON; for ( i = 0; i < 2 * SBA_DIRAC_NRG_SMOOTH_SHORT; i++ ) Loading Loading @@ -1128,6 +1147,11 @@ static void ivas_spar_calc_smooth_facs( smooth_fac[b] = max( min_smooth_gains1[b], min( max_smooth_gains2[b], smooth_fac[b] ) ); } #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING /* only update if we collected a full 5ms worth of energies for the buffer */ if ( isFirstSubframe || nSlots == MAX_PARAM_SPATIAL_SUBFRAMES ) { #endif for ( b = 0; b < nbands_spar; b++ ) { for ( i = 2 * SBA_DIRAC_NRG_SMOOTH_LONG; i > 0; i-- ) Loading @@ -1135,7 +1159,9 @@ static void ivas_spar_calc_smooth_facs( smooth_buf[b][i] = smooth_buf[b][i - 1]; } } #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING } #endif return; } Loading Loading @@ -1685,7 +1711,11 @@ void ivas_spar_dec_upmixer_sf( if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); #else 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 ); #endif } for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) Loading Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ #define NONBE_FIX_897_USAN_WITH_MASA_RENDERING /* Nokia: issue #897: USAN null pointer in MASA external renderer to Ambisonics */ #define NONBE_FIX_903_OSBA_TO_STEREO /* VA: issue 903: fix OSBA to stereo rendering issue */ #define NONBE_FIX_811_DFT_DOUBLE_TO_FLOAT /* FhG: issue 811: change double precision functions to float in DFT Stereo */ #define NONBE_FIX_906_SBA_LBR_SMOOTHING /* FhG: issue #906: fix SBA low bit rate smoothing for HOA2/HOA3 output */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ Loading
lib_dec/ivas_spar_decoder.c +36 −6 Original line number Diff line number Diff line Loading @@ -1062,6 +1062,10 @@ static void ivas_spar_calc_smooth_facs( float *cldfb_in_ts_re[CLDFB_NO_COL_MAX], float *cldfb_in_ts_im[CLDFB_NO_COL_MAX], int16_t nbands_spar, #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING const int16_t nSlots, const int16_t isFirstSubframe, #endif ivas_fb_bin_to_band_data_t *bin2band, float *smooth_fac, float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1] ) Loading @@ -1083,15 +1087,30 @@ static void ivas_spar_calc_smooth_facs( subframe_band_nrg[b] = 0.f; while ( bin < CLDFB_NO_CHANNELS_MAX && b == bin2band->p_cldfb_map_to_spar_band[bin] ) { #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING for ( ts = 0; ts < nSlots; ts++ ) #else for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) #endif { subframe_band_nrg[b] += cldfb_in_ts_re[ts][bin] * cldfb_in_ts_re[ts][bin] + cldfb_in_ts_im[ts][bin] * cldfb_in_ts_im[ts][bin]; } bin++; } subframe_band_nrg[b] = sqrtf( subframe_band_nrg[b] ); #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING if ( isFirstSubframe && nSlots < MAX_PARAM_SPATIAL_SUBFRAMES ) { /* fill up to full 5ms subframe */ smooth_buf[b][0] += subframe_band_nrg[b]; } else { #endif smooth_buf[b][0] = subframe_band_nrg[b]; #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING } #endif /* calculate short and long energy averages */ smooth_short_avg[b] = EPSILON; for ( i = 0; i < 2 * SBA_DIRAC_NRG_SMOOTH_SHORT; i++ ) Loading Loading @@ -1128,6 +1147,11 @@ static void ivas_spar_calc_smooth_facs( smooth_fac[b] = max( min_smooth_gains1[b], min( max_smooth_gains2[b], smooth_fac[b] ) ); } #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING /* only update if we collected a full 5ms worth of energies for the buffer */ if ( isFirstSubframe || nSlots == MAX_PARAM_SPATIAL_SUBFRAMES ) { #endif for ( b = 0; b < nbands_spar; b++ ) { for ( i = 2 * SBA_DIRAC_NRG_SMOOTH_LONG; i > 0; i-- ) Loading @@ -1135,7 +1159,9 @@ static void ivas_spar_calc_smooth_facs( smooth_buf[b][i] = smooth_buf[b][i - 1]; } } #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING } #endif return; } Loading Loading @@ -1685,7 +1711,11 @@ void ivas_spar_dec_upmixer_sf( if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { #ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); #else 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 ); #endif } for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) Loading