Commit c7a1fb8e authored by janssonfr's avatar janssonfr
Browse files

Merged with main

parents ef0c7c93 939890ac
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -837,6 +837,10 @@ enum fea_names
#define SNS_MSVQ_NSTAGES_TCX10                  3
#define SNS_MSVQ_NSTAGES_TCX10                  3
#define SNS_MSVQ_NSTAGES_SIDE                   2
#define SNS_MSVQ_NSTAGES_SIDE                   2
#endif
#endif
#ifdef FIX_445_SNS_BUGFIXES
#define SNS_CDBKS_BITS_4_FRAC                   12
#define SNS_MEANS_BITS_4_FRAC                   14
#endif


#define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG       0.001f
#define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG       0.001f
#define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME      2 * FRAMES_PER_SEC
#define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME      2 * FRAMES_PER_SEC
+12 −0
Original line number Original line Diff line number Diff line
@@ -2415,12 +2415,18 @@ void sns_avq_cod(
    float *snsmid_q,                                            /* o  : Quantized mid-LFS vectors               */
    float *snsmid_q,                                            /* o  : Quantized mid-LFS vectors               */
    int16_t *index,                                             /* o  : Quantization indices                    */
    int16_t *index,                                             /* o  : Quantization indices                    */
    const int16_t core,                                         /* i  : core                                    */
    const int16_t core,                                         /* i  : core                                    */
#ifdef FIX_445_SNS_BUGFIXES
    const int16_t L_frame,
#endif
    const int16_t low_brate_mode                                /* i  : flag low bit operating mode             */
    const int16_t low_brate_mode                                /* i  : flag low bit operating mode             */
);
);


void sns_avq_cod_stereo(
void sns_avq_cod_stereo(
    const float *snsl,                                          /* i  : Input sns vector (left channel)         */
    const float *snsl,                                          /* i  : Input sns vector (left channel)         */
    const float *snsr,                                          /* i  : Input sns vector (right channel)        */
    const float *snsr,                                          /* i  : Input sns vector (right channel)        */
#ifdef FIX_445_SNS_BUGFIXES
    const int16_t L_frame,
#endif
    float *snsl_q,                                              /* o  : Quantized sns vector (left channel)     */
    float *snsl_q,                                              /* o  : Quantized sns vector (left channel)     */
    float *snsr_q,                                              /* o  : Quantized sns vector (right channel)    */
    float *snsr_q,                                              /* o  : Quantized sns vector (right channel)    */
    int16_t *indexl,                                            /* o  : Quantization indices (left channel)     */
    int16_t *indexl,                                            /* o  : Quantization indices (left channel)     */
@@ -2433,6 +2439,9 @@ void sns_avq_dec(
    float SNS_Q[NB_DIV][M],                                     /* o  : Quantized SNS vectors                   */
    float SNS_Q[NB_DIV][M],                                     /* o  : Quantized SNS vectors                   */
#else
#else
    float *SNS_Q,                                               /* o  : Quantized SNS vectors                   */
    float *SNS_Q,                                               /* o  : Quantized SNS vectors                   */
#endif
#ifdef FIX_445_SNS_BUGFIXES
    const int16_t L_frame,
#endif
#endif
    const int16_t numlpc                                        /* i  : Number of sets of lpc                   */
    const int16_t numlpc                                        /* i  : Number of sets of lpc                   */
);
);
@@ -2440,6 +2449,9 @@ void sns_avq_dec(
void sns_avq_dec_stereo(
void sns_avq_dec_stereo(
    int16_t *indexl,                                            /* i  : Quantization indices (left channel)     */
    int16_t *indexl,                                            /* i  : Quantization indices (left channel)     */
    int16_t *indexr,                                            /* i  : Quantization indices (right channe)     */
    int16_t *indexr,                                            /* i  : Quantization indices (right channe)     */
#ifdef FIX_445_SNS_BUGFIXES
    const int16_t L_frame,
#endif
    float *SNS_Ql,                                              /* o  : Quantized SNS vectors (left channel)    */
    float *SNS_Ql,                                              /* o  : Quantized SNS vectors (left channel)    */
    float *SNS_Qr                                               /* o  : Quantized SNS vectors (right channe)    */
    float *SNS_Qr                                               /* o  : Quantized SNS vectors (right channe)    */
);
);
+744 −1

File changed.

Preview size limit exceeded, changes collapsed.

+26 −0
Original line number Original line Diff line number Diff line
@@ -408,6 +408,24 @@ extern const int16_t ivas_num_active_bands[FB - WB + 1];
/*------------------------------------------------------------------------------------------*
/*------------------------------------------------------------------------------------------*
 * SNS MSVQ codebooks and means
 * SNS MSVQ codebooks and means
 *------------------------------------------------------------------------------------------*/
 *------------------------------------------------------------------------------------------*/
#ifdef FIX_445_SNS_BUGFIXES
extern const int16_t ivas_sns_cdbks_tcx20_levels[];
extern const int16_t ivas_sns_cdbks_tcx20_bits[];

extern const int16_t ivas_sns_cdbks_tcx10_levels[];
extern const int16_t ivas_sns_cdbks_tcx10_bits[];

extern const float *const ivas_sns_cdbks_tcx20[];
extern const float *const ivas_sns_cdbks_tcx10[];

extern const int16_t ivas_sns_cdbks_side_tcx20_levels[];
extern const int16_t ivas_sns_cdbks_side_tcx20_bits[];
extern const int16_t ivas_sns_cdbks_side_tcx10_levels[];
extern const int16_t ivas_sns_cdbks_side_tcx10_bits[];

extern const float *const ivas_sns_cdbks_side_tcx20[];
extern const float *const ivas_sns_cdbks_side_tcx10[];
#else
extern const int16_t ivas_sns_cdbks_tcx20_levels[];
extern const int16_t ivas_sns_cdbks_tcx20_levels[];
extern const int16_t ivas_sns_cdbks_tcx20_bits[];
extern const int16_t ivas_sns_cdbks_tcx20_bits[];


@@ -430,6 +448,14 @@ extern const float ivas_sns_means_side_tcx20[];
extern const float *const ivas_sns_cdbks_side_tcx10[];
extern const float *const ivas_sns_cdbks_side_tcx10[];
extern const float ivas_sns_means_side_tcx10[];
extern const float ivas_sns_means_side_tcx10[];
#endif
#endif
#endif


#ifdef FIX_445_SNS_BUGFIXES
/* means and codebooks for the split VQ in the 2-stage SNS VQ */
extern const int16_t sns_1st_cdbk[2][2][8 * 32];
extern const int16_t sns_1st_means_16k[2][16];
extern const int16_t sns_1st_means_25k6[2][16];
extern const int16_t sns_1st_means_32k[2][16];
#endif
/* IVAS_ROM_COM_H */
/* IVAS_ROM_COM_H */
#endif
#endif
+21 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,9 @@
#include "prot.h"
#include "prot.h"
#include "ivas_prot.h"
#include "ivas_prot.h"
#include "rom_com.h"
#include "rom_com.h"
#ifdef FIX_445_SNS_BUGFIXES
#include "ivas_rom_com.h"
#endif
#include <math.h>
#include <math.h>
#include <assert.h>
#include <assert.h>
#ifdef DEBUGGING
#ifdef DEBUGGING
@@ -118,6 +121,23 @@ void sns_compute_scf(
    xs[FDNS_NPTS - 1] = 0.75f * x[FDNS_NPTS - 1] + 0.25f * x[FDNS_NPTS - 2];
    xs[FDNS_NPTS - 1] = 0.75f * x[FDNS_NPTS - 1] + 0.25f * x[FDNS_NPTS - 2];


    /* Pre-emphasis */
    /* Pre-emphasis */
#ifdef FIX_445_SNS_BUGFIXES
    switch ( L_frame )
    {
        case L_FRAME16k:
            tilt = 19.f;
            break;
        case L_FRAME25_6k:
            tilt = 22.f;
            break;
        case L_FRAME32k:
            tilt = 23.5f;
            break;
        default:
            tilt = 0.f;
            assert( !"illegal frame length in sns_compute_scf" );
    }
#else
    if ( L_frame == L_FRAME16k )
    if ( L_frame == L_FRAME16k )
    {
    {
        tilt = 18.f;
        tilt = 18.f;
@@ -143,6 +163,7 @@ void sns_compute_scf(
        tilt = 0.f;
        tilt = 0.f;
        assert( 0 && "illegal frame length in sns_compute_scf" );
        assert( 0 && "illegal frame length in sns_compute_scf" );
    }
    }
#endif


    for ( i = 0; i < FDNS_NPTS; i++ )
    for ( i = 0; i < FDNS_NPTS; i++ )
    {
    {
Loading