Commit 8ced60a1 authored by multrus's avatar multrus
Browse files

rename functions ending with _ivas_fx to _fx

parent ceb03ef7
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -8651,7 +8651,11 @@ void ivas_mdct_core_reconstruct_fx(
    Word16 q_x,
    Word16 e_sig[CPE_CHANNELS] );

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_start_encoding_14bits_fx(
#else
void ari_start_encoding_14bits_ivas_fx(
#endif
    Tastat *s );

void tcx_scalar_quantization_ivas_fx(
@@ -9664,7 +9668,11 @@ void IGFSaveSpectrumForITF_ivas_fx(
    const Word32 *pITFSpectrum,      /* i  : MDCT spectrum                   */
    Word16 exp_pITFSpectrum );

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_ext_fx(
#else
Word16 ari_encode_14bits_ext_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Tastat *s,
@@ -9672,7 +9680,11 @@ Word16 ari_encode_14bits_ext_ivas_fx(
    UWord16 const *cum_freq /* Q0 */
);

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_sign_fx(
#else
Word16 ari_encode_14bits_sign_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Word32 bits, /* Q0 */
@@ -9680,7 +9692,11 @@ Word16 ari_encode_14bits_sign_ivas_fx(
    Word16 sign /* Q0 */
);

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_encoding_14bits_fx(
#else
Word16 ari_done_encoding_14bits_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Tastat *s );
+0 −32
Original line number Diff line number Diff line
@@ -151,11 +151,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
    lsbs_bits2 = ptr + nbbits - 1;

    /*Start Encoding*/
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    ari_start_encoding_14bits_ivas_fx( &as );
#else
    ari_start_encoding_14bits_fx( &as );
#endif

    /*Main Loop through the 2-tuples*/
    b1_i = -1;
@@ -197,11 +193,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
        move16();

        /*Copy states*/
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        ari_copy_states_ivas_fx( &as, &as_overflow );
#else
        ari_copy_states_fx( &as, &as_overflow );
#endif
        bp_overflow = bp; /* Q0 */
        move16();
        nbbits_signs_overflow = nbbits_signs; /* Q0 */
@@ -230,11 +222,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
            assert( tmp >= 0 && tmp < 4096 );
            pki = ari_lookup_s17_LC[tmp]; /* Q0 */
            move16();
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            bp = ari_encode_14bits_ext_ivas_fx( ptr, bp, &as, VAL_ESC, ari_pk_s17_LC_ext[pki] ); /* Q0 */
#else
            bp = ari_encode_14bits_ext_fx( ptr, bp, &as, VAL_ESC, ari_pk_s17_LC_ext[pki] ); /* Q0 */
#endif
            *lsbs_bits2-- = s_and( a1, 1 );
            move16();
            *lsbs_bits2-- = s_and( b1, 1 );
@@ -253,11 +241,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
        assert( tmp >= 0 && tmp < 4096 );
        pki = ari_lookup_s17_LC[tmp]; /* Q0 */
        move16();
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        bp = ari_encode_14bits_ext_ivas_fx( ptr, bp, &as, add( a1, shl( b1, A_THRES_SHIFT ) ), ari_pk_s17_LC_ext[pki] ); /* Q0 */
#else
        bp = ari_encode_14bits_ext_fx( ptr, bp, &as, add( a1, shl( b1, A_THRES_SHIFT ) ), ari_pk_s17_LC_ext[pki] ); /* Q0 */
#endif

        /* Check bit budget */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
@@ -266,11 +250,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
        IF( GT_16( add( add( add( bp, extract_l( as.value ) ), nbbits_signs ), nbbits_lsbs ), nbbits_m2 ) )
#endif
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as_overflow, &as );
#else
            ari_copy_states_fx( &as_overflow, &as );
#endif
            bp = bp_overflow; /* Q0 */
            move16();

@@ -296,11 +276,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
                    assert( t >= 0 && t < 4096 );
                    pki = ari_lookup_s17_LC[t]; /* Q0 */
                    move16();
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    bp = ari_encode_14bits_ext_ivas_fx( ptr, bp, &as, 0, ari_pk_s17_LC_ext[pki] ); /* Q0 */
#else
                    bp = ari_encode_14bits_ext_fx( ptr, bp, &as, 0, ari_pk_s17_LC_ext[pki] ); /* Q0 */
#endif

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    IF( GT_16( add( add( add( bp, extract_l( as.bits_to_follow ) ), nbbits_signs ), nbbits_lsbs ), nbbits_m2 ) )
@@ -308,11 +284,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
                    IF( GT_16( add( add( add( bp, extract_l( as.value ) ), nbbits_signs ), nbbits_lsbs ), nbbits_m2 ) )
#endif
                    {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                        ari_copy_states_ivas_fx( &as_overflow, &as );
#else
                        ari_copy_states_fx( &as_overflow, &as );
#endif
                        bp = bp_overflow; /* Q0 */
                        move16();
                        BREAK;
@@ -359,11 +331,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
    } /*end of the 2-tuples loop*/

    /* End arithmetic coder, overflow management */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    bp = ari_done_encoding_14bits_ivas_fx( ptr, bp, &as ); /* Q0 */
#else
    bp = ari_done_encoding_14bits_fx( ptr, bp, &as ); /* Q0 */
#endif

    /* Overflow is detected */
    IF( NE_16( k, lastnz ) )
+35 −19
Original line number Diff line number Diff line
@@ -63,7 +63,10 @@ void ari_copy_states_fx(
 *-------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_copy_states_fx(
#else
void ari_copy_states_ivas_fx(
#endif
    Tastat *source,
    Tastat *dest )
{
@@ -78,7 +81,6 @@ void ari_copy_states_ivas_fx(

    return;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


/*---------------------------------------------------------------
@@ -256,13 +258,13 @@ Word16 ari_encode_14bits_ext_fx(
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
/*------------------------------------------------------------------------
 * Function: ari_encode_overflow_fx()
 *
 *
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_overflow_fx(
    TastatEnc *s )
{
@@ -271,26 +273,28 @@ Word16 ari_encode_overflow_fx(
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_encode_overflow_ivas_fx()
 * Function: ari_encode_overflow_fx()
 *
 *
 *-------------------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_overflow_fx(
#else
Word16 ari_encode_overflow_ivas_fx(
#endif
    Tastat *s )
{
    return L_sub( L_sub( s->high, 0 ), s->low ) <= 0;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_high_low()
 *
 *
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
static Word16 ari_encode_14bits_high_low(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -381,16 +385,16 @@ Word16 ari_encode_14bits_range_fx(

    return ari_encode_14bits_high_low( ptr, bp, bits, s, high, low );
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_range_ivas_fx
 *
 * Encode an cumulative frequency interval.
 *-------------------------------------------------------------------------*/
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_range_ivas_fx(
Word16 ari_encode_14bits_range_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Word16 bits, /* Q0 */
@@ -406,10 +410,9 @@ Word16 ari_encode_14bits_range_ivas_fx(
    high = L_add( s->low, mul_sbc_14bits( range, cum_freq_high ) ); /* Q0 */
    low = L_add( s->low, mul_sbc_14bits( range, cum_freq_low ) );   /* Q0 */

    Word16 ret = ari_encode_14bits_high_low_fx( ptr, bp, bits, s, high, low );
    return ret;
    return ari_encode_14bits_high_low_fx( ptr, bp, bits, s, high, low );
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */
#endif

/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_sign_fx
@@ -484,16 +487,14 @@ Word16 ari_done_cbr_encoding_14bits_fx(

    return bp;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_done_cbr_encoding_14bits_ivas_fx
 *
 * Finish up encoding in CBR mode.
 *-------------------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_cbr_encoding_14bits_ivas_fx(
#else
Word16 ari_done_cbr_encoding_14bits_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Word16 bits, /* Q0 */
@@ -503,7 +504,7 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx(
    tmp = sub( bits, 16 ); /* Q0 */
    WHILE( GT_16( sub( tmp, bp ), (Word16) s->bits_to_follow ) )
    {
        bp = ari_encode_14bits_sign_ivas_fx( ptr, bp, bits, s, 0 ); /* Q0 */
        bp = ari_encode_14bits_sign_fx( ptr, bp, bits, s, 0 ); /* Q0 */
    }

    high = extract_l( L_sub( s->high, 0 ) ); /* Q0 */
@@ -521,10 +522,13 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx(

    return bp;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

#endif

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_start_encoding_14bits_fx(
#else
void ari_start_encoding_14bits_ivas_fx(
#endif
    Tastat *s )
{
    /* : addressing is made with walking pointer s */
@@ -540,12 +544,16 @@ void ari_start_encoding_14bits_ivas_fx(


/*---------------------------------------------------------------
 * ari_done_encoding_14bits_ivas_fx()
 * ari_done_encoding_14bits_fx()
 *
 * Finish ArCo encoding
 *-------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_encoding_14bits_fx(
#else
Word16 ari_done_encoding_14bits_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Tastat *s )
@@ -569,7 +577,11 @@ Word16 ari_done_encoding_14bits_ivas_fx(
 *
 *-------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_ext_fx(
#else
Word16 ari_encode_14bits_ext_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Tastat *s,
@@ -718,12 +730,16 @@ static Word16 ari_encode_14bits_high_low_fx(


/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_sign_ivas_fx()
 * Function: ari_encode_14bits_sign_fx()
 *
 * Encode a sign with equal probabilities.
 *-------------------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_sign_fx(
#else
Word16 ari_encode_14bits_sign_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Word32 bits, /* Q0 */
+2 −65
Original line number Diff line number Diff line
@@ -540,13 +540,8 @@ static Word16 tcx_arith_encode(
    Word16 tmpi1, tmpi2;

    /* Final coding */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    ari_start_encoding_14bits_ivas_fx( &as );
    ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
    ari_start_encoding_14bits_fx( &as );
    ari_copy_states_fx( &as, &as_lastgood );
#endif
    bp = 0;
    move16();
    bp_lastgood = 0;
@@ -559,11 +554,7 @@ static Word16 tcx_arith_encode(
        IF( q_abs_spectrum[k] == 0 )
        {
            assert( exps[k] >= 2 );
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            bp = ari_encode_14bits_range_ivas_fx( prm, bp, target_bits, &as, shr( exps[k], 1 ), 16384 );
#else
            bp = ari_encode_14bits_range_fx( prm, bp, target_bits, &as, shr( exps[k], 1 ), 16384 );
#endif
        }
        ELSE /* q_abs_spectrum[k] != 0 */
        {
@@ -576,32 +567,19 @@ static Word16 tcx_arith_encode(
                powfp_odd2( exps[k], q_abs_spectrum[k], &tmpi1, &tmpi2 );
            }

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            bp = ari_encode_14bits_range_ivas_fx( prm, bp, target_bits, &as, shr( tmpi2, 1 ), shr( tmpi1, 1 ) );
            bp = ari_encode_14bits_sign_ivas_fx( prm, bp, target_bits, &as, signs[k] );
#else
            bp = ari_encode_14bits_range_fx( prm, bp, target_bits, &as, shr( tmpi2, 1 ), shr( tmpi1, 1 ) );
            bp = ari_encode_14bits_sign_fx( prm, bp, target_bits, &as, signs[k] );
#endif
        }

        /* Check bit budget status */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        IF( ari_encode_overflow_ivas_fx( &as ) ) /* no bits left */
#else
        IF( ari_encode_overflow_fx( &as ) ) /* no bits left */
#endif
        {
            /* printf("\noverflow at %d\n\n", k); */

            IF( GT_16( q_abs_spectrum[k], 1 ) ) /* Lower magnitude is still > 0 */
            {
                /* Restore state */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                ari_copy_states_ivas_fx( &as_lastgood, &as );
#else
                ari_copy_states_fx( &as_lastgood, &as );
#endif
                bp = bp_lastgood;
                move16();

@@ -612,25 +590,12 @@ static Word16 tcx_arith_encode(
                /* Retry encoding */
                powfp_odd2( exps[k], q_abs_spectrum[k], &tmpi1, &tmpi2 );

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                bp = ari_encode_14bits_range_ivas_fx( prm, bp, target_bits, &as, shr( tmpi2, 1 ), shr( tmpi1, 1 ) );
                bp = ari_encode_14bits_sign_ivas_fx( prm, bp, target_bits, &as, signs[k] );
#else
                bp = ari_encode_14bits_range_fx( prm, bp, target_bits, &as, shr( tmpi2, 1 ), shr( tmpi1, 1 ) );
                bp = ari_encode_14bits_sign_fx( prm, bp, target_bits, &as, signs[k] );
#endif

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                IF( !ari_encode_overflow_ivas_fx( &as ) ) /* Success */
#else
                IF( !ari_encode_overflow_fx( &as ) ) /* Success */
#endif
                {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
                    ari_copy_states_fx( &as, &as_lastgood );
#endif
                    bp_lastgood = bp;
                    move16();
                    kEncoded = k;
@@ -640,11 +605,7 @@ static Word16 tcx_arith_encode(
                    BREAK;
                }
            }
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as_lastgood, &as );
#else
            ari_copy_states_fx( &as_lastgood, &as );
#endif
            bp = bp_lastgood;
            move16();
            kEncoded = sub( k, 1 );
@@ -654,11 +615,7 @@ static Word16 tcx_arith_encode(
        }
        ELSE
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
            ari_copy_states_fx( &as, &as_lastgood );
#endif
            bp_lastgood = bp;
            move16();
        }
@@ -671,23 +628,12 @@ static Word16 tcx_arith_encode(
    {
        assert( exps[k] >= 1 );

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        bp = ari_encode_14bits_range_ivas_fx( prm, bp, target_bits, &as, shr( exps[k], 1 ), 16384 );
#else
        bp = ari_encode_14bits_range_fx( prm, bp, target_bits, &as, shr( exps[k], 1 ), 16384 );
#endif

        /* Check bit budget status */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        IF( ari_encode_overflow_ivas_fx( &as ) ) /* no bits left */
#else
        IF( ari_encode_overflow_fx( &as ) ) /* no bits left */
#endif
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as_lastgood, &as );
#else
            ari_copy_states_fx( &as_lastgood, &as );
#endif
            bp = bp_lastgood;
            move16();
            kEncoded = sub( k, 1 );
@@ -695,11 +641,7 @@ static Word16 tcx_arith_encode(
        }
        ELSE
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
            ari_copy_states_fx( &as, &as_lastgood );
#endif
            bp_lastgood = bp;
            move16();
        }
@@ -715,12 +657,7 @@ static Word16 tcx_arith_encode(
#endif
    }

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    Word16 ret = ari_done_cbr_encoding_14bits_ivas_fx( prm, bp, target_bits, &as );
#else
    Word16 ret = ari_done_cbr_encoding_14bits_fx( prm, bp, target_bits, &as );
#endif
    return ret;
    return ari_done_cbr_encoding_14bits_fx( prm, bp, target_bits, &as );
}


+67 −23
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static void arith_encode_bits(
        {
            bit = s_and( shr( x, i ), 1 );
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_sign_ivas_fx( ptr, hPrivateData->ptrBitIndex, MAX16B /* disable the bit count limitation */, &hPrivateData->acState_ivas_fx, bit );
            hPrivateData->ptrBitIndex = ari_encode_14bits_sign_fx( ptr, hPrivateData->ptrBitIndex, MAX16B /* disable the bit count limitation */, &hPrivateData->acState_ivas_fx, bit );
#else
            hPrivateData->ptrBitIndex = ari_encode_14bits_sign_fx( ptr, hPrivateData->ptrBitIndex, MAX16B /* disable the bit count limitation */, &hPrivateData->acState_fx, bit );
#endif
@@ -142,7 +142,11 @@ static void arith_encode_bits(
        FOR( i = nBits - 1; i >= 0; --i ) /* nBits > 0 */
        {
            bit = s_and( shr( x, i ), 1 );
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_sign_fx( ptr, hPrivateData->ptrBitIndex, MAX16B /* disable the bit count limitation */, &hPrivateData->acState, bit );
#else
            hPrivateData->ptrBitIndex = ari_encode_14bits_sign_ivas_fx( ptr, hPrivateData->ptrBitIndex, MAX16B /* disable the bit count limitation */, &hPrivateData->acState, bit );
#endif
            move16();
        }
    }
@@ -174,7 +178,7 @@ static void arith_encode_residual(
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                  hPrivateData->ptrBitIndex,
                                                                  &hPrivateData->acState_ivas_fx,
                                                                  x,
@@ -189,11 +193,19 @@ static void arith_encode_residual(
        }
        ELSE
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                  hPrivateData->ptrBitIndex,
                                                                  &hPrivateData->acState,
                                                                  x,
                                                                  cumulativeFrequencyTable );
#else
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                       hPrivateData->ptrBitIndex,
                                                                       &hPrivateData->acState,
                                                                       x,
                                                                       cumulativeFrequencyTable );
#endif
        }
        move16();

@@ -207,7 +219,7 @@ static void arith_encode_residual(
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                  hPrivateData->ptrBitIndex,
                                                                  &hPrivateData->acState_ivas_fx,
                                                                  0,
@@ -222,11 +234,19 @@ static void arith_encode_residual(
        }
        ELSE
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                  hPrivateData->ptrBitIndex,
                                                                  &hPrivateData->acState,
                                                                  0,
                                                                  cumulativeFrequencyTable );
#else
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                       hPrivateData->ptrBitIndex,
                                                                       &hPrivateData->acState,
                                                                       0,
                                                                       cumulativeFrequencyTable );
#endif
        }

        move16();
@@ -239,7 +259,7 @@ static void arith_encode_residual(
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                  hPrivateData->ptrBitIndex,
                                                                  &hPrivateData->acState_ivas_fx,
                                                                  IGF_SYMBOLS_IN_TABLE - 1,
@@ -254,11 +274,19 @@ static void arith_encode_residual(
        }
        ELSE
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                  hPrivateData->ptrBitIndex,
                                                                  &hPrivateData->acState,
                                                                  IGF_SYMBOLS_IN_TABLE - 1,
                                                                  cumulativeFrequencyTable );
#else
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                       hPrivateData->ptrBitIndex,
                                                                       &hPrivateData->acState,
                                                                       IGF_SYMBOLS_IN_TABLE - 1,
                                                                       cumulativeFrequencyTable );
#endif
        }
        move16();
    }
@@ -336,7 +364,7 @@ static void encode_sfe_vector(
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                    hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                          hPrivateData->ptrBitIndex,
                                                                          &hPrivateData->acState_ivas_fx,
                                                                          shr( x[f], 2 ),
@@ -351,11 +379,19 @@ static void encode_sfe_vector(
                }
                ELSE
                {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    hPrivateData->ptrBitIndex = ari_encode_14bits_ext_fx( ptr,
                                                                          hPrivateData->ptrBitIndex,
                                                                          &hPrivateData->acState,
                                                                          shr( x[f], 2 ),
                                                                          (const UWord16 *) hPrivateData->cf_se00 );
#else
                    hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                               hPrivateData->ptrBitIndex,
                                                                               &hPrivateData->acState,
                                                                               shr( x[f], 2 ),
                                                                               (const UWord16 *) hPrivateData->cf_se00 );
#endif
                }
                move16();
                arith_encode_bits( hPrivateData, ptr, x[f] & 3, 2, element_mode ); /* LSBs as 2 bit raw */
@@ -446,14 +482,18 @@ Word16 IGFSCFEncoderEncode_fx(
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        ari_start_encoding_14bits_ivas_fx( &hPublicData->acState_ivas_fx );
        ari_start_encoding_14bits_fx( &hPublicData->acState_ivas_fx );
#else
        ari_start_encoding_14bits_fx( &hPublicData->acState_fx );
#endif
    }
    ELSE
    {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        ari_start_encoding_14bits_fx( &hPublicData->acState );
#else
        ari_start_encoding_14bits_ivas_fx( &hPublicData->acState );
#endif
    }

    /* check if coder needs a reset and do it if necessary */
@@ -469,14 +509,18 @@ Word16 IGFSCFEncoderEncode_fx(
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_ivas_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState_ivas_fx );
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState_ivas_fx );
#else
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState_fx );
#endif
    }
    ELSE
    {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState );
#else
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_ivas_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState );
#endif
    }
    hPublicData->bitCount = add( hPublicData->bitCount, hPublicData->ptrBitIndex );
    move16();
Loading