Commit 79d5e397 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into ci/fix_sanitizer_tests_scripts_for_combined_formats

parents c1e445cd bbdf1492
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ if(UNIX)
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
  endif()
  # C compiler flags
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off")  # disable floating point operation contraction
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-unused-parameter")
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ endif
CFLAGS   += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long     \
            -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes  \
            -Werror-implicit-function-declaration \
            -Wno-implicit-fallthrough
            -Wno-implicit-fallthrough -ffp-contract=off

# libs to link
LDLIBS   += -lm
+17 −2
Original line number Diff line number Diff line
@@ -1335,34 +1335,49 @@ typedef struct {
    unsigned short length[81];
} HUFF_ELEMENTS;

#ifdef FIX_891_PARAMUPMIX_CLEANUP
typedef struct {
    HUFF_ELEMENTS df0;
    HUFF_ELEMENTS df;
} HUFF_TABLE;
#else
typedef struct {
    HUFF_ELEMENTS df0;
    HUFF_ELEMENTS df;
    HUFF_ELEMENTS dt;
} HUFF_TABLE;
#endif

typedef enum {
    ALPHA,
    BETA
} PAR_TYPE;

#ifndef FIX_891_PARAMUPMIX_CLEANUP
typedef enum {
    FINE,
    COARSE
} QUANT_TYPE;

#endif
typedef struct {
    int16_t nquant;
    int16_t offset;
    float data[35];
} ACPL_QUANT_TABLE;  

#ifdef FIX_891_PARAMUPMIX_CLEANUP
typedef struct
{
    const int16_t (*alpha)[2];
    const int16_t (*beta)[2];
} HUFF_NODE_TABLE;
#else
typedef struct
{
    const int16_t (*alpha[2])[2];
    const int16_t (*beta[2])[2];
} HUFF_NODE_TABLE;

#endif

/*----------------------------------------------------------------------------------*
 * Parametric MC Constants
+30 −0
Original line number Diff line number Diff line
@@ -1453,7 +1453,11 @@ int16_t stereo_dft_sg_recovery(

void stereo_dft_dec_res(
    CPE_DEC_HANDLE hCPE,                                        /* i/o: decoder CPE handle                  */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    float res_buf[STEREO_DFT_N_8k],                             /* i  : residual buffer                     */
#else
    float res_buf[STEREO_DFT_BUF_MAX],                          /* i  : residual buffer                     */
#endif
    float *output                                               /* o  : output frame                        */
);

@@ -1461,7 +1465,11 @@ void stereo_dft_dec_res(
int16_t res_bpf_adapt(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft,                      /* i/o: DFT stereo decoder handle           */
    const float *bpf_error_signal_8k,                           /* i  : BPF modification signal             */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    float res_buf[STEREO_DFT_N_8k]                              /* i  : residual buffer                     */
#else
    float res_buf[STEREO_DFT_BUF_MAX]                           /* i  : residual buffer                     */
#endif
);

void bpf_pitch_coherence(
@@ -1477,7 +1485,11 @@ void stereo_dft_dec_read_BS(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft,                      /* i/o: decoder DFT stereo handle           */
    const int16_t bwidth,                                       /* i  : bandwidth                           */
    const int16_t output_frame,                                 /* i  : output frame length                 */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    float res_buf[STEREO_DFT_N_8k],                             /* o  : residual buffer                     */
#else
    float res_buf[STEREO_DFT_BUF_MAX],                          /* o  : residual buffer                     */
#endif
    int16_t *nb_bits,                                           /* o  : number of bits read                 */
    float *coh,                                                 /* i/o: Coherence                           */
    const int16_t ivas_format                                   /* i  : ivas format                         */
@@ -2252,10 +2264,19 @@ void EstimateStereoTCXNoiseLevel(

void TNSAnalysisStereo(
    Encoder_State **sts,                                        /* i  : state handle                            */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    float *mdst_spectrum[CPE_CHANNELS][NB_DIV],                 /* o  : MDST spectrum                           */
#else
    float *mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV],             /* o  : MDST spectrum                           */
#endif
    const int16_t bWhitenedDomain,                              /* i  : whitened domain flag                    */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    int16_t tnsSize[CPE_CHANNELS][NB_DIV],                      /* i  : number of tns parameters put into prm   */
    int16_t tnsBits[CPE_CHANNELS][NB_DIV],                      /* i  : number of tns bits in the frame         */
#else
    int16_t tnsSize[MCT_MAX_CHANNELS][NB_DIV],                  /* i  : number of tns parameters put into prm   */
    int16_t tnsBits[MCT_MAX_CHANNELS][NB_DIV],                  /* i  : number of tns bits in the frame         */
#endif
    int16_t param_core[][NB_DIV * NPRM_DIV],                    /* o  : quantized noise filling level           */
    const int16_t mct_on                                        /* i  : flag mct block (1) or stereo (0)        */
);
@@ -2538,8 +2559,13 @@ void stereo_decoder_tcx(
    STEREO_MDCT_DEC_DATA *hStereoMdct,                          /* i/o: MDCT stereo decoder structure           */
    int16_t ms_mask[NB_DIV][MAX_SFB],                           /* i  : bandwise MS mask                        */
    float *spec_r_0[NB_DIV],                                    /* i/o: spectrum right channel                  */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    float *spec_l[],                                            /* i/o: spectrum left channel  [NB_DIV][N]      */
    float *spec_r[],                                            /* i/o: spectrum right channel [NB_DIV][N]      */
#else
    float *spec_l[NB_DIV],                                      /* i/o: spectrum left channel                   */
    float *spec_r[NB_DIV],                                      /* i/o: spectrum right channel                  */
#endif
    const int16_t mdct_stereo_mode[],                           /* i  : stereo mode (FB/band wise MS, dual mono */
    const int16_t core_l,                                       /* i  : core for left channel (TCX20/TCX10)     */
    const int16_t core_r,                                       /* i  : core for right channel (TCX20/TCX10)    */
@@ -3071,7 +3097,11 @@ void mctStereoIGF_enc(

void ivas_mdct_dec_side_bits_frame_channel(
    CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure                   */
#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO
    int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW],              /* o  : lpc_parameters                          */
#else
    int16_t param_lpc[MCT_MAX_CHANNELS][NPRM_LPC_NEW],          /* o  : lpc_parameters                          */
#endif
    int16_t p_param[CPE_CHANNELS][NB_DIV],                      /* o  : pointer to param buffer                 */
    Decoder_State *st0,                                         /* i  : pointer to bitstream handle             */
    int16_t nTnsBitsTCX10[CPE_CHANNELS][NB_DIV],                /* o  : number of bits for TNS                  */
+68 −2
Original line number Diff line number Diff line
@@ -2518,7 +2518,7 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_
    1, 1, 1, 2, 24, 69, 122, 194, 285, 487, 690, 1173, 2255, 4709, 10599, 24635, 10862, 4709, 2204, 1059, 566, 330, 221, 150, 95, 59, 28, 2, 1, 1, 1
};
#ifndef FIX_891_PARAMUPMIX_CLEANUP
/*----------------------------------------------------------------------------------*
 * Parametric Upmix MC ROM tables
 *----------------------------------------------------------------------------------*/
@@ -2528,7 +2528,7 @@ const int16_t ivas_param_upmx_mx_qmap[2][33] =
    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0 },
                              { 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0 } 
};
#endif
/*----------------------------------------------------------------------------------*
 * MASA ROM tables
@@ -6439,6 +6439,71 @@ const int16_t sns_1st_means_32k[2][16] =
 * MC ParamUpmix ROM tables
 *-----------------------------------------------------------------------*/
#ifdef FIX_891_PARAMUPMIX_CLEANUP
const int16_t ivas_param_upmx_mx_qmap[33] =
{ 
    0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0
};
const ACPL_QUANT_TABLE ivas_mc_paramupmix_alpha_quant_table =
{
        33, /* nquant */
        16, /* offset */
        { -2.000000e+000f, -1.809375e+000f, -1.637500e+000f, -1.484375e+000f, -1.350000e+000f, -1.234375e+000f, -1.137500e+000f, -1.059375e+000f, -1.000000e+000f, -9.406250e-001f, 
          -8.625000e-001f, -7.656250e-001f, -6.500000e-001f, -5.156250e-001f, -3.625000e-001f, -1.906250e-001f, +0.000000e+000f, +1.906250e-001f, +3.625000e-001f, +5.156250e-001f, 
          +6.500000e-001f, +7.656250e-001f, +8.625000e-001f, +9.406250e-001f, +1.000000e+000f, +1.059375e+000f, +1.137500e+000f, +1.234375e+000f, +1.350000e+000f, +1.484375e+000f, 
          +1.637500e+000f, +1.809375e+000f, +2.000000e+000f } /* data */
};
const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[9] =
{
        {
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +2.375000e-001f, +5.500000e-001f, +9.375000e-001f, +1.400000e+000f, +1.937500e+000f, +2.550000e+000f, +3.237500e+000f, +4.000000e+000f } /* data */
        },
        {   /* Beta #2 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +2.035449e-001f, +4.713672e-001f, +8.034668e-001f, +1.199844e+000f, +1.660498e+000f, +2.185430e+000f, +2.774639e+000f, +3.428125e+000f } /* data */
        },
        {   /* Beta #3 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +1.729297e-001f, +4.004688e-001f, +6.826172e-001f, +1.019375e+000f, +1.410742e+000f, +1.856719e+000f, +2.357305e+000f, +2.912500e+000f } /* data */
        },
        {   /* Beta #4 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +1.456543e-001f, +3.373047e-001f, +5.749512e-001f, +8.585938e-001f, +1.188232e+000f, +1.563867e+000f, +1.985498e+000f, +2.453125e+000f } /* data */
        },
        {   /* Beta #5 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +1.217188e-001f, +2.818750e-001f, +4.804688e-001f, +7.175000e-001f, +9.929688e-001f, +1.306875e+000f, +1.659219e+000f, +2.050000e+000f } /* data */
        },
        {   /* Beta #6 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +1.011230e-001f, +2.341797e-001f, +3.991699e-001f, +5.960938e-001f, +8.249512e-001f, +1.085742e+000f, +1.378467e+000f, +1.703125e+000f } /* data */
        },
        {   /* Beta #7 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +8.386719e-002f, +1.942188e-001f, +3.310547e-001f, +4.943750e-001f, +6.841797e-001f, +9.004688e-001f, +1.143242e+000f, +1.412500e+000f } /* data */
        },
        {   /* Beta #8 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +6.995117e-002f, +1.619922e-001f, +2.761230e-001f, +4.123438e-001f, +5.706543e-001f, +7.510547e-001f, +9.535449e-001f, +1.178125e+000f } /* data */
        },
        {   /* Beta #9 */
            9, /* nquant */
            0, /* offset */
            { +0.000000e+000f, +5.937500e-002f, +1.375000e-001f, +2.343750e-001f, +3.500000e-001f, +4.843750e-001f, +6.375000e-001f, +8.093750e-001f, +1.000000e+000f } /* data */
        }
};
#else
const ACPL_QUANT_TABLE ivas_mc_paramupmix_alpha_quant_table[] =
{
    /* Alfa Fine */
@@ -6537,5 +6602,6 @@ const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[2][9] =
        }
    }
};
#endif
/* clang-format on */
Loading