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