Unverified Commit a5955984 authored by norvell's avatar norvell
Browse files

Add FIX_BASOP_2023_TDREND_DISTATT_PRECISION for synching with range-checks implemented in BASOP

parent 2a32ccea
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
/* ################### Start DEBUGGING switches ########################### */

#ifndef RELEASE
/*#define DEBUGGING*/                           /* Activate debugging part of the code */
#define DEBUGGING                           /* Activate debugging part of the code */
#endif
/*#define WMOPS*/                               /* Activate complexity and memory counters */
/*#define WMOPS_PER_FRAME*/                     /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */
@@ -178,6 +178,7 @@
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_1563_FIX_STEREO_SW                          /* VA: float issue 1563: fix clicks in stereo switching */
#define FIX_1562_DTX_CRASH_DECODER                      /* VA: float issue 1562: fix crash in stereo decoding in DTX and bitrate switching */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Distance attenuation scaling */

/* ##################### End NON-BE switches ########################### */

+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ ivas_error TDREND_REND_RenderSourceHRFilt(
    float LeftOutputFrame[L_SPATIAL_SUBFR_48k];
    float RightOutputFrame[L_SPATIAL_SUBFR_48k];

    dbgwrite( &Src_p->Gain, sizeof( float ), 1, 1, "Gain.float" );

    TDREND_Apply_ITD( Src_p->InputFrame_p, LeftOutputFrame, RightOutputFrame, &Src_p->previtd, Src_p->itd, Src_p->mem_itd, subframe_length );
    TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength, Src_p->Gain, Src_p->prevGain );
    TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength, Src_p->Gain, Src_p->prevGain );
+15 −0
Original line number Diff line number Diff line
@@ -71,6 +71,12 @@
#define IVAS_ER_LIST_ORIGIN_X 0.0f
#define IVAS_ER_LIST_ORIGIN_Y 0.0f

#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
#define DIST_ATT_MAX_MAXDIST 63.0f
#define DIST_ATT_MAX_REFDIST 6.3f
#define DIST_ATT_MAX_ROLLOFF 4.0f
#endif

#ifndef TRUE
#define TRUE 1
#endif
@@ -1331,11 +1337,20 @@ ivas_error RenderConfigReader_checkValues(
            }
        }

#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        /* Verify range of distance attenuation parameters: refDist:       0.0 <= distAtt[1] <= 6.3         */
        /*                                                  maxDist:       distAtt[1] <= distAtt[0] <= 63.0 */
        /*                                                  rollOffFactor: 0 <= distAtt[2] <= 4.0           */
        hRenderConfig->distAtt[1] = min( max( 0, hRenderConfig->distAtt[1] ), DIST_ATT_MAX_REFDIST );
        hRenderConfig->distAtt[0] = min( max( hRenderConfig->distAtt[1], hRenderConfig->distAtt[0] ), DIST_ATT_MAX_MAXDIST );
        hRenderConfig->distAtt[2] = min( max( 0.0f, hRenderConfig->distAtt[2] ), DIST_ATT_MAX_ROLLOFF );
#else
        /* Verify range of distance attenuation parameters: 0.1 <= distAtt[0] <= distAtt[1] */
        /*                                                  0.0 <= distAtt[2] <= 10.0       */
        hRenderConfig->distAtt[0] = max( 0.1f, hRenderConfig->distAtt[0] );
        hRenderConfig->distAtt[1] = max( hRenderConfig->distAtt[0], hRenderConfig->distAtt[1] );
        hRenderConfig->distAtt[2] = max( 0.0f, min( 10.0f, hRenderConfig->distAtt[2] ) );
#endif

        /* Verify range of directivity patterns */
        for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ )