562
|
1 /*
|
|
2 decode.h: common definitions for decode functions
|
|
3
|
|
4 copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
|
5 see COPYING and AUTHORS files in distribution or http://mpg123.org
|
|
6 initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
|
|
7 */
|
|
8 #ifndef MPG123_DECODE_H
|
|
9 #define MPG123_DECODE_H
|
|
10
|
|
11 #ifdef FLOATOUT
|
|
12 #define WRITE_SAMPLE(samples,sum,clip) *(samples) = sum
|
|
13 #define sample_t float
|
|
14 #else
|
|
15 #define WRITE_SAMPLE(samples,sum,clip) \
|
|
16 if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
|
|
17 else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
|
|
18 else { *(samples) = REAL_TO_SHORT(sum); }
|
|
19 #define sample_t short
|
|
20 #endif
|
|
21
|
|
22 #define NTOM_MAX 8 /* maximum allowed factor for upsampling */
|
|
23 #define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */
|
|
24 #define NTOM_MUL (32768)
|
|
25
|
|
26 /* synth_1to1 in optimize.h, one should also use opts for these here... */
|
|
27
|
|
28 int synth_2to1 (real *,int, mpg123_handle*, int);
|
|
29 int synth_2to1_8bit (real *,int, mpg123_handle *,int);
|
|
30 int synth_2to1_mono (real *, mpg123_handle *);
|
|
31 int synth_2to1_mono2stereo (real *, mpg123_handle *);
|
|
32 int synth_2to1_8bit_mono (real *, mpg123_handle *);
|
|
33 int synth_2to1_8bit_mono2stereo (real *, mpg123_handle *);
|
|
34
|
|
35 int synth_4to1 (real *,int, mpg123_handle*, int);
|
|
36 int synth_4to1_8bit (real *,int, mpg123_handle *,int);
|
|
37 int synth_4to1_mono (real *, mpg123_handle *);
|
|
38 int synth_4to1_mono2stereo (real *, mpg123_handle *);
|
|
39 int synth_4to1_8bit_mono (real *, mpg123_handle *);
|
|
40 int synth_4to1_8bit_mono2stereo (real *, mpg123_handle *);
|
|
41
|
|
42 int synth_ntom (real *,int, mpg123_handle*, int);
|
|
43 int synth_ntom_8bit (real *,int, mpg123_handle *,int);
|
|
44 int synth_ntom_mono (real *, mpg123_handle *);
|
|
45 int synth_ntom_mono2stereo (real *, mpg123_handle *);
|
|
46 int synth_ntom_8bit_mono (real *, mpg123_handle *);
|
|
47 int synth_ntom_8bit_mono2stereo (real *, mpg123_handle *);
|
|
48
|
|
49 int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */
|
|
50 unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */
|
|
51
|
|
52 off_t ntom_frmouts(mpg123_handle *fr, off_t frame);
|
|
53 off_t ntom_ins2outs(mpg123_handle *fr, off_t ins);
|
|
54 off_t ntom_frameoff(mpg123_handle *fr, off_t soff);
|
|
55
|
|
56 void init_layer3(void);
|
|
57 void init_layer3_stuff(mpg123_handle *fr);
|
|
58 void init_layer2(void);
|
|
59 void init_layer2_stuff(mpg123_handle *fr);
|
|
60 int make_conv16to8_table(mpg123_handle *fr);
|
|
61
|
|
62 int do_layer3(mpg123_handle *fr);
|
|
63 int do_layer2(mpg123_handle *fr);
|
|
64 int do_layer1(mpg123_handle *fr);
|
|
65 void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]);
|
|
66
|
|
67 #endif
|