Commit 86b8c57d authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'FhG/contribution-33-sns-quantization' into 'main'

[non-BE]Contribution 33 MSVQ for SNS quantization at stereo mid bitrates

See merge request !563
parents a1836f3e 58455d0d
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -829,6 +829,14 @@ enum fea_names

#define SNS_LOW_BR_MODE                         -1
#define SNS_NPTS                                16 /* Number of downsampled SNS parameters */
#ifdef SNS_MSVQ
#define SNS_STEREO_MODE_LR                      0
#define SNS_STEREO_MODE_MS                      1
#define SNS_STEREO_MODE_OFFSET_INDICES          4
#define SNS_MSVQ_NSTAGES_TCX20                  4
#define SNS_MSVQ_NSTAGES_TCX10                  3
#define SNS_MSVQ_NSTAGES_SIDE                   2
#endif

#define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG       0.001f
#define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME      2 * FRAMES_PER_SEC
+21 −0
Original line number Diff line number Diff line
@@ -2391,6 +2391,23 @@ void sns_shape_spectrum(
    const int16_t L_frame                                       /* i  : frame length                                                */
);

#ifdef SNS_MSVQ
int16_t quantize_sns(
    float sns_in[CPE_CHANNELS][NB_DIV][M],
    float snsQ_out[CPE_CHANNELS][NB_DIV][M],
    Encoder_State **sts,
    int16_t *indices,
    int16_t *zero_side_flag,
    int16_t *sns_stereo_mode
);

void dequantize_sns(
    int16_t indices[CPE_CHANNELS][NPRM_LPC_NEW],
    float snsQ_out[CPE_CHANNELS][NB_DIV][M],
    Decoder_State **sts
);
#endif

void sns_avq_cod(
    const float *sns,                                           /* i  : Input sns vectors                       */
    const float *snsmid,                                        /* i  : Input mid-sns vectors                   */
@@ -2412,7 +2429,11 @@ void sns_avq_cod_stereo(

void sns_avq_dec(
    int16_t *index,                                             /* i  : Quantization indices                    */
#ifdef SNS_MSVQ
    float SNS_Q[NB_DIV][M],                                     /* o  : Quantized SNS vectors                   */
#else
    float *SNS_Q,                                               /* o  : Quantized SNS vectors                   */
#endif
    const int16_t numlpc                                        /* i  : Number of sets of lpc                   */
);

+606 −0

File changed.

Preview size limit exceeded, changes collapsed.

+27 −0
Original line number Diff line number Diff line
@@ -400,5 +400,32 @@ extern const float ivas_fb_resp_cheby_ramp_16del[IVAS_FB_1MS_16K_SAMP + 1];

extern const int16_t ivas_num_active_bands[FB - WB + 1];

#ifdef SNS_MSVQ
/*------------------------------------------------------------------------------------------*
 * SNS MSVQ codebooks and means
 *------------------------------------------------------------------------------------------*/
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 float ivas_sns_means_tcx20[];
extern const float ivas_sns_means_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 ivas_sns_means_side_tcx20[];
extern const float *const ivas_sns_cdbks_side_tcx10[];
extern const float ivas_sns_means_side_tcx10[];
#endif

/* IVAS_ROM_COM_H */
#endif
+1 −1
Original line number Diff line number Diff line
@@ -141,11 +141,11 @@
#define DISABLE_ADAP_RES_COD_TMP                        /* temporary fix for IVAS-403, disables adaptive residual coding */
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */


#define FIX_398_MASA_DIRECTION_ALIGNMENT                /* Nokia: Issue 398: in 2dir MASA, dynamically adjust directions to be consistent */
#define REND_DEBUGGING_REVISION                         /* VA: encapsulate rendering debugging options with DEBUGGING */
#define FIX_419_ISM_MD_FIX                              /* VA: Issue 419: fix the upper value limitation for parameter angle1_diff_cnt */

#define SNS_MSVQ                                        /* FhG: contribution 33 - MSVQ for SNS parameters at stereo mid bitrates */

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