Loading lib_com/prot_fx.h +6 −0 Original line number Diff line number Diff line Loading @@ -9209,10 +9209,12 @@ void getTCXWindowing_ivas_fx( Decoder_State *st0 /* i : bitstream */ ); #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_start_decoding_14bits_prm_ivas_fx( const Word16 *ptr, Word16 bp, Tastat *s ); #endif void generate_masking_noise_ivas_fx( Word32 *timeDomainBuffer, /* i/o: time-domain signal */ Loading Loading @@ -9388,6 +9390,7 @@ void hq_generic_hf_encoding_fx( Word16 *hq_generic_exc_clas, /* o : bwe excitation class */ Word16 length ); #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_decode_14bits_pow_ivas( Word16 *ptr, Word16 bp, Loading @@ -9395,13 +9398,16 @@ Word16 ari_decode_14bits_pow_ivas( Word16 *res, Tastat *s, UWord16 base ); #endif #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_decode_14bits_sign_ivas( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s ); #endif ivas_error config_acelp1_fx( const Word16 enc_dec, /* i : encoder/decoder flag */ Loading lib_dec/ACcontextMapping_dec_fx.c +1 −17 Original line number Diff line number Diff line Loading @@ -13,9 +13,6 @@ #include "ivas_prot_fx.h" #include "ivas_rom_com.h" #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC #include "ivas_prot_fx.h" #endif /*-------------------------------------------------------------------* * ACcontextMapping_decode2_no_mem_s17_LC() Loading Loading @@ -136,12 +133,7 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( } /* Start Decoding */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 extra_bits_read = 0; ivas_ari_start_decoding_14bits_ext_1_lfe( st, &as, &extra_bits_read ); #else ari_start_decoding_14bits_fx( st, &as ); #endif overflow_bit_pos = st->next_bit_pos; move16(); Loading Loading @@ -190,11 +182,8 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( assert( tmp >= 0 && tmp < 4096 ); pki = ari_lookup_s17_LC[tmp]; move16(); #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC r = ivas_ari_decode_14bits_bit_ext_1_lfe( st, &as, ari_pk_s17_LC_ext[pki], &extra_bits_read ); #else r = ari_decode_14bits_s17_ext_fx( st, &as, ari_pk_s17_LC_ext[pki] ); #endif IF( LT_16( r, VAL_ESC ) ) { BREAK; Loading Loading @@ -291,13 +280,8 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( } } #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC ivas_ari_done_decoding_14bits_ext_1_lfe( st, extra_bits_read ); #endif /* Total number of decoded AC bits */ #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC get_next_indice_tmp_fx( st, -( cbitsnew - 2 ) ); #endif /*detect overflow*/ IF( NE_16( k, lastnz ) ) Loading lib_dec/ari_dec_fx.c +44 −10 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ void ari_start_decoding_14bits_fx( move32(); } #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_start_decoding_14bits_prm_fx( const Word16 *ptr, /* Q0 */ Word16 bp, Loading Loading @@ -88,8 +89,8 @@ Word16 ari_start_decoding_14bits_prm_fx( return add( bp, i ); } #endif #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC static Word16 ari_lookup_s17_fx( Word32 cum, Word32 range, Loading Loading @@ -136,7 +137,6 @@ static Word16 ari_lookup_s17_fx( L_shr( 0, 0 ); /* pointer subtraction */ return extract_l( p - cum_freq ); } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */ static Word16 ari_lookup_s27_fx( Word32 cum, Loading Loading @@ -263,12 +263,10 @@ static Word16 ari_decode_14bits_ext_fx( /** * \brief Only for 17 symbols with new extended Tables */ #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_decode_14bits_s17_ext_fx( Decoder_State *st, Tastat *s, UWord16 const *cum_freq ) { return ari_decode_14bits_ext_fx( st, s, cum_freq, ari_lookup_s17_fx ); } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */ /** * \brief Only for 27 symbols with new extended Tables Loading @@ -291,6 +289,7 @@ Word16 ari_decode_14bits_bit_ext_fx( Decoder_State *st, Tastat *s ) return ari_decode_14bits_ext_fx( st, s, cum_freq, ari_lookup_bit_fx ); } #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC static Word16 ari_lookup_pow_fx( Tastat *s, Word16 base ) { Word32 cum, range; Loading Loading @@ -486,21 +485,28 @@ 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_DEC return ari_decode_14bits_sign_ivas( ptr, bp, bits, res, s ); #else return ari_decode_14bits_notbl_fx( ptr, bp, bits, res, s, 0, ari_lookup_sign_fx ); #endif } #endif #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC /*--------------------------------------------------------------- * ari_start_decoding_14bits_ivas() * ari_start_decoding_14bits() * * Start ArCo decoding *-------------------------------------------------------------*/ Word16 ari_start_decoding_14bits_prm_ivas_fx( #else /*--------------------------------------------------------------- * ari_start_decoding_14bits_prm() * * Start ArCo decoding *-------------------------------------------------------------*/ Word16 ari_start_decoding_14bits_prm_fx( #endif const Word16 *ptr, Word16 bp, Tastat *s ) Loading @@ -527,7 +533,25 @@ Word16 ari_start_decoding_14bits_prm_ivas_fx( return add( bp, i ); } #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC /*------------------------------------------------------------------------ * Function: ari_decode_14bits_pow_fx * * Decode a symbol which follows the exponential distribution. That is, * symbols are in the following intervals * * p(x = 0) = 1 - exp(- 0.5 * base * 2) * p(x = q>0) = exp(- (q-0.5)*base* 2) - exp(- (q+0.5)*base*2 ) * *-------------------------------------------------------------------------*/ Word16 ari_decode_14bits_pow_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s, Word16 base ) #else Word16 ari_decode_14bits_pow_ivas( Word16 *ptr, Word16 bp, Loading @@ -535,6 +559,7 @@ Word16 ari_decode_14bits_pow_ivas( Word16 *res, Tastat *s, UWord16 base ) #endif { UWord16 symbol; Word32 low, high; Loading Loading @@ -680,7 +705,16 @@ Word16 ari_decode_14bits_pow_ivas( return bp; } #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC /*------------------------------------------------------------------------ * Function: ari_decode_14bits_sign_fx * * Decode a sign with equal probabilities. *-------------------------------------------------------------------------*/ Word16 ari_decode_14bits_sign_fx( #else Word16 ari_decode_14bits_sign_ivas( #endif Word16 *ptr, Word16 bp, Word16 bits, Loading lib_dec/arith_coder_dec_fx.c +17 −9 Original line number Diff line number Diff line Loading @@ -31,11 +31,7 @@ static Word16 tcx_arith_decode_fx( Word64 W_tmp; move32(); #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_DEC */ tmp = sub( envelope_e, 1 + 15 ); W_tmp = 0; Loading @@ -52,11 +48,7 @@ static Word16 tcx_arith_decode_fx( exp_k = round_fx( expfp( envelope[k], tmp ) ); } /* decode line magnitude */ #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_DEC */ IF( q == 0 ) { Loading @@ -66,7 +58,7 @@ static Word16 tcx_arith_decode_fx( IF( q != 0 ) /* line is non-zero, decode sign */ { #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_decode_14bits_sign_ivas( prm, bp, target_bits, &s, &as ); bp = ari_decode_14bits_sign_fx( prm, bp, target_bits, &s, &as ); s = sub( 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 ); Loading Loading @@ -125,10 +117,18 @@ static Word16 tcx_arith_decode_ivas_fx( Word16 bp, k, q; Word16 s; Tastat as; #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 exp_k; #else UWord16 exp_k; #endif Word16 tmp; #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_start_decoding_14bits_prm_fx( prm, 0, &as ); #else bp = ari_start_decoding_14bits_prm_ivas_fx( prm, 0, &as ); #endif tmp = sub( envelope_e, 1 ); Loading @@ -145,12 +145,20 @@ static Word16 tcx_arith_decode_ivas_fx( } /* decode line magnitude */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_decode_14bits_pow_fx( prm, bp, target_bits, &q, &as, exp_k ); #else bp = ari_decode_14bits_pow_ivas( prm, bp, target_bits, &q, &as, exp_k ); #endif IF( q ) { /* line is non-zero, decode sign */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_decode_14bits_sign_fx( prm, bp, target_bits, &s, &as ); #else bp = ari_decode_14bits_sign_ivas( prm, bp, target_bits, &s, &as ); #endif q_spectrum[k] = L_mult( q, sub( 3, shl( s, 1 ) ) ); move32(); q_spectrum[k] = L_shl( q_spectrum[k], 30 - SPEC_EXP_DEC ); // Q(31-20) Loading Loading
lib_com/prot_fx.h +6 −0 Original line number Diff line number Diff line Loading @@ -9209,10 +9209,12 @@ void getTCXWindowing_ivas_fx( Decoder_State *st0 /* i : bitstream */ ); #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_start_decoding_14bits_prm_ivas_fx( const Word16 *ptr, Word16 bp, Tastat *s ); #endif void generate_masking_noise_ivas_fx( Word32 *timeDomainBuffer, /* i/o: time-domain signal */ Loading Loading @@ -9388,6 +9390,7 @@ void hq_generic_hf_encoding_fx( Word16 *hq_generic_exc_clas, /* o : bwe excitation class */ Word16 length ); #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_decode_14bits_pow_ivas( Word16 *ptr, Word16 bp, Loading @@ -9395,13 +9398,16 @@ Word16 ari_decode_14bits_pow_ivas( Word16 *res, Tastat *s, UWord16 base ); #endif #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_decode_14bits_sign_ivas( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s ); #endif ivas_error config_acelp1_fx( const Word16 enc_dec, /* i : encoder/decoder flag */ Loading
lib_dec/ACcontextMapping_dec_fx.c +1 −17 Original line number Diff line number Diff line Loading @@ -13,9 +13,6 @@ #include "ivas_prot_fx.h" #include "ivas_rom_com.h" #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC #include "ivas_prot_fx.h" #endif /*-------------------------------------------------------------------* * ACcontextMapping_decode2_no_mem_s17_LC() Loading Loading @@ -136,12 +133,7 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( } /* Start Decoding */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 extra_bits_read = 0; ivas_ari_start_decoding_14bits_ext_1_lfe( st, &as, &extra_bits_read ); #else ari_start_decoding_14bits_fx( st, &as ); #endif overflow_bit_pos = st->next_bit_pos; move16(); Loading Loading @@ -190,11 +182,8 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( assert( tmp >= 0 && tmp < 4096 ); pki = ari_lookup_s17_LC[tmp]; move16(); #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC r = ivas_ari_decode_14bits_bit_ext_1_lfe( st, &as, ari_pk_s17_LC_ext[pki], &extra_bits_read ); #else r = ari_decode_14bits_s17_ext_fx( st, &as, ari_pk_s17_LC_ext[pki] ); #endif IF( LT_16( r, VAL_ESC ) ) { BREAK; Loading Loading @@ -291,13 +280,8 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( } } #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC ivas_ari_done_decoding_14bits_ext_1_lfe( st, extra_bits_read ); #endif /* Total number of decoded AC bits */ #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC get_next_indice_tmp_fx( st, -( cbitsnew - 2 ) ); #endif /*detect overflow*/ IF( NE_16( k, lastnz ) ) Loading
lib_dec/ari_dec_fx.c +44 −10 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ void ari_start_decoding_14bits_fx( move32(); } #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_start_decoding_14bits_prm_fx( const Word16 *ptr, /* Q0 */ Word16 bp, Loading Loading @@ -88,8 +89,8 @@ Word16 ari_start_decoding_14bits_prm_fx( return add( bp, i ); } #endif #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC static Word16 ari_lookup_s17_fx( Word32 cum, Word32 range, Loading Loading @@ -136,7 +137,6 @@ static Word16 ari_lookup_s17_fx( L_shr( 0, 0 ); /* pointer subtraction */ return extract_l( p - cum_freq ); } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */ static Word16 ari_lookup_s27_fx( Word32 cum, Loading Loading @@ -263,12 +263,10 @@ static Word16 ari_decode_14bits_ext_fx( /** * \brief Only for 17 symbols with new extended Tables */ #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 ari_decode_14bits_s17_ext_fx( Decoder_State *st, Tastat *s, UWord16 const *cum_freq ) { return ari_decode_14bits_ext_fx( st, s, cum_freq, ari_lookup_s17_fx ); } #endif /* FIX_2402_REPL_EVS_ARI_CODEC_DEC */ /** * \brief Only for 27 symbols with new extended Tables Loading @@ -291,6 +289,7 @@ Word16 ari_decode_14bits_bit_ext_fx( Decoder_State *st, Tastat *s ) return ari_decode_14bits_ext_fx( st, s, cum_freq, ari_lookup_bit_fx ); } #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC static Word16 ari_lookup_pow_fx( Tastat *s, Word16 base ) { Word32 cum, range; Loading Loading @@ -486,21 +485,28 @@ 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_DEC return ari_decode_14bits_sign_ivas( ptr, bp, bits, res, s ); #else return ari_decode_14bits_notbl_fx( ptr, bp, bits, res, s, 0, ari_lookup_sign_fx ); #endif } #endif #ifndef FIX_2402_REPL_EVS_ARI_CODEC_DEC /*--------------------------------------------------------------- * ari_start_decoding_14bits_ivas() * ari_start_decoding_14bits() * * Start ArCo decoding *-------------------------------------------------------------*/ Word16 ari_start_decoding_14bits_prm_ivas_fx( #else /*--------------------------------------------------------------- * ari_start_decoding_14bits_prm() * * Start ArCo decoding *-------------------------------------------------------------*/ Word16 ari_start_decoding_14bits_prm_fx( #endif const Word16 *ptr, Word16 bp, Tastat *s ) Loading @@ -527,7 +533,25 @@ Word16 ari_start_decoding_14bits_prm_ivas_fx( return add( bp, i ); } #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC /*------------------------------------------------------------------------ * Function: ari_decode_14bits_pow_fx * * Decode a symbol which follows the exponential distribution. That is, * symbols are in the following intervals * * p(x = 0) = 1 - exp(- 0.5 * base * 2) * p(x = q>0) = exp(- (q-0.5)*base* 2) - exp(- (q+0.5)*base*2 ) * *-------------------------------------------------------------------------*/ Word16 ari_decode_14bits_pow_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s, Word16 base ) #else Word16 ari_decode_14bits_pow_ivas( Word16 *ptr, Word16 bp, Loading @@ -535,6 +559,7 @@ Word16 ari_decode_14bits_pow_ivas( Word16 *res, Tastat *s, UWord16 base ) #endif { UWord16 symbol; Word32 low, high; Loading Loading @@ -680,7 +705,16 @@ Word16 ari_decode_14bits_pow_ivas( return bp; } #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC /*------------------------------------------------------------------------ * Function: ari_decode_14bits_sign_fx * * Decode a sign with equal probabilities. *-------------------------------------------------------------------------*/ Word16 ari_decode_14bits_sign_fx( #else Word16 ari_decode_14bits_sign_ivas( #endif Word16 *ptr, Word16 bp, Word16 bits, Loading
lib_dec/arith_coder_dec_fx.c +17 −9 Original line number Diff line number Diff line Loading @@ -31,11 +31,7 @@ static Word16 tcx_arith_decode_fx( Word64 W_tmp; move32(); #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_DEC */ tmp = sub( envelope_e, 1 + 15 ); W_tmp = 0; Loading @@ -52,11 +48,7 @@ static Word16 tcx_arith_decode_fx( exp_k = round_fx( expfp( envelope[k], tmp ) ); } /* decode line magnitude */ #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_DEC */ IF( q == 0 ) { Loading @@ -66,7 +58,7 @@ static Word16 tcx_arith_decode_fx( IF( q != 0 ) /* line is non-zero, decode sign */ { #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_decode_14bits_sign_ivas( prm, bp, target_bits, &s, &as ); bp = ari_decode_14bits_sign_fx( prm, bp, target_bits, &s, &as ); s = sub( 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 ); Loading Loading @@ -125,10 +117,18 @@ static Word16 tcx_arith_decode_ivas_fx( Word16 bp, k, q; Word16 s; Tastat as; #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC Word16 exp_k; #else UWord16 exp_k; #endif Word16 tmp; #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_start_decoding_14bits_prm_fx( prm, 0, &as ); #else bp = ari_start_decoding_14bits_prm_ivas_fx( prm, 0, &as ); #endif tmp = sub( envelope_e, 1 ); Loading @@ -145,12 +145,20 @@ static Word16 tcx_arith_decode_ivas_fx( } /* decode line magnitude */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_decode_14bits_pow_fx( prm, bp, target_bits, &q, &as, exp_k ); #else bp = ari_decode_14bits_pow_ivas( prm, bp, target_bits, &q, &as, exp_k ); #endif IF( q ) { /* line is non-zero, decode sign */ #ifdef FIX_2402_REPL_EVS_ARI_CODEC_DEC bp = ari_decode_14bits_sign_fx( prm, bp, target_bits, &s, &as ); #else bp = ari_decode_14bits_sign_ivas( prm, bp, target_bits, &s, &as ); #endif q_spectrum[k] = L_mult( q, sub( 3, shl( s, 1 ) ) ); move32(); q_spectrum[k] = L_shl( q_spectrum[k], 30 - SPEC_EXP_DEC ); // Q(31-20) Loading