Commit d2300d4f authored by vaclav's avatar vaclav
Browse files

accept FIX_520_REMOVE_MEMMOVE_JBM

parent 13b3e54c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@
/*#define SPLIT_REND_WITH_HEAD_ROT  */                  /* Dlb,FhG: Split Rendering contributions 21 and 35 */

#define FIX_820_DOUBLE_PREC_MACROS                      /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */
#define FIX_520_REMOVE_MEMMOVE_JBM                      /* VA: issue 520: Remove memmove() from JBM code */
#define FIX_853_ARRAY_SIZE_MISMATCH                     /* Nokia: Issue #853: Mismatch of declaration and definition of computeIntensityVector_ana and computeReferencePower_ana */
#define FIX_814_DOUBLE_PREC_IN_REVERB                   /* Philips: Issue 814: Replace double precision arithmetic in reverb */
#define FIX_866_MOVE_VBAP                               /* Nokia: Issue 866: Move VBAP to lib_rend */
+1 −12
Original line number Diff line number Diff line
@@ -437,10 +437,7 @@ static void JB4_CIRCULARBUFFER_calcPercentile(
    const uint16_t capacity,
    JB4_CIRCULARBUFFER_ELEMENT newElement )
{
    uint16_t i;
#ifdef FIX_520_REMOVE_MEMMOVE_JBM
    uint16_t j;
#endif
    uint16_t i, j;

    /* insert newElement if elements buffer is not yet full */
    if ( *size < capacity )
@@ -450,14 +447,10 @@ static void JB4_CIRCULARBUFFER_calcPercentile(
            if ( newElement <= elements[i] )
            {
                /* insert newElement at index i */
#ifdef FIX_520_REMOVE_MEMMOVE_JBM
                for ( j = *size; j > i; --j )
                {
                    elements[j] = elements[j - 1];
                }
#else
                memmove( elements + i + 1, elements + i, ( *size - i ) * sizeof( JB4_CIRCULARBUFFER_ELEMENT ) ); /* IVAS_fmToDo: avoid use of memmove() */
#endif
                elements[i] = newElement;
                ++*size;
                return;
@@ -481,14 +474,10 @@ static void JB4_CIRCULARBUFFER_calcPercentile(
        if ( newElement >= elements[i] )
        {
            /* insert newElement at index i */
#ifdef FIX_520_REMOVE_MEMMOVE_JBM
            for ( j = 0; j < i; j++ )
            {
                elements[j] = elements[1 + j];
            }
#else
            memmove( elements, elements + 1, i * sizeof( JB4_CIRCULARBUFFER_ELEMENT ) );
#endif
            elements[i] = newElement;
            return;
        }
+4 −12
Original line number Diff line number Diff line
@@ -145,15 +145,13 @@ int16_t JB4_INPUTBUFFER_Enque(
    JB4_INPUTBUFFER_ELEMENT element,
    JB4_INPUTBUFFER_ELEMENT *replacedElement )
{
    uint16_t size;
    uint16_t j, size;
    int16_t low, high, middle, diff;
    uint16_t insertPos;
    uint16_t canMoveRight;
    uint16_t canMoveLeft;
    bool replace;
#ifdef FIX_520_REMOVE_MEMMOVE_JBM
    uint16_t j;
#endif

    *replacedElement = NULL;

    size = JB4_INPUTBUFFER_Size( h );
@@ -239,14 +237,11 @@ int16_t JB4_INPUTBUFFER_Enque(
    if ( canMoveRight )
    {
        /* move higher elements to the right and insert at insertPos */
#ifdef FIX_520_REMOVE_MEMMOVE_JBM
        for ( j = h->writePos; j > insertPos; --j )
        {
            h->data[j] = h->data[j - 1];
        }
#else
        memmove( h->data + insertPos + 1, h->data + insertPos, ( h->writePos - insertPos ) * sizeof( JB4_INPUTBUFFER_ELEMENT ) ); /* IVAS_fmToDo: avoid use of memmove() */
#endif

        h->data[insertPos] = element;
        ++h->writePos;
        if ( h->writePos == h->capacity )
@@ -257,14 +252,11 @@ int16_t JB4_INPUTBUFFER_Enque(
    else
    {
        /* move lower elements to the left and insert before insertPos */
#ifdef FIX_520_REMOVE_MEMMOVE_JBM
        for ( j = 0; j < low; j++ )
        {
            h->data[h->readPos - 1 + j] = h->data[h->readPos + j];
        }
#else
        memmove( h->data + h->readPos - 1, h->data + h->readPos, low * sizeof( JB4_INPUTBUFFER_ELEMENT ) );                       /* IVAS_fmToDo: avoid use of memmove() */
#endif

        h->data[insertPos - 1] = element;
        --h->readPos;
        assert( (int16_t) h->readPos >= 0 );