home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Sound / LAME / src / machine.h < prev    next >
C/C++ Source or Header  |  2000-07-27  |  4KB  |  147 lines

  1. /*
  2.  *    Machine dependent defines/includes for LAME.
  3.  *
  4.  *    Copyright (c) 1999 A.L. Faber
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22.  
  23. #ifndef MACHINE_H_INCLUDED
  24. #define MACHINE_H_INCLUDED
  25.  
  26. #include        <stdio.h>
  27. #include        <string.h>
  28. #if defined(__riscos__) && defined(FPA10)
  29. #include    "ymath.h"
  30. #else
  31. #include    <math.h>
  32. #endif
  33.  
  34. #include        <stdlib.h>
  35. #include        <ctype.h>
  36. #include        <signal.h>
  37. #include        <fcntl.h>
  38. #include        <errno.h>
  39.  
  40. #ifdef macintosh
  41. #include   <types.h>
  42. #include   <stat.h>
  43. #else
  44. #include  <sys/types.h>
  45. #include  <sys/stat.h>
  46. #endif
  47.  
  48.  
  49.  
  50. /* three different types of pow() functions:
  51.    1. table lookup
  52.    2. pow()
  53.    3. exp()   on some machines this is claimed to be faster than pow()
  54. */
  55.  
  56.  
  57. #define POW20(x)  pow20[x]
  58. /*
  59. #define POW20(x)  pow(2.0,((double)(x)-210)*.25)
  60. #define POW20(x)  exp( ((double)(x)-210)*(.25*LOG2) )
  61. */
  62.  
  63. #define IPOW20(x)  ipow20[x]
  64. /*
  65. #define IPOW20(x)  exp( -((double)(x)-210)*.1875*LOG2 )
  66. #define IPOW20(x)  pow(2.0,-((double)(x)-210)*.1875)
  67. */
  68.  
  69.  
  70.  
  71. #if ( defined(_MSC_VER) && !defined(INLINE))
  72. #    define INLINE _inline
  73. #elif defined(__SASC) || defined(__GNUC__)
  74. #    define INLINE __inline
  75. #else
  76. #    define INLINE
  77. #endif
  78.  
  79. #if ( defined(_MSC_VER))
  80. #    pragma warning( disable : 4244 )
  81. #    pragma warning( disable : 4305 )
  82. #endif
  83.  
  84. #if ( defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) )
  85. #    define WIN32_LEAN_AND_MEAN
  86. #    include <windows.h>
  87. #else
  88.     typedef float FLOAT;
  89. #endif
  90.  
  91.  
  92. /* MH: the x86 asm quantization routines in quantize-pvt.c
  93.    are designed to work only with 8-byte doubles or 4-byte
  94.    floats. if you use a different type (e.g. 10-byte extended
  95.    precision long doubles, as supported by ICL), you will need
  96.    to disable the ASM routines (or fix them :) */
  97.  
  98. /* NOTE: RH: 7/00:  if FLOAT8=float, it breaks resampling and VBR code */
  99. #ifdef FLOAT8_is_double
  100.     typedef double FLOAT8;
  101. #else
  102.     #if defined(FLOAT8_is_float)
  103.         typedef float FLOAT8;
  104.     #else
  105.         typedef double FLOAT8;
  106.         #define FLOAT8_is_double
  107.     #endif
  108. #endif
  109.  
  110.  
  111. #if defined _WIN32 && !defined __CYGWIN__
  112.     typedef unsigned long    u_long;
  113.     typedef unsigned int    u_int;
  114.     typedef unsigned short    u_short;
  115.     typedef unsigned char    u_char;
  116.     typedef short  int    int16_t;
  117. #elif defined __DECALPHA__
  118. /*       do nothing */
  119. #elif defined OS_AMIGAOS
  120. /*       do nothing */
  121. #elif defined __DJGPP__
  122.     typedef unsigned long    u_long;
  123.     typedef unsigned int    u_int;
  124.     typedef unsigned short    u_short;
  125.     typedef unsigned char    u_char;
  126. #elif !defined __GNUC__ || defined __STRICT_ANSI__
  127.     typedef unsigned long    u_long;
  128.     typedef unsigned int    u_int;
  129.     typedef unsigned short    u_short;
  130.     typedef unsigned char    u_char;
  131. #endif
  132.  
  133.  
  134.  
  135.  
  136. #if defined _WIN32 && !defined __CYGWIN__
  137. #define int64 __int64
  138. #elif defined __DECALPHA__
  139. /* do nothing */
  140. #elif defined OS_AMIGAOS
  141. /* do nothing */
  142. #else
  143. #define int64 long long
  144. #endif
  145.  
  146. #endif
  147.