Commit f7134a5e authored by Fabian Bauer's avatar Fabian Bauer
Browse files

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into...

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into basop-2283-isar-post-renderer-broken-for-externally-rendered-omasa-input-and-binaural_split_coded
parents 4acb4290 f4896dcb
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -997,8 +997,11 @@ void init_tcx_cfg_ivas_fx(

    IF( hTcxCfg->fIsTNSAllowed )
    {
#ifdef FIX_2388_INITTNSCONFIGURATION
        InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );
#else
        InitTnsConfigs_ivas_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );

#endif
        SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) );
    }

@@ -1253,7 +1256,11 @@ void init_tcx_cfg_fx(

    IF( hTcxCfg->fIsTNSAllowed )
    {
#ifdef FIX_2388_INITTNSCONFIGURATION
        InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );
#else
        InitTnsConfigs( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );
#endif

        SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) );
    }
+7 −3
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ static Word16 VDQ_vec_fx( Word16 *Qvec_out_fx, const Word16 *mean_dic_fx, const


/*========================================================================*/
/* FUNCTION : void Comp_and_apply_gain_enc_fx                             */
/* FUNCTION : void Comp_and_apply_gain_fx                                 */
/*------------------------------------------------------------------------*/
/* PURPOSE :  Compute and apply the quantized per band gain               */
/*------------------------------------------------------------------------*/
@@ -473,7 +473,7 @@ static void GSC_gain_adj(
    }
    ELSE
    {
        Gain_off = 0;
        Gain_off = 0; /* For higher bitrate, thus for L_frame == L_FRAME16k as well */
        move16();

        test();
@@ -511,7 +511,11 @@ static void GSC_gain_adj(
        }

        /*mimic ACELP decay of energy for low rates*/
#ifndef FIX_2406_FIX_GAIN_ON_INACTIVE
        FOR( i = 0; i < MBANDS_GN; i++ )
#else
        FOR( i = 0; i < Mbands_gn; i++ )
#endif
        {
            old_y_gain[i] = y_gain_tmp[i];
            move16();
@@ -526,7 +530,7 @@ static void GSC_gain_adj(


/*==========================================================================*/
/* FUNCTION : Word16 gsc_gaindec_ivas_fx()                                  */
/* FUNCTION : Word16 gsc_gaindec_fx()                                       */
/*--------------------------------------------------------------------------*/
/* PURPOSE  :  Generic signal frequency band decoding and application       */
/*--------------------------------------------------------------------------*/
+6 −0
Original line number Diff line number Diff line
@@ -84,12 +84,16 @@
#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 FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */
#define FIX_2388_INITTNSCONFIGURATION                   /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */
#define FIX_2397_COPY_AQ_MDCT_CORE_BFI                  /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */
#define HARMONIZE_TBE                                   /* VA: harmonize core-coder TBE function duplications */
#define FIX_2405_HARM_SMC_INIT                          /* VA, basop 2405, harmonisation of SMC init */
#define FIX_2280_REDUCTION_UNNECESSARY_SCALING          /* VA: reduction of unnecessary scaling */
#define FIX_2280_REDUCTION_UNNECESSARY_SCALING_NONBE    /* VA: reduction of unnecessary scaling, non-BE part */
#define FIX_2403_COMBINE_PITCH_OL                       /* VA : basop 2403, reusing common code between EVS and IVAS in pitch_ol */
#define FIX_2404_HARM_SIGNAL_CLAS                       /* VA: basop-2404, harmonize signal_clas and signa_ivas_clas */
#define HARMONIZE_ACELP_ENC                             /* VA: basop issue 2400: Remove duplicated main ACELP encoder function */
#define FIX_2392_MSAN_DESTROY_DEC                       /* VA: basop issue 2392: fix MSAN in ivas_destroy_dec_fx() */

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

@@ -102,6 +106,8 @@
#define FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER           /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */
#define FIX_2408_FD_BWE_UPDATE                          /* VA: basop issue 2408: bug-fix in the FD BWE memory updates in wb_pre_proc_ivas_fx()  */
#define FIX_2380_HARM_GSC_GAIN_COMP_FX                  /* VA: basop issue 2380 & 2381: Fix issue when switching from CNG low energy to active content with high energy */
#define FIX_2406_FIX_GAIN_ON_INACTIVE                   /* VA: basop issue 2406: gain between 6.4 and 8kHz was too weak during inactive content with Fs=16kHz  */
#define FIX_2407_FIX_RESIDU_IVAS                        /* VA: basop 2407, Implementation issue in residu_ivas + unnecessary complexity */
#define FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE  /* VA: Precision improvement without increasing complexity, or complexity reduction that might be not BE on the LSB */
#define FIX_2252_LP_CNG_STARTS_SID                      /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */
#define FIX_2283_ISM_MD_DELAY                           /* Dolby: Fix ISM metadata delay round-off */
+38 −13
Original line number Diff line number Diff line
@@ -3577,6 +3577,7 @@ Word32 DTFS_getEngy_band_wb_fx(
    Word16 lband,
    Word16 hband );
#ifndef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfiguration(
    const Word16 bwidth,
    const Word16 frameLength,
@@ -3585,8 +3586,13 @@ void InitTnsConfiguration(
    const Word32 total_brate,
    const Word16 element_mode,
    const Word16 is_mct );
#endif
#ifdef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfiguration_fx(
#else
void InitTnsConfiguration_ivas_fx(
#endif
    const Word16 bwidth,
    const Word16 frameLength,
    STnsConfig *pTnsConfig,
@@ -4231,6 +4237,7 @@ void tcx_noise_filling_with_shift(
    const Word16 element_mode /* i  : IVAS element mode   */
);
#ifndef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfigs(
    const Word16 bwidth,
    const Word16 L_frame,
@@ -4239,8 +4246,14 @@ void InitTnsConfigs(
    const Word32 total_brate,
    const Word16 element_mode,
    const Word16 is_mct );
#endif
void InitTnsConfigs_ivas_fx(
#ifdef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfigs_fx
#else
void InitTnsConfigs_ivas_fx
#endif
    (
        const Word16 bwidth,
        const Word16 L_frame,
        STnsConfig tnsConfig[2][2],
@@ -10867,7 +10880,11 @@ ivas_error init_encoder_fx(
    const Word32 element_brate  /* i  : element bitrate                      */
);
#ifdef HARMONIZE_ACELP_ENC
ivas_error acelp_core_enc_fx(
#else
ivas_error acelp_core_enc_ivas_fx(
#endif
    Encoder_State *st,                  /* i/o: encoder state structure                 */
    const Word16 inp[],                 /* i  : input signal of the current frame       Q_new*/
    Word16 A[NB_SUBFR16k * ( M + 1 )],  /* i  : A(z) unquantized for the 4 subframes    Q12*/
@@ -10880,12 +10897,20 @@ ivas_error acelp_core_enc_ivas_fx(
    Word32 bwe_exc_extended_fx[],       /* i/o: bandwidth extended excitation           st->prev_Q_bwe_exc*/
    Word16 *voice_factors_fx,           /* o  : voicing factors                         Q15*/
    Word16 old_syn_12k8_16k[],          /* o  : intermediate ACELP synthesis at 12.8kHz or 16kHz to be used by SWB BWE        q_old_syn_12k8_16*/
    Word16 *q_old_syn_12k8_16,
#ifndef HARMONIZE_ACELP_ENC
    Word16 *q_old_syn_12k8_16, /* o  : Q factor of old_syn_12k8_16k[]          */
#endif
    Word16 pitch_buf[NB_SUBFR16k],       /* o  : floating pitch for each subframe        Q6*/
    Word16 *unbits,                      /* o  : number of unused bits                   Q0*/
    STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle                */
    Word16 tdm_lsfQ_PCh[M],              /* i  : Q LSFs for primary channel              X2.56*/
    const Word16 Q_new );
#ifdef HARMONIZE_ACELP_ENC
    const Word16 Q_new, /* i  : Scaling factor                          */
    const Word16 shift  /* i  : Shift need to obtain 12 bits vectors    */
#else
    const Word16 Q_new
#endif
);
void flip_and_downmix_generic_fx32(
    Word32 input[],                      /* i : input spectrum Qx*/
+17 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ void residu_ivas_fx(
    const Word16 l   /* i  : size of filtering                */
)
{
#ifndef FIX_2407_FIX_RESIDU_IVAS
    Word32 s;
    Word16 i, j;

@@ -38,7 +39,23 @@ void residu_ivas_fx(
        y[i] = s;
        move32();
    }
#else
    Word64 s64;
    Word16 i, j, scaling;

    scaling = sub( Q15, a_exp );
    FOR( i = 0; i < l; i++ )
    {
        s64 = W_mult_32_16( x[i], a[0] );
        FOR( j = 1; j <= m; j++ )
        {
            s64 = W_mac_32_16( s64, x[i - j], a[j] );
        }
        y[i] = W_shl_sat_l( s64, scaling );
        move32();
    }

#endif
    return;
}

Loading