Commit 044085bf authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'efap_init_data_fxd' into 'main'

efap_init_data converted to fixed.

See merge request !45
parents a0e1755a e66ee833
Loading
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -5400,7 +5400,13 @@ void v_sort_ind(
    int16_t *idx,                                               /* o  : Original index positions                                 */
    const int16_t len                                           /* i  : vector length                                            */
);

#ifdef IVAS_FLOAT_FIXED
void v_sort_ind_fixed(
    Word32 *x,         /* i/o: Vector to be sorted      */
    Word16 *idx,     /* o  : Original index positions */
    const Word16 len /* i  : vector length            */
);
#endif

/*----------------------------------------------------------------------------------*
 * LS Renderer prototypes
+40 −0
Original line number Diff line number Diff line
@@ -1304,6 +1304,7 @@ void panning_wrap_angles_fixed(
    }
}
#endif

/*-------------------------------------------------------------------------*
 * v_sort_ind()
 *
@@ -1342,6 +1343,45 @@ void v_sort_ind(
    return;
}

#ifdef IVAS_FLOAT_FIXED
/*-------------------------------------------------------------------------*
 * v_sort_ind_fixed()
 *
 * Sort a float array
 * (modified version of v_sort() to return an index array)
 *-------------------------------------------------------------------------*/

void v_sort_ind_fixed(
    Word32 *x,         /* i/o: Vector to be sorted      */
    Word16 *idx,     /* o  : Original index positions */
    const Word16 len /* i  : vector length            */
)
{
    Word16 i, j;
    Word32 tempr;
    Word16 tempi;

    FOR ( i = 0; i < len; i++ )
    {
        idx[i] = i;
    }

    FOR ( i = len - 2; i >= 0; i-- )
    {
        tempr = x[i];
        tempi = idx[i];
        FOR ( j = i + 1; ( j < len ) && ( tempr > x[j] ); j++ )
        {
            x[j - 1] = x[j];
            idx[j - 1] = idx[j];
        }
        x[j - 1] = tempr;
        idx[j - 1] = tempi;
    }

    return;
}
#endif

/*-------------------------------------------------------------------*
 * is_IVAS_bitrate()
+5 −0
Original line number Diff line number Diff line
@@ -402,6 +402,11 @@ void sort(
    uint16_t len /* i/o: vector length                                   */
);

void sort_l(
    Word32 *x, /* i/o: Vector to be sorted                             */
    Word16 len /* i/o: vector length                                   */
);

/*! r: variance of vector */
float var(
    const float *x,   /* i  : input vector                                    */
+11 −1
Original line number Diff line number Diff line
@@ -7931,6 +7931,16 @@ void delay_signal_fx(
    const Word16 delay /* i  : delay in samples                  */
);

Word32 anint_fixed(
    Word32 x, /* i: Round to the nearest integer               */
    Word16 exp /* i: Exponent for round step */
);

Word32 ceil_fixed(
    Word32 x,  /* i: number to ceil         */
    Word16 exp /* i: Exponent for ceil step */
);

void v_add_fx(
    const Word32 x1[], /* i  : Input vector 1                       */
    const Word32 x2[], /* i  : Input vector 2                       */
+49 −0
Original line number Diff line number Diff line
@@ -1433,6 +1433,26 @@ void sort(
    return;
}

void sort_l(
    Word32 *x, /* i/o: Vector to be sorted                             */
    Word16 len /* i/o: vector length                                   */
)
{
    Word16 i, j;
    Word32 tempr;

    FOR ( i = len - 2; i >= 0; i-- )
    {
        tempr = x[i];
        FOR ( j = i + 1; ( j < len ) && ( tempr > x[j] ); j++ )
        {
            x[j - 1] = x[j];
        }
        x[j - 1] = tempr;
    }

    return;
}

/*---------------------------------------------------------------------*
 * var()
@@ -1813,6 +1833,35 @@ double anint(
    return ( x ) >= 0 ? (int32_t) ( ( x ) + 0.5 ) : (int32_t) ( (x) -0.5 );
}

/*-------------------------------------------------------------------*
 * anint_fixed()
 *
 * Round to the nearest integer.
 *-------------------------------------------------------------------*/
Word32 anint_fixed( Word32 x, Word16 exp )
{
    IF ( x == 0 )
    {
        return 0;
    }
    return ( x ) >= 0 ? L_add( x, ( 1 << ( exp - 1 ) ) ) : L_sub( x, ( 1 << ( exp - 1 ) ) );
}

/*-------------------------------------------------------------------*
 * ceil_fixed()
 *
 * Ceil to the next multiple of (1 << exp).
 *-------------------------------------------------------------------*/
Word32 ceil_fixed(Word32 x, Word16 exp) {
    Word32 step;
    step = x / ( 1 << exp );
    IF ( x % ( 1 << exp ) > 0 )
    {
        step++;
    }
    return (step << exp);
}

/*-------------------------------------------------------------------*
 * is_numeric_float()
 *
Loading