Commit 58aaaf8b authored by JÜRGEN Gerstacker's avatar JÜRGEN Gerstacker
Browse files

removed debugging code, cleanup

parent 93f60a44
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -95,9 +95,7 @@
#define SIMPLIFY_CORE_ENC                               /* VA: basop issue 2430: Simplify ivas_core_enc_fx() */
#define FIX_2402_SIMPLIFY_ARI_CODEC                     /* FhG: basop issue 2402: simplified arithmetic in TCX arithmetic coder */
#define FIX_2402_INLINE_FCT_ARI_CODEC                   /* FhG: basop issue 2402: simplify processing in arithmetic decoding, inline mul_sbc_14bits, all BE */
#define FIX_2402_REPL_EVS_ARI_CODEC_DEC                 /* FhG: basop issue 2402: replace EVS arith decoder with IVAS arith decoder */
//#define FIX_2402_REPL_EVS_ARI_CODEC_DEC2                 /* FhG: basop issue 2402: replace EVS arith decoder with IVAS arith decoder */
#define FIX_2402_REPL_EVS_ARI_CODEC_DEC3               /* FhG: basop issue 2402: replace EVS arith decoder with IVAS arith decoder */
#define FIX_2402_REPL_EVS_ARI_CODEC_DEC               /* FhG: basop issue 2402: replace EVS arith decoder with IVAS arith decoder, except functions in igf_scf_dec_fx.c */
#define FIX_2402_SIGNED_VERSION                         /* FhG: basop issue 2402: use signed operator instead of unsigned, better match for hardware */
#define FIX_2402_REPL_EVS_ARI_CODEC_ENC                 /* FhG: basop issue 2402: replace EVS arith encoder with IVAS arith encoder */
#define FIX_BASOP_2551_HARM_SCALAR_QUAN                 /* FhG: issue 2551: Harmonize function pair tcx_scalar_quantization_fx*/
+9 −49
Original line number Diff line number Diff line
@@ -11,12 +11,6 @@

// #define FIX_2402_DEBUGGING

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#define HIGH( as ) ( ( as ).high + 1 )
#else
#define HIGH( as ) ( ( as ).high )
#endif

/*---------------------------------------------------------------
 * Ari decode 14 bits routines
  -------------------------------------------------------------*/
@@ -49,7 +43,6 @@ Word32 ari_decode_overflow_ivas_fx( Tastat *s )
 * \param[i/o] st
 * \param[o] s
 */
#if !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC ) || !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC2 )
void ari_start_decoding_14bits_fx(
    Decoder_State *st,
    Tastat *s )
@@ -65,7 +58,6 @@ void ari_start_decoding_14bits_fx(
    s->value = val;
    move32();
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

Word16 ari_start_decoding_14bits_prm_fx(
    const Word16 *ptr, /* Q0 */
@@ -198,7 +190,6 @@ static Word16 ari_lookup_s17_fx(
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

#if !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC ) || !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC2 )
static Word16 ari_lookup_s27_fx(
    Word32 cum,
    Word32 range,
@@ -333,9 +324,7 @@ static Word16 ari_lookup_s27_fx(
    return extract_l( p - cum_freq );
#endif
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

#if !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC ) || !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC2 )
static Word16 ari_lookup_bit_fx(
    Word32 cum,
    Word32 range,
@@ -369,9 +358,7 @@ static Word16 ari_lookup_bit_fx(
#endif
    return symbol;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

#if !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC ) || !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC2 )
static Word16 ari_decode_14bits_ext_fx(
    Decoder_State *st,
    Tastat *s,
@@ -441,7 +428,6 @@ static Word16 ari_decode_14bits_ext_fx(

    return symbol;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */


/**
@@ -457,18 +443,15 @@ Word16 ari_decode_14bits_s17_ext_fx( Decoder_State *st, Tastat *s, UWord16 const
/**
 * \brief Only for 27 symbols with new extended Tables
 */
#if !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC ) || !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC2 )
Word16 ari_decode_14bits_s27_ext_fx( Decoder_State *st, Tastat *s, UWord16 const *cum_freq )
{
    return ari_decode_14bits_ext_fx( st, s, cum_freq, ari_lookup_s27_fx );
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

/**
 * \brief Only for decoding one bit with uniform probability:
 * the equivalent cum_freq table used is {16384, 8192, 0}
 */
#if !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC ) || !defined( FIX_2402_REPL_EVS_ARI_CODEC_DEC2 )
Word16 ari_decode_14bits_bit_ext_fx( Decoder_State *st, Tastat *s )
{
    static const UWord16 cum_freq[3] = { 16384, 8192, 0 };
@@ -477,9 +460,8 @@ Word16 ari_decode_14bits_bit_ext_fx( Decoder_State *st, Tastat *s )
    move16();
    return ari_decode_14bits_ext_fx( st, s, cum_freq, ari_lookup_bit_fx );
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC
static Word16 ari_lookup_pow_fx( Tastat *s, Word16 base )
{
    Word32 cum, range;
@@ -573,9 +555,9 @@ static Word16 ari_lookup_pow_fx( Tastat *s, Word16 base )

    return symbol;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC
static Word16 ari_lookup_sign_fx( Tastat *s, Word16 base )
{
    Word32 cum, range;
@@ -604,9 +586,9 @@ static Word16 ari_lookup_sign_fx( Tastat *s, Word16 base )

    return symbol;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

#ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC
static Word16 ari_decode_14bits_notbl_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,
@@ -674,7 +656,7 @@ static Word16 ari_decode_14bits_notbl_fx(

    return bp;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */

/*------------------------------------------------------------------------
 * Function: ari_decode_14bits_pow_fx
@@ -689,16 +671,7 @@ static Word16 ari_decode_14bits_notbl_fx(
Word16 ari_decode_14bits_pow_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s, Word16 base )
{
    /* There are two versions to call: pow_ivas or pow_fx (default) */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
    return ari_decode_14bits_pow_ivas( ptr, bp, bits, res, s, base );
#else
    Word16 ret = ari_decode_14bits_notbl_fx( ptr, bp, bits, res, s, base, ari_lookup_pow_fx );
#ifdef FIX_2402_DEBUGGING
    printf( "decode_14bits_pow() symb= %d\n",
            *res );
#endif
    return ret;
#endif
    return ari_decode_14bits_notbl_fx( ptr, bp, bits, res, s, base, ari_lookup_pow_fx );
}

/*------------------------------------------------------------------------
@@ -708,15 +681,10 @@ Word16 ari_decode_14bits_pow_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *re
 *-------------------------------------------------------------------------*/
Word16 ari_decode_14bits_sign_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s )
{
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC
    return ari_decode_14bits_sign_ivas( ptr, bp, bits, res, s );
#else
    Word16 ret = ari_decode_14bits_notbl_fx( ptr, bp, bits, res, s, 0, ari_lookup_sign_fx );
#ifdef FIX_2402_DEBUGGING
    printf( "decode_14bits_sign() symb= %d\n",
            *res );
#endif
    return ret;
    return ari_decode_14bits_notbl_fx( ptr, bp, bits, res, s, 0, ari_lookup_sign_fx );
#endif
}

@@ -904,10 +872,6 @@ Word16 ari_decode_14bits_pow_ivas(

    *res = symbol;
    move16();
#ifdef FIX_2402_DEBUGGING
    printf( "decode_14bits_pow() symb= %d\n",
            symbol );
#endif
    return bp;
}

@@ -1008,10 +972,6 @@ Word16 ari_decode_14bits_sign_ivas(

    *res = symbol;
    move16();
#ifdef FIX_2402_DEBUGGING
    printf( "decode_14bits_sign() symb= %d\n",
            symbol - 1 );
#endif

    return bp;
}
+8 −16
Original line number Diff line number Diff line
@@ -11,14 +11,6 @@
#include "basop_util.h"
#include "basop_proto_func.h"

// #define FIX_2402_DEBUGGING

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#define HIGH( as ) ( ( as ).high + 1 )
#else
#define HIGH( as ) ( ( as ).high )
#endif

/* Returns: number of bits consumed */
static Word16 tcx_arith_decode_fx(
    Word16 L_frame,          /* i  : number of spectral lines      Q0 */
@@ -39,11 +31,11 @@ static Word16 tcx_arith_decode_fx(
    Word64 W_tmp;
    move32();

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC
    bp = ari_start_decoding_14bits_prm_ivas_fx( prm, 0, &as );
#else
    bp = ari_start_decoding_14bits_prm_fx( prm, 0, &as );
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */
#ifdef FIX_2402_DEBUGGING
    printf( "start_dec_14bits_prm() as.h,l,v= %d,%d,%d\n",
            HIGH( as ), as.low, as.value );
@@ -64,11 +56,11 @@ static Word16 tcx_arith_decode_fx(
            exp_k = round_fx( expfp( envelope[k], tmp ) );
        }
        /* decode line magnitude */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC
        bp = ari_decode_14bits_pow_ivas( prm, bp, target_bits, &q, &as, exp_k );
#else
        bp = ari_decode_14bits_pow_fx( prm, bp, target_bits, &q, &as, exp_k );
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */
#ifdef FIX_2402_DEBUGGING
        printf( "14bits_pow_ivas() as.h,l,v= %d,%d,%d, bp=%d\n",
                HIGH( as ), as.low, as.value, bp );
@@ -81,12 +73,12 @@ static Word16 tcx_arith_decode_fx(
        }
        IF( q != 0 ) /* line is non-zero, decode sign */
        {
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC
            bp = ari_decode_14bits_sign_ivas( prm, bp, target_bits, &s, &as );
            s -= 1; /* ivas returns 1 or 2, evs expects 0 or 1 */
#else
            bp = ari_decode_14bits_sign_fx( prm, bp, target_bits, &s, &as );
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */
#ifdef FIX_2402_DEBUGGING
            printf( "14bits_sign_ivas() as.h,l,v= %d,%d,%d, bp=%d\n",
                    HIGH( as ), as.low, as.value, bp );
@@ -105,11 +97,11 @@ static Word16 tcx_arith_decode_fx(
        printf( "before overflow_() as.h,l,v= %d,%d,%d, bp=%d\n",
                HIGH( as ), as.low, as.value, bp );
#endif
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC3
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC
        IF( ari_decode_overflow_ivas_fx( &as ) )
#else
        IF( ari_decode_overflow_fx( &as ) )
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC3 */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */
        {
#ifdef FIX_2402_DEBUGGING
            printf( "after overflow_() as.h,l,v= %d,%d,%d, bp=%d\n",
+0 −105
Original line number Diff line number Diff line
@@ -68,12 +68,7 @@ static Word16 quant_ctx_fx(
static Word16 arith_decode_bits_fx(
    IGFSCFDEC_INSTANCE_HANDLE hPrivateData, /* i/o: instance handle */
    Decoder_State *st,                      /* i/o: pointer to bitstream decoder state */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    Word16 nBits, /* i  : number of bits to decode */
    Word16 *extra_bits_read
#else
    Word16 nBits /* i  : number of bits to decode */
#endif
)
{
    Word16 i;
@@ -87,12 +82,7 @@ static Word16 arith_decode_bits_fx(
    {
        x = lshl( x, 1 );
        /* decode one bit using the new raw AC function */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
        static const UWord16 cum_freq[3] = { 16384, 8192, 0 };
        bit = ivas_ari_decode_14bits_bit_ext_1_lfe( st, &hPrivateData->acState, cum_freq, extra_bits_read );
#else
        bit = ari_decode_14bits_bit_ext_fx( st, &hPrivateData->acState );
#endif
        if ( bit != 0 )
        {
            x = s_or( x, 1 );
@@ -106,12 +96,7 @@ static Word16 arith_decode_residual_fx(
    IGFSCFDEC_INSTANCE_HANDLE hPrivateData,  /* i/o: instance handle */
    Decoder_State *st,                       /* i/o: pointer to decoder state */
    const UWord16 *cumulativeFrequencyTable, /* i  : cumulative frequency table to be used Q0 */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    Word16 tableOffset, /* i  : offset used to align the table */
    Word16 *extra_bits_read
#else
    Word16 tableOffset /* i  : offset used to align the table */
#endif
)
{
    Word16 val;
@@ -120,11 +105,7 @@ static Word16 arith_decode_residual_fx(
    move16();

    /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    val = ivas_ari_decode_14bits_bit_ext_1_lfe( st, &hPrivateData->acState, cumulativeFrequencyTable, extra_bits_read ); // Q0
#else
    val = ari_decode_14bits_s27_ext_fx( st, &hPrivateData->acState, cumulativeFrequencyTable ); // Q0
#endif

    /* meaning of the values of val: */
    /* esc_{0} IGF_MIN_ENC_SEPARATE ... IGF_MAX_ENC_SEPARATE esc_{IGF_SYMBOLS_IN_TABLE - 1} */
@@ -141,27 +122,15 @@ static Word16 arith_decode_residual_fx(

    /* decode one of the tails of the distribution */
    /* decode extra with 4 bits */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    extra = arith_decode_bits_fx( hPrivateData, st, 4, extra_bits_read ); // Q0
#else
    extra = arith_decode_bits_fx( hPrivateData, st, 4 ); // Q0
#endif
    IF( EQ_16( extra, 15 ) ) /* escape code 15 to indicate extra >= 15 */
    {
        /* decode addtional extra with 6 bits */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
        extra = arith_decode_bits_fx( hPrivateData, st, 6, extra_bits_read ); // Q0
#else
        extra = arith_decode_bits_fx( hPrivateData, st, 6 ); // Q0
#endif
        IF( EQ_16( extra, 63 ) ) /* escape code 63 to indicate extra >= 63 */
        {
            /* decode safety extra with 7 bits */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
            extra = arith_decode_bits_fx( hPrivateData, st, 7, extra_bits_read ); // Q0
#else
            extra = arith_decode_bits_fx( hPrivateData, st, 7 ); // Q0
#endif
            extra = add( 63, extra );
        }
        extra = add( 15, extra ); // Q0
@@ -184,22 +153,10 @@ static Word16 arith_decode_residual_fx(
}

static void arith_decode_flush_fx(
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    Decoder_State *st, /* i/o: pointer to decoder state */
    Word16 *extra_bits_read
#else
    Decoder_State *st /* i/o: pointer to decoder state */
#endif
)
{
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    ivas_ari_done_decoding_14bits_ext_1_lfe( st, *extra_bits_read );
#else
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    (void) extra_bits_read; /* remove warning */
#endif
    get_next_indice_tmp_fx( st, -14 ); /* return back the least significant 14 bits to the bitstream */
#endif

    return;
}
@@ -210,12 +167,7 @@ static void decode_sfe_vector_fx(
    Word16 t,                               /* i  : counter reset to 0 at each independent block */
    Word16 *prev_x,                         /* i  : previous vector */
    Word16 *x,                              /* o  : current vector to decode */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    Word16 length, /* i  : number of elements to decode */
    Word16 *extra_bits_read
#else
    Word16 length /* i  : number of elements to decode */
#endif
)
{
    /*
@@ -244,36 +196,19 @@ static void decode_sfe_vector_fx(
                /* (t == 0) && (f == 0) */
                /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */
                /* NOTE: the float equivalent uses a tmp variable + explicit cast here to avoid undefined behaviour here. This BASOP version does not need it as it already uses signed Word16 return value here. */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
                res = ivas_ari_decode_14bits_bit_ext_1_lfe( st, &hPrivateData->acState, (const UWord16 *) hPrivateData->cf_se00, extra_bits_read ); // Q0
#else
                res = ari_decode_14bits_s27_ext_fx( st, &hPrivateData->acState, (const UWord16 *) hPrivateData->cf_se00 );
#endif

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
                pred = arith_decode_bits_fx( hPrivateData, st, 2, extra_bits_read ); /* LSBs as 2 bit raw */
                x[f] = add( shl( res, 2 ), pred );                                   // Q0
#else
                pred = arith_decode_bits_fx( hPrivateData, st, 2 ); /* LSBs as 2 bit raw */
                x[f] = add( shl( res, 2 ), pred );                  // Q0
#endif
                move16();
            }
            ELSE IF( EQ_16( f, 1 ) )
            {
                /* (t == 0) && (f == 1) */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se01,
                                                hPrivateData->cf_off_se01,
                                                extra_bits_read );
#else
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se01,
                                                hPrivateData->cf_off_se01 );
#endif
                x[f] = add( x[0], res ); // Q0
                move16();                /* f - increment is 0, pred = b */
            }
@@ -286,18 +221,10 @@ static void decode_sfe_vector_fx(
                index1 = L_mac0( ( IGF_SYMBOLS_IN_TABLE + 1 ) * IGF_CTX_OFFSET, ( IGF_SYMBOLS_IN_TABLE + 1 ), ctx );
                /* index2 is IGF_CTX_OFFSET + ctx */
                index2 = L_mac0( IGF_CTX_OFFSET, 1, ctx );
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se02 + index1,
                                                hPrivateData->cf_off_se02[index2],
                                                extra_bits_read );
#else
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se02 + index1,
                                                hPrivateData->cf_off_se02[index2] );
#endif
                x[f] = add( x[prev_offset], res ); // Q0
                move16();                          /* pred = b */
            }
@@ -308,18 +235,10 @@ static void decode_sfe_vector_fx(
            IF( f == 0 )
            {
                /* (t == 1) && (f == 0) */
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se10,
                                                hPrivateData->cf_off_se10,
                                                extra_bits_read );
#else
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se10,
                                                hPrivateData->cf_off_se10 );
#endif
                x[f] = add( prev_x[f], res ); // Q0
                move16();                     /* pred = a */
            }
@@ -340,18 +259,10 @@ static void decode_sfe_vector_fx(
                /* index2 is IGF_CTX_COUNT * (IGF_CTX_OFFSET + ctx_t) + (IGF_CTX_OFFSET + ctx_f) */
                index2 = L_mac0( ( IGF_CTX_COUNT + 1 ) * IGF_CTX_OFFSET, IGF_CTX_COUNT, ctx_t );
                index2 = L_mac0( index2, 1, ctx_f );
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se11 + index1,
                                                hPrivateData->cf_off_se11[index2],
                                                extra_bits_read );
#else
                res = arith_decode_residual_fx( hPrivateData,
                                                st,
                                                hPrivateData->cf_se11 + index1,
                                                hPrivateData->cf_off_se11[index2] );
#endif
                x[f] = add( pred, res ); // Q0
                move16();
            }
@@ -409,15 +320,7 @@ void IGFSCFDecoderDecode(
    /* insert data */
    hPublicData->bitsRead = st->next_bit_pos;
    move16();
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    Word16 extra_bits_read = 0;
    move16();
#endif
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    ivas_ari_start_decoding_14bits_ext_1_lfe( st, &hPublicData->acState, &extra_bits_read );
#else
    ari_start_decoding_14bits_fx( st, &hPublicData->acState ); /* start AC decoding */
#endif

    /* check if coder needs a reset and do it if necessary */
    IF( indepFlag != 0 )
@@ -426,17 +329,9 @@ void IGFSCFDecoderDecode(
        IGFSCFDecoderReset( hPublicData );
    }

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC2
    decode_sfe_vector_fx( hPublicData, st, hPublicData->t, hPublicData->prev, sfe, hPublicData->scfCountLongBlock[igfGridIdx],
                          &extra_bits_read );

    arith_decode_flush_fx( st,
                           &extra_bits_read ); /* finish AC decoding */
#else
    decode_sfe_vector_fx( hPublicData, st, hPublicData->t, hPublicData->prev, sfe, hPublicData->scfCountLongBlock[igfGridIdx] );

    arith_decode_flush_fx( st ); /* finish AC decoding */
#endif

    /* advance history */
    Copy( sfe, hPublicData->prev, hPublicData->scfCountLongBlock[igfGridIdx] );