Commit 387619a8 authored by norvell's avatar norvell
Browse files

Merge branch 'basop-2023-td-renderer-distance-attenuation-precision-problem' into 'main'

[Non BE][Rend non BE][Split non BE][Allow regression]Basop 2023 TD renderer distAtt precision

See merge request !2959
parents 0470a382 d0565f81
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1649,7 +1649,11 @@ static void resetHeadRotation(
        pPos[i].x_fx = 0;
        pPos[i].y_fx = 0;
        pPos[i].z_fx = 0;
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        pPos[i].q_fact = 22;
#else
        pPos[i].q_fact = 25;
#endif
    }

    return;
+12 −0
Original line number Diff line number Diff line
@@ -63,6 +63,10 @@
#define IVAS_ER_LIST_HEIGHT              1.6f
#define IVAS_ER_LIST_HEIGHT_FX           6710886 /* 1.6f in Q.22 */
#define IVAS_DEFAULT_AEID                65535
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
#define IVAS_LISTENER_POSITION_MAX     327.67f
#define IVAS_LISTENER_POSITION_MAX_Q22 1374347592 /* 327.67 in Q22 */
#endif

/* JBM constants for adaptive-playout */
#define IVAS_TIME_SCALE_MIN 50  /* min. time-scaling [%] */
@@ -160,7 +164,11 @@ typedef struct
typedef struct
{
    float x, y, z;
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word32 x_fx, y_fx, z_fx; /* Q22, Q22, Q22 */
#else
    Word32 x_fx, y_fx, z_fx;
#endif
    Word16 q_fact;

} IVAS_VECTOR3;
@@ -351,7 +359,11 @@ typedef struct _IVAS_RENDER_CONFIG
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15}
    float distAtt[3];
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word32 distAtt_fx[3]; /* {Q25, Q28, Q28} */
#else
    Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */
#endif

} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Basop issue 2023: Distance attenuation scaling, adding clamping of distance att input and listener position */ 
#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS        /* Nokia: float issue 1569: fix render config checks in renderer */
#define FIX_BASOP_2526_SPAR_MASA_PARAM_MAP_Q_BUG        /* Nokia: BASOP issue 2526: Fix wrong Q variable in SPAR to MASA param mapping */
+4 −0
Original line number Diff line number Diff line
@@ -264,7 +264,11 @@ ivas_error ivas_td_binaural_renderer_sf_fx(
            enableCombinedOrientation = st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx];
            move16();

#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
            /* Shifting x_fx, y_fx, z_fx to the same Q-factor as Listener_p->Pos_q (usually Q22) */
#else
            /* Shifting x_fx, y_fx, z_fx to the same Q-factor as Listener_p->Pos_q (usually Q25) */
#endif
            Word16 pos_q = st_ivas->hBinRendererTd->Listener_p->Pos_q;
            move16();
            tmp_vector_fx->x_fx = L_shr( tmp_vector_fx->x_fx, sub( tmp_vector_fx->q_fact, pos_q ) );
+13 −0
Original line number Diff line number Diff line
@@ -44,6 +44,13 @@
#include <assert.h>
#include "wmc_auto.h"

#ifndef min
#define min( x, y ) ( ( x ) < ( y ) ? ( x ) : ( y ) )
#endif

#ifndef max
#define max( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
#endif

/*---------------------------------------------------------------------*
 * Local structs
@@ -2102,9 +2109,15 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
        return error;
    }

#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    hHeadTrackData->Pos[subframe_idx].x_fx = max( min( IVAS_LISTENER_POSITION_MAX_Q22, Pos.x_fx ), -IVAS_LISTENER_POSITION_MAX_Q22 );
    hHeadTrackData->Pos[subframe_idx].y_fx = max( min( IVAS_LISTENER_POSITION_MAX_Q22, Pos.y_fx ), -IVAS_LISTENER_POSITION_MAX_Q22 );
    hHeadTrackData->Pos[subframe_idx].z_fx = max( min( IVAS_LISTENER_POSITION_MAX_Q22, Pos.z_fx ), -IVAS_LISTENER_POSITION_MAX_Q22 );
#else
    hHeadTrackData->Pos[subframe_idx].x_fx = Pos.x_fx;
    hHeadTrackData->Pos[subframe_idx].y_fx = Pos.y_fx;
    hHeadTrackData->Pos[subframe_idx].z_fx = Pos.z_fx;
#endif
    hHeadTrackData->Pos[subframe_idx].q_fact = Pos.q_fact;
    move32();
    move32();
Loading