Loading lib_com/ivas_prot.h +7 −1 Original line number Diff line number Diff line Loading @@ -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 Loading lib_com/ivas_tools.c +40 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,7 @@ void panning_wrap_angles_fixed( } } #endif /*-------------------------------------------------------------------------* * v_sort_ind() * Loading Loading @@ -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() Loading lib_com/prot.h +5 −0 Original line number Diff line number Diff line Loading @@ -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 */ Loading lib_com/prot_fx2.h +11 −1 Original line number Diff line number Diff line Loading @@ -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 */ Loading lib_com/tools.c +49 −0 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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 Loading
lib_com/ivas_prot.h +7 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
lib_com/ivas_tools.c +40 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,7 @@ void panning_wrap_angles_fixed( } } #endif /*-------------------------------------------------------------------------* * v_sort_ind() * Loading Loading @@ -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() Loading
lib_com/prot.h +5 −0 Original line number Diff line number Diff line Loading @@ -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 */ Loading
lib_com/prot_fx2.h +11 −1 Original line number Diff line number Diff line Loading @@ -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 */ Loading
lib_com/tools.c +49 −0 Original line number Diff line number Diff line Loading @@ -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() Loading Loading @@ -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