From a038b9f180f288764a96bdc5f6785466d89f0dba Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 3 Jul 2024 15:01:23 +0530 Subject: [PATCH] Fix for issue 788: Distortion between 10k to 20k in fixe point OSBA Mono output [x] Updates made in TCX noise filling and IGF dec with which distortions are reduced. --- lib_dec/dec_tcx_fx.c | 2 +- lib_dec/igf_dec_fx.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index ca3f1dca6..f521839cd 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -4482,7 +4482,7 @@ void decoder_tcx_noisefilling_fx( #else if ( st->igf ) { - pInfoTCXNoise = st->hIGFDec->infoTCXNoise_evs; + pInfoTCXNoise = st->hIGFDec->infoTCXNoise_ptr; move16(); } #endif diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index 8d846a794..cdcdfab1f 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -3507,12 +3507,12 @@ void IGFDecApplyMono_ivas( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in /*14 seems to be precise enough*/ hPrivateData->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( - hInstance->infoTCXNoise_evs + hGrid->minSrcSubband, + hInstance->infoTCXNoise_ptr, igf_spec + hGrid->minSrcSubband, sub( hGrid->startLine, hGrid->minSrcSubband ) ); hPrivateData->n_noise_bands = IGF_replaceTCXNoise_1( igf_spec, hPrivateData->headroom_TCX_noise_white, - hInstance->infoTCXNoise_evs, + hInstance->infoTCXNoise_ptr, hGrid->minSrcSubband, hGrid->startLine, &hPrivateData->totalNoiseNrg ); @@ -3529,13 +3529,13 @@ void IGFDecApplyMono_ivas( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in IF( EQ_16( hPrivateData->currWhiteningLevel[i], IGF_WHITENING_OFF ) ) { hPrivateData->headroom_TCX_noise = IGF_getScaleFactor32Cond( - hInstance->infoTCXNoise_evs + hGrid->minSrcSubband, + hInstance->infoTCXNoise_ptr, hPrivateData->pSpecFlat + hGrid->minSrcSubband, sub( hGrid->startLine, hGrid->minSrcSubband ) ); hPrivateData->n_noise_bands_off = IGF_replaceTCXNoise_1( hPrivateData->pSpecFlat, hPrivateData->headroom_TCX_noise, - hInstance->infoTCXNoise_evs, + hInstance->infoTCXNoise_ptr, hGrid->minSrcSubband, hGrid->startLine, &hPrivateData->totalNoiseNrg_off ); @@ -3546,7 +3546,7 @@ void IGFDecApplyMono_ivas( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in IGF_prep_ivas( hPrivateData, igfGridIdx, - hInstance->infoTCXNoise_evs, + hInstance->infoTCXNoise_ptr, igf_spec, igf_spec_e, hPrivateData->pSpecFlat, @@ -3574,11 +3574,11 @@ void IGFDecApplyMono_ivas( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in /* reset TCX noise indicator vector */ IF( EQ_16( igfGridIdx, IGF_GRID_LB_SHORT ) ) { - set16_fx( hInstance->infoTCXNoise_evs, 0, IGF_START_MX / 2 ); + set16_fx( hInstance->infoTCXNoise_ptr, 0, IGF_START_MX / 2 ); } ELSE { - set16_fx( hInstance->infoTCXNoise_evs, 0, IGF_START_MX ); + set16_fx( hInstance->infoTCXNoise_ptr, 0, IGF_START_MX ); } } @@ -3726,12 +3726,12 @@ void IGFDecApplyStereo( move16(); } - hPrivateDataL->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecL->infoTCXNoise_evs + hGrid->minSrcSubband, + hPrivateDataL->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecL->infoTCXNoise_ptr + hGrid->minSrcSubband, igf_specL_fx + hGrid->minSrcSubband, sub( hGrid->startLine, hGrid->minSrcSubband ) ); hPrivateDataL->n_noise_bands = IGF_replaceTCXNoise_1( igf_specL_fx, hPrivateDataL->headroom_TCX_noise_white, - hIGFDecL->infoTCXNoise_evs, + hIGFDecL->infoTCXNoise_ptr, hGrid->minSrcSubband, hGrid->startLine, &hPrivateDataL->totalNoiseNrg ); @@ -3758,12 +3758,12 @@ void IGFDecApplyStereo( move16(); } - hPrivateDataR->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecR->infoTCXNoise_evs + hGrid->minSrcSubband, + hPrivateDataR->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecR->infoTCXNoise_ptr, igf_specR_fx + hGrid->minSrcSubband, sub( hGrid->startLine, hGrid->minSrcSubband ) ); hPrivateDataR->n_noise_bands = IGF_replaceTCXNoise_1( igf_specR_fx, hPrivateDataR->headroom_TCX_noise_white, - hIGFDecR->infoTCXNoise_evs, + hIGFDecR->infoTCXNoise_ptr, hGrid->minSrcSubband, hGrid->startLine, &hPrivateDataR->totalNoiseNrg ); @@ -3778,23 +3778,23 @@ void IGFDecApplyStereo( test(); IF( EQ_16( hPrivateDataL->currWhiteningLevel[i], IGF_WHITENING_OFF ) || EQ_16( hPrivateDataR->currWhiteningLevel[i], IGF_WHITENING_OFF ) ) { - hPrivateDataL->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecL->infoTCXNoise_evs + hGrid->minSrcSubband, + hPrivateDataL->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecL->infoTCXNoise_ptr + hGrid->minSrcSubband, hPrivateDataL->pSpecFlat + hGrid->minSrcSubband, sub( hGrid->startLine, hGrid->minSrcSubband ) ); hPrivateDataL->n_noise_bands_off = IGF_replaceTCXNoise_1( hPrivateDataL->pSpecFlat, hPrivateDataL->headroom_TCX_noise_white, - hIGFDecL->infoTCXNoise_evs, + hIGFDecL->infoTCXNoise_ptr, hGrid->minSrcSubband, hGrid->startLine, &hPrivateDataL->totalNoiseNrg_off ); hPrivateDataL->totalNoiseNrg_off_exp = shl( sub( hPrivateDataL->pSpecFlat_exp, sub( hPrivateDataL->headroom_TCX_noise_white, 5 ) ), 1 ); - hPrivateDataR->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecR->infoTCXNoise_evs + hGrid->minSrcSubband, + hPrivateDataR->headroom_TCX_noise_white = IGF_getScaleFactor32Cond( hIGFDecR->infoTCXNoise_ptr, hPrivateDataR->pSpecFlat + hGrid->minSrcSubband, sub( hGrid->startLine, hGrid->minSrcSubband ) ); hPrivateDataR->n_noise_bands_off = IGF_replaceTCXNoise_1( hPrivateDataR->pSpecFlat, hPrivateDataR->headroom_TCX_noise_white, - hIGFDecR->infoTCXNoise_evs, + hIGFDecR->infoTCXNoise_ptr, hGrid->minSrcSubband, hGrid->startLine, &hPrivateDataR->totalNoiseNrg_off ); @@ -3818,8 +3818,8 @@ void IGFDecApplyStereo( IGF_prepStereo( hPrivateDataL, hPrivateDataR, igfGridIdx, - hIGFDecL->infoTCXNoise_evs, - hIGFDecR->infoTCXNoise_evs, + hIGFDecL->infoTCXNoise_ptr, + hIGFDecR->infoTCXNoise_ptr, igf_specL_fx, igf_specL_e_arr, igf_specR_fx, @@ -3887,13 +3887,13 @@ void IGFDecApplyStereo( /* reset TCX noise indicator vector */ IF( EQ_16( igfGridIdx, IGF_GRID_LB_SHORT ) ) { - set16_fx( hIGFDecL->infoTCXNoise_evs, 0, IGF_START_MX / 2 ); - set16_fx( hIGFDecR->infoTCXNoise_evs, 0, IGF_START_MX / 2 ); + set16_fx( hIGFDecL->infoTCXNoise_ptr, 0, IGF_START_MX / 2 ); + set16_fx( hIGFDecR->infoTCXNoise_ptr, 0, IGF_START_MX / 2 ); } ELSE { - set16_fx( hIGFDecL->infoTCXNoise_evs, 0, IGF_START_MX ); - set16_fx( hIGFDecR->infoTCXNoise_evs, 0, IGF_START_MX ); + set16_fx( hIGFDecL->infoTCXNoise_ptr, 0, IGF_START_MX ); + set16_fx( hIGFDecR->infoTCXNoise_ptr, 0, IGF_START_MX ); } return; -- GitLab