Commit 4092556d authored by vaillancour's avatar vaillancour
Browse files

new branch to work on core

parent 1589c5e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@

#define REUSE_EVS_ACELP
#ifdef REUSE_EVS_ACELP
//#define USE_NEW_TARGET
#define USE_NEW_TARGET
#define REUSE_EVS_ACELP_GEN
#define REUSE_EVS_ACELP_SHIFT
#define REUSE_EVS_ACELP_TC
+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 );
#ifdef REUSE_EVS_ACELP_SHIFT // This should be moved outside of ACELP
#if 1//def REUSE_EVS_ACELP_SHIFT // This should be moved outside of ACELP
        {
            Word16 tmp, max;
            max = 0;
+2 −2
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ void encod_gen_voic_fx(

    shift_wsp = add( Q_new, shift );
#ifdef REUSE_EVS_ACELP
    if ( st_fx->element_mode > EVS_MONO && LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
    if ( st_fx->element_mode > EVS_MONO/* && LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) && st_fx->element_mode == IVAS_CPE_TD*/ )
    {
        shift_wsp = sub( shift_wsp, 1 );
    }
@@ -203,7 +203,7 @@ void encod_gen_voic_fx(

        Copy( &res_fx[i_subfr_fx], &exc_fx[i_subfr_fx], L_SUBFR ); /*Q_new*/
#ifdef USE_NEW_TARGET
        IF( st_fx->element_mode > EVS_MONO && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
        IF( st_fx->element_mode > EVS_MONO/* && st_fx->idchan == 1*/ )
        {
            Word16 q_h1;
            find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr_fx, &hLPDmem->mem_w0, p_Aq_fx,
+16 −15
Original line number Diff line number Diff line
@@ -723,23 +723,24 @@ 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
        IF( st_fx->element_mode > EVS_MONO && st_fx->element_mode == IVAS_CPE_DFT )
        {
            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 );

            q_h1 = sub( 14, norm_s( h1[0] ) );
#ifndef REUSE_EVS_ACELP
        Copy_Scale_sig( h1, h2, L_subfr, sub( 11, q_h1 ) ); /*Q11*/
#else
            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*/
        }
        ELSE
#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 */

+2 −2
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ Word16 encod_tran_fx(
    set16_fx( code_preQ, 0, L_SUBFR );
    shift_wsp = add( Q_new, shift );
#ifdef REUSE_EVS_ACELP_TC
    if ( st_fx->element_mode > EVS_MONO && LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
    if ( st_fx->element_mode > EVS_MONO/* && LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) && st_fx->element_mode == IVAS_CPE_TD*/ )
    {
        shift_wsp = sub( shift_wsp, 1 );
    }
@@ -165,7 +165,7 @@ Word16 encod_tran_fx(

        Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */
#ifdef USE_NEW_TARGET
        IF( st_fx->element_mode > EVS_MONO && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) )
        IF( st_fx->element_mode > EVS_MONO /*&& st_fx->idchan == 1*/ )
        {
            Word16 q_h1;
            find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
Loading