Unverified Commit 8381e938 authored by norvell's avatar norvell
Browse files

Add definitions of max/min when stdlib.h is not present

parent 2ddbe177
Loading
Loading
Loading
Loading
Loading
+7 −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
+0 −2
Original line number Diff line number Diff line
@@ -74,8 +74,6 @@ ivas_error TDREND_REND_RenderSourceHRFilt_fx(
    Word16 left_filter_e;
    Word16 right_filter_e;

    dbgwrite( &Src_p->Gain_fx, sizeof( int ), 1, 1, "Gain_fx.int" );

    TDREND_Apply_ITD_fx( Src_p->InputFrame_p_fx, LeftOutputFrame_fx, RightOutputFrame_fx,
                         &Src_p->previtd, Src_p->itd, Src_p->mem_itd_fx, subframe_length );

+8 −0
Original line number Diff line number Diff line
@@ -84,6 +84,14 @@
#define DIST_ATT_MAX_MAXDIST 63.0f
#define DIST_ATT_MAX_REFDIST 6.3f
#define DIST_ATT_MAX_ROLLOFF 4.0f

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

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

#ifndef TRUE
+11 −0
Original line number Diff line number Diff line
@@ -41,6 +41,17 @@
#define Q29 29
#define Q31 31

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

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


struct RotFileReader
{
    FILE *trajFile;