Unverified Commit 7745411e authored by norvell's avatar norvell
Browse files

Add missing forwarding of Listener position q_fact

parent 822aef79
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ typedef struct
{
    float x, y, z;
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word32 x_fx, y_fx, z_fx; /* Q22, Q22, Q22 */
    Word32 x_fx, y_fx, z_fx; /* qfact, qfact, qfact */
#else
    Word32 x_fx, y_fx, z_fx;
#endif
+5 −0
Original line number Diff line number Diff line
@@ -1937,7 +1937,12 @@ ivas_error TDREND_MIX_LIST_SetOrient_fx(

void TDREND_MIX_LIST_SetPos_fx(
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd,          /* i/o: TD renderer handle                          */
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    const Word32 *Pos_p,                                        /* i  : Listener's position                         */
    const Word16 Pos_q                                          /* i  : Listener's position Q value                 */
#else
    const Word32 *Pos_p                                         /* i  : Listener's position                         */
#endif
);

ivas_error TDREND_Update_listener_orientation_fx(
+20 −0
Original line number Diff line number Diff line
@@ -729,6 +729,9 @@ ivas_error TDREND_Update_listener_orientation_fx(
    Word32 Rmat_fx[3][3];
    Word16 orient_q, headPosition_q;
    Word32 Pos_p_fx[3];
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word16 Pos_q;
#endif
    ivas_error error;

    IF( headRotEnabled )
@@ -767,6 +770,9 @@ ivas_error TDREND_Update_listener_orientation_fx(
            Pos_p_fx[0] = ( *Pos_fx ).x_fx; // Q Pos_fx->q_fact
            Pos_p_fx[1] = ( *Pos_fx ).y_fx; // Q Pos_fx->q_fact
            Pos_p_fx[2] = ( *Pos_fx ).z_fx; // Q Pos_fx->q_fact
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
            Pos_q = ( *Pos_fx ).q_fact;
#endif
        }
        ELSE
        {
@@ -774,10 +780,16 @@ ivas_error TDREND_Update_listener_orientation_fx(
            Pos_p_fx[0] = 0;
            Pos_p_fx[1] = 0;
            Pos_p_fx[2] = 0;
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
            Pos_q = Q31;
#endif
        }
        move32();
        move32();
        move32();
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        move16();
#endif
    }
    ELSE
    {
@@ -806,10 +818,18 @@ ivas_error TDREND_Update_listener_orientation_fx(
        move32();
        Pos_p_fx[2] = 0;
        move32();
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        Pos_q = Q31;
        move16();
#endif
    }

    /* Set the listener position and orientation:*/
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    TDREND_MIX_LIST_SetPos_fx( hBinRendererTd, Pos_p_fx, Pos_q );
#else
    TDREND_MIX_LIST_SetPos_fx( hBinRendererTd, Pos_p_fx );
#endif

    error = TDREND_MIX_LIST_SetOrient_fx( hBinRendererTd, FrontVec_fx, UpVec_fx, orient_q );

+13 −0
Original line number Diff line number Diff line
@@ -55,7 +55,12 @@ static ivas_error DefaultBSplineModel_fx( TDREND_HRFILT_FiltSet_t *HrFiltSet_p,

void TDREND_MIX_LIST_SetPos_fx(
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd,     /* i/o: TD renderer handle      */
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    const Word32 *Pos_p,                                   /* i  : Listener's position     */ // Q Pos_fx->q_fact
    const Word16 Pos_q                                     /* i  : Listener's position Q value                 */
#else
    const Word32 *Pos_p /* i  : Listener's position     */ // Q Pos_fx->q_fact
#endif
)
{
    TDREND_MIX_Listener_t *Listener_p;
@@ -63,10 +68,18 @@ void TDREND_MIX_LIST_SetPos_fx(
    Listener_p = hBinRendererTd->Listener_p;
    test();
    test();
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    test();
    IF( NE_32( Pos_p[0], Listener_p->Pos_fx[0] ) || NE_32( Pos_p[1], Listener_p->Pos_fx[1] ) || NE_32( Pos_p[2], Listener_p->Pos_fx[2] ) || NE_16( Pos_q, Listener_p->Pos_q ) )
#else
    IF( NE_32( Pos_p[0], Listener_p->Pos_fx[0] ) || NE_32( Pos_p[1], Listener_p->Pos_fx[1] ) || NE_32( Pos_p[2], Listener_p->Pos_fx[2] ) )
#endif
    {
        /* Set position */
        Copy32( Pos_p, Listener_p->Pos_fx, 3 ); // Q Pos_fx->q_fact
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        Listener_p->Pos_q = Pos_q;
#endif

        /* Set pose update flag */
        Listener_p->PoseUpdated = TRUE;
+1 −2
Original line number Diff line number Diff line
@@ -340,8 +340,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx(

        /* Absolute position */
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        pos_q = s_min( SrcSpatial_p->q_Pos_p, Listener_p->Pos_q );
        move16();
        pos_q = min( SrcSpatial_p->q_Pos_p, Listener_p->Pos_q );
        Copy_Scale_sig32( SrcSpatial_p->Pos_p_fx, Src_p_aligned, 3, sub( pos_q, SrcSpatial_p->q_Pos_p ) );
        Copy_Scale_sig32( Listener_p->Pos_fx, Lis_p_aligned, 3, sub( pos_q, Listener_p->Pos_q ) );
        TDREND_SPATIAL_VecMapToNewCoordSystem_fx( Src_p_aligned, Lis_p_aligned, Listener_p->Front_fx, Listener_p->Up_fx, Listener_p->Right_fx, ListRelPos, ListRelPosAbs );