Commit b747062b authored by multrus's avatar multrus
Browse files

merge from main

parents 2e87ebab 94e4e1b7
Loading
Loading
Loading
Loading
Loading
+82 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ static UWord16 ivas_ari_get_symbol(
 *
 *-------------------------------------------------------------*/

#ifndef FIX_2402_SIGNED_VERSION
UWord16 ivas_ari_decode_14bits_bit_ext_1_lfe(
    Decoder_State *st,
    Tastat *s,
@@ -180,6 +181,87 @@ UWord16 ivas_ari_decode_14bits_bit_ext_1_lfe(

    return symbol;
}
#else /* FIX_2402_SIGNED_VERSION */
Word16 ivas_ari_decode_14bits_bit_ext_1_lfe(
    Decoder_State *st,
    Tastat *s,
    const UWord16 *cum_freq,
    Word16 *extra_bits_read )
{
    Word16 symbol;
    Word32 low, high, range, value;
    Word32 cum;

    /* read s->low,high,value sequentially */
    low = s->low;
    high = s->high;
    value = s->value;

    move32();
    move32();
    move32();

    range = L_add( L_sub( high, low ), 1 );
    cum = L_sub( L_lshl( ( L_add( L_sub( value, low ), 1 ) ), stat_bitsnew ), 1 );

    symbol = ivas_ari_get_symbol( cum_freq, range, cum );

    high = L_sub( L_add( low, mul_sbc_14bits( range, cum_freq[symbol] ) ), 1 );
    low = L_add( low, mul_sbc_14bits( range, cum_freq[symbol + 1] ) );

    FOR( ;; )
    {
        IF( GE_32( high, ari_q2new ) )
        {
            IF( GE_32( low, ari_q2new ) )
            {
                value = L_sub( value, ari_q2new );
                low = L_sub( low, ari_q2new );
                high = L_sub( high, ari_q2new );
            }
            ELSE
            {
                test();
                IF( GE_32( low, ari_q1new ) && LT_32( high, ari_q3new ) )
                {
                    value = L_sub( value, ari_q1new );
                    low = L_sub( low, ari_q1new );
                    high = L_sub( high, ari_q1new );
                }
                ELSE
                {
                    BREAK;
                }
            }
        }

        low = L_add( low, low );
        high = L_add( high, UL_addNsD( high, 1 ) );

        IF( GE_16( st->next_bit_pos, st->bits_frame ) )
        {
            value = L_lshl( value, 1 );
            *extra_bits_read = add( *extra_bits_read, 1 );
            move16();
        }
        ELSE
        {
            value = L_or( L_lshl( value, 1 ), get_next_indice_1_fx( st ) );
        }
    }

    s->low = low;
    s->high = high;
    s->value = value;

    move32();
    move32();
    move32();

    return symbol;
}

#endif /* FIX_2402_SIGNED_VERSION */

/*---------------------------------------------------------------
 * Function ivas_ari_done_decoding_14bits_ext_1_lfe()
+5 −0
Original line number Diff line number Diff line
@@ -1165,7 +1165,12 @@ static Word16 ivas_calculate_abs_fr_fx(

    FOR( i = 0; i < frame_len; i++ )
    {
#ifdef FIX_BASOP_2642_INCORRECT_IF_THRESHOLD
        test();
        if ( LT_32( ppFilterbank_FRs_s_fx[i], 419430 ) )
#else
        if ( ppFilterbank_FRs_s_fx[i] < 0 )
#endif
        {
            ppFilterbank_FRs_s_fx[i] = 419430; // 0.1 in Q22
            move32();
+9 −0
Original line number Diff line number Diff line
@@ -5298,12 +5298,21 @@ void ivas_ari_start_decoding_14bits_ext_1_lfe(
    Word16 *extra_bits_read 
);

#ifndef FIX_2402_SIGNED_VERSION
UWord16 ivas_ari_decode_14bits_bit_ext_1_lfe(
    Decoder_State *st,
    Tastat *s,
    const UWord16 *cum_freq,
    Word16 *extra_bits_read 
);
#else
Word16 ivas_ari_decode_14bits_bit_ext_1_lfe(
    Decoder_State *st,
    Tastat *s,
    const UWord16 *cum_freq,
    Word16 *extra_bits_read 
);
#endif

void ivas_ari_done_decoding_14bits_ext_1_lfe(
    Decoder_State *st,
+6 −0
Original line number Diff line number Diff line
@@ -87,6 +87,11 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARMONIZE_2502_GENERATE_COMFORT_NOISE_DEC       /* FhG: harmonize generate_comfort_noise_dec_fx() and generate_comfort_noise_dec_ivas_fx() */
#define FIX_BASOP_2650_DEC_PRM_TCX                      /* FhG: Simplify calculation of st->bits_frame_core in dec_prm_tcx(), align function name to float */
#define FIX_2648_IVAS_ISM_DEC_DIGEST_TC                 /* FhG: improvements on ivas_ism_dec_digest_tc_fx() */
#define BE_FIX_BASOP_2543_MISMATCH_REND_OPEN_FX_FL      /* FhG: Aligns implementation of split rendering init loops in IVAS_REND_Open between float and BASOP */
#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 HARMONIZE_2583_open_decoder_LPD                 /* FhG: harmonize open_decoder_LPD between EVS and IVAS versions */

/* #################### End BE switches ################################## */
@@ -98,6 +103,7 @@
#define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH          /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */
#define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP           /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */
#define FIX_BASOP_2635_EFAP_ADD_VERTEX_ELE_ROUND        /* FhG: BASOP #2635: round |elevation| with anint_fx before the 90deg subtraction in add_vertex_fx */
#define FIX_BASOP_2642_INCORRECT_IF_THRESHOLD           /* Dolby: BASOP #2642: incorrect threshold 0.0 used instead of 0.1 in if condition */
#define FIX_BASOP_2639_INCORRECT_ARRAY_INDEX            /* Dolby: BASOP #2639: incorrect array index in ivas_spar_unquant_dtx_indicies */
#define FIX_BASOP_2640_MASA_STEREO_TYPE_ASSERT          /* Nokia: BASOP issue 2640: Fix assert by saturating shift when exponent difference is very large. */
#define FIX_2636_OMASA_INTERFORMAT_BRATE                /* VA: basop issue 2636: Correct condition in function ivas_interformat_brate_fx() */
+6 −0
Original line number Diff line number Diff line
@@ -9229,10 +9229,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 */
@@ -9408,6 +9410,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,
@@ -9415,13 +9418,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