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

introduced additional macro for the encoder replacement (EVS -> IVAS arith codec)

parent 129ee244
Loading
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@

#ifdef DEBUG_ARITH_IVAS_REPLACEMENT
/* to compare respective values in ivas- and evs-arith-enc calculations */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
#define HIGH( p )      ( ( p ) + 1 )
#define BITS_TO_FOLLOW bits_to_follow
#else
@@ -53,7 +53,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
    CONTEXT_HM_CONFIG *hm_cfg )
{
    Word16 ptr[BITBUFSIZE];
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    Tastat as, as_overflow;
#else
    TastatEnc as, as_overflow;
@@ -166,7 +166,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
    lsbs_bits2 = ptr + nbbits - 1;

    /*Start Encoding*/
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    ari_start_encoding_14bits_ivas_fx( &as );
#else
    ari_start_encoding_14bits_fx( &as );
@@ -215,7 +215,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
        move16();

        /*Copy states*/
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        ari_copy_states_ivas_fx( &as, &as_overflow );
#else
        ari_copy_states_fx( &as, &as_overflow );
@@ -251,7 +251,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_SIMPLIFY_ARI_CODEC
#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 */
@@ -278,20 +278,20 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
        assert( tmp >= 0 && tmp < 4096 );
        pki = ari_lookup_s17_LC[tmp]; /* Q0 */
        move16();
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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_SIMPLIFY_ARI_CODEC
#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 ) )
#else
        IF( GT_16( add( add( add( bp, extract_l( as.value ) ), nbbits_signs ), nbbits_lsbs ), nbbits_m2 ) )
#endif
        {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as_overflow, &as );
#else
            ari_copy_states_fx( &as_overflow, &as );
@@ -321,19 +321,19 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
                    assert( t >= 0 && t < 4096 );
                    pki = ari_lookup_s17_LC[t]; /* Q0 */
                    move16();
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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_SIMPLIFY_ARI_CODEC
#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 ) )
#else
                    IF( GT_16( add( add( add( bp, extract_l( as.value ) ), nbbits_signs ), nbbits_lsbs ), nbbits_m2 ) )
#endif
                    {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                        ari_copy_states_ivas_fx( &as_overflow, &as );
#else
                        ari_copy_states_fx( &as_overflow, &as );
@@ -384,7 +384,7 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx(
    } /*end of the 2-tuples loop*/

    /* End arithmetic coder, overflow management */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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 */
+28 −18
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 * forward declarations
 *-------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
static Word16 ari_encode_14bits_high_low_ivas_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -23,6 +24,7 @@ static Word16 ari_encode_14bits_high_low_ivas_fx(
    Word32 high, /* Q0 */
    Word32 low   /* Q0 */
);
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


/*---------------------------------------------------------------
@@ -34,7 +36,7 @@ static Word16 ari_encode_14bits_high_low_ivas_fx(
 * \return none
 *-------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_copy_states_fx(
    TastatEnc *source,
    TastatEnc *dest )
@@ -48,7 +50,7 @@ void ari_copy_states_fx(

    return;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


/*---------------------------------------------------------------
@@ -60,6 +62,7 @@ void ari_copy_states_fx(
 * \return none
 *-------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_copy_states_ivas_fx(
    Tastat *source,
    Tastat *dest )
@@ -75,6 +78,7 @@ void ari_copy_states_ivas_fx(

    return;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


/*---------------------------------------------------------------
@@ -90,7 +94,7 @@ void ari_copy_states_ivas_fx(
 * \return none
 *-------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_start_encoding_14bits_fx(
    TastatEnc *s )
{
@@ -102,7 +106,7 @@ void ari_start_encoding_14bits_fx(

    return;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*---------------------------------------------------------------
 * Ari encoder 14 bits routines
@@ -146,7 +150,7 @@ Word16 ari_put_bit_plus_follow(
 *
 * \return bit consumption
 * ------------------------------------------------------------ - */
#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_encoding_14bits_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -162,7 +166,7 @@ Word16 ari_done_encoding_14bits_fx(
    }
    return ari_put_bit_plus_follow( ptr, bp, add( s->value, 1 ), bit );
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*---------------------------------------------------------------
 *ari_encode_14bits_ext_fx()
@@ -178,7 +182,7 @@ Word16 ari_done_encoding_14bits_fx(
 *
 * \return bit consumption
 * ------------------------------------------------------------ - */
#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_ext_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -259,7 +263,7 @@ Word16 ari_encode_14bits_ext_fx(
#endif
    return bp;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_encode_overflow_fx()
@@ -267,13 +271,13 @@ Word16 ari_encode_14bits_ext_fx(
 *
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_overflow_fx(
    TastatEnc *s )
{
    return L_sub( L_sub( s->high, 1 ), s->low ) <= 0;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_encode_overflow_ivas_fx()
@@ -281,11 +285,13 @@ Word16 ari_encode_overflow_fx(
 *
 *-------------------------------------------------------------------------*/

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

/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_high_low()
@@ -293,7 +299,7 @@ Word16 ari_encode_overflow_ivas_fx(
 *
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
static Word16 ari_encode_14bits_high_low(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -364,7 +370,7 @@ static Word16 ari_encode_14bits_high_low(

    return bp;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


/*------------------------------------------------------------------------
@@ -373,7 +379,7 @@ static Word16 ari_encode_14bits_high_low(
 * Encode an cumulative frequency interval.
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_range_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -399,7 +405,7 @@ Word16 ari_encode_14bits_range_fx(
#endif
    return ret;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_range_ivas_fx
@@ -407,6 +413,7 @@ Word16 ari_encode_14bits_range_fx(
 * Encode an cumulative frequency interval.
 *-------------------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_range_ivas_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -433,6 +440,7 @@ Word16 ari_encode_14bits_range_ivas_fx(
#endif
    return ret;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_encode_14bits_sign_fx
@@ -440,7 +448,7 @@ Word16 ari_encode_14bits_range_ivas_fx(
 * Encode a sign with equal probabilities.
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_sign_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -471,7 +479,7 @@ Word16 ari_encode_14bits_sign_fx(
    Word16 ret = ari_encode_14bits_high_low( ptr, bp, bits, s, high, low );
    return ret;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


/*------------------------------------------------------------------------
@@ -480,7 +488,7 @@ Word16 ari_encode_14bits_sign_fx(
 * Finish up encoding in CBR mode.
 *-------------------------------------------------------------------------*/

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
#ifndef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_cbr_encoding_14bits_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -528,7 +536,7 @@ Word16 ari_done_cbr_encoding_14bits_fx(

    return bp;
}
#endif /* FIX_2402_SIMPLIFY_ARI_CODEC */
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */

/*------------------------------------------------------------------------
 * Function: ari_done_cbr_encoding_14bits_ivas_fx
@@ -536,6 +544,7 @@ Word16 ari_done_cbr_encoding_14bits_fx(
 * Finish up encoding in CBR mode.
 *-------------------------------------------------------------------------*/

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_cbr_encoding_14bits_ivas_fx(
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
@@ -583,6 +592,7 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx(

    return bp;
}
#endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */


void ari_start_encoding_14bits_ivas_fx(
+18 −18
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@

#ifdef DEBUG_ARITH_IVAS_REPLACEMENT
/* to compare respective values in ivas- and evs-arith-enc calculations */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
#define HIGH( p )      ( ( p ) + 1 )
#define BITS_TO_FOLLOW bits_to_follow
#else
@@ -541,7 +541,7 @@ static Word16 tcx_arith_encode(
    Word16 prm[]             /* o  : bit-stream                                Q0 */
)
{
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    Tastat as, as_lastgood;
#else
    TastatEnc as, as_lastgood;
@@ -552,7 +552,7 @@ static Word16 tcx_arith_encode(
    Word16 tmpi1, tmpi2;

    /* Final coding */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
    ari_start_encoding_14bits_ivas_fx( &as );
    ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
@@ -571,7 +571,7 @@ static Word16 tcx_arith_encode(
        IF( q_abs_spectrum[k] == 0 )
        {
            assert( exps[k] >= 2 );
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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 );
@@ -588,7 +588,7 @@ static Word16 tcx_arith_encode(
                powfp_odd2( exps[k], q_abs_spectrum[k], &tmpi1, &tmpi2 );
            }

#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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
@@ -598,7 +598,7 @@ static Word16 tcx_arith_encode(
        }

        /* Check bit budget status */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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 */
@@ -609,7 +609,7 @@ static Word16 tcx_arith_encode(
            IF( GT_16( q_abs_spectrum[k], 1 ) ) /* Lower magnitude is still > 0 */
            {
                /* Restore state */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                ari_copy_states_ivas_fx( &as_lastgood, &as );
#else
                ari_copy_states_fx( &as_lastgood, &as );
@@ -624,7 +624,7 @@ static Word16 tcx_arith_encode(
                /* Retry encoding */
                powfp_odd2( exps[k], q_abs_spectrum[k], &tmpi1, &tmpi2 );

#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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
@@ -632,13 +632,13 @@ static Word16 tcx_arith_encode(
                bp = ari_encode_14bits_sign_fx( prm, bp, target_bits, &as, signs[k] );
#endif

#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
                    ari_copy_states_fx( &as, &as_lastgood );
@@ -652,7 +652,7 @@ static Word16 tcx_arith_encode(
                    BREAK;
                }
            }
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as_lastgood, &as );
#else
            ari_copy_states_fx( &as_lastgood, &as );
@@ -666,7 +666,7 @@ static Word16 tcx_arith_encode(
        }
        ELSE
        {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
            ari_copy_states_fx( &as, &as_lastgood );
@@ -683,19 +683,19 @@ static Word16 tcx_arith_encode(
    {
        assert( exps[k] >= 1 );

#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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_SIMPLIFY_ARI_CODEC
#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_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as_lastgood, &as );
#else
            ari_copy_states_fx( &as_lastgood, &as );
@@ -707,7 +707,7 @@ static Word16 tcx_arith_encode(
        }
        ELSE
        {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            ari_copy_states_ivas_fx( &as, &as_lastgood );
#else
            ari_copy_states_fx( &as, &as_lastgood );
@@ -720,7 +720,7 @@ static Word16 tcx_arith_encode(
    IF( EQ_16( kEncoded, sub( L_frame, 1 ) ) ) /* RESQ bits possibly available */
    {
        /* Limit target bits to actually needed bits */
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        target_bits = add( add( bp, 16 ), extract_l( as.bits_to_follow ) );
#else
        target_bits = add( add( bp, 16 ), extract_l( as.value ) );
@@ -732,7 +732,7 @@ static Word16 tcx_arith_encode(
            __FILE__, __LINE__,
            bp, target_bits, as.low, HIGH( as.high ), as.BITS_TO_FOLLOW );
#endif
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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 );
+7 −7
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ static void arith_encode_bits(
        FOR( i = nBits - 1; i >= 0; --i ) /* nBits > 0 */
        {
            bit = s_and( shr( x, i ), 1 );
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#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 );
#else
            hPrivateData->ptrBitIndex = ari_encode_14bits_sign_fx( ptr, hPrivateData->ptrBitIndex, MAX16B /* disable the bit count limitation */, &hPrivateData->acState_fx, bit );
@@ -173,7 +173,7 @@ static void arith_encode_residual(
                                                /* encode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                       hPrivateData->ptrBitIndex,
                                                                       &hPrivateData->acState_ivas_fx,
@@ -206,7 +206,7 @@ static void arith_encode_residual(
        extra = sub( IGF_MIN_ENC_SEPARATE - 1, x );
        IF( EQ_16( element_mode, EVS_MONO ) )
        {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                       hPrivateData->ptrBitIndex,
                                                                       &hPrivateData->acState_ivas_fx,
@@ -238,7 +238,7 @@ static void arith_encode_residual(

        IF( EQ_16( element_mode, EVS_MONO ) )
        {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
            hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                       hPrivateData->ptrBitIndex,
                                                                       &hPrivateData->acState_ivas_fx,
@@ -335,7 +335,7 @@ static void encode_sfe_vector(
                /* encode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
                    hPrivateData->ptrBitIndex = ari_encode_14bits_ext_ivas_fx( ptr,
                                                                               hPrivateData->ptrBitIndex,
                                                                               &hPrivateData->acState_ivas_fx,
@@ -445,7 +445,7 @@ Word16 IGFSCFEncoderEncode_fx(
    /* start AC encoding */
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        ari_start_encoding_14bits_ivas_fx( &hPublicData->acState_ivas_fx );
#else
        ari_start_encoding_14bits_fx( &hPublicData->acState_fx );
@@ -468,7 +468,7 @@ Word16 IGFSCFEncoderEncode_fx(
    /* finish AC encoding */
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
#ifdef FIX_2402_SIMPLIFY_ARI_CODEC
#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_ivas_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState_ivas_fx );
#else
        hPublicData->ptrBitIndex = ari_done_encoding_14bits_fx( ptr, hPublicData->ptrBitIndex, &hPublicData->acState_fx );