Commit e97c0019 authored by sbsarac's avatar sbsarac
Browse files

Merge branch 'main' into 1053-reverb-reconfiguration-runtime-aeid-file-tests

parents 18cf84a5 0da15e11
Loading
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -456,17 +456,48 @@ void td_stereo_param_updt(
    if ( tdm_use_IAWB_Ave_lpc == 1 )
    {
        mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M );

#ifdef FIX_1111_TDM_LSP_BUFFER
        if ( tdm_lspQ_PCh != NULL )
        {
            lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 );
        }
#else
        lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 );
#endif
    }
    else if ( flag_ACELP16k == 1 )
    {
#ifdef FIX_1111_TDM_LSP_BUFFER
        if ( tdm_lspQ_PCh != NULL )
        {
            mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M );
            lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 );
            lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 );
        }
        else
        {
            float lsp_temp[M];
            mvr2r( lsp_old_PCh, lsp_temp, M );
            lsp_convert_poly( lsp_temp, L_FRAME, 0 );
            lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 );
        }
#else
        mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M );
        lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 );
        lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 );
#endif
    }
    else
    {
#ifdef FIX_1111_TDM_LSP_BUFFER
        if ( tdm_lspQ_PCh != NULL )
        {
            mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M );
        }
#else
        mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M );
#endif
        mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M );
    }

+4 −2
Original line number Diff line number Diff line
@@ -158,10 +158,11 @@
//#define FIX_CREND_FIX_POINT_HRTF_FILE_FORMAT          /* Orange issue 1031 : new fix point hrtf binary file format */
//#define FIX_CREND_SIMPLIFY_CODE                         /* Ora : simplify line code in crend */
#define FLOAT_FIX_POINT_HRTF_FILE_FORMAT                /* allows reading floation or fix point hrtf binary file format */
#define FIX_1115_FASTCONV_HRTF_FILE_LOAD                /* FhG: issue 1115: fix crash when loading FastConv-only binary HRTF file */


#define FIX_1099_JBM_MD_HANDLE_ALLOC                    /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */

#define FIX_1111_TDM_LSP_BUFFER                         /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */
#define FIX_1053_AEID_FILE_TEST                         /* Philips: Tests for the -aeid file and fix for memory error */

/* #################### End BE switches ################################## */
@@ -171,6 +172,7 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/
#define REVERT_ZERO_FLUSH_TRESH                               /* FhG: issue 1069: revert threshold value introduced with !1518 due to significant complexity increase*/ 
/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+8 −0
Original line number Diff line number Diff line
@@ -618,11 +618,15 @@ ivas_error ivas_allocate_binaural_hrtf(

    if ( renderer_type == RENDERER_BINAURAL_FASTCONV || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
    {
#ifndef FIX_1115_FASTCONV_HRTF_FILE_LOAD
        if ( ( HrtfFastConv->leftHRIRReal != NULL ) && ( HrtfFastConv->leftHRIRImag != NULL ) && ( HrtfFastConv->rightHRIRReal != NULL ) && ( HrtfFastConv->rightHRIRImag != NULL ) )
        {
            return IVAS_ERR_OK;
        }
        else
#else
        if ( ( HrtfFastConv->leftHRIRReal == NULL ) && ( HrtfFastConv->leftHRIRImag == NULL ) && ( HrtfFastConv->rightHRIRReal == NULL ) && ( HrtfFastConv->rightHRIRImag == NULL ) )
#endif
        {

            if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, BINAURAL_NTAPS, allocate_init_flag ) )
@@ -646,11 +650,15 @@ ivas_error ivas_allocate_binaural_hrtf(

    if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
    {
#ifndef FIX_1115_FASTCONV_HRTF_FILE_LOAD
        if ( ( HrtfFastConv->leftBRIRReal != NULL ) && ( HrtfFastConv->leftBRIRImag != NULL ) && ( HrtfFastConv->rightBRIRReal != NULL ) && ( HrtfFastConv->rightBRIRImag != NULL ) )
        {
            return IVAS_ERR_OK;
        }
        else
#else
        if ( ( HrtfFastConv->leftBRIRReal == NULL ) && ( HrtfFastConv->leftBRIRImag == NULL ) && ( HrtfFastConv->rightBRIRReal == NULL ) && ( HrtfFastConv->rightBRIRImag == NULL ) )
#endif
        {
            if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, BINAURAL_NTAPS_MAX, allocate_init_flag ) )
            {
+7 −3
Original line number Diff line number Diff line
@@ -51,7 +51,11 @@
#define SVD_MINIMUM_VALUE     1e-32f   /* minimum value                                                   */
#define CONVERGENCE_FACTOR    1.0e-04f /* factor for SVD convergence                                      */
#define SVD_MAX_NUM_ITERATION 75       /* maximum number of interations before exiting the SVD            */
#ifdef REVERT_ZERO_FLUSH_TRESH
#define SVD_ZERO_FLUSH_THRESHOLD 1.0e-20f
#else
#define SVD_ZERO_FLUSH_THRESHOLD 0.0f
#endif


/*-----------------------------------------------------------------------*
+8 −0
Original line number Diff line number Diff line
@@ -99,7 +99,11 @@ ivas_error ivas_core_enc(
    int16_t Voicing_flag[CPE_CHANNELS];
    float pitch_buf[CPE_CHANNELS][NB_SUBFR16k];
    int16_t unbits[CPE_CHANNELS];
#ifdef FIX_1111_TDM_LSP_BUFFER
    float tdm_lsfQ_PCh[M];
#else
    float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M];
#endif
    int16_t last_element_mode, tdm_Pitch_reuse_flag;
    int32_t element_brate, last_element_brate, input_Fs;
    int16_t diff_nBits;
@@ -270,7 +274,11 @@ ivas_error ivas_core_enc(

        if ( st->element_mode == IVAS_CPE_TD && n == 0 )
        {
#ifdef FIX_1111_TDM_LSP_BUFFER
            td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc );
#else
            td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc );
#endif
        }
    }