Loading apps/decoder.c +4 −0 Original line number Diff line number Diff line Loading @@ -763,7 +763,11 @@ int main( if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); #ifdef FIX_OLD_BINARY_FORMAT destroy_td_hrtf( hHrtfTD ); #else goto cleanup; #endif } else { Loading lib_com/ivas_prot.h +7 −0 Original line number Diff line number Diff line Loading @@ -2927,6 +2927,13 @@ int16_t check_bounds_s( const int16_t high /* i : High limit */ ); #ifdef FIX_CRASH_LONG_BRIR void set_zero_l( float *vec, /* o : input vector */ const uint32_t lvec /* i : length of the vector */ ); #endif ivas_error stereo_memory_enc( CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const int32_t input_Fs, /* i : input sampling rate */ Loading lib_com/ivas_tools.c +22 −0 Original line number Diff line number Diff line Loading @@ -579,6 +579,28 @@ int16_t check_bounds_s( return value_adj; } #ifdef FIX_CRASH_LONG_BRIR /*---------------------------------------------------------------------* * set_zero_l() * * Set a vector vec[] of dimension lvec to zero *---------------------------------------------------------------------*/ void set_zero_l( float *vec, /* o : input vector */ const uint32_t lvec /* i : length of the vector */ ) { uint32_t i; for ( i = 0; i < lvec; i++ ) { *vec++ = 0.0f; } return; } #endif /****************************************************************************/ /* matrix functions */ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_CRASH_LONG_BRIR /* Orange : Fix crash when long BRIR is set */ #define FIX_643_PCA_OPTION /* VA: issue 643: rename PCA bypass command-line option */ /* #################### End BE switches ################################## */ Loading lib_rend/ivas_crend.c +39 −1 Original line number Diff line number Diff line Loading @@ -1302,7 +1302,11 @@ ivas_error ivas_rend_openCrend( ) { int16_t i, subframe_length; #ifdef FIX_CRASH_LONG_BRIR int32_t max_total_ir_len; #else int16_t max_total_ir_len; #endif HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; Loading Loading @@ -1352,13 +1356,21 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_re[i], max_total_ir_len ); #else set_zero( hCrend->freq_buffer_re[i], max_total_ir_len ); #endif if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_im[i], max_total_ir_len ); #else set_zero( hCrend->freq_buffer_im[i], max_total_ir_len ); #endif } for ( i = 0; i < BINAURAL_CHANNELS; i++ ) Loading @@ -1367,7 +1379,11 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->prev_out_buffer[i], subframe_length ); #else set_zero( hCrend->prev_out_buffer[i], subframe_length ); #endif } max_total_ir_len = hHrtf->num_iterations_diffuse[0] * subframe_length; Loading @@ -1378,13 +1394,27 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR if ( hCrend->freq_buffer_re_diffuse != NULL ) { set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); } #else set_zero( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); #endif if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR if ( hCrend->freq_buffer_im_diffuse != NULL ) { set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); } #else set_zero( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); #endif } else { Loading @@ -1399,7 +1429,11 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->lfe_delay_line, max_total_ir_len ); #else set_zero( hCrend->lfe_delay_line, max_total_ir_len ); #endif } else { Loading Loading @@ -1595,7 +1629,7 @@ void ivas_rend_closeCrend( #ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * ivas_rend_openCldfbRend() * ivas_rend_closeCldfbRend() * * Close CLDFB based fastconv binaural renderer memories *------------------------------------------------------------------------*/ Loading Loading @@ -1642,7 +1676,11 @@ static ivas_error ivas_rend_crendConvolver( int16_t i, j, k, m; int16_t subframe_length, idx_in; int16_t lfe_idx_in; #ifdef FIX_CRASH_LONG_BRIR int32_t offset, offset_in, offset_diffuse; #else int16_t offset, offset_in, offset_diffuse; #endif int16_t nchan_in, nchan_out; const float *pIn; float *pFreq_buf_re, *pFreq_buf_im; Loading Loading
apps/decoder.c +4 −0 Original line number Diff line number Diff line Loading @@ -763,7 +763,11 @@ int main( if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); #ifdef FIX_OLD_BINARY_FORMAT destroy_td_hrtf( hHrtfTD ); #else goto cleanup; #endif } else { Loading
lib_com/ivas_prot.h +7 −0 Original line number Diff line number Diff line Loading @@ -2927,6 +2927,13 @@ int16_t check_bounds_s( const int16_t high /* i : High limit */ ); #ifdef FIX_CRASH_LONG_BRIR void set_zero_l( float *vec, /* o : input vector */ const uint32_t lvec /* i : length of the vector */ ); #endif ivas_error stereo_memory_enc( CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const int32_t input_Fs, /* i : input sampling rate */ Loading
lib_com/ivas_tools.c +22 −0 Original line number Diff line number Diff line Loading @@ -579,6 +579,28 @@ int16_t check_bounds_s( return value_adj; } #ifdef FIX_CRASH_LONG_BRIR /*---------------------------------------------------------------------* * set_zero_l() * * Set a vector vec[] of dimension lvec to zero *---------------------------------------------------------------------*/ void set_zero_l( float *vec, /* o : input vector */ const uint32_t lvec /* i : length of the vector */ ) { uint32_t i; for ( i = 0; i < lvec; i++ ) { *vec++ = 0.0f; } return; } #endif /****************************************************************************/ /* matrix functions */ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_CRASH_LONG_BRIR /* Orange : Fix crash when long BRIR is set */ #define FIX_643_PCA_OPTION /* VA: issue 643: rename PCA bypass command-line option */ /* #################### End BE switches ################################## */ Loading
lib_rend/ivas_crend.c +39 −1 Original line number Diff line number Diff line Loading @@ -1302,7 +1302,11 @@ ivas_error ivas_rend_openCrend( ) { int16_t i, subframe_length; #ifdef FIX_CRASH_LONG_BRIR int32_t max_total_ir_len; #else int16_t max_total_ir_len; #endif HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; Loading Loading @@ -1352,13 +1356,21 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_re[i], max_total_ir_len ); #else set_zero( hCrend->freq_buffer_re[i], max_total_ir_len ); #endif if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_im[i], max_total_ir_len ); #else set_zero( hCrend->freq_buffer_im[i], max_total_ir_len ); #endif } for ( i = 0; i < BINAURAL_CHANNELS; i++ ) Loading @@ -1367,7 +1379,11 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->prev_out_buffer[i], subframe_length ); #else set_zero( hCrend->prev_out_buffer[i], subframe_length ); #endif } max_total_ir_len = hHrtf->num_iterations_diffuse[0] * subframe_length; Loading @@ -1378,13 +1394,27 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR if ( hCrend->freq_buffer_re_diffuse != NULL ) { set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); } #else set_zero( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); #endif if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR if ( hCrend->freq_buffer_im_diffuse != NULL ) { set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); } #else set_zero( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); #endif } else { Loading @@ -1399,7 +1429,11 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } #ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->lfe_delay_line, max_total_ir_len ); #else set_zero( hCrend->lfe_delay_line, max_total_ir_len ); #endif } else { Loading Loading @@ -1595,7 +1629,7 @@ void ivas_rend_closeCrend( #ifdef SPLIT_REND_WITH_HEAD_ROT /*------------------------------------------------------------------------- * ivas_rend_openCldfbRend() * ivas_rend_closeCldfbRend() * * Close CLDFB based fastconv binaural renderer memories *------------------------------------------------------------------------*/ Loading Loading @@ -1642,7 +1676,11 @@ static ivas_error ivas_rend_crendConvolver( int16_t i, j, k, m; int16_t subframe_length, idx_in; int16_t lfe_idx_in; #ifdef FIX_CRASH_LONG_BRIR int32_t offset, offset_in, offset_diffuse; #else int16_t offset, offset_in, offset_diffuse; #endif int16_t nchan_in, nchan_out; const float *pIn; float *pFreq_buf_re, *pFreq_buf_im; Loading