| 1 | /* $Id: dspfunc.h 1.4 2006/12/14 18:07:15 rzopf Exp $ */ |
|---|
| 2 | /***************************************************************************** |
|---|
| 3 | Copyright 2004 Broadcom Corp. All Rights Reserved. |
|---|
| 4 | |
|---|
| 5 | $Log: dspfunc.h $ |
|---|
| 6 | Revision 1.4 2006/12/14 18:07:15 rzopf |
|---|
| 7 | *** empty log message *** |
|---|
| 8 | |
|---|
| 9 | Revision 1.3 2006/02/28 21:35:23 rzopf |
|---|
| 10 | modified frame size related code to use a variable instead of a constant. |
|---|
| 11 | |
|---|
| 12 | Revision 1.2 2006/02/27 21:02:12 rzopf |
|---|
| 13 | Replaced short and long data types with Word16 and WOrd32. |
|---|
| 14 | |
|---|
| 15 | Revision 1.1 2006/02/24 18:30:47 rzopf |
|---|
| 16 | Initial Version. |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | ******************************************************************************/ |
|---|
| 20 | |
|---|
| 21 | #ifndef __AVL_DSPFUNC_H__ |
|---|
| 22 | #define __AVL_DSPFUNC_H__ |
|---|
| 23 | |
|---|
| 24 | #define EXTRACT_HI(x) (x>>16) |
|---|
| 25 | #define EXTRACT_LO(x) ((x-((x>>16)<<16))>>1) |
|---|
| 26 | #define MPY_32_16(x32, y16) (((EXTRACT_HI(x32)*((Word32)y16))+((EXTRACT_LO(x32)*((Word32)y16))>>15))<<1) |
|---|
| 27 | |
|---|
| 28 | typedef long Word32; |
|---|
| 29 | typedef long Word16; |
|---|
| 30 | |
|---|
| 31 | Word32 bvxx_Pow2( /* (o) Q0 : result (range: 0<=val<=0x7fffffff) */ |
|---|
| 32 | Word16 exponent, /* (i) Q0 : Integer part. (range: 0<=val<=30) */ |
|---|
| 33 | Word16 fraction /* (i) Q15 : Fractional part. (range: 0.0<=val<1.0) */ |
|---|
| 34 | ); |
|---|
| 35 | |
|---|
| 36 | void bvxx_Log2( |
|---|
| 37 | Word32 L_x, /* (i) Q0 : input value */ |
|---|
| 38 | Word16 *exponent, /* (o) Q0 : Integer part of Log2. (range: 0<=val<=30) */ |
|---|
| 39 | Word16 *fraction /* (o) Q15: Fractional part of Log2. (range: 0<=val<1) */ |
|---|
| 40 | ); |
|---|
| 41 | |
|---|
| 42 | void CalcPower(short *inbuf, Word32 *power, Word32 *shift, Word32 frsz); |
|---|
| 43 | Word16 Norm(Word32 in); |
|---|
| 44 | Word16 Norm16(Word16 in); |
|---|
| 45 | |
|---|
| 46 | Word16 div_s (Word16 var1, Word16 var2); |
|---|
| 47 | Word16 imod(Word16 a, Word16 b, Word16 *dividend); |
|---|
| 48 | |
|---|
| 49 | #endif /* __DSPFUNC_H__ */ |
|---|
| 50 | |
|---|