Commit 97d60f44 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

Merge branch 'main' into 1366-improve-wmops-of-sns_1st_cod_fx

parents 1ca3a7fd 012d3489
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -47,7 +47,7 @@ void CNG_exc_fx(
    Word16 *cng_ener_seed1,
    Word16 *cng_ener_seed1,
    Word16 exc3[], /*Q_exc*/
    Word16 exc3[], /*Q_exc*/
    Word16 Opt_AMR_WB,
    Word16 Opt_AMR_WB,
    const int16_t element_mode /* i  : IVAS Element mode                     */
    const Word16 element_mode /* i  : IVAS Element mode                     */
)
)
{
{
    Word16 i, tmp, tmp2, exp, exp2, Q_ener;
    Word16 i, tmp, tmp2, exp, exp2, Q_ener;
+2 −4
Original line number Original line Diff line number Diff line
@@ -239,7 +239,7 @@ enum{
#define L_FRAME48k_EXT                  1200            /* Extended MDCT frame size in samples at 48kHz */
#define L_FRAME48k_EXT                  1200            /* Extended MDCT frame size in samples at 48kHz */


/* Conversion of ns to samples for a given sampling frequency */
/* Conversion of ns to samples for a given sampling frequency */
#define NS2SA( fs, x )                  ( int16_t )( ( ( ( int32_t )( fs ) / 100L ) * ( ( x ) / 100L ) ) / 100000L )
#define NS2SA( fs, x )                  ( Word16 )( ( ( ( Word32 )( fs ) / 100L ) * ( ( x ) / 100L ) ) / 100000L )
#define NRG_CHANGE_E 8
#define NRG_CHANGE_E 8
#define AVG_FLAT_E 8
#define AVG_FLAT_E 8
#define ACTIVE_FRAME                    0xFF
#define ACTIVE_FRAME                    0xFF
@@ -1172,7 +1172,6 @@ enum
#define NBITS_NOISE_FILL_LEVEL              3                       /* Number of bits used for coding noise filling level for each range */
#define NBITS_NOISE_FILL_LEVEL              3                       /* Number of bits used for coding noise filling level for each range */
#define NF_GAIN_BITS                        ( NBITS_TCX_GAIN + NOISE_FILL_RANGES * NBITS_NOISE_FILL_LEVEL )
#define NF_GAIN_BITS                        ( NBITS_TCX_GAIN + NOISE_FILL_RANGES * NBITS_NOISE_FILL_LEVEL )
#define MIN_NOISE_FILLING_HOLE              8
#define MIN_NOISE_FILLING_HOLE              8
#define HOLE_SIZE_FROM_LTP_FLT( gain )      ( 4 + ( int16_t )( 2.0f * gain * ( 4.0f / 0.625f ) ) )
#define HOLE_SIZE_FROM_LTP( gain )          (add(4, extract_h(L_shr(L_mult0(gain, 0x6666), 10)))) /* gain (Q15), 0x6666 = 2.0*(4.0/0.625) (4Q11) */
#define HOLE_SIZE_FROM_LTP( gain )          (add(4, extract_h(L_shr(L_mult0(gain, 0x6666), 10)))) /* gain (Q15), 0x6666 = 2.0*(4.0/0.625) (4Q11) */
#define HOLE_SIZE_FROM_LTP32( gain )        (add(4, extract_h(L_shr(Mpy_32_32(gain, 0x66666667), 11))))  /* gain (Q31), 0x66666667 = 2.0*(4.0/0.625) (4Q27) */
#define HOLE_SIZE_FROM_LTP32( gain )        (add(4, extract_h(L_shr(Mpy_32_32(gain, 0x66666667), 11))))  /* gain (Q31), 0x66666667 = 2.0*(4.0/0.625) (4Q27) */


@@ -1469,7 +1468,7 @@ enum
#define cbitsnew                            16
#define cbitsnew                            16
#define stat_bitsnew                        14
#define stat_bitsnew                        14


#define ari_q4new                           ( ( (int32_t) 1 << cbitsnew ) - 1 )
#define ari_q4new                           ( ( (Word32) 1 << cbitsnew ) - 1 )
#define ari_q1new                           ( ari_q4new / 4 + 1 )
#define ari_q1new                           ( ari_q4new / 4 + 1 )
#define ari_q2new                           ( 2 * ari_q1new )
#define ari_q2new                           ( 2 * ari_q1new )
#define ari_q3new                           ( 3 * ari_q1new )
#define ari_q3new                           ( 3 * ari_q1new )
@@ -1951,7 +1950,6 @@ typedef enum _DCTTYPE
#define N_SMC_MIXTURES                      6                       /* number of mixtures */
#define N_SMC_MIXTURES                      6                       /* number of mixtures */
#define N_PCA_COEF                          12                      /* number of PCA components */
#define N_PCA_COEF                          12                      /* number of PCA components */
#define HALF_N_PCA_COEF_LOG_P12_Q18         2890731                 //Q18 of (0.5f * N_PCA_COEF *logf( PI2 ))
#define HALF_N_PCA_COEF_LOG_P12_Q18         2890731                 //Q18 of (0.5f * N_PCA_COEF *logf( PI2 ))
#define SMC_ST_MEAN_FACT                    0.5                     /* forgetting factor of short-term IIR mean filter */
#define SMC_ST_MEAN_RSHIFT_FACT_FX            1                     /* SMC_ST_MEAN_FACT equivalent right shift factor */
#define SMC_ST_MEAN_RSHIFT_FACT_FX            1                     /* SMC_ST_MEAN_FACT equivalent right shift factor */


#define M_LSP_SPMUS                         6                       /* number of LSPs used in speech/music classifier */
#define M_LSP_SPMUS                         6                       /* number of LSPs used in speech/music classifier */
+25 −25
Original line number Original line Diff line number Diff line
@@ -108,9 +108,9 @@ typedef enum _IVAS_ENC_FEC_INDICATOR


typedef struct _IVAS_ENC_CHANNEL_AWARE_CONFIG
typedef struct _IVAS_ENC_CHANNEL_AWARE_CONFIG
{
{
    int16_t channelAwareModeEnabled;
    Word16 channelAwareModeEnabled;
    IVAS_ENC_FEC_INDICATOR fec_indicator;
    IVAS_ENC_FEC_INDICATOR fec_indicator;
    int16_t fec_offset;
    Word16 fec_offset;


} IVAS_ENC_CHANNEL_AWARE_CONFIG;
} IVAS_ENC_CHANNEL_AWARE_CONFIG;


@@ -130,7 +130,7 @@ typedef struct _IVAS_ISM_METADATA
    float gainFactor;
    float gainFactor;
    float yaw;
    float yaw;
    float pitch;
    float pitch;
    int16_t non_diegetic_flag;
    Word16 non_diegetic_flag;


} IVAS_ISM_METADATA;
} IVAS_ISM_METADATA;


@@ -183,29 +183,29 @@ typedef struct ivas_LS_setup_custom IVAS_LSSETUP_CUSTOM_STRUCT;


typedef struct _IVAS_LS_CUSTOM_LAYOUT
typedef struct _IVAS_LS_CUSTOM_LAYOUT
{
{
    int16_t num_spk;
    Word16 num_spk;
    float azimuth[IVAS_MAX_OUTPUT_CHANNELS];
    float azimuth[IVAS_MAX_OUTPUT_CHANNELS];
    float elevation[IVAS_MAX_OUTPUT_CHANNELS];
    float elevation[IVAS_MAX_OUTPUT_CHANNELS];
    Word32 azimuth_fx[IVAS_MAX_OUTPUT_CHANNELS];   // Q22
    Word32 azimuth_fx[IVAS_MAX_OUTPUT_CHANNELS];   // Q22
    Word32 elevation_fx[IVAS_MAX_OUTPUT_CHANNELS]; // Q22
    Word32 elevation_fx[IVAS_MAX_OUTPUT_CHANNELS]; // Q22
    int16_t num_lfe;
    Word16 num_lfe;
    int16_t lfe_idx[IVAS_MAX_OUTPUT_CHANNELS];
    Word16 lfe_idx[IVAS_MAX_OUTPUT_CHANNELS];


} IVAS_CUSTOM_LS_DATA;
} IVAS_CUSTOM_LS_DATA;


typedef struct _IVAS_JBM_TRACE_DATA
typedef struct _IVAS_JBM_TRACE_DATA
{
{
    uint32_t systemTimestamp_ms;
    UWord32 systemTimestamp_ms;
    uint16_t extBufferedSamples;
    UWord16 extBufferedSamples;
    uint16_t lastDecodedWasActive;
    UWord16 lastDecodedWasActive;
    int32_t output_Fs;
    Word32 output_Fs;
    int16_t dataUnit_flag;
    Word16 dataUnit_flag;
    uint16_t sequenceNumber;
    UWord16 sequenceNumber;
    uint32_t timeStamp;
    UWord32 timeStamp;
    uint32_t rcvTime;
    UWord32 rcvTime;


    int16_t partial_frame;
    Word16 partial_frame;
    int16_t partialCopyOffset;
    Word16 partialCopyOffset;


} IVAS_JBM_TRACE_DATA;
} IVAS_JBM_TRACE_DATA;


@@ -217,8 +217,8 @@ typedef struct _IVAS_JBM_TRACE_DATA


typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
{
{
    int16_t override;
    Word16 override;
    int16_t nBands;                                                                                                                      /* Number of frequency bands for which reverb properties are provided, integer, range [2..256]        */
    Word16 nBands;                                                                                                                       /* Number of frequency bands for which reverb properties are provided, integer, range [2..256]        */
    float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX];                                                                                         /* Center frequencies for which following values are provided:                                        */
    float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX];                                                                                         /* Center frequencies for which following values are provided:                                        */
    float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX];                                                                                    /*  - The room's T60 per center frequency                                                             */
    float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX];                                                                                    /*  - The room's T60 per center frequency                                                             */
    float pAcoustic_dsr[IVAS_CLDFB_NO_CHANNELS_MAX];                                                                                     /*  - The room's Diffuse to Source Ratio per center frequency                                         */
    float pAcoustic_dsr[IVAS_CLDFB_NO_CHANNELS_MAX];                                                                                     /*  - The room's Diffuse to Source Ratio per center frequency                                         */
@@ -231,12 +231,12 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
    Word32 inputPreDelay_fx; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10]  */    /* Assumed Q-27*/
    Word32 inputPreDelay_fx; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10]  */    /* Assumed Q-27*/


    /* early reflections */
    /* early reflections */
    int16_t use_er;                           /* ER activation flag      */
    Word16 use_er;                           /* ER activation flag      */
    int32_t lowComplexity;                    /* Low complexity ER flag  */
    Word32 lowComplexity;                    /* Low complexity ER flag  */
    IVAS_VECTOR3 dimensions;                 /* Room dimensions [m]     */
    IVAS_VECTOR3 dimensions;                 /* Room dimensions [m]     */
    float AbsCoeff[IVAS_ROOM_ABS_COEFF];     /* Absorption coeffs       */
    float AbsCoeff[IVAS_ROOM_ABS_COEFF];     /* Absorption coeffs       */
    IVAS_VECTOR3 ListenerOrigin;             /* Listener origin         */
    IVAS_VECTOR3 ListenerOrigin;             /* Listener origin         */
    int32_t AbsCoeff_fx[IVAS_ROOM_ABS_COEFF]; /* Absorption coeffs       */
    Word32 AbsCoeff_fx[IVAS_ROOM_ABS_COEFF]; /* Absorption coeffs       */


} IVAS_ROOM_ACOUSTICS_CONFIG_DATA;
} IVAS_ROOM_ACOUSTICS_CONFIG_DATA;


+34 −1
Original line number Original line Diff line number Diff line
@@ -592,11 +592,12 @@ void edxt_fx(
    const UWord16 synthesis   /* i  : nonzero for inverse Q0*/
    const UWord16 synthesis   /* i  : nonzero for inverse Q0*/
)
)
{
{
    Word16 k, m, fac;
    Word16 k, m, fac, hdrm, tmp = 0;
    const Word16 *cosPtr, *sinPtr;
    const Word16 *cosPtr, *sinPtr;
    Word16 n;
    Word16 n;
    n = 0;
    n = 0;
    move16();
    move16();
    move16();
    cosPtr = NULL;
    cosPtr = NULL;
    sinPtr = NULL;
    sinPtr = NULL;
    IF( EQ_16( length, 512 ) )
    IF( EQ_16( length, 512 ) )
@@ -735,7 +736,23 @@ void edxt_fx(


            IF( EQ_16( length, 512 ) )
            IF( EQ_16( length, 512 ) )
            {
            {
                /* Scaling down re and im buffers to avoid overflow in DoRTFTn_fx if the minimum headroom is less than 4 bits */
                hdrm = s_min( L_norm_arr( re, 512 ), L_norm_arr( im, 512 ) );
                IF( LT_16( hdrm, 4 ) )
                {
                    tmp = sub( hdrm, 4 );
                    scale_sig32( re, 512, tmp );
                    scale_sig32( im, 512, tmp );
                }

                DoRTFTn_fx( re, im, 512 );
                DoRTFTn_fx( re, im, 512 );

                IF( LT_16( hdrm, 4 ) )
                {
                    tmp = negate( tmp );
                    scale_sig32( re, 512, tmp );
                    scale_sig32( im, 512, tmp );
                }
            }
            }
            ELSE /* fft() doesn't support 512 */
            ELSE /* fft() doesn't support 512 */
            {
            {
@@ -831,7 +848,23 @@ void edxt_fx(


            IF( EQ_16( length, 512 ) )
            IF( EQ_16( length, 512 ) )
            {
            {
                /* Scaling down re and im buffers to avoid overflow in DoRTFTn_fx if the minimum headroom is less than 4 bits */
                hdrm = s_min( L_norm_arr( re, 512 ), L_norm_arr( im, 512 ) );
                IF( LT_16( hdrm, 4 ) )
                {
                    tmp = sub( hdrm, 4 );
                    scale_sig32( re, 512, tmp );
                    scale_sig32( im, 512, tmp );
                }

                DoRTFTn_fx( re, im, 512 );
                DoRTFTn_fx( re, im, 512 );

                IF( LT_16( hdrm, 4 ) )
                {
                    tmp = negate( tmp );
                    scale_sig32( re, 512, tmp );
                    scale_sig32( im, 512, tmp );
                }
            }
            }
            ELSE /* fft() doesn't support 512 */
            ELSE /* fft() doesn't support 512 */
            {
            {
+1 −1
Original line number Original line Diff line number Diff line
@@ -505,7 +505,7 @@ static void fft15_with_cmplx_data( cmplx *inp_data /*Qx*/ )
 */
 */
void fft16( Word32 *re, Word32 *im, Word16 s, Word16 bScale )
void fft16( Word32 *re, Word32 *im, Word16 s, Word16 bScale )
{
{
    int i;
    Word16 i;
    if ( s == 2 )
    if ( s == 2 )
    {
    {
        fft16_with_cmplx_data( (cmplx *) re, bScale );
        fft16_with_cmplx_data( (cmplx *) re, bScale );
Loading