lpc10_encdecs.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #define LPC10_ORDER 10
00027
00028 #if !defined(min)
00029 #define min(a,b) ((a) <= (b) ? (a) : (b))
00030 #endif
00031 #if !defined(max)
00032 #define max(a,b) ((a) >= (b) ? (a) : (b))
00033 #endif
00034
00035 void lpc10_placea(int32_t *ipitch,
00036 int32_t voibuf[4][2],
00037 int32_t *obound,
00038 int32_t af,
00039 int32_t vwin[3][2],
00040 int32_t awin[3][2],
00041 int32_t ewin[3][2],
00042 int32_t lframe,
00043 int32_t maxwin);
00044
00045 void lpc10_placev(int32_t *osbuf,
00046 int32_t *osptr,
00047 int32_t oslen,
00048 int32_t *obound,
00049 int32_t vwin[3][2],
00050 int32_t af,
00051 int32_t lframe,
00052 int32_t minwin,
00053 int32_t maxwin,
00054 int32_t dvwinl,
00055 int32_t dvwinh);
00056
00057 void lpc10_voicing(lpc10_encode_state_t *st,
00058 int32_t *vwin,
00059 float *inbuf,
00060 float *lpbuf,
00061 const int32_t buflim[],
00062 int32_t half,
00063 float *minamd,
00064 float *maxamd,
00065 int32_t *mintau,
00066 float *ivrc,
00067 int32_t *obound);
00068
00069 void lpc10_analyse(lpc10_encode_state_t *st, float *speech, int32_t *voice, int32_t *pitch, float *rms, float rc[]);
00070
00071 static __inline__ int32_t pow_ii(int32_t x, int32_t n)
00072 {
00073 int32_t pow;
00074 uint32_t u;
00075
00076 if (n <= 0)
00077 {
00078 if (n == 0 || x == 1)
00079 return 1;
00080 if (x != -1)
00081 return (x == 0) ? 1/x : 0;
00082 n = -n;
00083 }
00084 u = n;
00085 for (pow = 1; ; )
00086 {
00087 if ((u & 1))
00088 pow *= x;
00089 if ((u >>= 1) == 0)
00090 break;
00091 x *= x;
00092 }
00093 return pow;
00094 }
00095
00096
00097 static __inline__ float r_sign(float a, float b)
00098 {
00099 float x;
00100
00101 x = fabsf(a);
00102 return (b >= 0.0f) ? x : -x;
00103 }
00104
00105