Commit b85322b6 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into fix_hrtf_processing_scripts_for_3rd_party_sofa_support

parents b3491de2 5427da14
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -176,8 +176,6 @@ typedef struct
#else
    IVAS_AUDIO_CONFIG intern_audio_config;
    int16_t room_reverb_flag;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
    IVAS_AUDIO_CONFIG hrtf_set_audio_cfg;
#endif

} IVAS_DEC_HRTF_BINARY_WRAPPER;
@@ -741,8 +739,6 @@ int main(
#else
        hHrtfBinary.room_reverb_flag = 0;
        hHrtfBinary.intern_audio_config = IVAS_AUDIO_CONFIG_INVALID;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
        hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID;
#endif
    }

@@ -2376,8 +2372,8 @@ static ivas_error decodeG192(
                /* Read main parameters from the bitstream to set-up the decoder */
                hHrtfBinary->binaural_renderer_old = hHrtfBinary->binaural_renderer;
                hHrtfBinary->binaural_renderer_sec_old = hHrtfBinary->binaural_renderer_sec;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->hrtf_set_audio_cfg, &hHrtfBinary->room_reverb_flag, &hHrtfBinary->intern_audio_config ) ) != IVAS_ERR_OK )
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->room_reverb_flag, &hHrtfBinary->intern_audio_config ) ) != IVAS_ERR_OK )
#endif
@@ -3291,8 +3287,8 @@ static ivas_error decodeVoIP(
                /* Read main parameters from the bitstream to set-up the decoder */
                hHrtf->binaural_renderer_old = hHrtf->binaural_renderer;
                hHrtf->binaural_renderer_sec_old = hHrtf->binaural_renderer_sec;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->hrtf_set_audio_cfg, &hHrtf->room_reverb_flag, &hHrtf->intern_audio_config ) ) != IVAS_ERR_OK )
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->room_reverb_flag, &hHrtf->intern_audio_config ) ) != IVAS_ERR_OK )
#endif
@@ -3725,6 +3721,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile(
    IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary,
    IVAS_DEC_HANDLE hIvasDec,
    const int32_t output_Fs )
#endif
{
    ivas_error error;
    IVAS_BIN_RENDERER_TYPE binaural_renderer, binaural_renderer_sec;
@@ -3812,7 +3809,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile(
            }

#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
            if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hHrtfBinary->hrtfReader, hHrtfBinary->hrtf_set_audio_cfg, output_Fs ) ) != IVAS_ERR_OK )
            if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hHrtfBinary->hrtfReader, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, output_Fs ) ) != IVAS_ERR_OK )
#else
            if ( ( error = create_SetOfHRTF_from_binary( *hHrtfBinary->hSetOfHRTF, hHrtfBinary->hrtfReader, output_Fs ) ) != IVAS_ERR_OK )
#endif
+3 −0
Original line number Diff line number Diff line
@@ -2523,6 +2523,9 @@ static CmdlnArgs defaultArgs(
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID;
    args.outConfig.outSetupCustom.num_spk = 0;
    args.outConfig.outSetupCustom.num_lfe = 0;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
    args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID;
#endif

    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
    {
+1 −5
Original line number Diff line number Diff line
@@ -173,11 +173,7 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT           /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */
#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING    /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */
#define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH               /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */
#define NONBE_FIX_1205_TD_STEREO_MOD_CT                 /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */
#define NONBE_1203_MDCT2DFT_SWITCHING                   /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */
#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION    /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */
#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */
#define NONBE_1229_FIX_ISM1_DPID                        /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */
#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO            /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */
+41 −12
Original line number Diff line number Diff line
@@ -909,11 +909,12 @@ ivas_error IVAS_DEC_ReadFormat(
    IVAS_DEC_HANDLE hIvasDec,                      /* i/o: IVAS decoder handle                      */
    IVAS_BIN_RENDERER_TYPE *binaural_renderer,     /* o  : binaural renderer type                   */
    IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec, /* o  : secondary binaural renderer type         */
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
    IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg, /* o  : HRTF set audio config.           */
#endif
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
    IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o  : HRTF set audio config.                   */
#else
    int16_t *room_reverb_flag,             /* o  : room reverb flag                         */
    IVAS_AUDIO_CONFIG *intern_audio_config /* o  : internal audio configuration             */
#endif
)
{
    ivas_error error;
@@ -922,7 +923,7 @@ ivas_error IVAS_DEC_ReadFormat(
    ISM_MODE ism_mode_old;
    MC_MODE mc_mode_old;
    int16_t nchan_transport_old;
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
    AUDIO_CONFIG intern_config_old, transport_config_old, output_config;
#else
    AUDIO_CONFIG intern_config_old, transport_config_old;
@@ -943,10 +944,11 @@ ivas_error IVAS_DEC_ReadFormat(
    transport_config_old = st_ivas->transport_config;
    renderer_type_old = st_ivas->renderer_type;

#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
    output_config = st_ivas->hDecoderConfig->output_config;

#endif

    if ( st_ivas->ivas_format == MONO_FORMAT )
    {
        return IVAS_ERR_OK;
@@ -1009,9 +1011,36 @@ ivas_error IVAS_DEC_ReadFormat(
            *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_TDREND;
        }

#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
        *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID;
        if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND )
        if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV )
        {
            if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT )
            {
                /* SHD HRIRs */
                *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_HOA3;

                if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
                {
                    /* BRIRs */
                    *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4;
                }
            }
            else if ( st_ivas->ivas_format == MC_FORMAT )
            {
                /* HRIRs */
                *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4;

                if ( ( st_ivas->hDecoderConfig->Opt_Headrotation ) &&
                     !( st_ivas->mc_mode == MC_MODE_PARAMUPMIX && output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) )
                {
                    /* SHD HRIRs for low complexity rotation */
                    *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_HOA3;
                }
            }
        }
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
        else if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND )
        {
            if ( st_ivas->ivas_format == ISM_FORMAT )
            {
@@ -1031,7 +1060,7 @@ ivas_error IVAS_DEC_ReadFormat(
            }
        }
#endif

#else
        *intern_audio_config = st_ivas->intern_config;
#endif

+3 −3
Original line number Diff line number Diff line
@@ -157,9 +157,9 @@ ivas_error IVAS_DEC_ReadFormat(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    IVAS_BIN_RENDERER_TYPE *binaural_renderer,  /* o  : binaural renderer type                                                  */
    IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec,/* o: secondary binaural renderer type                                        */
#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM
    IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg,      /* o  : HRTF set audio config.                                                  */
#endif
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
    IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg       /* o  : HRTF set audio config.                                                  */
#else
    int16_t *room_reverb_flag,                  /* o  : room reverb flag                                                        */
    IVAS_AUDIO_CONFIG *intern_audio_config      /* o  : internal audio configuration                                            */
#endif
Loading