Commit 818afcf4 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

LTV testing with all changes merged

parent bbfbe899
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -10830,8 +10830,8 @@ void ProcessStereoIGF_fx(
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV],        /* i  : inverse spectrum                        */
    const Word16 frameno,                                 /* i  : flag indicating index of current subfr. */
    const Word16 sp_aud_decision0,                        /* i  : sp_aud_decision0                        */
    const Word32 element_brate                            /* i  : element bitrate                         */
);
    const Word32 element_brate,                           /* i  : element bitrate                         */
    const Word16 mct_on );
/*igf_enc.c*/
void IGFEncApplyStereo_fx(
    STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct,              /* i/o: MDCT stereo encoder structure           */
@@ -10844,8 +10844,8 @@ void IGFEncApplyStereo_fx(
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV],        /* i  : inverse spectrum                        */
    const Word16 frameno,                                 /* i  : flag indicating index of current subfr. */
    const Word16 sp_aud_decision0,                        /* i  : sp_aud_decision0                        */
    const Word32 element_brate                            /* i  : element bitrate                         */
);
    const Word32 element_brate,                           /* i  : element bitrate                         */
    const Word16 mct_on );
void IGFSaveSpectrumForITF_ivas_fx(
    IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder  */
+1 −1
Original line number Diff line number Diff line
@@ -3753,7 +3753,7 @@ void GenShapedSHBExcitation_ivas_enc_fx(
    IF( LT_32( bitrate, ACELP_24k40 ) )
#endif
    {
        syn_filt_fx( 0, lpc_shb, LPC_SHB_ORDER, exc16kWhtnd, excSHB, L_FRAME16k, state_lpc_syn, 1 );
        Syn_filt_s( 0, lpc_shb, LPC_SHB_ORDER, exc16kWhtnd, excSHB, L_FRAME16k, state_lpc_syn, 1 );
        /* i: exc16kWhtnd in Q_bwe_exc */
        /* o: excSHB in Q_bwe_exc */
    }
+22 −22
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ void wtda_ivas_fx(

void wtda_ext_fx(
    const Word16 *new_audio,  /* i  : input audio (Q_in)                  */
    Word16 *wtda_audio,       /* o  : windowed audio (Q_in)               */
    Word16 *wtda_audio,       /* o  : windowed audio (Q_in - 1)           */
    const Word16 left_mode,   /* i  : window overlap of previous frame (0: full, 2: none, or 3: half) */
    const Word16 right_mode,  /* i  : window overlap of current frame (0: full, 2: none, or 3: half) */
    const Word16 L,           /* i  : length                              */
@@ -628,10 +628,10 @@ void wtda_ext_fx(
            FOR( i = 0; i < L / 2 - n; i += 2 )
            {
                wtda_audio[i] = round_fx( L_mac0( L_mult0( negate( allsig_r[L / 2 - i - 1] ), win_int_right[3 * L_FRAME16k / 2 - i / 2 - 1 - windecay16] ),
                                                  allsig_r[L / 2 + i], win_int_right[3 * L_FRAME16k / 2 + i / 2 - windecay16] ) ); // q_in
                                                  allsig_r[L / 2 + i], win_int_right[3 * L_FRAME16k / 2 + i / 2 - windecay16] ) ); // q_in - 1
                move16();
                wtda_audio[i + 1] = round_fx( L_mac0( L_mult0( negate( allsig_r[L / 2 - ( i + 1 ) - 1] ), win_right[( 3 * L_FRAME16k / 2 - i / 2 - 1 ) * decimate + decay - windecay48] ),
                                                      allsig_r[L / 2 + i + 1], win_right[( 3 * L_FRAME16k / 2 + 1 + i / 2 ) * decimate - decay - 1 - windecay48] ) ); // q_in
                                                      allsig_r[L / 2 + i + 1], win_right[( 3 * L_FRAME16k / 2 + 1 + i / 2 ) * decimate - decay - 1 - windecay48] ) ); // q_in - 1
                move16();
            }
        }
@@ -640,19 +640,19 @@ void wtda_ext_fx(
            FOR( i = 0; i < L / 2 - n; i += 2 )
            {
                wtda_audio[i] = round_fx( L_msu0( L_mult0( negate( allsig_r[L / 2 - i - 1] ), win_int_right[3 * L_FRAME16k / 2 - i / 2 - 1 - windecay16] ),
                                                  allsig_r[L / 2 + i], win_int_right[3 * L_FRAME16k / 2 + i / 2 - windecay16] ) ); // q_in
                                                  allsig_r[L / 2 + i], win_int_right[3 * L_FRAME16k / 2 + i / 2 - windecay16] ) ); // q_in - 1
                move16();
                wtda_audio[i + 1] = round_fx( L_msu0( L_mult0( negate( allsig_r[L / 2 - ( i + 1 ) - 1] ), win_right[( 3 * L_FRAME16k / 2 - i / 2 - 1 ) * decimate + decay - windecay48] ),
                                                      allsig_r[L / 2 + i + 1], win_right[( 3 * L_FRAME16k / 2 + 1 + i / 2 ) * decimate - decay - 1 - windecay48] ) ); // q_in
                                                      allsig_r[L / 2 + i + 1], win_right[( 3 * L_FRAME16k / 2 + 1 + i / 2 ) * decimate - decay - 1 - windecay48] ) ); // q_in - 1
                move16();
            }
        }

        FOR( i = L / 2 - n; i < L / 2; i += 2 )
        {
            wtda_audio[i] = shr( negate( allsig_r[L / 2 - i - 1] ), 1 ); // q_in
            wtda_audio[i] = shr( negate( allsig_r[L / 2 - i - 1] ), 1 ); // q_in - 1
            move16();
            wtda_audio[i + 1] = shr( negate( allsig_r[L / 2 - ( i + 1 ) - 1] ), 1 ); // q_in
            wtda_audio[i + 1] = shr( negate( allsig_r[L / 2 - ( i + 1 ) - 1] ), 1 ); // q_in - 1
            move16();
        }

@@ -661,20 +661,20 @@ void wtda_ext_fx(
            FOR( i = 0; i < n; i += 2 )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( negate( allsig_l[i] ), win_left[( i / 2 ) * decimate + decay] ),
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in - 1
                move16();
                wtda_audio[i + L / 2 + 1] = round_fx( L_msu0( L_mult0( negate( allsig_l[i + 1] ), win_int_left[i / 2] ),
                                                              new_audio[n - ( i + 1 ) - 1], MAX16B ) ); // q_in
                                                              new_audio[n - ( i + 1 ) - 1], MAX16B ) ); // q_in - 1
                move16();
            }

            FOR( i = n; i < L / 2; i += 2 )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( negate( allsig_l[i] ), win_left[( i / 2 ) * decimate + decay] ),
                                                          allsig_l[L - i - 1], win_left[( L / 2 - i / 2 ) * decimate - 1 - decay] ) ); // q_in
                                                          allsig_l[L - i - 1], win_left[( L / 2 - i / 2 ) * decimate - 1 - decay] ) ); // q_in - 1
                move16();
                wtda_audio[i + L / 2 + 1] = round_fx( L_msu0( L_mult0( negate( allsig_l[i + 1] ), win_int_left[i / 2] ),
                                                              allsig_l[L - ( i + 1 ) - 1], win_int_left[L / 2 - i / 2 - 1] ) ); // q_in
                                                              allsig_l[L - ( i + 1 ) - 1], win_int_left[L / 2 - i / 2 - 1] ) ); // q_in - 1
                move16();
            }
        }
@@ -683,20 +683,20 @@ void wtda_ext_fx(
            FOR( i = 0; i < n; i += 2 )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( allsig_l[i], win_left[( i / 2 ) * decimate + decay] ),
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in - 1
                move16();
                wtda_audio[i + L / 2 + 1] = round_fx( L_msu0( L_mult0( allsig_l[i + 1], win_int_left[i / 2] ),
                                                              new_audio[n - ( i + 1 ) - 1], MAX16B ) ); // q_in
                                                              new_audio[n - ( i + 1 ) - 1], MAX16B ) ); // q_in - 1
                move16();
            }

            FOR( i = n; i < L / 2; i += 2 )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( allsig_l[i], win_left[( i / 2 ) * decimate + decay] ),
                                                          allsig_l[L - i - 1], win_left[( L / 2 - i / 2 ) * decimate - 1 - decay] ) ); // q_in
                                                          allsig_l[L - i - 1], win_left[( L / 2 - i / 2 ) * decimate - 1 - decay] ) ); // q_in - 1
                move16();
                wtda_audio[i + L / 2 + 1] = round_fx( L_msu0( L_mult0( allsig_l[i + 1], win_int_left[i / 2] ),
                                                              allsig_l[L - ( i + 1 ) - 1], win_int_left[L / 2 - i / 2 - 1] ) ); // q_in
                                                              allsig_l[L - ( i + 1 ) - 1], win_int_left[L / 2 - i / 2 - 1] ) ); // q_in - 1
                move16();
            }
        }
@@ -708,7 +708,7 @@ void wtda_ext_fx(
            FOR( i = 0; i < L / 2 - n; i++ )
            {
                wtda_audio[i] = round_fx( L_mac0( L_mult0( negate( allsig_r[L / 2 - i - 1] ), win_right[3 * L / 2 * decimate - ( i + 1 ) * decimate + decay - windecay48] ),
                                                  allsig_r[L / 2 + i], win_right[3 * L / 2 * decimate - 1 + ( i + 1 ) * decimate - decay - windecay48] ) ); // q_in
                                                  allsig_r[L / 2 + i], win_right[3 * L / 2 * decimate - 1 + ( i + 1 ) * decimate - decay - windecay48] ) ); // q_in - 1
                move16();
            }
        }
@@ -717,14 +717,14 @@ void wtda_ext_fx(
            FOR( i = 0; i < L / 2 - n; i++ )
            {
                wtda_audio[i] = round_fx( L_msu0( L_mult0( negate( allsig_r[L / 2 - i - 1] ), win_right[3 * L / 2 * decimate - ( i + 1 ) * decimate + decay - windecay48] ),
                                                  allsig_r[L / 2 + i], win_right[3 * L / 2 * decimate - 1 + ( i + 1 ) * decimate - decay - windecay48] ) ); // q_in
                                                  allsig_r[L / 2 + i], win_right[3 * L / 2 * decimate - 1 + ( i + 1 ) * decimate - decay - windecay48] ) ); // q_in - 1
                move16();
            }
        }

        FOR( i = L / 2 - n; i < L / 2; i++ )
        {
            wtda_audio[i] = shr( negate( allsig_r[L / 2 - i - 1] ), 1 ); // q_in
            wtda_audio[i] = shr( negate( allsig_r[L / 2 - i - 1] ), 1 ); // q_in - 1
            move16();
        }

@@ -733,14 +733,14 @@ void wtda_ext_fx(
            FOR( i = 0; i < n; i++ )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( negate( allsig_l[i] ), win_left[i * decimate + decay] ),
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in - 1
                move16();
            }

            FOR( i = n; i < L / 2; i++ )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( negate( allsig_l[i] ), win_left[i * decimate + decay] ),
                                                          allsig_l[L - i - 1], win_left[L * decimate - i * decimate - 1 - decay] ) ); // q_in
                                                          allsig_l[L - i - 1], win_left[L * decimate - i * decimate - 1 - decay] ) ); // q_in - 1
                move16();
            }
        }
@@ -749,14 +749,14 @@ void wtda_ext_fx(
            FOR( i = 0; i < n; i++ )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( allsig_l[i], win_left[i * decimate + decay] ),
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in
                                                          new_audio[n - i - 1], MAX16B ) ); // q_in - 1
                move16();
            }

            FOR( i = n; i < L / 2; i++ )
            {
                wtda_audio[i + L / 2] = round_fx( L_msu0( L_mult0( allsig_l[i], win_left[i * decimate + decay] ),
                                                          allsig_l[L - i - 1], win_left[L * decimate - i * decimate - 1 - decay] ) ); // q_in
                                                          allsig_l[L - i - 1], win_left[L * decimate - i * decimate - 1 - decay] ) ); // q_in - 1
                move16();
            }
        }
+10 −0
Original line number Diff line number Diff line
@@ -505,6 +505,16 @@ void gain_dec_mless_fx(

        L_tmp = Dot_product12( code_fx, code_fx, L_SUBFR, &expg ); /*Q31 - expg*/
        expg = sub( expg, 18 + 6 );                                /* exp: -18 (code in Q9), -6 (/L_SUBFR) */

        // To avoid crash in case code value is 0
        IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_tmp, expg, 21474836, 0 ), -1 ) )
        {
            L_tmp = 21474836;
            expg = 0;
            move32();
            move16();
        }

        expg2 = expg;
        move16();
        L_tmp1 = L_tmp; /* sets to 'L_tmp' in 1 clock */
+5 −5
Original line number Diff line number Diff line
@@ -703,7 +703,7 @@ static void IGF_CalculateEnvelope_ivas_fx(
                        BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sfb], hPrivateData->sfb_sb_e[sfb], negate( hPrivateData->SFM_tb_fx[sfb] ), hPrivateData->sfb_tb_e[sfb], &diffSFM );

                        test();
                        IF( diffSFM > 0 && LT_32( hPrivateData->SFM_tb_fx[sfb], L_shr( 3277 /*0.1 Q15*/, tmp_tb_e ) ) ) /* check whether target SFB is more tonal than source SFB */
                        IF( diffSFM > 0 && LT_32( hPrivateData->SFM_tb_fx[sfb], L_shr( 3277 /*0.1 Q15*/, hPrivateData->sfb_tb_e[sfb] ) ) ) /* check whether target SFB is more tonal than source SFB */
                        {
                            Word16 currDampingFactor, dampingFactor;
                            Word16 slope, threshold;
@@ -2668,7 +2668,7 @@ void IGFEncApplyMono_ivas_fx(
            move16();
        }
    }
    IGF_ErodeSpectrum( &highPassEner_exp, st->hIGFEnc, pMDCTSpectrum_fx, pPowerSpectrumParameter_fx, common_pPowerSpectrum_exp, igfGridIdx );
    IGF_ErodeSpectrum_ivas_fx( &highPassEner_exp, st->hIGFEnc, pMDCTSpectrum_fx, pPowerSpectrumParameter_fx, common_pPowerSpectrum_exp, igfGridIdx, 0 );
}


@@ -2689,8 +2689,8 @@ void IGFEncApplyStereo_fx(
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV],        /* i  : inverse spectrum                        */
    const Word16 frameno,                                 /* i  : flag indicating index of current subfr. */
    const Word16 sp_aud_decision0,                        /* i  : sp_aud_decision0                        */
    const Word32 element_brate                            /* i  : element bitrate                         */
)
    const Word32 element_brate,                           /* i  : element bitrate                         */
    const Word16 mct_on )
{
    Word16 highPassEner_exp;
    Word32 *pPowerSpectrumParameter_fx[NB_DIV]; /* If it is NULL it informs a function that specific handling is needed */
@@ -2766,7 +2766,7 @@ void IGFEncApplyStereo_fx(

        IGF_Whitening_ivas_fx( hIGFEnc[ch], pPowerSpectrumParameter_fx[ch], &exp_pPowerSpectrum[0], igfGridIdx, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, ( sts[0]->hTcxEnc->fUseTns[frameno] || sts[1]->hTcxEnc->fUseTns[frameno] ), sp_aud_decision0, element_brate, sts[ch]->element_mode );

        IGF_ErodeSpectrum( &highPassEner_exp, hIGFEnc[ch], sts[ch]->hTcxEnc->spectrum_fx[frameno], pPowerSpectrumParameter_fx[ch], sts[ch]->hTcxEnc->spectrum_e[frameno], igfGridIdx );
        IGF_ErodeSpectrum_ivas_fx( &highPassEner_exp, hIGFEnc[ch], sts[ch]->hTcxEnc->spectrum_fx[frameno], pPowerSpectrumParameter_fx[ch], sts[ch]->hTcxEnc->spectrum_e[frameno], igfGridIdx, mct_on );
    }
    return;
}
Loading