Commit a0fc112a authored by premathasara's avatar premathasara
Browse files

Merging with latest of main

parents 35d9a6cc 34c6b03f
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -793,14 +793,11 @@ enum fea_names
#define MAX_MDCT_ITD_BRATE                      IVAS_64k

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

#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,
@@ -812,7 +809,6 @@ typedef enum {
    ON_FIRST_LOST_FRAME,
    ON_FIRST_GOOD_FRAME,
} TONALMDCTCONC_NOISE_SHAPE_WHITENING_MODE;
#endif


/*----------------------------------------------------------------------------------*
+20 −14
Original line number Diff line number Diff line
@@ -1987,9 +1987,7 @@ void decoder_tcx_invQ(

void decoder_tcx_noisefilling(
    Decoder_State *st,                                          /* i/o: coder memory state                      */
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
    float concealment_noise[L_FRAME48k],
#endif
    const float A[],                                            /* i  : coefficients NxAz[M+1]                  */
    const int16_t L_frameTCX_glob,
    const int16_t L_spec,
@@ -2002,9 +2000,7 @@ void decoder_tcx_noisefilling(
    const int16_t *prm_sqQ,
    int16_t nf_seed,
    const int16_t bfi,                                          /* i  : Bad frame indicator                     */
#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        */
);

@@ -2087,12 +2083,8 @@ 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(
@@ -2125,12 +2117,8 @@ 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(
@@ -3042,6 +3030,10 @@ void ivas_dirac_param_est_enc(
    float **pp_fr_real,
    float **pp_fr_imag,
    const int16_t input_frame 
#ifdef SBA_HOA_HBR_IMPROV
	,
    const SBA_MODE sba_mode                                    
#endif
 );

/*----------------------------------------------------------------------------------*
@@ -3101,6 +3093,14 @@ int16_t ivas_sba_get_nchan_metadata(
    const int16_t sba_order                                     /* i  : Ambisonic (SBA) order                   */
);

#ifdef SBA_HOA_HBR_IMPROV
/*! r: get the flag to code SPAR HOA MD for all band  */
int16_t ivas_sba_get_spar_hoa_md_flag(
    const int16_t sba_order,       /* i  : Ambisonic (SBA) order            */
    const int32_t ivas_total_brate /* i  : IVAS total bitrate            */
);
#endif

void ivas_sba_zero_vert_comp(
    float sba_data[][L_FRAME48k],                               /* i/o: SBA data frame                          */
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                   */
@@ -3995,6 +3995,10 @@ ivas_error ivas_spar_md_dec_open(
    ivas_spar_md_dec_state_t **hMdDec_out,                      /* i/o: SPAR MD decoder handle                  */
    const DECODER_CONFIG_HANDLE hDecoderConfig,                 /* i  : configuration structure                 */
    const int16_t num_channels                                  /* i  : number of internal channels             */
#ifdef SBA_HOA_HBR_IMPROV
    ,
	const int16_t sba_order                            /* i  : flag to send HOA MD for all bands                */
#endif
);

void ivas_spar_md_dec_close(
@@ -4842,6 +4846,10 @@ void computeReferencePower_enc(
    float *reference_power,                                     /* o  : Estimated power                                 */
    const int16_t enc_param_start_band,                         /* i  : first band to process                           */
    const int16_t num_freq_bands                                /* i  : Number of frequency bands                       */
#ifdef SBA_HOA_HBR_IMPROV
	,
    const SBA_MODE sba_mode                                     /* i  : SBA mode                       */
#endif
);


@@ -5499,7 +5507,6 @@ ivas_error ivas_orient_trk_GetTrackedOrientation(
    float *roll 
);

#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
void TonalMdctConceal_create_concealment_noise(
    float concealment_noise[L_FRAME48k],
    CPE_DEC_HANDLE hCPE,
@@ -5523,7 +5530,6 @@ int16_t get_igf_startline(
    int16_t L_frame,
    int16_t L_frameTCX
);
#endif

float rand_triangular_signed(
    int16_t *seed );
+25 −0
Original line number Diff line number Diff line
@@ -281,6 +281,31 @@ int16_t ivas_sba_get_nchan_metadata(
    return ( nb_channels );
}

#ifdef SBA_HOA_HBR_IMPROV
/*-------------------------------------------------------------------*
 * ivas_sba_get_spar_hoa_md_flag()
 *
 * et the flag to code SPAR HOA MD for all band
 *-------------------------------------------------------------------*/

/*! r: get the flag to code SPAR HOA MD for all band  */
int16_t ivas_sba_get_spar_hoa_md_flag(
    const int16_t sba_order,       /* i  : Ambisonic (SBA) order            */
    const int32_t ivas_total_brate /* i  : IVAS total bitrate            */
)
{
    int16_t spar_hoa_md_flag = 0;
    if ( sba_order > 1 && ivas_total_brate >= IVAS_256k )
    {
        spar_hoa_md_flag = 1;
    }
    else
    {
        spar_hoa_md_flag = 0;
    }
    return spar_hoa_md_flag;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_zero_vert_comp()
+0 −4
Original line number Diff line number Diff line
@@ -37,15 +37,12 @@
#include "ivas_prot.h"
#include "rom_com.h"
#include <math.h>
#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE
#include <assert.h>
#endif
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "wmops.h"

#ifdef MDCT_STEREO_PLC_FADE_2_BG_NOISE

/*-------------------------------------------------------------------
 * sns_compute_scf()
@@ -212,7 +209,6 @@ void sns_compute_scf(

    return;
}
#endif

/*-------------------------------------------------------------------
 * sns_interpolate_scalefactors()
+2 −1
Original line number Diff line number Diff line
@@ -1737,10 +1737,11 @@ void ivas_get_spar_md_from_dirac(

            /*SPAR from DirAC*/
            set_f( response_avg, 0.0f, MAX_OUTPUT_CHANNELS );
#ifndef SBA_HOA_HBR_IMPROV
            set_f( hSpar_md->band_coeffs[band + i_ts * IVAS_MAX_NUM_BANDS].pred_re, 0.0f, IVAS_SPAR_MAX_CH - 1 );
            set_f( &hSpar_md->band_coeffs[band + i_ts * IVAS_MAX_NUM_BANDS].C_re[0][0], 0.0f, ( IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS ) * ( IVAS_SPAR_MAX_DMX_CHS - 1 ) );
            set_f( &hSpar_md->band_coeffs[band + i_ts * IVAS_MAX_NUM_BANDS].P_re[0], 0.0f, ( IVAS_SPAR_MAX_CH - 1 ) );

#endif
            if ( n_ts > 1 )
            {
                ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][i_ts], (int16_t) ele_dirac[band][i_ts], response_avg, order );
Loading