Commit a8e2c96b authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

TNS bug fixes, updates in swb_tbe_enc and lp_filt_exc_enc_ivas_fx

parent 2b068b61
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ void TNSAnalysisStereo_fx(
                                    Word16 maxEnergyChange_fx;
                                    maxEnergyChange_fx = mac_r( L_mult( GetTCXMaxenergyChange_ivas_fx( sts[0]->hTranDet, isTCX10, NSUBBLOCKS, 3 ), 16384 ), GetTCXMaxenergyChange_ivas_fx( sts[1]->hTranDet, isTCX10, NSUBBLOCKS, 3 ), 16384 );

                                    IF( GE_16( maxEnergyChange_fx, pTnsParameters[0]->minEnergyChange ) )
                                    IF( GE_16( maxEnergyChange_fx, L_shl( pTnsParameters[0]->minEnergyChange, Q3 - Q7 ) ) )
                                    {
                                        sts[0]->hTcxEnc->tnsData[k].nFilters = add( sts[0]->hTcxEnc->tnsData[k].nFilters, 1 );
                                        move16();
@@ -552,7 +552,7 @@ void TNSAnalysisStereo_fx(
                        {
                            Word16 maxEnergyChange_fx = GetTCXMaxenergyChange_ivas_fx( sts[ch]->hTranDet, isTCX10, NSUBBLOCKS, 3 );

                            IF( GE_16( maxEnergyChange_fx, pTnsParameters->minEnergyChange ) )
                            IF( GE_16( maxEnergyChange_fx, L_shl( pTnsParameters->minEnergyChange, Q3 - Q7 ) ) )
                            {
                                sts[ch]->hTcxEnc->tnsData[k].nFilters = add( sts[ch]->hTcxEnc->tnsData[k].nFilters, 1 );
                                move16();
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ Word16 lp_filt_exc_enc_ivas_fx(
        }
        IF( use_prev_sf_pit_gain == 1 )
        {
            wtmp1 = adpt_enr_fx( codec_mode, exc_tmp, h1, y1_tmp, L_subfr, &gain2, gain_pit, clip_gain, xn, xn2_tmp, &exp_ener1, use_prev_sf_pit_gain );
            wtmp1 = adpt_enr_fx( codec_mode, exc_tmp, h1, y1_tmp, L_subfr, gain_pit, g_corr2, clip_gain, xn, xn2_tmp, &exp_ener1, use_prev_sf_pit_gain );
        }
        ELSE
        {
+3 −3
Original line number Diff line number Diff line
@@ -4049,7 +4049,9 @@ void swb_tbe_enc_ivas_fx(
    {
        /* Re-normalize gain shape before quantization */
        // sum_gain = sum2_f(GainShape, NUM_SHB_SUBGAINS);
        sum_gain_fx = sum16_32_fx( GainShape_fx, NUM_SHB_SUBGAINS );
        tmp = 0;
        move16();
        sum_gain_fx = sum2_16_exp_fx( GainShape_fx, NUM_SHB_SUBGAINS, &tmp, 2 );
        IF( sum_gain_fx == 0 )
        {
            normFact_fx = 0;
@@ -4058,8 +4060,6 @@ void swb_tbe_enc_ivas_fx(
        ELSE
        {
            // normFact = (float) sqrt( 1.0f / sum_gain );
            tmp = Q16;
            move16();
            normFact_fx = ISqrt32( sum_gain_fx, &tmp );
        }

+1 −1
Original line number Diff line number Diff line
@@ -675,7 +675,7 @@ Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configur
            ELSE
            {
                maxEnergyChange = GetTCXMaxenergyChange_ivas_fx( hTranDet, isTCX10, NSUBBLOCKS, 3 );
                IF( sub( maxEnergyChange, pTnsParameters->minEnergyChange ) >= 0 )
                IF( sub( maxEnergyChange, L_shl( pTnsParameters->minEnergyChange, Q3 - Q7 ) ) >= 0 )
                {

                    pTnsData->nFilters = add( pTnsData->nFilters, 1 );