Commit 3e9d0d31 authored by vaillancour's avatar vaillancour
Browse files

test shift

parent 491989d5
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1378,10 +1378,10 @@ ivas_error acelp_core_enc_ivas_fx(
        }
        ELSE IF( EQ_16( st->coder_type, TRANSITION ) )
        {
#ifdef TRY_SHIFT_ACELP 
#if 0//def TRY_SHIFT_ACELP 
            encod_tran_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, tc_subfr, position, unbits, shift, Q_new );
#else
            encod_tran_ivas_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, tc_subfr, position, unbits, 0, Q_new );
            encod_tran_ivas_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, tc_subfr, position, unbits, shift, Q_new );
#endif
        }
        ELSE IF( ppp_mode )
@@ -1420,8 +1420,11 @@ ivas_error acelp_core_enc_ivas_fx(
        {
            /* GENERIC, VOICED and INACTIVE frames (coded by AVQ technology) */
#ifdef TRY_SHIFT_ACELP
#if 0
            encod_gen_voic_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, unbits, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf_fx, shift, Q_new );
            //encod_gen_voic_ivas_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, unbits, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf_fx, shift, Q_new );
#else
            encod_gen_voic_ivas_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, unbits, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf_fx, shift, Q_new );
#endif
#else
            encod_gen_voic_ivas_fx( st, inp, Aw, Aq, Es_pred_fx, res_fx, syn_fx, exc_fx, exc2_fx, pitch_buf, voice_factors_fx, bwe_exc_fx, unbits, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf_fx, 0, Q_new );
#endif
+13 −4
Original line number Diff line number Diff line
@@ -469,6 +469,7 @@ void encod_gen_voic_ivas_fx(
    Word16 shift_wsp;
    Word16 harm_flag_acelp;
    Word16 lp_select, lp_flag, L_frame;
#undef USE_EVS_FUNC_FT_G
#if !defined TRY_SHIFT_ACELP || !defined USE_EVS_FUNC_FT_G
    Word16 q_h1;
#endif
@@ -545,9 +546,17 @@ void encod_gen_voic_ivas_fx(
    /*------------------------------------------------------------------*
     * ACELP subframe loop
     *------------------------------------------------------------------*/
#if defined USE_EVS_FUNC_LP
    //if ( st_fx->core_brate < MIN_BRATE_AVQ_EXC )
//#ifdef TRY_SHIFT_ACELP
//    if ( st_fx->element_mode > EVS_MONO )
//    {
//        shift_wsp = sub( shift_wsp, 1 );
//    }
//#endif
#ifdef TRY_SHIFT_ACELP
    if ( LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
    {
        shift_wsp = sub( shift_wsp, 1 );
    }
#endif
    FOR( i_subfr_fx = 0; i_subfr_fx < L_frame; i_subfr_fx += L_SUBFR )
    {
@@ -572,7 +581,7 @@ void encod_gen_voic_ivas_fx(
        Scale_sig( h1_fx, L_SUBFR, sub( 14, q_h1 ) );             /* set h1[] in Q14 with scaling for convolution Q14*/
#elif defined TRY_SHIFT_ACELP && !defined USE_EVS_FUNC_FT_G
        q_h1 = sub( 14, norm_s( h1_fx[0] ) );
        Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, sub( 11, q_h1 ) + shift);   /*Q11*/
        Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, sub( 11, q_h1 ) );   /*Q11*/
        Scale_sig( h1_fx, L_SUBFR, sub( 14, q_h1 ) + shift );             /* set h1[] in Q14 with scaling for convolution Q14*/
#else
        Copy_Scale_sig( h1_fx, h2_fx, L_SUBFR, -2 );  /*Q11*/
@@ -581,7 +590,7 @@ void encod_gen_voic_ivas_fx(
        /* scaling of xn[] to limit dynamic at 12 bits */
        Scale_sig( xn_fx, L_SUBFR, shift );

#ifndef USE_EVS_FUNC_FT_G
#ifndef TRY_SHIFT_ACELP
        *pt_pitch_fx = pit_encode_ivas_fx( hBstr, st_fx->acelp_cfg.pitch_bits, st_fx->core_brate, 0, L_frame, st_fx->coder_type, &pitch_limit_flag, i_subfr_fx, exc_fx,
                                           L_SUBFR, st_fx->pitch, &T0_min_fx, &T0_max_fx, &T0_fx, &T0_frac_fx, h1_fx, xn_fx, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf, Q_new ); /* Q6 */
        move16();
+10 −3
Original line number Diff line number Diff line
@@ -473,6 +473,7 @@ Word16 encod_tran_ivas_fx(
    Word16 L_frame_fx;
    Word16 shift_wsp;
    Word32 L_tmp;
#undef USE_EVS_FUNC_FT_T
#if !defined TRY_SHIFT_ACELP || !defined USE_EVS_FUNC_FT_T
    Word16 q_h1;
#endif
@@ -529,9 +530,15 @@ Word16 encod_tran_ivas_fx(
    move16();
    set16_fx( code_preQ, 0, L_SUBFR );
    shift_wsp = add( Q_new, shift );
#ifdef USE_EVS_FUNC_LP
    //if ( st_fx->core_brate < MIN_BRATE_AVQ_EXC )
//#ifdef USE_EVS_FUNC_LP
//    //if ( st_fx->core_brate < MIN_BRATE_AVQ_EXC )
//        shift_wsp = sub( shift_wsp, 1 );
//#endif
#ifdef TRY_SHIFT_ACELP
    if ( LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
    {
        shift_wsp = sub( shift_wsp, 1 );
    }
#endif
    /*----------------------------------------------------------------*
     * ACELP subframe loop
@@ -559,7 +566,7 @@ Word16 encod_tran_ivas_fx(
        Scale_sig( h1, L_SUBFR, sub( 13, q_h1 ) );
#elif defined TRY_SHIFT_ACELP && !defined USE_EVS_FUNC_FT_T
        q_h1 = sub( 14, norm_s( h1[0] ) );
        Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) + shift ); /*Q11*/
        Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/
        Scale_sig( h1, L_SUBFR, sub( 14, q_h1 ) + shift );
#else
        Copy_Scale_sig( h1, h2_fx, L_SUBFR, -2 );  /*Q11*/