Commit ca2bd30c authored by janssontoftg's avatar janssontoftg
Browse files

Fix for issue 59, under define FIX_I59.

- Correcting delay of LFE using binaural_latency_ns instead of latency_s for total latency of binaural renderer.
- Corrected delay compensation for TD renderer by removing IVAS_FB_DEC_DELAY_NS and do rounding in samples instead of in nanosecond.
parent abfc13af
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -54,8 +54,10 @@ float get_delay(
    const int16_t what_delay,         /* i  : what delay? (ENC or DEC)            */
    const int32_t io_fs,              /* i  : input/output sampling frequency     */
    const IVAS_FORMAT ivas_format,    /* i  : IVAS format                         */
#ifndef FIX_I59
    HANDLE_CLDFB_FILTER_BANK hCldfb,  /* i  : Handle of Cldfb analysis            */
    RENDERER_TYPE renderer_type,      /* i  : IVAS rendering type                 */
#endif
    const int32_t binaural_latency_ns /* i  : binaural renderer HRTF delay in ns  */
)
{
@@ -94,7 +96,12 @@ float get_delay(
        else /* IVAS */
        {
            delay = IVAS_DEC_DELAY_NS;

#ifdef FIX_I59
            /* compensate for binaural renderer delay */
            {
                delay += binaural_latency_ns;
            }
#else
            if ( hCldfb != NULL || renderer_type == RENDERER_BINAURAL_OBJECTS_TD )
            {
                delay += IVAS_FB_DEC_DELAY_NS;
@@ -104,6 +111,7 @@ float get_delay(
            {
                delay += binaural_latency_ns;
            }
#endif
        }
    }

+4 −0
Original line number Diff line number Diff line
@@ -4815,7 +4815,11 @@ void ivas_lfe_enc(
ivas_error ivas_create_lfe_dec( 
    LFE_DEC_HANDLE *hLFE_out,                                   /* o  : IVAS LFE decoder structure              */
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
#ifdef FIX_I59
    const int32_t binaural_latency_ns                           /* i  : additional LFE delay to sync with binaural renderer */
#else
    const float add_delay_s                                     /* i  : additional LFE delay to sync with binaural filter */
#endif
);

void ivas_lfe_dec_close( 
+1 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@


#define FIX_I87                                         /*  fix for issue 86: incorrect Ambisonics order set for head rotation in SBA */
#define FIX_I59                                          /* fix for issue 59: correcting delay of LFE and delay compensation */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+2 −0
Original line number Diff line number Diff line
@@ -716,8 +716,10 @@ float get_delay(
    const int16_t what_delay,         /* i  : what delay? (ENC or DEC)        */
    const int32_t io_fs,              /* i  : input/output sampling frequency */
    const IVAS_FORMAT ivas_format,    /* i  : IVAS format                     */
#ifndef FIX_I59
    HANDLE_CLDFB_FILTER_BANK hCldfb,  /* i  : Handle of Cldfb analysis        */
    RENDERER_TYPE renderer_type,      /* i  : IVAS rendering type                 */
#endif
    const int32_t binaural_latency_ns /* i  : binaural renderer HRTF delay in ns  */
);

+4 −0
Original line number Diff line number Diff line
@@ -496,6 +496,10 @@ ivas_error ivas_binRenderer_open(
            st_ivas->binaural_latency_ns = (int32_t) ( FASTCONV_HOA3_latency_s * 1000000000.f );
        }
    }
#ifdef FIX_I59
    /* Add CLDFB delay */
    st_ivas->binaural_latency_ns += IVAS_FB_DEC_DELAY_NS;
#endif

    /* Allocate memories needed for reverb module */
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
Loading