Loading lib_enc/ACcontextMapping_enc_fx.c +0 −25 Original line number Diff line number Diff line Loading @@ -17,18 +17,6 @@ #define MAKE_NUMBER_QX( number, QX ) ( ( number ) << ( QX ) ) /* evaulated at compile time */ #define MAKE_VARIABLE_QX( variable, QX ) W_shl( W_deposit32_l( L_deposit_l( ( variable ) ) ), ( QX ) ) /* evaluated at run time */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT /* to compare respective values in ivas- and evs-arith-enc calculations */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC #define HIGH( p ) ( ( p ) + 1 ) #define BITS_TO_FOLLOW bits_to_follow #else #define HIGH( p ) ( ( p ) + 0 ) #define BITS_TO_FOLLOW value #endif #endif /*-------------------------------------------------------------------* * ACcontextMapping_encode2_no_mem_s17_LC_fx() * Loading Loading @@ -110,9 +98,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( flag_overflow = 0; move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "in ACcontextMapping_encode2_no_mem_s17_LC_fx()\n" ); #endif IF( hm_cfg ) /* mapped domain */ { numPeakIndicesOrig = hm_cfg->numPeakIndices; /* Q0 */ Loading Loading @@ -184,9 +169,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( b1_i = get_next_coeff( ii, &p2, &idx2, hm_cfg ); /* Q0 */ idx = s_min( idx1, idx2 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "start loop: k,lastnz=%d,%d, a1_i,b1_i,idx= %d,%d,%d\n", k, lastnz, a1_i, b1_i, idx ); #endif /* Get context */ ctx = &c[s_or( p1, p2 )]; /* Q0 */ Loading Loading @@ -219,9 +201,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( ari_copy_states_ivas_fx( &as, &as_overflow ); #else ari_copy_states_fx( &as, &as_overflow ); #endif #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "middle loop: k,lastnz=%d,%d, a1_i,b1_i,idx= %d,%d,%d\n", k, lastnz, a1_i, b1_i, idx ); #endif bp_overflow = bp; /* Q0 */ move16(); Loading Loading @@ -255,10 +234,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( 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 #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "l,h,v= 0x%04x,0x%04x,0x%04x, bp=%03d, a1,b1=0x%04x,0x%04x\n", as.low, HIGH( as.high ), as.BITS_TO_FOLLOW, bp, a1, b1 ); #endif *lsbs_bits2-- = s_and( a1, 1 ); move16(); Loading lib_enc/ari_enc_fx.c +0 −86 Original line number Diff line number Diff line Loading @@ -122,17 +122,11 @@ Word16 ari_put_bit_plus_follow( { assert( bit == 0 || bit == 1 ); ptr[bp++] = bit; /* send initially a zero or one Q0*/ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:1: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); bit = s_xor( bit, 1 ); /* invert bit to send */ FOR( ; bits_to_follow > 0; bits_to_follow-- ) { ptr[bp++] = bit; /* send inverted bit Q0*/ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:2: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); } Loading Loading @@ -258,9 +252,6 @@ Word16 ari_encode_14bits_ext_fx( move32(); s->value = bits_to_follow; /* Q0 */ move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_encode_14bits_ext_fx(), bp=%d, symbol=%d\n", bp, symbol ); #endif return bp; } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */ Loading Loading @@ -314,10 +305,6 @@ static Word16 ari_encode_14bits_high_low( bits_to_follow = s->value; move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low1: s->low,high,btfo=0x%04x,0x%04x,0x%04x high,low=0x%04x,0x%04x bp=%d\n", s->low, s->high - 1, s->value, high, low, bp ); #endif /* while there are more than 16 bits left */ tmp = sub( 16, bits ); /* Q0 */ WHILE( add( add( bp, bits_to_follow ), tmp ) < 0 ) Loading Loading @@ -354,10 +341,6 @@ static Word16 ari_encode_14bits_high_low( } low = L_add( low, low ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low2: high=0x%04x, s->btfo=%d\n", high, s->value ); #endif high = L_add( high, high ); /* Scale up code range. Q0*/ } Loading Loading @@ -395,14 +378,7 @@ Word16 ari_encode_14bits_range_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 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range, s->low,high=0x%04x,0x%04x range=0x%04x low,high=0x%04x,0x%04x\n", s->low, s->high, range, low, high ); #endif Word16 ret = ari_encode_14bits_high_low( ptr, bp, bits, s, high, low ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range end ret=%d, s->low,high,value=x%04x,0x%04x,x%04x\n", ret, s->low, s->high, s->value ); #endif return ret; } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */ Loading @@ -429,15 +405,8 @@ 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 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range, s->low,high=0x%04x,0x%04x range=0x%04x low,high=0x%04x,0x%04x\n", s->low, s->high + 1, range, low, high ); #endif Word16 ret = ari_encode_14bits_high_low_ivas_fx( ptr, bp, bits, s, high, low ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range end ret=%d, s->low,high,value=x%04x,0x%04x,x%04x\n", ret, s->low, s->high + 1, s->bits_to_follow ); #endif return ret; } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */ Loading @@ -463,9 +432,6 @@ Word16 ari_encode_14bits_sign_fx( high = L_add( s->high, 0 ); low = L_add( s->low, 0 ); range = L_sub( high, low ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "sign low,high=0x%04x,0x%04x range=0x%04x\n", low, high, range ); #endif L_tmp = L_shr( range, 1 ); if ( sign != 0 ) { Loading Loading @@ -496,22 +462,10 @@ Word16 ari_done_cbr_encoding_14bits_fx( TastatEnc *s ) { Word16 high, tmp, k; #ifdef DEBUG_ARITH_IVAS_REPLACEMENT Word16 bp0 = bp; #endif tmp = sub( bits, 16 ); /* Q0 */ WHILE( GT_16( sub( tmp, bp ), s->value ) ) { #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "%s:%d: before ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", __FILE__, __LINE__, bp, bits, s->low, s->high, s->value ); #endif bp = ari_encode_14bits_sign_fx( ptr, bp, bits, s, 0 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "after ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", bp, bits, s->low, s->high, s->value ); #endif } high = extract_l( L_sub( s->high, 1 ) ); /* Q0 */ Loading @@ -520,16 +474,9 @@ Word16 ari_done_cbr_encoding_14bits_fx( high = lshl( high, 1 ); tmp = s_min( 15, sub( bits, bp ) ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:3: bp0=%d bp=%d, bits=%d,s=0x%04x,0x%04x,0x%04x, high=%d,tmp=%d,\n", bp0, bp, s->low, s->high, s->BIT_TO_FOLLOW, high, tmp ); #endif FOR( k = 0; k < tmp; ++k ) { ptr[bp++] = lshr( high, 15 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:4: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); high = lshl( high, 1 ); } Loading @@ -552,22 +499,10 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx( Tastat *s ) { Word16 high, tmp, k; #ifdef DEBUG_ARITH_IVAS_REPLACEMENT Word16 bp0 = bp; #endif tmp = sub( bits, 16 ); /* Q0 */ WHILE( GT_16( sub( tmp, bp ), (Word16) s->bits_to_follow ) ) { #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "%s:%d: before ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", __FILE__, __LINE__, bp, bits, s->low, s->high, s->bits_to_follow ); #endif bp = ari_encode_14bits_sign_ivas_fx( ptr, bp, bits, s, 0 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "after ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", bp, bits, s->low, s->high, s->value ); #endif } high = extract_l( L_sub( s->high, 0 ) ); /* Q0 */ Loading @@ -576,16 +511,9 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx( high = lshl( high, 1 ); tmp = s_min( 15, sub( bits, bp ) ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:3: bp0=%d bp=%d, bits=%d,s=0x%04x,0x%04x,0x%04x, high=%d,tmp=%d,\n", bp0, bp, s->low, s->high, s->BITS_TO_FOLLOW, high, tmp ); #endif FOR( k = 0; k < tmp; ++k ) { ptr[bp++] = lshr( high, 15 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:4: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); high = lshl( high, 1 ); } Loading Loading @@ -714,9 +642,6 @@ Word16 ari_encode_14bits_ext_ivas_fx( move32(); s->bits_to_follow = bits_to_follow; /* Q0 */ move32(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_encode_14bits_ext_fx(), bp=%d, symbol=%d\n", bp, symbol ); #endif return bp; } Loading @@ -739,10 +664,6 @@ static Word16 ari_encode_14bits_high_low_ivas_fx( bits_to_follow = extract_l( s->bits_to_follow ); /* Q0 */ move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low1: s->low,high,btfo=0x%04x,0x%04x,0x%04x high,low=0x%04x,0x%04x bp=%d\n", s->low, s->high, s->bits_to_follow, high, low, bp ); #endif /* while there are more than 16 bits left */ tmp = sub( 16, bits ); /* Q0 */ Loading Loading @@ -780,10 +701,6 @@ static Word16 ari_encode_14bits_high_low_ivas_fx( } low = L_add( low, low ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low2: high=0x%04x, s->btfo=%d\n", high, s->bits_to_follow ); #endif high = L_add( high, high ); /* Scale up code range. */ } Loading Loading @@ -818,9 +735,6 @@ Word16 ari_encode_14bits_sign_ivas_fx( high = L_add( s->high, 1 ); low = L_add( s->low, 0 ); range = L_sub( high, low ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "sign low,high=0x%04x,0x%04x range=0x%04x\n", low, high, range ); #endif L_tmp = L_shr( range, 1 ); if ( sign != 0 ) Loading lib_enc/arith_coder_enc_fx.c +0 −17 Original line number Diff line number Diff line Loading @@ -11,18 +11,6 @@ #include "basop_util.h" #include "rom_com.h" #ifdef DEBUG_ARITH_IVAS_REPLACEMENT /* to compare respective values in ivas- and evs-arith-enc calculations */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC #define HIGH( p ) ( ( p ) + 1 ) #define BITS_TO_FOLLOW bits_to_follow #else #define HIGH( p ) ( ( p ) + 0 ) #define BITS_TO_FOLLOW value #endif #endif /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ Loading Loading @@ -727,11 +715,6 @@ static Word16 tcx_arith_encode( #endif } #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "%s:%d: before ari_done_cbr_encoding_14bits_fx()i bp=%d target_bits=%d as=0x%04x,0x%04x,0x%04x\n", __FILE__, __LINE__, bp, target_bits, as.low, HIGH( as.high ), as.BITS_TO_FOLLOW ); #endif #ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC Word16 ret = ari_done_cbr_encoding_14bits_ivas_fx( prm, bp, target_bits, &as ); #else Loading Loading
lib_enc/ACcontextMapping_enc_fx.c +0 −25 Original line number Diff line number Diff line Loading @@ -17,18 +17,6 @@ #define MAKE_NUMBER_QX( number, QX ) ( ( number ) << ( QX ) ) /* evaulated at compile time */ #define MAKE_VARIABLE_QX( variable, QX ) W_shl( W_deposit32_l( L_deposit_l( ( variable ) ) ), ( QX ) ) /* evaluated at run time */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT /* to compare respective values in ivas- and evs-arith-enc calculations */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC #define HIGH( p ) ( ( p ) + 1 ) #define BITS_TO_FOLLOW bits_to_follow #else #define HIGH( p ) ( ( p ) + 0 ) #define BITS_TO_FOLLOW value #endif #endif /*-------------------------------------------------------------------* * ACcontextMapping_encode2_no_mem_s17_LC_fx() * Loading Loading @@ -110,9 +98,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( flag_overflow = 0; move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "in ACcontextMapping_encode2_no_mem_s17_LC_fx()\n" ); #endif IF( hm_cfg ) /* mapped domain */ { numPeakIndicesOrig = hm_cfg->numPeakIndices; /* Q0 */ Loading Loading @@ -184,9 +169,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( b1_i = get_next_coeff( ii, &p2, &idx2, hm_cfg ); /* Q0 */ idx = s_min( idx1, idx2 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "start loop: k,lastnz=%d,%d, a1_i,b1_i,idx= %d,%d,%d\n", k, lastnz, a1_i, b1_i, idx ); #endif /* Get context */ ctx = &c[s_or( p1, p2 )]; /* Q0 */ Loading Loading @@ -219,9 +201,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( ari_copy_states_ivas_fx( &as, &as_overflow ); #else ari_copy_states_fx( &as, &as_overflow ); #endif #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "middle loop: k,lastnz=%d,%d, a1_i,b1_i,idx= %d,%d,%d\n", k, lastnz, a1_i, b1_i, idx ); #endif bp_overflow = bp; /* Q0 */ move16(); Loading Loading @@ -255,10 +234,6 @@ void ACcontextMapping_encode2_no_mem_s17_LC_fx( 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 #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "l,h,v= 0x%04x,0x%04x,0x%04x, bp=%03d, a1,b1=0x%04x,0x%04x\n", as.low, HIGH( as.high ), as.BITS_TO_FOLLOW, bp, a1, b1 ); #endif *lsbs_bits2-- = s_and( a1, 1 ); move16(); Loading
lib_enc/ari_enc_fx.c +0 −86 Original line number Diff line number Diff line Loading @@ -122,17 +122,11 @@ Word16 ari_put_bit_plus_follow( { assert( bit == 0 || bit == 1 ); ptr[bp++] = bit; /* send initially a zero or one Q0*/ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:1: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); bit = s_xor( bit, 1 ); /* invert bit to send */ FOR( ; bits_to_follow > 0; bits_to_follow-- ) { ptr[bp++] = bit; /* send inverted bit Q0*/ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:2: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); } Loading Loading @@ -258,9 +252,6 @@ Word16 ari_encode_14bits_ext_fx( move32(); s->value = bits_to_follow; /* Q0 */ move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_encode_14bits_ext_fx(), bp=%d, symbol=%d\n", bp, symbol ); #endif return bp; } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */ Loading Loading @@ -314,10 +305,6 @@ static Word16 ari_encode_14bits_high_low( bits_to_follow = s->value; move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low1: s->low,high,btfo=0x%04x,0x%04x,0x%04x high,low=0x%04x,0x%04x bp=%d\n", s->low, s->high - 1, s->value, high, low, bp ); #endif /* while there are more than 16 bits left */ tmp = sub( 16, bits ); /* Q0 */ WHILE( add( add( bp, bits_to_follow ), tmp ) < 0 ) Loading Loading @@ -354,10 +341,6 @@ static Word16 ari_encode_14bits_high_low( } low = L_add( low, low ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low2: high=0x%04x, s->btfo=%d\n", high, s->value ); #endif high = L_add( high, high ); /* Scale up code range. Q0*/ } Loading Loading @@ -395,14 +378,7 @@ Word16 ari_encode_14bits_range_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 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range, s->low,high=0x%04x,0x%04x range=0x%04x low,high=0x%04x,0x%04x\n", s->low, s->high, range, low, high ); #endif Word16 ret = ari_encode_14bits_high_low( ptr, bp, bits, s, high, low ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range end ret=%d, s->low,high,value=x%04x,0x%04x,x%04x\n", ret, s->low, s->high, s->value ); #endif return ret; } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */ Loading @@ -429,15 +405,8 @@ 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 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range, s->low,high=0x%04x,0x%04x range=0x%04x low,high=0x%04x,0x%04x\n", s->low, s->high + 1, range, low, high ); #endif Word16 ret = ari_encode_14bits_high_low_ivas_fx( ptr, bp, bits, s, high, low ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "range end ret=%d, s->low,high,value=x%04x,0x%04x,x%04x\n", ret, s->low, s->high + 1, s->bits_to_follow ); #endif return ret; } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_ENC */ Loading @@ -463,9 +432,6 @@ Word16 ari_encode_14bits_sign_fx( high = L_add( s->high, 0 ); low = L_add( s->low, 0 ); range = L_sub( high, low ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "sign low,high=0x%04x,0x%04x range=0x%04x\n", low, high, range ); #endif L_tmp = L_shr( range, 1 ); if ( sign != 0 ) { Loading Loading @@ -496,22 +462,10 @@ Word16 ari_done_cbr_encoding_14bits_fx( TastatEnc *s ) { Word16 high, tmp, k; #ifdef DEBUG_ARITH_IVAS_REPLACEMENT Word16 bp0 = bp; #endif tmp = sub( bits, 16 ); /* Q0 */ WHILE( GT_16( sub( tmp, bp ), s->value ) ) { #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "%s:%d: before ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", __FILE__, __LINE__, bp, bits, s->low, s->high, s->value ); #endif bp = ari_encode_14bits_sign_fx( ptr, bp, bits, s, 0 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "after ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", bp, bits, s->low, s->high, s->value ); #endif } high = extract_l( L_sub( s->high, 1 ) ); /* Q0 */ Loading @@ -520,16 +474,9 @@ Word16 ari_done_cbr_encoding_14bits_fx( high = lshl( high, 1 ); tmp = s_min( 15, sub( bits, bp ) ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:3: bp0=%d bp=%d, bits=%d,s=0x%04x,0x%04x,0x%04x, high=%d,tmp=%d,\n", bp0, bp, s->low, s->high, s->BIT_TO_FOLLOW, high, tmp ); #endif FOR( k = 0; k < tmp; ++k ) { ptr[bp++] = lshr( high, 15 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:4: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); high = lshl( high, 1 ); } Loading @@ -552,22 +499,10 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx( Tastat *s ) { Word16 high, tmp, k; #ifdef DEBUG_ARITH_IVAS_REPLACEMENT Word16 bp0 = bp; #endif tmp = sub( bits, 16 ); /* Q0 */ WHILE( GT_16( sub( tmp, bp ), (Word16) s->bits_to_follow ) ) { #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "%s:%d: before ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", __FILE__, __LINE__, bp, bits, s->low, s->high, s->bits_to_follow ); #endif bp = ari_encode_14bits_sign_ivas_fx( ptr, bp, bits, s, 0 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "after ari_encode_14bits_sign_fx() bp=%d, bits=%d, s=0x%04x,0x%04x,0x%04x\n", bp, bits, s->low, s->high, s->value ); #endif } high = extract_l( L_sub( s->high, 0 ) ); /* Q0 */ Loading @@ -576,16 +511,9 @@ Word16 ari_done_cbr_encoding_14bits_ivas_fx( high = lshl( high, 1 ); tmp = s_min( 15, sub( bits, bp ) ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:3: bp0=%d bp=%d, bits=%d,s=0x%04x,0x%04x,0x%04x, high=%d,tmp=%d,\n", bp0, bp, s->low, s->high, s->BITS_TO_FOLLOW, high, tmp ); #endif FOR( k = 0; k < tmp; ++k ) { ptr[bp++] = lshr( high, 15 ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_enc_fx.c:4: ptr[%d-1]=%d\n", bp, ptr[bp - 1] ); #endif move16(); high = lshl( high, 1 ); } Loading Loading @@ -714,9 +642,6 @@ Word16 ari_encode_14bits_ext_ivas_fx( move32(); s->bits_to_follow = bits_to_follow; /* Q0 */ move32(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "ari_encode_14bits_ext_fx(), bp=%d, symbol=%d\n", bp, symbol ); #endif return bp; } Loading @@ -739,10 +664,6 @@ static Word16 ari_encode_14bits_high_low_ivas_fx( bits_to_follow = extract_l( s->bits_to_follow ); /* Q0 */ move16(); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low1: s->low,high,btfo=0x%04x,0x%04x,0x%04x high,low=0x%04x,0x%04x bp=%d\n", s->low, s->high, s->bits_to_follow, high, low, bp ); #endif /* while there are more than 16 bits left */ tmp = sub( 16, bits ); /* Q0 */ Loading Loading @@ -780,10 +701,6 @@ static Word16 ari_encode_14bits_high_low_ivas_fx( } low = L_add( low, low ); #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "high_low2: high=0x%04x, s->btfo=%d\n", high, s->bits_to_follow ); #endif high = L_add( high, high ); /* Scale up code range. */ } Loading Loading @@ -818,9 +735,6 @@ Word16 ari_encode_14bits_sign_ivas_fx( high = L_add( s->high, 1 ); low = L_add( s->low, 0 ); range = L_sub( high, low ); /* Q0 */ #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "sign low,high=0x%04x,0x%04x range=0x%04x\n", low, high, range ); #endif L_tmp = L_shr( range, 1 ); if ( sign != 0 ) Loading
lib_enc/arith_coder_enc_fx.c +0 −17 Original line number Diff line number Diff line Loading @@ -11,18 +11,6 @@ #include "basop_util.h" #include "rom_com.h" #ifdef DEBUG_ARITH_IVAS_REPLACEMENT /* to compare respective values in ivas- and evs-arith-enc calculations */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC #define HIGH( p ) ( ( p ) + 1 ) #define BITS_TO_FOLLOW bits_to_follow #else #define HIGH( p ) ( ( p ) + 0 ) #define BITS_TO_FOLLOW value #endif #endif /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ Loading Loading @@ -727,11 +715,6 @@ static Word16 tcx_arith_encode( #endif } #ifdef DEBUG_ARITH_IVAS_REPLACEMENT printf( "%s:%d: before ari_done_cbr_encoding_14bits_fx()i bp=%d target_bits=%d as=0x%04x,0x%04x,0x%04x\n", __FILE__, __LINE__, bp, target_bits, as.low, HIGH( as.high ), as.BITS_TO_FOLLOW ); #endif #ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC Word16 ret = ari_done_cbr_encoding_14bits_ivas_fx( prm, bp, target_bits, &as ); #else Loading