Commit 41d85420 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into orange/fix_binaural_delay_precision

parents ff763a02 f41541c9
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1409,10 +1409,16 @@ typedef enum
#define SFX_SPAT_BIN_NUM_SUBSAMPLES             64
#define ITD_MEM_LEN                             (MAX_ITD + SFX_SPAT_BIN_SINC_M)
#define L_SUBFRAME5MS_48k                       (L_FRAME48k/4)
#ifdef FIX_337_TDREND_INTP
#define MAX_ANGULAR_STEP                        (1.0f)
#else
#define MAX_ANGULAR_STEP                        (15.0f)
#endif
#define MAX_ANGULAR_STEP_INV                    ( 1.0f / MAX_ANGULAR_STEP )
#define MAX_INTERPOLATION_STEPS                 12
#ifndef FIX_310_TD_REND_DELAY
#define BINAURAL_TD_LATENCY_S                   0.0f                        /* ITD fix removes TD renderer delay -- should be cleaned out */
#endif

/* ----- Enums - TD Renderer ----- */

+2 −0
Original line number Diff line number Diff line
@@ -151,8 +151,10 @@

#define FIX_197_CREND_INTERFACE 
#define FIX_301_PLC                                     /* FhG: issue 301 - fix bug of missing update of overlap buffer for DFT-stereo PLC*/
#define FIX_337_TDREND_INTP                             /* Issue 337: TD renderer interpolation threshold set too low */

#define FIX_BINAURAL_DELAY_PRECISION                    /* fix delay precision for binaural latency for crend*/
#define FIX_310_TD_REND_DELAY                           /* Adding HRTF delay being read from ROM/Binary file, fix rounding for delay compensation in renderer */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+12 −0
Original line number Diff line number Diff line
@@ -694,17 +694,29 @@ ivas_error ivas_binRenderer_open(
        {
            if ( hBinRenderer->ivas_format == MC_FORMAT )
            {
#ifdef HRTF_BINARY_FILE
                st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HRIR_latency_s * 1000000000.f );
#else
                st_ivas->binaural_latency_ns = (int32_t) ( FASTCONV_HRIR_latency_s * 1000000000.f );
#endif
            }
            else
            {
#ifdef HRTF_BINARY_FILE
                st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f );
#else
                st_ivas->binaural_latency_ns = (int32_t) ( FASTCONV_HOA3_latency_s * 1000000000.f );
#endif
            }
        }
        else
        {
            /* same value for MC or HOA both use MC BRIR*/
#ifdef HRTF_BINARY_FILE
            st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f );
#else
            st_ivas->binaural_latency_ns = (int32_t) ( FASTCONV_BRIR_latency_s * 1000000000.f );
#endif
        }
#else
        if ( hBinRenderer->ivas_format == MC_FORMAT )
+3 −0
Original line number Diff line number Diff line
@@ -211,6 +211,9 @@ void DefaultBSplineModel(

    HRTF_model_precalc( model );

#ifdef FIX_310_TD_REND_DELAY
    HrFiltSet_p->latency_s = orange53_rom_latency_s;
#endif
    HrFiltSet_p->SampleRate = output_Fs;
    HrFiltSet_p->FiltLength = HrFiltSet_p->ModelParams.K;
    BSplineModelEvalAlloc( &HrFiltSet_p->ModelParams, &HrFiltSet_p->ModelEval );
+8 −1
Original line number Diff line number Diff line
@@ -188,8 +188,11 @@ ivas_error ivas_td_binaural_open(
    }

    st_ivas->hBinRendererTd = hBinRendererTd;

#ifdef FIX_310_TD_REND_DELAY
    st_ivas->binaural_latency_ns = (int32_t) ( hBinRendererTd->HrFiltSet_p->latency_s * 1000000000.f );
#else
    st_ivas->binaural_latency_ns = (int32_t) ( BINAURAL_TD_LATENCY_S * 1000000000.f );
#endif

    return error;
}
@@ -630,7 +633,11 @@ ivas_error ivas_rend_TDObjRendOpen(

    pTDRend->hBinRendererTd = hBinRendererTd;

#ifdef FIX_310_TD_REND_DELAY
    pTDRend->binaural_latency_ns = (int32_t) ( hBinRendererTd->HrFiltSet_p->latency_s * 1000000000.f );
#else
    pTDRend->binaural_latency_ns = (int32_t) ( BINAURAL_TD_LATENCY_S * 1000000000.f );
#endif

    return IVAS_ERR_OK;
}
Loading