ReactOS 0.4.16-dev-91-g764881a
fmt123.h
Go to the documentation of this file.
1/*
2 libmpg123: MPEG Audio Decoder library
3
4 separate header just for audio format definitions not tied to
5 library code
6
7 copyright 1995-2020 by the mpg123 project
8 free software under the terms of the LGPL 2.1
9 see COPYING and AUTHORS files in distribution or http://mpg123.org
10*/
11
12#ifndef MPG123_ENC_H
13#define MPG123_ENC_H
14
44{
45/* 0000 0000 0000 1111 Some 8 bit integer encoding. */
46 MPG123_ENC_8 = 0x00f
47/* 0000 0000 0100 0000 Some 16 bit integer encoding. */
49/* 0100 0000 0000 0000 Some 24 bit integer encoding. */
50, MPG123_ENC_24 = 0x4000
51/* 0000 0001 0000 0000 Some 32 bit integer encoding. */
53/* 0000 0000 1000 0000 Some signed integer encoding. */
55/* 0000 1110 0000 0000 Some float encoding. */
57/* 0000 0000 1101 0000 signed 16 bit */
59/* 0000 0000 0110 0000 unsigned 16 bit */
61/* 0000 0000 0000 0001 unsigned 8 bit */
63/* 0000 0000 1000 0010 signed 8 bit */
65/* 0000 0000 0000 0100 ulaw 8 bit */
67/* 0000 0000 0000 1000 alaw 8 bit */
69/* 0001 0001 1000 0000 signed 32 bit */
71/* 0010 0001 0000 0000 unsigned 32 bit */
73/* 0101 0000 1000 0000 signed 24 bit */
75/* 0110 0000 0000 0000 unsigned 24 bit */
77/* 0000 0010 0000 0000 32bit float */
79/* 0000 0100 0000 0000 64bit float */
81/* Any possibly known encoding from the list above. */
88};
89
101#define MPG123_SAMPLESIZE(enc) ( \
102 (enc) < 1 \
103 ? 0 \
104 : ( (enc) & MPG123_ENC_8 \
105 ? 1 \
106 : ( (enc) & MPG123_ENC_16 \
107 ? 2 \
108 : ( (enc) & MPG123_ENC_24 \
109 ? 3 \
110 : ( ( (enc) & MPG123_ENC_32 \
111 || (enc) == MPG123_ENC_FLOAT_32 ) \
112 ? 4 \
113 : ( (enc) == MPG123_ENC_FLOAT_64 \
114 ? 8 \
115 : 0 \
116) ) ) ) ) )
117
130#define MPG123_ZEROSAMPLE(enc, siz, off) ( \
131 (enc) == MPG123_ENC_ULAW_8 \
132 ? (off == 0 ? 0xff : 0x00) \
133 : ( (enc) == MPG123_ENC_ALAW_8 \
134 ? (off == 0 ? 0xd5 : 0x00) \
135 : ( (((enc) & (MPG123_ENC_SIGNED|MPG123_ENC_FLOAT)) || (siz) != ((off)+1)) \
136 ? 0x00 \
137 : 0x80 \
138 ) ) )
139
148{
149 long rate;
154};
155
156/* @} */
157
158#endif
159
int channels
Definition: fmt123.h:150
int encoding
Definition: fmt123.h:153
long rate
Definition: fmt123.h:149
mpg123_enc_enum
Definition: fmt123.h:44
@ MPG123_ENC_UNSIGNED_32
Definition: fmt123.h:72
@ MPG123_ENC_SIGNED_16
Definition: fmt123.h:58
@ MPG123_ENC_ULAW_8
Definition: fmt123.h:66
@ MPG123_ENC_UNSIGNED_24
Definition: fmt123.h:76
@ MPG123_ENC_ANY
Definition: fmt123.h:82
@ MPG123_ENC_32
Definition: fmt123.h:52
@ MPG123_ENC_8
Definition: fmt123.h:46
@ MPG123_ENC_SIGNED_24
Definition: fmt123.h:74
@ MPG123_ENC_SIGNED
Definition: fmt123.h:54
@ MPG123_ENC_SIGNED_8
Definition: fmt123.h:64
@ MPG123_ENC_FLOAT_64
Definition: fmt123.h:80
@ MPG123_ENC_24
Definition: fmt123.h:50
@ MPG123_ENC_ALAW_8
Definition: fmt123.h:68
@ MPG123_ENC_16
Definition: fmt123.h:48
@ MPG123_ENC_SIGNED_32
Definition: fmt123.h:70
@ MPG123_ENC_UNSIGNED_16
Definition: fmt123.h:60
@ MPG123_ENC_FLOAT
Definition: fmt123.h:56
@ MPG123_ENC_UNSIGNED_8
Definition: fmt123.h:62
@ MPG123_ENC_FLOAT_32
Definition: fmt123.h:78