Skip to content
Commits on Source (6)
......@@ -153,6 +153,7 @@
/* #################### End FIXES switches ############################ */
#define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
#define FIX_1995_REVERB_INIT /* issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */
/* #################### Start BASOP porting switches ############################ */
......
......@@ -2146,24 +2146,16 @@ ivas_error IVAS_DEC_GetHrtfHandle(
ivas_error IVAS_DEC_GetHrtfCRendHandle(
IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */
IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */
IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */
)
{
#ifdef FIX_CREND_SIMPLIFY_CODE
if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfCrend == NULL )
{
return IVAS_ERR_WRONG_PARAMS;
}
*hSetOfHRTF = &hIvasDec->st_ivas->hHrtfCrend;
#else
if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL )
{
return IVAS_ERR_WRONG_PARAMS;
}
*hHrtfCrend = &hIvasDec->st_ivas->hHrtfCrend;
*hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF;
#endif
return IVAS_ERR_OK;
}
......
......@@ -115,15 +115,15 @@ ivas_error ivas_hrtf_init(
*------------------------------------------------------------------------*/
static ivas_error ivas_hrtf_open(
HRTFS_CREND_HANDLE *hHrtf_out /* o : HRTF handle */
HRTFS_HANDLE *hHrtf_out /* o : HRTF handle */
)
{
HRTFS_CREND_HANDLE hHrtf;
HRTFS_HANDLE hHrtf;
ivas_error error;
if ( *hHrtf_out == NULL )
{
if ( ( hHrtf = (HRTFS_CREND_HANDLE) malloc( sizeof( HRTFS_CREND_DATA ) ) ) == NULL )
if ( ( hHrtf = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL )
{
return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" );
}
......@@ -174,11 +174,7 @@ static ivas_error ivas_hrtf_open(
*------------------------------------------------------------------------*/
static void ivas_hrtf_close(
#ifdef FIX_CREND_SIMPLIFY_CODE
HRTFS_CREND_HANDLE *hHrtf /* i/o: HRTF handle */
#else
HRTFS_HANDLE *hHrtf /* i/o: HRTF handle */
#endif
)
{
if ( hHrtf == NULL || *hHrtf == NULL )
......@@ -1437,11 +1433,7 @@ ivas_error ivas_rend_openCrend(
{
int16_t i, subframe_length;
int32_t max_total_ir_len;
#ifdef FIX_CREND_SIMPLIFY_CODE
HRTFS_CREND_HANDLE hHrtf;
#else
HRTFS_HANDLE hHrtf;
#endif
CREND_HANDLE hCrend;
ivas_error error;
int16_t pos_idx;
......
......@@ -1868,6 +1868,7 @@ static ivas_error ivas_binaural_reverb_open(
* Allocate and initialize binaural room reverberator handle
* for CLDFB renderers
*------------------------------------------------------------------------*/
ivas_error ivas_binaural_reverb_init(
REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */
const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */
......@@ -1876,8 +1877,7 @@ ivas_error ivas_binaural_reverb_init(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */
const int32_t sampling_rate, /* i : sampling rate */
const float *defaultTimes, /* i : default reverberation times */
const float *defaultEne /* i : default reverberation energies */
,
const float *defaultEne, /* i : default reverberation energies */
float *earlyEne /* i/o: Early part energies to be modified */
)
{
......@@ -1899,7 +1899,11 @@ ivas_error ivas_binaural_reverb_init(
}
else
{
#ifdef FIX_1995_REVERB_INIT
for ( bin = 0; bin < numBins; bin++ )
#else
for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{
revTimes[bin] = defaultTimes[bin];
revEne[bin] = defaultEne[bin];
......@@ -1907,7 +1911,11 @@ ivas_error ivas_binaural_reverb_init(
preDelay = 10;
}
#ifdef FIX_1995_REVERB_INIT
for ( bin = 0; bin < numBins; bin++ )
#else
for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{
/* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid
spectral artefacts with the synthetic reverberator. */
......
......@@ -975,7 +975,6 @@ typedef struct
int16_t *elevBsStart_dyn;
#else
int16_t *azimDim2_dyn;
#endif
int16_t *azimDim3_dyn;
int16_t *azim_start_idx_dyn;
......