Unverified Commit 86f9ea10 authored by janssontoftg's avatar janssontoftg
Browse files

Fixing missing min() for linux builds and removed missing constant, remove unused function.

parent d782f717
Loading
Loading
Loading
Loading
Loading
+10 −20
Original line number Diff line number Diff line
@@ -34,6 +34,15 @@
#include "ivas_rtp_internal.h"
#ifdef ISM_PI_DATA
#include <stdlib.h>

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

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

#endif

#ifdef IVAS_RTPDUMP
@@ -267,25 +276,6 @@ static uint32_t getIndexTable( const float *table, uint32_t tableLength, float v

#define GET_IDX( table, nBits, value ) getIndexTable( table, ( 1u << ( nBits ) ), ( value ) )

static uint32_t getIndexTable_s( const int16_t *table, uint32_t tableLength, int16_t value )
{
    uint32_t idx = 0;
    if ( value <= table[0] )
    {
        return 0;
    }

    for ( idx = 1; idx < tableLength; idx++ )
    {
        if ( value < table[idx] )
        {
            break;
        }
    }
    return idx - 1;
}


static ivas_error packAcousticEnvironment( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten )
{
    uint32_t nBytes = 0;
@@ -1137,7 +1127,7 @@ static ivas_error unpackISMDirectivity( const uint8_t *buffer, uint32_t numDataB

        if ( idx == 0 )
        {
            ism_directivity->directivity[n].outerAttenuationdB = SHRT_MIN; /* corresponds to muting */
            ism_directivity->directivity[n].outerAttenuationdB = -32768.0f; /* corresponds to muting */
        }
        else
        {