Commit 17757c3e authored by multrus's avatar multrus
Browse files

Merge branch 'main' into fix-directivity-precision

parents 65a98095 c3c5aa50
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
#include "prot_fx.h"
#include "cnst.h"


#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
/**
 * \brief  31x16 Bit multiply (x*y)
 *
@@ -26,6 +28,7 @@ Word32 L_multi31x16_X2( Word16 xh, Word16 xl, Word16 y )

    return z;
}
#endif

/*---------------------------------------------------------------
  Ari 14 bits common routines
@@ -39,6 +42,9 @@ Word32 L_multi31x16_X2( Word16 xh, Word16 xl, Word16 y )
 *
 * \return r*c
 */
#ifndef FIX_2402_INLINE_FCT_ARI_CODEC
/* Note: moved to proto_fx.h */

Word32 mul_sbc_14bits(
    Word32 r, /* Q0 */
    Word16 c  /* Q0 */
@@ -57,3 +63,4 @@ Word32 mul_sbc_14bits(

    return ( ret );
}
#endif
+2 −0
Original line number Diff line number Diff line
@@ -338,7 +338,9 @@ extern const Word32 ls_azimuth_CICP16_fx[9];
extern const Word32 ls_elevation_CICP16_fx[9];
extern const Word32 ls_azimuth_CICP19_fx[11];
extern const Word32 ls_elevation_CICP19_fx[11];
#ifndef FIX_BASOP_2095_REMOVE_TABLES_PT01
extern const Word16 pow_10_q11[128];
#endif
extern const Word32 pow_10_q23[14];
extern const Word16 ivas_sin_az_fx[361];
extern const Word16 ivas_sine_panning_tbl_fx[601];
+4 −2
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ const Word16 dft_band_res_cod[3][4] =
    {0,5,6,7}
};

#ifndef FIX_BASOP_2095_REMOVE_TABLES_PT01
// Q31
const Word32 dft_res_gains_q_Q31[][2] = 
{
@@ -247,7 +248,7 @@ const Word32 dft_res_gains_q_Q31[][2] =
    {2144077696, 13136157 },
    {2147440640, 13580687 }
};

#endif

/* tables for adaptive Golomb-Rice coding of DFT stereo parameters */
const Word16 dft_code_itd[] =
@@ -3419,6 +3420,7 @@ const Word32 ls_azimuth_CICP19_fx[11] = { 125829120, -125829120, 0, 566231040, -
/* Q22 */
const Word32 ls_elevation_CICP19_fx[11] = { 0, 0, 0, 0, 0, 0, 0, 146800640, 146800640, 146800640, 146800640 };

#ifndef FIX_BASOP_2095_REMOVE_TABLES_PT01
const Word16 pow_10_q11[128] = {
    2048, 2085, 2123, 2161, 2200, 2240, 2281, 2322, 2364, 2407, 2451, 2496, 2541, 2587, 2634, 2682, 2731, 2780, 2831, 2882, 2934, 2988, 3042, 3097, 3153, 3211, 3269,
    3328, 3389, 3450, 3513, 3576, 3641, 3708, 3775, 3843, 3913, 3984, 4056, 4130, 4205, 4281, 4359, 4438, 4519, 4601, 4684, 4769, 4856, 4944, 5034, 5125, 5218, 5313,
@@ -3426,7 +3428,7 @@ const Word16 pow_10_q11[128] = {
    8793, 8952, 9115, 9280, 9449, 9620, 9795, 9973, 10154, 10338, 10526, 10717, 10911, 11109, 11311, 11516, 11725, 11938, 12155, 12375, 12600, 12829, 13062, 13299,
    13540, 13786, 14036, 14291, 14550, 14815, 15084, 15357, 15636, 15920, 16209, 16503, 16803, 17108, 17418, 17734, 18056, 18384, 18718, 19058, 19404, 19756, 20114
};

#endif
// Q12
const Word16 icbwe_gsMapping_tbl_fx[16] = { 
    -8192, -5527, -3935, -2907, -2289, -1824, -1404, -1035, -692, -404, -286, -204, -81, 0, 163, 327 
+10 −3
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* VA/Nokia: reintroduce format switching for g192 bitstreams */
#define HARMONIZE_2499_CONFIGUREFDCNGDEC                /* FhG: basop issue 2499: harmonoize configureFdCngDec */
#define FIX_BASOP_2530_IVAS_DECISION_MAT                /* VA: Fix ambiguous usage of extract_l() */
#define FIX_2402_SIMPLIFY_ARI_CODEC                     /* FhG: basop issue 2402: simplified arithmetic in TCX arithmetic coder */
#define FIX_2402_REPL_EVS_ARI_CODEC_ENC                 /* FhG: basop issue 2402: replace EVS arith encoder with IVAS arith encoder */
#define FIX_BASOP_2546_HARMONIZE_TCX_SCALAR             /* FhG: Fix issue 2546 Harmonize function tcx_scalar_quantization_rateloop*/
#define FIX_BASOP_2532_cx_e                             /* FhG: Fix issue 2532 about additional exponent variable*/
#define HARMONIZE_2543_SQ_gain                          /* FhG: Harmonize SQ_gain */
@@ -102,6 +104,9 @@
#define HARMONIZE_2537_SetTCXModeInfo                   /* FhG: Harmonize SetTCXModeInfo  - IVAS_VERSION OBVIOUSLY NOT FITTING FOR EVS - pipes not green */
#define HARMONIZE_2537_GetTCXMaxenergyChange            /* FhG: Harmonize GetTCXMaxenergyChange */
#define HARMONIZE_2508_InitTransientDetection           /* FhG: harmonize GetAttackForTCXDecision derivates for evs/ivas  */
#define FIX_BASOP_2555_FRAMELEN_CALC                    /* FhG: BASOP issue 2555: Simplify (sub-)framelength calculation in ivas_mdct_core_tns_ns_fx() */
#define FIX_BASOP_2095_REMOVE_TABLES_PT01               /* FhG: BASOP issue 2095: remove unused tables, part 01 */
#define FIX_2346_DUPLICATED_IGF_FUNCTIONS_2             /* FhG: part 2 of basop issue 2346: Review potentially duplicated IGF functions */

/* #################### End BE switches ################################## */

@@ -129,7 +134,9 @@
#define FIX_FLOAT_1573_POSITION_UPDATE                  /* Eri: Float issue 1573: For static orientation and listener movement, the PoseUpdated flag is cleared and prevents 5 ms update rate. */
#define FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS         /* FhG: BASOP issue 2521: Fix wrong porting for determination of first subframe length in ivas_sba_dirac_stereo_compute_td_stefi_nrgs() */
#define FIX_1452_DEFAULT_REVERB                         /* Nokia/Philips/FhG: Fix default room presets and their usage in renderer */

#define FIX_2547_ALIGN_CONDITIONS_IN_CORE_SW_DEC        /* VA : Basop issue 2547: Align conditions in core sw dec */
#define FIX_2547_ALIGN_CONDITIONS_IN_CORE_SW_DEC_EVS    /* VA : Basop issue 2547: Align conditions in core sw dec, condition that could affect EVS as well, but adapted to keep EVS BE */
#define FIX_BASOP_2548_ProcessIGF_fx_PREDICTIONGAIN     /* FhG: fixes obvious bug for IVAS path. For EVS path, issue is still not resolved */

/* ##################### End NON-BE switches ########################### */

+52 −0
Original line number Diff line number Diff line
@@ -5172,15 +5172,51 @@ Word16 IGFCommonFuncsIGFGetCFTables_fx(
    const Word16 **cf_off_se11  /* o  : offsets for CF tables above         */
);

#ifndef FIX_2402_SIMPLIFY_ARI_CODEC
Word32 L_multi31x16_X2(
    Word16 xh,
    Word16 xl,
    Word16 y );
#endif

#ifndef FIX_2402_INLINE_FCT_ARI_CODEC
Word32 mul_sbc_14bits(
    Word32 r, /* Q0 */
    Word16 c  /* Q0 */
);
#else
/**
 * \brief  Integer Multiply
 *
 * \param[i] r
 * \param[i] c
 *
 * \return r*c
 */
static inline Word32 mul_sbc_14bits(
    Word32 r, /* Q0 */
    Word16 c  /* Q0 */
);
static inline Word32 mul_sbc_14bits(
    Word32 r, /* Q0 */
    Word16 c  /* Q0 */
)
{
    /* Note: moved from ari_fx.c to allow inlining */

    Word32 ret;

    /*
      temp = (((int32) r)*((int32) c))>>stat_bitsnew;
     */
    assert( stat_bitsnew == 14 );
    ret = Mpy_32_16_1( L_shl( r, 15 - stat_bitsnew ), c );

    /*assert( (((int) r)*((int) c))>>stat_bitsnew == ret);*/

    return ( ret );
}
#endif

void ham_cos_window(
    Word16 *fh,
@@ -8615,7 +8651,11 @@ void ivas_mdct_core_reconstruct_fx(
    Word16 q_x,
    Word16 e_sig[CPE_CHANNELS] );

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
void ari_start_encoding_14bits_fx(
#else
void ari_start_encoding_14bits_ivas_fx(
#endif
    Tastat *s );

void tcx_scalar_quantization_ivas_fx(
@@ -9628,7 +9668,11 @@ void IGFSaveSpectrumForITF_ivas_fx(
    const Word32 *pITFSpectrum,      /* i  : MDCT spectrum                   */
    Word16 exp_pITFSpectrum );

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_ext_fx(
#else
Word16 ari_encode_14bits_ext_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Tastat *s,
@@ -9636,7 +9680,11 @@ Word16 ari_encode_14bits_ext_ivas_fx(
    UWord16 const *cum_freq /* Q0 */
);

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_encode_14bits_sign_fx(
#else
Word16 ari_encode_14bits_sign_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Word32 bits, /* Q0 */
@@ -9644,7 +9692,11 @@ Word16 ari_encode_14bits_sign_ivas_fx(
    Word16 sign /* Q0 */
);

#ifdef FIX_2402_REPL_EVS_ARI_CODEC_ENC
Word16 ari_done_encoding_14bits_fx(
#else
Word16 ari_done_encoding_14bits_ivas_fx(
#endif
    Word16 *ptr, /* Q0 */
    Word16 bp,   /* Q0 */
    Tastat *s );
Loading