ReactOS 0.4.15-dev-8241-g63935f8
decode.h
Go to the documentation of this file.
1/*
2 decode.h: common definitions for decode functions
3
4 This file is strongly tied with optimize.h concerning the synth functions.
5 Perhaps one should restructure that a bit.
6
7 copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
8 see COPYING and AUTHORS files in distribution or http://mpg123.org
9 initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
10*/
11#ifndef MPG123_DECODE_H
12#define MPG123_DECODE_H
13
14/* Selection of class of output routines for basic format. */
15#ifndef REAL_IS_FIXED
16#define OUT_FORMATS 4 /* Basic output formats: 16bit, 8bit, real and s32 */
17#else
18#define OUT_FORMATS 2 /* Only up to 16bit */
19#endif
20
21#define OUT_16 0
22#define OUT_8 1
23/* Those are defined but not supported for fixed point decoding! */
24#define OUT_REAL 2 /* Write a floating point sample (that is, one matching the internal real type). */
25#define OUT_S32 3
26
27#ifdef NO_NTOM
28#define NTOM_MAX 1
29#else
30#define NTOM_MAX 8 /* maximum allowed factor for upsampling */
31#define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */
32#define NTOM_MUL (32768)
34#endif
35
36/* Let's collect all possible synth functions here, for an overview.
37 If they are actually defined and used depends on preprocessor machinery.
38 See synth.c and optimize.h for that, also some special C and assembler files. */
39
40#ifndef NO_16BIT
41/* The signed-16bit-producing variants. */
42int synth_1to1 (real*, int, mpg123_handle*, int);
52int synth_1to1_altivec (real*, int, mpg123_handle*, int);
63/* This is different, special usage in layer3.c only.
64 Hence, the name... and now forget about it.
65 Never use it outside that special portion of code inside layer3.c! */
66int absynth_1to1_i486(real*, int, mpg123_handle*, int);
67/* These mono/stereo converters use one of the above for the grunt work. */
70
71/* Sample rate decimation comes in less flavours. */
72#ifndef NO_DOWNSAMPLE
73int synth_2to1 (real*, int, mpg123_handle*, int);
78int synth_4to1 (real *,int, mpg123_handle*, int);
83#endif
84#ifndef NO_NTOM
85/* NtoM is really just one implementation. */
86int synth_ntom (real *,int, mpg123_handle*, int);
89#endif
90#endif
91
92#ifndef NO_8BIT
93/* The 8bit-producing variants. */
94/* There are direct 8-bit synths and wrappers over a possibly optimized 16bit one. */
97#ifndef NO_16BIT
100#endif
102#ifndef NO_16BIT
105#endif
106#ifndef NO_DOWNSAMPLE
115#endif
116#ifndef NO_NTOM
120#endif
121#endif
122
123#ifndef REAL_IS_FIXED
124
125#ifndef NO_REAL
126/* The real-producing variants. */
143#ifndef NO_DOWNSAMPLE
152#endif
153#ifndef NO_NTOM
157#endif
158#endif
159
160#ifndef NO_32BIT
161/* 32bit integer */
170int synth_1to1_s32_altivec (real*, int, mpg123_handle*, int);
178#ifndef NO_DOWNSAMPLE
187#endif
188#ifndef NO_NTOM
192#endif
193#endif
194
195#endif /* FIXED */
196
197
198/* Inside these synth functions, some dct64 variants may be used.
199 The special optimized ones that only appear in assembler code are not mentioned here.
200 And, generally, these functions are only employed in a matching synth function. */
201void dct64 (real *,real *,real *);
202void dct64_i386 (real *,real *,real *);
203void dct64_altivec(real *,real *,real *);
204void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/
205
206/* This is used by the layer 3 decoder, one generic function and 3DNow variants. */
207void dct36 (real *,real *,real *,real *,real *);
211void dct36_sse (real *,real *,real *,real *,real *);
212void dct36_avx (real *,real *,real *,real *,real *);
213void dct36_neon (real *,real *,real *,real *,real *);
215
216/* Tools for NtoM resampling synth, defined in ntom.c . */
217int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */
218unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */
219/* Frame and sample offsets. */
220#ifndef NO_NTOM
221/*
222 Outsamples of _this_ frame.
223 To be exact: The samples to be expected from the next frame decode (using the current ntom_val). When you already decoded _this_ frame, this is the number of samples to be expected from the next one.
224*/
226/* Total out/insample offset. */
230#endif
231
232/* Initialization of any static data that majy be needed at runtime.
233 Make sure you call these once before it is too late. */
234#ifndef NO_LAYER3
235void init_layer3(void);
237void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i));
238#endif
239#ifndef NO_LAYER12
240void init_layer12(void);
242void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m));
243#endif
244
245void prepare_decode_tables(void);
246
247extern real *pnts[5]; /* tabinit provides, dct64 needs */
248
249/* Runtime (re)init functions; needed more often. */
250void make_decode_tables(mpg123_handle *fr); /* For every volume change. */
251/* Stuff needed after updating synth setup (see set_synth_functions()). */
252
253#ifdef OPT_MMXORSSE
254/* Special treatment for mmx-like decoders, these functions go into the slots below. */
256#ifndef NO_LAYER3
258#endif
259#ifndef NO_LAYER12
261#endif
262#endif
263
264#ifndef NO_8BIT
265/* Needed when switching to 8bit output. */
267#endif
268
269/* These are the actual workers.
270 They operate on the parsed frame data and handle decompression to audio samples.
271 The synth functions defined above are called from inside the layer handlers. */
272
273#ifndef NO_LAYER3
274int do_layer3(mpg123_handle *fr);
275#endif
276#ifndef NO_LAYER2
277int do_layer2(mpg123_handle *fr);
278#endif
279#ifndef NO_LAYER1
280int do_layer1(mpg123_handle *fr);
281#endif
282/* There's an 3DNow counterpart in asm. */
283void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]);
284
285#endif
void init_layer3(void)
Definition: layer3.c:183
void prepare_decode_tables(void)
Definition: tabinit.c:76
void init_layer12(void)
Definition: layer2.c:39
real * pnts[5]
Definition: tabinit.c:45
__kernel_off_t off_t
Definition: linux.h:201
GLuint GLuint num
Definition: glext.h:9618
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define synth_1to1_8bit_mono
Definition: intsym.h:73
#define synth_2to1_real_mono
Definition: intsym.h:106
#define synth_1to1_real_sse
Definition: intsym.h:90
#define synth_1to1_s32_stereo_x86_64
Definition: intsym.h:120
#define synth_2to1_real_i386
Definition: intsym.h:105
#define synth_1to1_8bit_m2s
Definition: intsym.h:74
#define synth_1to1_s32_avx
Definition: intsym.h:121
#define synth_1to1_8bit_wrap_mono
Definition: intsym.h:75
#define dct36_3dnowext
Definition: intsym.h:148
#define init_layer3_stuff
Definition: intsym.h:162
#define synth_2to1_8bit
Definition: intsym.h:77
#define synth_1to1_s32_i386
Definition: intsym.h:116
#define synth_4to1_real_mono
Definition: intsym.h:110
#define init_layer3_gainpow2_mmx
Definition: intsym.h:169
#define synth_2to1_m2s
Definition: intsym.h:61
#define synth_1to1_x86_64
Definition: intsym.h:45
#define synth_1to1_8bit
Definition: intsym.h:70
#define dct64_i386
Definition: intsym.h:143
#define synth_2to1
Definition: intsym.h:57
#define synth_ntom_s32_m2s
Definition: intsym.h:141
#define absynth_1to1_i486
Definition: intsym.h:54
#define ntom_set_ntom
Definition: intsym.h:32
#define synth_1to1_s32_x86_64
Definition: intsym.h:119
#define synth_4to1_8bit_m2s
Definition: intsym.h:84
#define dct64_i486
Definition: intsym.h:145
#define synth_4to1_real_m2s
Definition: intsym.h:111
#define synth_1to1_real_stereo_x86_64
Definition: intsym.h:93
#define synth_4to1_s32_m2s
Definition: intsym.h:138
#define dct64_altivec
Definition: intsym.h:144
#define synth_ntom_m2s
Definition: intsym.h:69
#define synth_1to1_real_i386
Definition: intsym.h:89
#define synth_1to1_stereo_neon64
Definition: intsym.h:53
#define synth_ntom
Definition: intsym.h:67
#define init_layer12_table
Definition: intsym.h:164
#define synth_1to1_stereo_x86_64
Definition: intsym.h:46
#define synth_1to1_stereo_altivec
Definition: intsym.h:44
#define synth_1to1_real_altivec
Definition: intsym.h:96
#define synth_1to1_mono
Definition: intsym.h:55
#define synth_1to1_stereo_sse
Definition: intsym.h:41
#define synth_2to1_real_m2s
Definition: intsym.h:107
#define synth_2to1_i386
Definition: intsym.h:59
#define synth_ntom_real
Definition: intsym.h:112
#define make_conv16to8_table
Definition: intsym.h:171
#define synth_1to1_i586_dither
Definition: intsym.h:37
#define synth_1to1_i586
Definition: intsym.h:36
#define synth_1to1_mmx
Definition: intsym.h:38
#define synth_4to1_8bit_mono
Definition: intsym.h:83
#define ntom_ins2outs
Definition: intsym.h:158
#define synth_1to1_m2s
Definition: intsym.h:56
#define synth_1to1_real_stereo_sse
Definition: intsym.h:91
#define synth_1to1_s32_stereo_neon
Definition: intsym.h:126
#define dct36_3dnow
Definition: intsym.h:147
#define dct36
Definition: intsym.h:146
#define synth_1to1_sse
Definition: intsym.h:40
#define dct36_avx
Definition: intsym.h:151
#define synth_2to1_s32_i386
Definition: intsym.h:132
#define synth_4to1_mono
Definition: intsym.h:65
#define synth_1to1_s32_sse
Definition: intsym.h:117
#define dct64
Definition: intsym.h:142
#define synth_1to1_avx
Definition: intsym.h:47
#define do_layer2
Definition: intsym.h:173
#define dct36_sse
Definition: intsym.h:150
#define dct36_x86_64
Definition: intsym.h:149
#define ntom_frame_outsamples
Definition: intsym.h:156
#define synth_2to1_s32_m2s
Definition: intsym.h:134
#define do_layer3
Definition: intsym.h:172
#define do_equalizer
Definition: intsym.h:175
#define synth_1to1_fltst_avx
Definition: intsym.h:95
#define synth_1to1_real_mono
Definition: intsym.h:102
#define synth_1to1_s32_stereo_avx
Definition: intsym.h:122
#define synth_1to1_s32_mono
Definition: intsym.h:129
#define synth_1to1_8bit_wrap_m2s
Definition: intsym.h:76
#define ntom_frameoff
Definition: intsym.h:159
#define synth_ntom_mono
Definition: intsym.h:68
#define synth_1to1_real_avx
Definition: intsym.h:94
#define synth_1to1_dither
Definition: intsym.h:34
#define synth_4to1_real_i386
Definition: intsym.h:109
#define synth_1to1_s32_stereo_sse
Definition: intsym.h:118
#define synth_ntom_8bit
Definition: intsym.h:85
#define synth_1to1_s32_m2s
Definition: intsym.h:130
#define synth_1to1_real_neon64
Definition: intsym.h:100
#define synth_ntom_s32_mono
Definition: intsym.h:140
#define synth_ntom_s32
Definition: intsym.h:139
#define synth_1to1_real_x86_64
Definition: intsym.h:92
#define synth_2to1_s32_mono
Definition: intsym.h:133
#define synth_4to1_s32_i386
Definition: intsym.h:136
#define ntom_val
Definition: intsym.h:155
#define make_decode_tables
Definition: intsym.h:167
#define synth_1to1_fltst_neon64
Definition: intsym.h:101
#define synth_1to1_i386
Definition: intsym.h:35
#define synth_4to1_8bit
Definition: intsym.h:81
#define synth_1to1_8bit_i386
Definition: intsym.h:71
#define synth_ntom_8bit_m2s
Definition: intsym.h:87
#define init_layer3_gainpow2
Definition: intsym.h:161
#define synth_1to1_s32_neon64
Definition: intsym.h:127
#define init_layer12_table_mmx
Definition: intsym.h:170
#define dct36_neon64
Definition: intsym.h:153
#define synth_1to1_real_m2s
Definition: intsym.h:103
#define synth_1to1_fltst_altivec
Definition: intsym.h:97
#define synth_2to1_8bit_mono
Definition: intsym.h:79
#define synth_1to1_arm
Definition: intsym.h:49
#define synth_1to1_s32st_neon64
Definition: intsym.h:128
#define synth_4to1_s32
Definition: intsym.h:135
#define synth_1to1_real
Definition: intsym.h:88
#define synth_2to1_dither
Definition: intsym.h:58
#define synth_2to1_real
Definition: intsym.h:104
#define synth_1to1_real_stereo_neon
Definition: intsym.h:99
#define synth_4to1_real
Definition: intsym.h:108
#define synth_1to1_altivec
Definition: intsym.h:43
#define synth_4to1_dither
Definition: intsym.h:63
#define synth_1to1_stereo_neon
Definition: intsym.h:51
#define do_layer1
Definition: intsym.h:174
#define init_layer12_stuff
Definition: intsym.h:165
#define synth_2to1_8bit_i386
Definition: intsym.h:78
#define ntom_frmouts
Definition: intsym.h:157
#define synth_1to1_neon
Definition: intsym.h:50
#define synth_1to1_8bit_wrap
Definition: intsym.h:72
#define synth_ntom_set_step
Definition: intsym.h:154
#define synth_1to1_3dnowext
Definition: intsym.h:42
#define synth_4to1
Definition: intsym.h:62
#define dct36_neon
Definition: intsym.h:152
#define synth_4to1_i386
Definition: intsym.h:64
#define synth_1to1
Definition: intsym.h:33
#define synth_1to1_neon64
Definition: intsym.h:52
#define synth_1to1_s32
Definition: intsym.h:115
#define synth_1to1_s32_altivec
Definition: intsym.h:123
#define synth_1to1_s32_neon
Definition: intsym.h:125
#define synth_ntom_real_mono
Definition: intsym.h:113
#define synth_2to1_mono
Definition: intsym.h:60
#define synth_1to1_s32_stereo_altivec
Definition: intsym.h:124
#define synth_1to1_stereo_avx
Definition: intsym.h:48
#define synth_ntom_real_m2s
Definition: intsym.h:114
#define synth_2to1_s32
Definition: intsym.h:131
#define synth_1to1_real_neon
Definition: intsym.h:98
#define make_decode_tables_mmx
Definition: intsym.h:168
#define synth_4to1_m2s
Definition: intsym.h:66
#define synth_ntom_8bit_mono
Definition: intsym.h:86
#define synth_4to1_8bit_i386
Definition: intsym.h:82
#define synth_4to1_s32_mono
Definition: intsym.h:137
#define synth_1to1_3dnow
Definition: intsym.h:39
#define synth_2to1_8bit_m2s
Definition: intsym.h:80
#define real