1 /*
2 	Audio File Library
3 	Copyright (C) 2000, Silicon Graphics, Inc.
4 
5 	This library is free software; you can redistribute it and/or
6 	modify it under the terms of the GNU Lesser General Public
7 	License as published by the Free Software Foundation; either
8 	version 2.1 of the License, or (at your option) any later version.
9 
10 	This library is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 	Lesser General Public License for more details.
14 
15 	You should have received a copy of the GNU Lesser General Public
16 	License along with this library; if not, write to the
17 	Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 	Boston, MA  02110-1301  USA
19 */
20 
21 /*
22 	pcm.h
23 
24 	This file defines various constants for PCM mapping.
25 */
26 
27 #ifndef PCM_H
28 #define PCM_H
29 
30 /*
31 	SLOPE_INTN = 2^(N-1)
32 */
33 #define SLOPE_INT8 (128.0)
34 #define SLOPE_INT16 (32768.0)
35 #define SLOPE_INT24 (8388608.0)
36 #define SLOPE_INT32 (2147483648.0)
37 
38 /*
39 	INTERCEPT_U_INTN = 2^(N-1)
40 */
41 #define INTERCEPT_U_INT8 (128.0)
42 #define INTERCEPT_U_INT16 (32768.0)
43 #define INTERCEPT_U_INT24 (8388608.0)
44 #define INTERCEPT_U_INT32 (2147483648.0)
45 
46 /*
47 	MIN_INTN = -(2^(N-1))
48 */
49 #define MIN_INT8 (-128.0)
50 #define MIN_INT16 (-32768.0)
51 #define MIN_INT24 (-8388608.0)
52 #define MIN_INT32 (-2147483648.0)
53 
54 /*
55 	MAX_INTN = 2^(N-1) - 1
56 */
57 #define MAX_INT8 127.0
58 #define MAX_INT16 32767.0
59 #define MAX_INT24 8388607.0
60 #define MAX_INT32 2147483647.0
61 
62 /*
63 	MAX_U_INTN = 2^N - 1
64 */
65 #define MAX_U_INT8 255.0
66 #define MAX_U_INT16 65535.0
67 #define MAX_U_INT24 16777215.0
68 #define MAX_U_INT32 4294967295.0
69 
70 extern const PCMInfo _af_default_signed_integer_pcm_mappings[];
71 extern const PCMInfo _af_default_unsigned_integer_pcm_mappings[];
72 extern const PCMInfo _af_default_float_pcm_mapping;
73 extern const PCMInfo _af_default_double_pcm_mapping;
74 
75 #endif
76