Commit 84b48772 authored by malenov's avatar malenov
Browse files

fix array size mismatch in DFT/MDCT stereo functions

parent 8c120d7d
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -1450,7 +1450,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                        */
);

@@ -1474,7 +1478,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                         */
@@ -2249,10 +2257,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)        */
);
@@ -2535,8 +2552,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)    */
@@ -3068,7 +3090,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                  */
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@
#define FIX_888_INTERFACE_UNIFICATION                   /* Nokia: issue #888: fix mismatch in 2D array size */
#define FIX_889_MASA_FILE_WRITER_OPEN                   /* Nokia: issue #889: mismatch in function definition and use */
#define FIX_890_ARRAY_SIZE                              /* Nokia: issue #890: mismatch in 2D array size declaration and use */

#define FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO              /* VA: issue #887: mismatch in defined and supplied array size */

/* #################### End BE switches ################################## */

+4 −0
Original line number Diff line number Diff line
@@ -286,7 +286,11 @@ static void dec_prm_tcx_spec(

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              */
+8 −0
Original line number Diff line number Diff line
@@ -1734,7 +1734,11 @@ void stereo_dft_dec(

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             */
)
{
@@ -1873,7 +1877,11 @@ void stereo_dft_dec_read_BS(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder 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             */
+7 −2
Original line number Diff line number Diff line
@@ -209,8 +209,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)    */
Loading