Commit 18d84b45 authored by malenov's avatar malenov
Browse files

fix out-of-array write opreation in stereo CNA

parent 998c3935
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1415,7 +1415,12 @@ enum
#define CHEAP_NORM_SIZE                     161

#define CNA_MAX_BRATE                       ACELP_13k20

#ifdef FIX_I414_OOA_CNA
#define CNA_INIT_NBANDS                     6
#else
#define MAX_CNA_NBANDS                      12
#endif

#define GAIN_Q_OFFSET_EVS 60.f
#define GAIN_Q_OFFSET_IVAS 45.f
+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@
#define FIX_401_DIRAC_RENDERER_META_READ_INDICES        /* Nokia: Issue 401: Fix metadata reading indices in DirAC renderer. */
#define FIX_406_IVAS_POSITION                           /* Eri: Issue 406: Unify IVAS_POSITION to use IVAS_VECTOR3 instead */
#define REND_DEBUGGING_REVISION                         /* VA: encapsulate rendering debugging options with DEBUGGING */
#define FIX_I414_OOA_CNA                                /* VA: Issue 414: Fixing out-of-array write operation in stereo CNA */



+5 −0
Original line number Diff line number Diff line
@@ -158,8 +158,13 @@ void initFdCngDec(
    hFdCngDec->cna_ILD_LT = 0.0f;
    hFdCngDec->first_cna_noise_updated = 0;
    hFdCngDec->first_cna_noise_update_cnt = 0;
#ifdef FIX_I414_OOA_CNA
    hFdCngDec->cna_nbands = CNA_INIT_NBANDS;
    mvs2s( cna_init_bands, hFdCngDec->cna_band_limits, CNA_INIT_NBANDS + 1 );
#else
    hFdCngDec->cna_nbands = 6;
    mvs2s( cna_init_bands, hFdCngDec->cna_band_limits, MAX_CNA_NBANDS + 1 );
#endif
    hFdCngDec->cna_act_fact = 1.0f;
    hFdCngDec->cna_rescale_fact = 0.0f;
    hFdCngDec->cna_seed = 5687;
+4 −0
Original line number Diff line number Diff line
@@ -226,7 +226,11 @@ const float dft_win_8k[70] =
 * stereo CNA tables
 *------------------------------------------------------------------------*/

#ifdef FIX_I414_OOA_CNA
const int16_t cna_init_bands[CNA_INIT_NBANDS + 1] =
#else
const int16_t cna_init_bands[MAX_CNA_NBANDS + 1] =
#endif
{
    1, 4, 14, 33, 67, 171, 320
};
+4 −0
Original line number Diff line number Diff line
@@ -68,7 +68,11 @@ extern const float dft_win232ms_48k[450];

extern const float dft_win_8k[70];

#ifdef FIX_I414_OOA_CNA
extern const int16_t cna_init_bands[CNA_INIT_NBANDS + 1];
#else
extern const int16_t cna_init_bands[MAX_CNA_NBANDS + 1];
#endif

extern const float min_smooth_gains1[SBA_DIRAC_STEREO_NUM_BANDS];
extern const float max_smooth_gains1[SBA_DIRAC_STEREO_NUM_BANDS];
Loading