Commit 836200e6 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_788_fix_1' into 'main'

Fix for issue 788: Distortion between 10k to 20k in fixe point OSBA Mono output

See merge request !424
parents 7e061fca a038b9f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+21 −21
Original line number Diff line number Diff line
@@ -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;