
#ifndef MATHOPS_H
#define MATHOPS_H

#include "config.h"

#ifndef VC_PROJ
#include <xtensa/tie/xt_hifi2.h>
#include <xtensa/tie/xt_misc.h>
#endif

#ifdef CRC_ON_8BIT
unsigned char UpdateCRC8(unsigned char *pBuffer);
#endif





short speech_maxabs16(const short *x, int len);

#ifndef HW_PITCH_OFF2

#ifndef HW_FRAC_DIV32_AIROHA
int frac_div32(int a, int b, int fixed_point);
#else
short frac_div32(int a, int b);
#endif

int speech_maxabs32(const int *x, int len);
#endif
/** Integer log in base2. Undefined for zero and negative numbers */
#ifndef HW_CODESIZE
short speech_ilog2(int x);
#endif
/** Base-2 logarithm approximation (log2(x)). (Q14 input, Q10 output) */
short speech_log2(int x);


short speech_rsqrt_norm(int x);

int speech_sqrt(int x);

#ifndef AFTER_190327_OPTI
int speech_exp2_frac(short x);
#endif
/** Base-2 exponential approximation (2^x). (Q10 input, Q16 output) */

#ifndef HW_CODESIZE
int speech_rcp(int x);
#endif


#ifndef OPT_KHW
int speech_div(int a, int b);
#endif


short speech_cos_norm(short x);

#endif /* MATHOPS_H */
