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

LTV test of all MRs

parent 182c2a50
Loading
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -675,12 +675,6 @@ ivas_error ivas_core_enc_fx(
            wb_bwe_enc_ivas_fx( st, new_inp_resamp16k_fx[n] );
        }

        IF( st->hBWE_FD != NULL )
        {
            Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, Q1 ); // Q-1 -> Q0
            st->Q_old_wtda = add( st->Q_old_wtda, Q1 );
            move16();
        }

        /*---------------------------------------------------------------------*
         * SWB(FB) TBE encoding
@@ -725,8 +719,6 @@ ivas_error ivas_core_enc_fx(
            Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, shift ); // st->Q_old_wtda
        }

        Word16 q_new_swb_speech_buffer = getScaleFactor16( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX );
        Scale_sig( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX, q_new_swb_speech_buffer ); // Q0->q_new_swb_speech_buffer

        /* SWB TBE encoder */
        test();
@@ -751,10 +743,8 @@ ivas_error ivas_core_enc_fx(
        ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) )
        {
            Copy_Scale_sig_32_16( shb_speech_fx32, shb_speech_fx, L_FRAME16k, -Q16 ); // Q_shb_spch - 16
            Scale_sig( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX, negate( q_new_swb_speech_buffer ) ); // q_new_swb_speech_buffer -> Q0
            /* SWB(FB) BWE encoder */
            swb_bwe_enc_ivas_fx( st, last_element_mode, old_inp_12k8_fx[n], old_inp_16k_fx[n], old_syn_12k8_16k_fx[n], new_swb_speech_fx_16, shb_speech_fx, sub( Q_shb_spch, Q16 ), sub( Q_new[n], 1 ) );
            Scale_sig( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX, q_new_swb_speech_buffer ); // Q0 -> q_new_swb_speech_buffer
            swb_bwe_enc_ivas_fx( st, last_element_mode, old_inp_12k8_fx[n], old_inp_16k_fx[n], old_syn_12k8_16k_fx[n], new_swb_speech_fx_16, st->q_inp, shb_speech_fx, sub( Q_shb_spch, Q16 ), sub( Q_new[n], 1 ) );
        }

        Scale_sig( old_syn_12k8_16k_fx[n], L_FRAME16k, sub( Q1, Q_new[n] ) ); // Q0
@@ -776,6 +766,9 @@ ivas_error ivas_core_enc_fx(
         *  Inter-channel BWE encoding
         *-------------------------------------------------------------------*/

        Word16 q_new_swb_speech_buffer = getScaleFactor16( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX );
        Scale_sig( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX, q_new_swb_speech_buffer ); // st->q_inp+q_new_swb_speech_buffer
        q_new_swb_speech_buffer = add( st->q_inp, q_new_swb_speech_buffer );
        test();
        test();
        IF( n == 0 && GE_32( input_Fs, 32000 ) && hStereoICBWE != NULL )
@@ -784,7 +777,7 @@ ivas_error ivas_core_enc_fx(
            stereo_icBWE_preproc_fx( hCPE, input_frame, new_swb_speech_buffer_fx_16 /*tmp buffer*/, q_new_swb_speech_buffer );

            q_new_swb_speech_buffer = add( q_new_swb_speech_buffer, 16 );
            Copy_Scale_sig_16_32_no_sat( new_swb_speech_buffer_fx_16, new_swb_speech_buffer_fx, L_FRAME48k + STEREO_DFT_OVL_MAX, Q16 ); // q_new_swb_speech_buffer - 16 - > q_new_swb_speech_buffer
            Copy_Scale_sig_16_32_no_sat( new_swb_speech_buffer_fx_16, new_swb_speech_buffer_fx, L_FRAME48k + STEREO_DFT_OVL_MAX, Q16 ); // q_new_swb_speech_buffer+st->q_inp - 16 - > q_new_swb_speech_buffer+st->q_inp
            Copy_Scale_sig_16_32_no_sat( voice_factors_fx[0], voice_factors_fx32[0], NB_SUBFR16k, Q16 );                                // Q31

            stereo_icBWE_enc_ivas_fx( hCPE, shb_speech_fx32, sub( Q31, Q_shb_spch ), new_swb_speech_buffer_fx, sub( Q31, q_new_swb_speech_buffer ), voice_factors_fx32[0] );
+1 −1
Original line number Diff line number Diff line
@@ -1425,7 +1425,7 @@ ivas_error pre_proc_front_ivas_fx(
     * TC frame selection
     *-----------------------------------------------------------------*/

    st->clas = signal_clas_fx( st, inp_12k8_fx, ee_fx, *relE_fx, L_look, tdm_SM_last_clas ); /* Q0 */
    st->clas = signal_clas_ivas_fx( st, inp_12k8_fx, ee_fx, *relE_fx, L_look, tdm_SM_last_clas ); /* Q0 */
    move16();

    select_TC_fx( MODE1, st->tc_cnt, &st->coder_type, st->localVAD );
+11 −4
Original line number Diff line number Diff line
@@ -887,7 +887,10 @@ ivas_error ivas_compute_core_buffers_fx(
            IF( EQ_16( st->bwidth, WB ) )
            {
                Copy_Scale_sig( new_inp_16k_fx - delay, st->hBWE_FD->old_input_wb_fx, delay, negate( add( Q_old_inp_16k, 1 ) ) ); /* Scaling to Q(-1) */
                Copy( new_inp_16k_fx - STEREO_DFT_OVL_16k, st->hBWE_FD->L_old_wtda_swb_fx + L_FRAME16k - STEREO_DFT_OVL_16k + delay, sub( STEREO_DFT_OVL_16k, delay ) ); /* Check Q here once. Q should be Q_old_wtda */
                scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, sub( Q_old_inp_16k, st->Q_old_wtda ) );                    // st->Q_old_wtda->Q_old_inp_16k
                Copy( new_inp_16k_fx - STEREO_DFT_OVL_16k, st->hBWE_FD->L_old_wtda_swb_fx + L_FRAME16k - STEREO_DFT_OVL_16k + delay, sub( STEREO_DFT_OVL_16k, delay ) );
                st->Q_old_wtda = Q_old_inp_16k;
                move16();
            }
        }
        ELSE IF( EQ_16( element_mode, IVAS_CPE_TD ) )
@@ -899,7 +902,10 @@ ivas_error ivas_compute_core_buffers_fx(
            IF( EQ_16( st->bwidth, WB ) && st->hBWE_FD != NULL )
            {
                Copy_Scale_sig( new_inp_16k_fx + L_FILT16k - delay, st->hBWE_FD->old_input_wb_fx, delay, negate( add( Q_old_inp_16k, 1 ) ) ); /* Scaling to Q(-1) */
                Copy( new_inp_16k_fx - L_MEM_RECALC_16K, st->hBWE_FD->L_old_wtda_swb_fx + L_FRAME16k - L_MEM_RECALC_16K - L_FILT16k + delay, sub( L_MEM_RECALC_16K + L_FILT16k, delay ) ); /* Check Q here once. Q should be Q_old_wtda */
                scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, sub( Q_old_inp_16k, st->Q_old_wtda ) );                                // st->Q_old_wtda->Q_old_inp_16k
                Copy( new_inp_16k_fx - L_MEM_RECALC_16K, st->hBWE_FD->L_old_wtda_swb_fx + L_FRAME16k - L_MEM_RECALC_16K - L_FILT16k + delay, sub( L_MEM_RECALC_16K + L_FILT16k, delay ) );
                st->Q_old_wtda = Q_old_inp_16k;
                move16();
            }
        }
        ELSE IF( element_mode == IVAS_SCE )
@@ -1132,6 +1138,7 @@ ivas_error ivas_compute_core_buffers_fx(
            Copy( st->lsp_old1_fx, st->lspold_enc_fx, M ); /* Q15 */
        }


        IF( Q_new )
        {
#ifdef REMOVE_EVS_DUPLICATES
+7 −6
Original line number Diff line number Diff line
@@ -2254,6 +2254,7 @@ void noise_est_ivas_fx(
    Word16 tmp_enr, tmp_floor; /* constants in Q8 */
    Word16 vad_bwidth_fx;      /* vad ns  control variabel for input bwidth from teh BWD  */
    /* for DTX operation */
    Word32 L_tmp;

    Word16 lim_Etot_fx;    /* Q8 */
    Word32 lim_Etot_sq_fx; /* Q16 */
@@ -3002,7 +3003,7 @@ void noise_est_ivas_fx(
    } */
    IF( *st_harm_cor_cnt == 0 )
    {
        hNoiseEst->lt_haco_ev_fx = mac_r( 64424509 /* 0.03 in Q32*/, hNoiseEst->lt_haco_ev_fx, 31785 /* 0.97 in Q15*/ ); // Q15
        hNoiseEst->lt_haco_ev_fx = mac_r( 64424509 /* 0.03 in Q31*/, hNoiseEst->lt_haco_ev_fx, 31785 /* 0.97 in Q15*/ ); // Q15
        move16();
    }
    ELSE
@@ -3559,14 +3560,14 @@ void noise_est_ivas_fx(
    }
    /*st->lt_aEn_zero = 0.2f * (st->aEn==0) + (1-0.2f)  *st->lt_aEn_zero;*/
    /*  y(n+1)=        alpha*tmp            + (1-alpha)*y(n)           */
    tmp = 0;
    move16();
    L_tmp = 0;
    move32();
    if ( hNoiseEst->aEn == 0 )
    {
        tmp = 6554; // 0.2 in Q15
        move16();
        L_tmp = 429496730; // 0.2 in Q31
        move32();
    }
    hNoiseEst->lt_aEn_zero_fx = mac_r( tmp, hNoiseEst->lt_aEn_zero_fx, 26214 /* 0.8 in Q15*/ ); // Q15
    hNoiseEst->lt_aEn_zero_fx = mac_r( L_tmp, hNoiseEst->lt_aEn_zero_fx, 26214 /* 0.8 in Q15*/ ); // Q15
    move16();

    IF( st_fx->element_mode > EVS_MONO )
+10 −0
Original line number Diff line number Diff line
@@ -570,6 +570,15 @@ Word16 signal_clas_fx( /* o : classification for current
                       Word16 *uc_clas       /* o  : temporary classification used in music/speech class*/
);

Word16 signal_clas_ivas_fx(                       /* o  : classification for current frames              */
                            Encoder_State *st,    /* i/o: encoder state structure                           */
                            const Word16 *speech, /* i  : pointer to speech signal for E computation        */
                            const Word32 *ee,     /* i  : lf/hf E ration for 2 half-frames                  */
                            const Word16 relE,    /* i  : frame relative E to the long term average         */
                            const Word16 L_look,  /* i  : look-ahead                                        */
                            Word16 *uc_clas       /* o  : temporary classification used in music/speech class*/
);

void speech_music_classif_fx(
    Encoder_State *st,            /* i/o: state structure                                 */
    const Word16 *new_inp,        /* i  : new input signal                                */
@@ -639,6 +648,7 @@ void swb_bwe_enc_ivas_fx(
    Word16 *old_input_16k_fx,          /* i  : input signal @16kHz for SWB BWE         */
    const Word16 *old_syn_12k8_16k_fx, /* i  : ACELP core synthesis at 12.8kHz or 16kHz */
    const Word16 *new_swb_speech_fx,   /* i  : original input signal at 32kHz           */
    const Word16 Q_new_swb_speech,     /* i  : Q for new_swb_speech_fx                  */
    Word16 *shb_speech_fx,             /* i  : SHB target signal (6-14kHz) at 16kHz     */
    Word16 Q_shb_speech,
    Word16 Q_slb_speech );
Loading