Commit d16adde4 authored by norvell's avatar norvell
Browse files

Merge with main. Update comment regarding SHB target BW.

parents 2367f889 a2fefd5e
Loading
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -805,16 +805,25 @@ enum fea_names
#define MAX_MDCT_ITD_BRATE                      IVAS_64k

#define SNS_LOW_BR_MODE                         -1
#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
#define SNS_NPTS                                16 /* Number of downsampled SNS parameters */

#define MDCT_ST_PLC_FADEOUT_START_FRAME         3
#define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG       0.001f
#ifdef FADE_TO_ZERO_FOR_TOO_LONG_FRAMELOSS
#define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME      2 * FRAMES_PER_SEC
#define MDCT_ST_PLC_FADEOUT_TO_ZERO_LEN         20
#endif

typedef enum {
    EQUAL_CORES,
    TCX10_IN_0_TCX20_IN_1,
    TCX20_IN_0_TCX10_IN_1,
} TONALMDCTCONC_NOISE_GEN_MODE;

typedef enum {
    ON_FIRST_LOST_FRAME,
    ON_FIRST_GOOD_FRAME,
} TONALMDCTCONC_NOISE_SHAPE_WHITENING_MODE;
#endif


@@ -1013,13 +1022,9 @@ enum
#define IVAS_DECORR_PARM_LOOKAHEAD_TAU          2e-3f
#define IVAS_DECORR_PARM_APD_TAU                20e-3f

/* IVAS PCA */
/* IVAS SBA PCA */
#define IVAS_PCA_NB_SUBR                        20 /* 80 -> 0.25 ms, 40 -> 0.5 ms... */
#ifdef SPAR_SCALING_HARMONIZATION
#define IVAS_PCA_COV_THRES                      3e-5f
#else
#define IVAS_PCA_COV_THRES                      1e-9f
#endif
#define IVAS_PCA_QUAT_EPS                       1e-7f
#define IVAS_PCA_QBITS                          19
#define IVAS_PCA_N1                             91
+27 −14
Original line number Diff line number Diff line
@@ -238,11 +238,9 @@ uint32_t ivas_syn_output(
    int16_t *synth_out                                          /* o  : integer 16 bits synthesis signal        */
);

#ifdef FIX_I98_HANDLES_TO_NULL
void ivas_initialize_handles_enc(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
#endif

ivas_error ivas_init_encoder(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                  */
@@ -1952,15 +1950,12 @@ void decoder_tcx_invQ(
    const int16_t **prm_sqQ,
    int16_t *nf_seed,
    const int16_t bfi,                                          /* i  : Bad frame indicator                     */
#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
    const int16_t isMCT,
#endif
    const int16_t frame_cnt                                     /* i  : frame counter in the super frame        */
);

void decoder_tcx_noisefilling(
    Decoder_State *st,                                          /* i/o: coder memory state                      */
#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    float concealment_noise[L_FRAME48k],
#endif
    const float A[],                                            /* i  : coefficients NxAz[M+1]                  */
@@ -1975,7 +1970,7 @@ void decoder_tcx_noisefilling(
    const int16_t *prm_sqQ,
    int16_t nf_seed,
    const int16_t bfi,                                          /* i  : Bad frame indicator                     */
#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    const int16_t isMCT,
#endif
    const int16_t frame_cnt                                     /* i  : frame counter in the super frame        */
@@ -2060,7 +2055,12 @@ void decoder_tcx_IGF_stereo(
    const int16_t L_frame,                                      /* i  : frame length                            */
    const int16_t left_rect,                                    /* i  : left part is rectangular                */
    const int16_t k,                                            /* i  : Subframe index                          */
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    const int16_t bfi,                                          /* i  : bad frame indicator                     */
    const int16_t is_mct                                        /* i  : flag to signal MCT or SMDCT                         */
#else
    const int16_t bfi                                           /* i  : bad frame indicator                     */
#endif
);

void ms_processing(
@@ -2093,7 +2093,12 @@ void IGFDecApplyStereo(
    const int16_t igfGridIdx,                                   /* i  : in case of CELP->TCX switching, use 1.25 framelength */
    const int16_t *coreMsMask,
    const int16_t restrict_hopsize,
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    const int16_t bfi,                                          /* i  : frame loss == 1, frame good == 0        */
    const int16_t bfi_apply_damping                                  /* i  : decoder element mode                    */
#else
    const int16_t bfi                                           /* i  : frame loss == 1, frame good == 0        */
#endif
);

void IGFEncStereoEncoder(
@@ -3724,9 +3729,6 @@ void ivas_spar_config(
void ivas_sba_upmixer_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder struct                     */
    float output[][L_FRAME48k],                                 /* i/o: transport/output audio channels         */
#ifndef SPAR_SCALING_HARMONIZATION
    const int16_t nchan_remapped,                               /* i  : num channels after remapping of TCs     */
#endif
    const int16_t output_frame                                  /* i  : output frame length                     */
);

@@ -5447,7 +5449,7 @@ ivas_error ivas_orient_trk_GetTrackedOrientation(
    float *roll 
);

#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
void TonalMdctConceal_create_concealment_noise(
    float concealment_noise[L_FRAME48k],
    CPE_DEC_HANDLE hCPE,
@@ -5456,9 +5458,21 @@ void TonalMdctConceal_create_concealment_noise(
    const int16_t idchan,
    const int16_t subframe_idx,
    const int16_t core,
    const int16_t crossfade_gain,
    const float crossfade_gain,
    const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode
);

void TonalMdctConceal_whiten_noise_shape(
    Decoder_State *st,
    const int16_t L_frame,
    const TONALMDCTCONC_NOISE_SHAPE_WHITENING_MODE
);

int16_t get_igf_startline(
    Decoder_State *st,
    int16_t L_frame,
    int16_t L_frameTCX
);
#endif

float rand_triangular_signed(
@@ -5469,8 +5483,7 @@ float rand_triangular_signed(
#ifdef ALIGN_SID_SIZE
void dtx_read_padding_bits(
    DEC_CORE_HANDLE st,
    int16_t num_bits
);
    int16_t num_bits );
#endif

#endif /* IVAS_PROT_H */
+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
#include "ivas_prot.h"
#include "rom_com.h"
#include <math.h>
#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
#include <assert.h>
#endif
#ifdef DEBUGGING
@@ -45,7 +45,7 @@
#endif
#include "wmops.h"

#ifdef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE

/*-------------------------------------------------------------------
 * sns_compute_scf()
+2 −3
Original line number Diff line number Diff line
@@ -68,11 +68,10 @@ static void SpectrumWeighting_Init(
 *  initialize a PsychoacousticParameters structure
 *-------------------------------------------------------------------*/

#ifndef FIX_IVAS_185_MDCT_ST_PLC_FADEOUT
#ifndef MDCT_STEREO_PLC_FADE_2_BG_NOISE
static
#endif
    ivas_error
    PsychoacousticParameters_Init(
ivas_error PsychoacousticParameters_Init(
        const int32_t sr_core,  /* i  : sampling rate of core-coder                                     */
        const int16_t nBins,    /* i  : Number of bins (spectral lines)                                 */
        const int8_t nBands,    /* i  : Number of spectrum subbands                                     */
+5 −8
Original line number Diff line number Diff line
@@ -141,23 +141,20 @@
#endif
#define DISABLE_ADAP_RES_COD_TMP                        /* temporary fix for IVAS-403, disables adaptive residual coding */
/*#define ITD_WINNER_GAIN_MODIFY */                     /* ITD optimization - WORK IN PROGRESS */

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
/*#define FIX_IVAS_185_MDCT_ST_PLC_FADEOUT*/            /* IVAS-185 fix bug in TCX-PLC fadeout for MDCT-Stereo and improve fadeout by fading to background noise instead of white noise */
#define MDCT_STEREO_PLC_FADE_2_BG_NOISE                /* IVAS-185 fix bug in TCX-PLC fadeout for MDCT-Stereo and improve fadeout by fading to background noise instead of white noise */
#define FADE_TO_ZERO_FOR_TOO_LONG_FRAMELOSS
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define SPAR_SCALING_HARMONIZATION                      /* Issue 80: Changes to harmonize scaling in spar */
#define FIX_I98_HANDLES_TO_NULL                         /* Issue 98: do the setting of all handles to NULL in one place */
#define FIX_I102_SWB_TBE_SWITCH                         /* Issue 102: avoid IO->SWB switching code for IVAS, generate SHB ACB mem with lerp in case of switch */
#define FIX_I106_TDREND_5MS                             /* Issue 106: 5 ms update rate in TD object renderer */
#define QUANTISE_REAL_FCN_CLEAN_UP                      /*Clean up the ivas_quantise_real_values() function*/

#define FIX_I74_BW_LIMITATION_ALT                       /* issue 74: Propagate bitrate induced BW limitation to hEncoderConfig. Ensures BE between explicit BW limitation using "-max_band <BW>" and BW limited by bitrate; alternative fix */
#define FIX_I74_CLEANING                                /* issue 74: remove redundant function call in ivas_cpe_enc() */
#define ALIGN_SID_SIZE                                  /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */
#define FIX_135_MDCT_STEREO_MODE_UNINITIALIZED          /* Issue 135: fix uninitialized value usage in SBA MDCT-Stereo core with PLC */
#define FIX_CONTROLLABLE_SID_UPDATE_RATE                /* Issue 117: fix controllable SID update rate mechanism */

#define SPAR_SCALING_HARMONIZATION                      /* issue 80: Changes to harmonize scaling in spar */

#define ALIGN_SID_SIZE                                  /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
Loading