Commit ce300690 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

take all files in libenc and lib dec from main

parent 521f8efc
Loading
Loading
Loading
Loading
Loading
+30 −4
Original line number Diff line number Diff line
@@ -43,9 +43,11 @@ static void Regression_Anal_fx(
    Word32 L_tmp1, L_tmp2;
    Word16 aindex_fx[MAX_PGF + 1]; // Q0
    Word32 b_p_fx[MAX_PGF + 1];    // Q10
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif

    /* Initialize */
@@ -78,7 +80,11 @@ static void Regression_Anal_fx(
    {
        b_p_fx[0] = L_add( b_p_fx[0], L_shr( values_fx[i], 2 ) ); /*10 */
        move32();
#ifdef ISSUE_1796_replace_shl_o
        b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */
#else
        b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_o( sub( num_pgf, i ), 13, &Overflow ) ) ); /*10 */
#endif
        move32();
    }

@@ -162,9 +168,11 @@ void HQ_FEC_processing_fx(
    Word16 energy_diff_fx; // Q10
    HQ_NBFEC_HANDLE hHQ_nbfec;
    HQ_DEC_HANDLE hHQ_core;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif
    hHQ_nbfec = st_fx->hHQ_nbfec;
    hHQ_core = st_fx->hHQ_core;
@@ -382,7 +390,11 @@ void HQ_FEC_processing_fx(

                FOR( j = 0; j < Num_bands_p[i]; j++ )
                {
#ifdef ISSUE_1796_replace_shl_o
                    hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 );
#else
                    hHQ_nbfec->Norm_gain_fx[k] = shl_o( tmp_fx, 1, &Overflow );
#endif
                    move16();
                    k = add( k, 1 );
                }
@@ -518,7 +530,11 @@ void ivas_HQ_FEC_Mem_update_fx(
                L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/
                k = add( k, 1 );
            }
#ifdef ISSUE_1796_replace_shl_o
            tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/
#else
            tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/
#endif
            norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/
            move32();
            tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/
@@ -803,7 +819,11 @@ void HQ_FEC_Mem_update_fx(
                L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/
                k = add( k, 1 );
            }
#ifdef ISSUE_1796_replace_shl_o
            tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/
#else
            tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/
#endif
            norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/
            move32();
            tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/
@@ -995,9 +1015,11 @@ static Word16 find_best_delay_fx(
    Word32 min_sq_cross_fx, min_corr_fx;
    Word32 accA_fx, accB_fx;
    Word32 Rxy_fx[MAXDELAY_FEC], Ryy_fx[MAXDELAY_FEC];
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif
    move16(); // d1m

@@ -1064,7 +1086,11 @@ static Word16 find_best_delay_fx(
        L_tmp1 = L_shl( min_sq_cross_fx, exp1 );
        L_tmp2 = L_shl( min_corr_fx, exp2 );
        tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */
#ifdef ISSUE_1796_replace_shl_o
        tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */
#else
        tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow );     /*14 */
#endif
    }

    *false_flag = 0;
+23 −0
Original line number Diff line number Diff line
@@ -126,7 +126,11 @@ void FEC_exc_estim_fx(

        gainCNG = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /* In Q3 */
    }
#ifdef ISSUE_1796_replace_shl_o
    tmp1 = shl_sat( st_fx->lp_gainc_fx, 1 );
#else
    tmp1 = shl_o( st_fx->lp_gainc_fx, 1, &Overflow );
#endif
    gainCNG = s_min( gainCNG, tmp1 );
    set16_fx( exc_dct_in, 0, L_FRAME16k );

@@ -187,9 +191,15 @@ void FEC_exc_estim_fx(
    {
        test();
        test();
#ifdef ISSUE_1796_replace_shl_o
        IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), shl_sat( mult( 29491, st_fx->bfi_pitch_fx ), 1 ) ) &&
              GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past  */
            GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) )                                                                                /* or last update too far in the past */
#else
        IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), shl_o( mult( 29491, st_fx->bfi_pitch_fx ), 1, &Overflow ) ) &&
              GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past  */
            GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) )                                                                                /* or last update too far in the past */
#endif
        {
            /* take the pitch value of last subframe of the previous frame */
            *tmp_tc = round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) );
@@ -200,9 +210,16 @@ void FEC_exc_estim_fx(
    {
        test();
        test();
#ifdef ISSUE_1796_replace_shl_o
        IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), shl_sat( mult( 29491, st_fx->bfi_pitch_fx ), 1 ) ) &&
              GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past  */
            GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) )                                                                                   /* or last update too far in the past */
#else
        IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), shl_o( mult( 29491, st_fx->bfi_pitch_fx ), 1, &Overflow ) ) &&
              GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past  */
            GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) )                                                                                   /* or last update too far in the past */
#endif

        {
            /* take the pitch value of last subframe of the previous frame */
            *tmp_tc = round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) );
@@ -751,9 +768,11 @@ static void pulseRes_preCalc( Word16 *cond1, Word16 *cond2, Word32 *cond3, Word1
{
    Word16 tmp_pit, tmp_pit_e, tmp_frame, tmp_frame_e;
    Word32 tmp_pit2;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif

    tmp_pit = BASOP_Util_Divide1616_Scale( new_pit /*Q0*/, Tc /*Q0*/, &tmp_pit_e ) /*Q15*/;
@@ -763,7 +782,11 @@ static void pulseRes_preCalc( Word16 *cond1, Word16 *cond2, Word32 *cond3, Word1
    tmp_frame = sub( 32767 /*1.f Q15*/, tmp_frame ); /*Q15*/
    BASOP_SATURATE_WARNING_OFF_EVS
    /*To calc Q15 threshold, overflow may happen - do negation and compare with negated value to check also highest possible value*/
#ifdef ISSUE_1796_replace_shl_o
    tmp_pit = shl_sat( negate( tmp_pit ), tmp_pit_e );
#else
    tmp_pit = shl_o( negate( tmp_pit ), tmp_pit_e, &Overflow );
#endif
    BASOP_SATURATE_WARNING_ON_EVS
    *cond1 = sub( tmp_pit, negate( tmp_frame ) );
    move16();
+12 −2
Original line number Diff line number Diff line
@@ -599,7 +599,11 @@ static void spectrum_mod_dct_fx(

                    Ltmp = L_mult( tmpN, m_binE ); /*2*Qdct+e_binE+9*/
                    e_binE = sub( add( e_tmp, e_binE ), 15 );
#ifdef ISSUE_1799_replace_L_shr_o
                    Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/
#else
                    Ltmp = L_shr_o( Ltmp, e_binE, &Overflow ); /*2*Qdct+9*/
#endif
                    Lgain = L_add_o( Ltmp, Lshift, &Overflow ); /*Saturation can occure here result in Q30*/
                }

@@ -901,8 +905,10 @@ static Word16 norm_lfe(
{
    Word32 Ltmp;
    Word16 exp2, tmp16, exp3;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif
#endif

    move32();
@@ -923,7 +929,11 @@ static Word16 norm_lfe(
        exp3 = sub( exp2, 12 + 16 - 3 ); /* if exp2 < 31, means that tmp >= 1.0 */
        /* Need to shl by 3 to take into account the 3 multiplications */
    }
#ifdef ISSUE_1796_replace_shl_o
    tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */
#else
    tmp16 = shl_o( tmp16, exp3, &Overflow );                   /* Result in Q12 */
#endif

    return tmp16;
}
+6 −0
Original line number Diff line number Diff line
@@ -872,10 +872,12 @@ static void decod_gen_voic_core_switch_fx(
    Word16 *pt1;
    GSC_DEC_HANDLE hGSCDec;
    hGSCDec = st_fx->hGSCDec;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move16();
#endif
#endif


    /*----------------------------------------------------------------------*
@@ -966,7 +968,11 @@ static void decod_gen_voic_core_switch_fx(
    IF( st_fx->prev_bfi )
    {
        /*gain_code = min(gain_code, 0.5f*gain_code+0.5f*st->lp_gainc);*/
#ifdef ISSUE_1796_replace_shl_o
        gain_code16 = s_min( gain_code16, mac_r( L_mult( 16384, gain_code16 ), shl_sat( 16384 >> 3, st_fx->Q_exc ), st_fx->lp_gainc_fx ) ); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */
#else
        gain_code16 = s_min( gain_code16, mac_r( L_mult( 16384, gain_code16 ), shl_o( 16384 >> 3, st_fx->Q_exc, &Overflow ), st_fx->lp_gainc_fx ) ); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */
#endif
    }

    FOR( i = 0; i < L_SUBFR; i++ )
+6 −0
Original line number Diff line number Diff line
@@ -30,9 +30,11 @@ void transf_cdbk_dec_fx(
    Word32 L_tmp;
    Word32 dct_code32[L_SUBFR];
    Word16 qdct;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif
    Word16 avq_bit_sFlag;
    Word16 trgtSvPos;
@@ -142,7 +144,11 @@ void transf_cdbk_dec_fx(
    }
    FOR( i = 0; i < L_SUBFR; i++ )
    {
#ifdef ISSUE_1796_replace_shl_o
        code_preQ[i] = shl_sat( code_preQ[i], q_Code_preQ );
#else
        code_preQ[i] = shl_o( code_preQ[i], q_Code_preQ, &Overflow );
#endif
        move16(); /* code_preQ in Q6*/
    }

Loading