~ubuntu-branches/ubuntu/lucid/lastfm/lucid

« back to all changes in this revision

Viewing changes to src/transcode/mpglib/mpglib/machine.h

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2007-12-31 09:49:54 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071231094954-ix1amvcsj9pk61ya
Tags: 1:1.4.1.57486.dfsg-1ubuntu1
* Merge from Debian unstable (LP: #180254), remaining changes:
  - debian/rules;
    - Added dh_icons
  - Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 02110-1301, USA.
 
20
 */
 
21
 
 
22
#ifndef LAME_MACHINE_H
 
23
#define LAME_MACHINE_H
 
24
 
 
25
#include <stdio.h>
 
26
 
 
27
# include <stdlib.h>
 
28
# include <string.h>
 
29
 
 
30
#if  defined(__riscos__)  &&  defined(FPA10)
 
31
# include "ymath.h"
 
32
#else
 
33
# include <math.h>
 
34
#endif
 
35
 
 
36
#include <ctype.h>
 
37
 
 
38
#ifdef HAVE_ERRNO_H
 
39
# include <errno.h>
 
40
#endif
 
41
#ifdef HAVE_FCNTL_H
 
42
# include <fcntl.h>
 
43
#endif
 
44
 
 
45
#if defined(macintosh)
 
46
# include <types.h>
 
47
# include <stat.h>
 
48
#else
 
49
# include <sys/types.h>
 
50
# include <sys/stat.h>
 
51
#endif
 
52
 
 
53
/* 
 
54
 * 3 different types of pow() functions:
 
55
 *   - table lookup
 
56
 *   - pow()
 
57
 *   - exp()   on some machines this is claimed to be faster than pow()
 
58
 */
 
59
 
 
60
#define POW20(x) (assert(-Q_MAX2 <= x && x < Q_MAX), pow20[x+Q_MAX2])
 
61
/*#define POW20(x)  pow(2.0,((double)(x)-210)*.25) */
 
62
/*#define POW20(x)  exp( ((double)(x)-210)*(.25*LOG2) ) */
 
63
 
 
64
#define IPOW20(x)  (assert(0 <= x && x < Q_MAX), ipow20[x])
 
65
/*#define IPOW20(x)  exp( -((double)(x)-210)*.1875*LOG2 ) */
 
66
/*#define IPOW20(x)  pow(2.0,-((double)(x)-210)*.1875) */
 
67
 
 
68
#define IIPOW20(x) (assert(0 <= x && x < Q_MAX2), iipow20[x])
 
69
 
 
70
/* in case this is used without configure */
 
71
#ifndef inline
 
72
# define inline
 
73
#endif
 
74
 
 
75
#if defined(_MSC_VER)
 
76
# undef inline
 
77
# define inline _inline
 
78
#elif defined(__SASC) || defined(__GNUC__) || defined(__ICC) || defined(__ECC)
 
79
/* if __GNUC__ we always want to inline, not only if the user requests it */
 
80
# undef inline
 
81
# define inline __inline
 
82
#endif
 
83
 
 
84
#if    defined(_MSC_VER)
 
85
# pragma warning( disable : 4244 )
 
86
/*# pragma warning( disable : 4305 ) */
 
87
#endif
 
88
 
 
89
/*
 
90
 * FLOAT    for variables which require at least 32 bits
 
91
 * FLOAT8   for variables which require at least 64 bits
 
92
 *
 
93
 * On some machines, 64 bit will be faster than 32 bit.  Also, some math
 
94
 * routines require 64 bit float, so setting FLOAT=float will result in a
 
95
 * lot of conversions.
 
96
 */
 
97
 
 
98
typedef float   FLOAT;
 
99
 
 
100
#ifndef FLOAT8  /* NOTE: RH: 7/00:  if FLOAT8=float, it breaks resampling and VBR code */
 
101
typedef double  FLOAT8;
 
102
# ifdef DBL_MAX
 
103
#  define FLOAT8_MAX DBL_MAX
 
104
# else
 
105
#  define FLOAT8_MAX 1e99 /* approx */
 
106
# endif
 
107
#else
 
108
# ifdef FLT_MAX
 
109
#  define FLOAT8_MAX FLT_MAX
 
110
# else
 
111
#  define FLOAT8_MAX 1e37 /* approx */
 
112
# endif
 
113
#endif
 
114
 
 
115
/* sample_t must be floating point, at least 32 bits */
 
116
typedef FLOAT     sample_t;
 
117
typedef sample_t  stereo_t [2];
 
118
 
 
119
#endif
 
120
 
 
121
/* end of machine.h */
 
122