summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorCristian Adam <cristianadam@xiph.org>2010-06-01 19:23:05 +0000
committerCristian Adam <cristianadam@xiph.org>2010-06-01 19:23:05 +0000
commit05f93f9b459f4e9fa67e226c76a62c8a41516ea7 (patch)
tree5d6be997c4db3df10858b97853c943a8ae68c459 /misc.h
parent8a52980a3c7d0cfa4a48c115e30df5b7add12d33 (diff)
downloadtremor-05f93f9b459f4e9fa67e226c76a62c8a41516ea7.tar.gz
Visual Studio 2005 project files and compile fixes.
git-svn-id: https://svn.xiph.org/branches/lowmem-branch/Tremolo@17263 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/misc.h b/misc.h
index d0a522a..e0dfeef 100644
--- a/misc.h
+++ b/misc.h
@@ -18,7 +18,7 @@
#ifndef _V_RANDOM_H_
#define _V_RANDOM_H_
#include "ivorbiscodec.h"
-#include "os_types.h"
+#include "os.h"
/*#define _VDBG_GRAPHFILE "_0.m"*/
@@ -46,7 +46,9 @@ extern void _VDBG_free(void *ptr,char *file,long line);
#ifndef _LOW_ACCURACY_
/* 64 bit multiply */
+#if !(defined WIN32 && defined WINCE)
#include <sys/types.h>
+#endif
#if BYTE_ORDER==LITTLE_ENDIAN
union magic {
@@ -68,17 +70,17 @@ union magic {
};
#endif
-static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
+STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
union magic magic;
magic.whole = (ogg_int64_t)x * y;
return magic.halves.hi;
}
-static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
+STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
return MULT32(x,y)<<1;
}
-static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
+STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
union magic magic;
magic.whole = (ogg_int64_t)x * y;
return ((ogg_uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17);
@@ -100,15 +102,15 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
* tables in this case.
*/
-static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
+STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
return (x >> 9) * y; /* y preshifted >>23 */
}
-static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
+STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
return (x >> 8) * y; /* y preshifted >>23 */
}
-static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
+STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
return (x >> 6) * y; /* y preshifted >>9 */
}
@@ -145,7 +147,7 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
#else
-static inline void XPROD32(ogg_int32_t a, ogg_int32_t b,
+STIN void XPROD32(ogg_int32_t a, ogg_int32_t b,
ogg_int32_t t, ogg_int32_t v,
ogg_int32_t *x, ogg_int32_t *y)
{
@@ -153,7 +155,7 @@ static inline void XPROD32(ogg_int32_t a, ogg_int32_t b,
*y = MULT32(b, t) - MULT32(a, v);
}
-static inline void XPROD31(ogg_int32_t a, ogg_int32_t b,
+STIN void XPROD31(ogg_int32_t a, ogg_int32_t b,
ogg_int32_t t, ogg_int32_t v,
ogg_int32_t *x, ogg_int32_t *y)
{
@@ -161,7 +163,7 @@ static inline void XPROD31(ogg_int32_t a, ogg_int32_t b,
*y = MULT31(b, t) - MULT31(a, v);
}
-static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b,
+STIN void XNPROD31(ogg_int32_t a, ogg_int32_t b,
ogg_int32_t t, ogg_int32_t v,
ogg_int32_t *x, ogg_int32_t *y)
{
@@ -176,7 +178,7 @@ static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b,
#ifndef _V_CLIP_MATH
#define _V_CLIP_MATH
-static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+STIN ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
int ret=x;
ret-= ((x<=32767)-1)&(x-32767);
ret-= ((x>=-32768)-1)&(x+32768);