Commit a71e14ce authored by vaillancour's avatar vaillancour
Browse files

fixing small issues

parent f10f08a4
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1296,7 +1296,7 @@ ivas_error acelp_core_enc_ivas_fx(
         *---------------------------------------------------------------*/

        calc_residu_fx( st, inp, res_fx, Aq );
#if 1 // def REUSE_EVS_ACELP_SHIFT // This should be moved outside of ACELP
#ifdef REUSE_EVS_ACELP_SHIFT // This should be moved outside of ACELP
        {
            Word16 tmp, max;
            max = 0;
+8 −13
Original line number Diff line number Diff line
@@ -115,9 +115,7 @@ void encod_gen_voic_fx(
    Flag Overflow = 0;
    move32();
#endif
#ifdef REUSE_EVS_ACELP
    Word16 q_h1;
#endif

    SC_VBR_ENC_HANDLE hSC_VBR = st_fx->hSC_VBR;
    BSTR_ENC_HANDLE hBstr = st_fx->hBstr;
    SP_MUS_CLAS_HANDLE hSpMusClas = st_fx->hSpMusClas;
@@ -204,22 +202,15 @@ void encod_gen_voic_fx(
         *----------------------------------------------------------------*/

        Copy( &res_fx[i_subfr_fx], &exc_fx[i_subfr_fx], L_SUBFR ); /*Q_new*/
#ifdef REUSE_EVS_ACELP
        IF( st_fx->element_mode > EVS_MONO )
#ifdef USE_NEW_TARGET
        IF( st_fx->element_mode > EVS_MONO && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
        {
            // find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
            //                           res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );
            // q_h1 = sub( 14, norm_s( h1_fx[0] ) );
            // Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/
            // Scale_sig( h1_fx, L_SUBFR, add( sub( 14, q_h1 ), shift ) );


            Word16 q_h1;
            find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
                                  res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );

            q_h1 = sub( 14, norm_s( h1_fx[0] ) );
            Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/
            // Scale_sig( h1_fx, L_SUBFR, sub( 14, q_h1 ) );             /* set h1[] in Q14 with scaling for convolution Q14*/
            Scale_sig( h1_fx, L_SUBFR, add( sub( 14, q_h1 ), shift ) );
        }
        ELSE
@@ -343,7 +334,11 @@ void encod_gen_voic_fx(
         *-----------------------------------------------------------------*/

        test();
#ifdef REUSE_EVS_ACELP
        IF( !st_fx->inactive_coder_type_flag && EQ_16( st_fx->coder_type, INACTIVE ) )
#else
        IF( GE_32( st_fx->core_brate, MAX_GSC_INACTIVE_BRATE ) && EQ_16( st_fx->coder_type, INACTIVE ) )
#endif
        {
            transf_cdbk_enc_fx( st_fx, 0, i_subfr_fx, cn_fx, exc_fx, p_Aq_fx, p_Aw_fx, h1_fx, xn_fx, xn2_fx, y1_fx, y2_fx,
                                Es_pred_fx, &gain_pit_fx, gain_code_fx, g_corr_fx, clip_gain_fx, &gain_preQ_fx, code_preQ_fx, unbits_fx, Q_new, shift );
+7 −1
Original line number Diff line number Diff line
@@ -720,7 +720,7 @@ void enc_pit_exc_ivas_fx(
         *----------------------------------------------------------------*/
        Copy( &res[i_subfr], &exc[i_subfr], L_subfr ); /* Q_new */
        /* condition on target (compared to float) has been put outside the loop */

#ifdef USE_NEW_TARGET
        find_targets_ivas_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq,
                              res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 );

@@ -731,6 +731,12 @@ void enc_pit_exc_ivas_fx(
        Copy_Scale_sig( h1, h2, L_subfr, add( sub( 11, q_h1 ), shift ) ); /*Q11*/
        move16();
        Scale_sig( h1, L_subfr, sub( 14, q_h1 ) ); /* set h1[] in Q14 with scaling for convolution Q14*/
#endif
#else
        find_targets_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hGSCEnc->mem_w0_tmp_fx, p_Aq,
                         res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 );
        Copy_Scale_sig( h1, h2, L_subfr, -2 );
        Scale_sig( h1, L_subfr, add( 1, shift ) ); /* set h1[] in Q14 with scaling for convolution */
#endif
        /* scaling of xn[] to limit dynamic at 12 bits */
        Scale_sig( xn, L_subfr, shift ); /* Q_new - 1 + shift */
+8 −15
Original line number Diff line number Diff line
@@ -96,14 +96,13 @@ Word16 encod_tran_fx(
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#ifdef REUSE_EVS_ACELP_TC
    Word16 q_h1;
#endif
    BSTR_ENC_HANDLE hBstr = st_fx->hBstr;
    SC_VBR_ENC_HANDLE hSC_VBR = st_fx->hSC_VBR;
    LPD_state_HANDLE hLPDmem = st_fx->hLPDmem;

#ifdef REUSE_EVS_ACELP_TC
    set16_fx( h1, 0, L_SUBFR + ( M + 1 ) );
#endif
    L_frame_fx = st_fx->L_frame;
    move16();
    /*------------------------------------------------------------------*
@@ -165,21 +164,15 @@ Word16 encod_tran_fx(
         *----------------------------------------------------------------*/

        Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */
#ifdef REUSE_EVS_ACELP_TC
        IF( st_fx->element_mode > EVS_MONO )
#ifdef USE_NEW_TARGET
        IF( st_fx->element_mode > EVS_MONO && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
        {
            // find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
            //                           res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 );
            // q_h1 = sub( 14, norm_s( h1[0] ) );
            // Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) );   /*Q11*/
            // Scale_sig( h1, L_SUBFR, add( sub( 14, q_h1 ), shift ) ); /* set h1[] in Q14 with scaling for convolution Q14*/
            Word16 q_h1;
            find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
                             res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 );

            q_h1 = sub( 14, norm_s( h1[0] ) );
            Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/
            // Scale_sig( h1, L_SUBFR, sub( 14, q_h1 ) );             /* set h1[] in Q14 with scaling for convolution Q14*/
            Scale_sig( h1, L_SUBFR, add( sub( 14, q_h1 ), shift ) ); /* set h1[] in Q14 with scaling for convolution Q14*/
            Scale_sig( h1, L_SUBFR, add( sub( 14, q_h1 ), shift ) );
        }
        ELSE
#endif
+8 −9
Original line number Diff line number Diff line
@@ -285,7 +285,6 @@ void encod_unvoiced_fx(
    Word16 i_subfr, Q_xn, Q_new_p5, tmp2, j, i;
    Word16 index, i_subfr_idx;
    Word16 unbits_PI;
    Word16 q_h1;

    acelp_cfg = &( st_fx->acelp_cfg );
    SC_VBR_ENC_HANDLE hSC_VBR = st_fx->hSC_VBR;
@@ -323,11 +322,11 @@ void encod_unvoiced_fx(
         *----------------------------------------------------------------*/
        i_subfr_idx = shr( i_subfr, 6 );
        Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */
#ifdef USE_UC_EVS
        IF( st_fx->element_mode > EVS_MONO )
#endif
        {

#ifdef USE_NEW_TARGET
        IF( st_fx->element_mode > EVS_MONO && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
        {
            Word16 q_h1;
            find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq_fx,
                                  res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );

@@ -338,19 +337,19 @@ void encod_unvoiced_fx(
            /* scaling of xn[] to limit dynamic at 12 bits */
            Scale_sig( xn_fx, L_SUBFR, shift ); // Q_new - 1 + shift
        }
#ifdef USE_UC_EVS
        else
        ELSE
#endif
        {

            find_targets_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq_fx,
                             res_fx, L_SUBFR, p_Aw_fx, st_fx->preemph_fac, xn_fx, cn_fx, h1_fx );

            /*Copy_Scale_sig(h1_fx, h2_fx, L_SUBFR, -2);*/
            Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, -2 );
            Scale_sig( h1_fx, L_SUBFR, add( 1, shift ) ); /* set h1[] in Q14 with scaling for convolution */

            /* scaling of xn[] to limit dynamic at 12 bits */
            Scale_sig( xn_fx, L_SUBFR, shift );
        }
#endif
        /*----------------------------------------------------------------*
         * Unvoiced subframe processing
         *----------------------------------------------------------------*/
Loading