Commit 4afa239d authored by kinuthia's avatar kinuthia
Browse files

Merge branch '1196-td-renderer-discontinuities-for-headtracking' into 'main'

[Non BE] [split non be] address clicks in TD renderer with headtracking

See merge request !1848
parents a459d38d 92baba8d
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,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_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 */

+4 −0
Original line number Diff line number Diff line
@@ -235,7 +235,11 @@ ivas_error ivas_td_binaural_renderer_sf(
        /* Render subframe */
        /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx,
           where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
        if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK )
#else
        if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
+17 −2
Original line number Diff line number Diff line
@@ -384,7 +384,11 @@ ivas_error ivas_td_binaural_renderer_unwrap(
        }

        /* Render subframe */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
        if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK )
#else
        if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -425,8 +429,12 @@ ivas_error TDREND_GetMix(
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle                        */
    float *output[],                                   /* i/o: ISM object synth / rendered output in 0,1 */
    const int16_t subframe_length,                     /* i/o: subframe length                           */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
    const int16_t subframe_idx /* i  : Subframe index to 5 ms subframe           */
#else
    const int16_t subframe_idx,          /* i  : Subframe index to 5 ms subframe           */
    const int16_t ism_md_subframe_update /* i  : Number of subframes to delay ism metadata to sync with audio */
#endif
)
{
    int16_t i;
@@ -438,9 +446,11 @@ ivas_error TDREND_GetMix(
    float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH];
    float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH];
    int16_t intp_count;
#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
    int16_t subframe_update_flag;

    subframe_update_flag = subframe_idx == ism_md_subframe_update;
#endif

    error = IVAS_ERR_OK;

@@ -464,8 +474,13 @@ ivas_error TDREND_GetMix(
        /* Update rendering params if needed */
        if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) )
        {
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
            TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev,
                                                            Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p );
#else
            TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev,
                                                            Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag );
#endif
        }

        /* Render source if needed */
+10 −1
Original line number Diff line number Diff line
@@ -305,8 +305,13 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
    int16_t *filterlength,                             /* o  : Length of filters                */
    int16_t *itd,                                      /* o  : ITD value                        */
    float *Gain,                                       /* o  : Gain value                       */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
    TDREND_SRC_t *Src_p /* i/o: Source pointer                   */
)
#else
    TDREND_SRC_t *Src_p, /* i/o: Source pointer                   */
    const int16_t subframe_update_flag )
#endif
{
    TDREND_MIX_Listener_t *Listener_p;
    TDREND_HRFILT_FiltSet_t *HrFiltSet_p;
@@ -397,7 +402,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
        Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */
    }

#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
    if ( ( *intp_count > 0 ) )
#else
    if ( ( *intp_count > 0 ) && subframe_update_flag )
#endif
    {
        /* Set deltas for interpolation */
        v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength );
+8 −0
Original line number Diff line number Diff line
@@ -658,8 +658,12 @@ ivas_error TDREND_GetMix(
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd,          /* i/o: TD renderer handle                        */
    float *output[],                                            /* i/o: ISM object synth/rendered output in 0,1 */
    const int16_t subframe_length,                              /* i/o: subframe length                           */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
    const int16_t subframe_idx                                  /* i  : Subframe index to 5 ms subframe           */
#else
    const int16_t subframe_idx,                                 /* i  : Subframe index to 5 ms subframe           */
    const int16_t ism_md_subframe_update                        /* i  : Number of subframes to delay metadata to sync with audio */
#endif
);

ivas_error TDREND_Update_listener_orientation(
@@ -760,8 +764,12 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams(
    int16_t *filterlength,                                      /* o  : Length of filters                       */
    int16_t *itd,                                               /* o  : ITD value                               */
    float *Gain,                                                /* o  : Gain value                              */
#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION
    TDREND_SRC_t *Src_p                                         /* i/o: Source pointer                          */
#else
    TDREND_SRC_t *Src_p,
    const int16_t subframe_update_flag                          /* i  : Flag to determine update subframe idx   */
#endif
);

ivas_error TDREND_SRC_Alloc(