ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

decode.h
Go to the documentation of this file.
00001 /*
00002     decode.h: common definitions for decode functions
00003 
00004     This file is strongly tied with optimize.h concerning the synth functions.
00005     Perhaps one should restructure that a bit.
00006 
00007     copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
00008     see COPYING and AUTHORS files in distribution or http://mpg123.org
00009     initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
00010 */
00011 #ifndef MPG123_DECODE_H
00012 #define MPG123_DECODE_H
00013 
00014 /* Selection of class of output routines for basic format. */
00015 #ifndef REAL_IS_FIXED
00016 #define OUT_FORMATS 4 /* Basic output formats: 16bit, 8bit, real and s32 */
00017 #else
00018 #define OUT_FORMATS 2 /* Only up to 16bit */
00019 #endif
00020 
00021 #define OUT_16 0
00022 #define OUT_8  1
00023 /* Those are defined but not supported for fixed point decoding! */
00024 #define OUT_REAL 2 /* Write a floating point sample (that is, one matching the internal real type). */
00025 #define OUT_S32 3
00026 
00027 #ifdef NO_NTOM
00028 #define NTOM_MAX 1
00029 #else
00030 #define NTOM_MAX 8          /* maximum allowed factor for upsampling */
00031 #define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */
00032 #define NTOM_MUL (32768)
00033 void ntom_set_ntom(mpg123_handle *fr, off_t num);
00034 #endif
00035 
00036 /* Let's collect all possible synth functions here, for an overview.
00037    If they are actually defined and used depends on preprocessor machinery.
00038    See synth.c and optimize.h for that, also some special C and assembler files. */
00039 
00040 #ifndef NO_16BIT
00041 /* The signed-16bit-producing variants. */
00042 int synth_1to1            (real*, int, mpg123_handle*, int);
00043 int synth_1to1_dither     (real*, int, mpg123_handle*, int);
00044 int synth_1to1_i386       (real*, int, mpg123_handle*, int);
00045 int synth_1to1_i586       (real*, int, mpg123_handle*, int);
00046 int synth_1to1_i586_dither(real*, int, mpg123_handle*, int);
00047 int synth_1to1_mmx        (real*, int, mpg123_handle*, int);
00048 int synth_1to1_3dnow      (real*, int, mpg123_handle*, int);
00049 int synth_1to1_sse        (real*, int, mpg123_handle*, int);
00050 int synth_1to1_stereo_sse (real*, real*, mpg123_handle*);
00051 int synth_1to1_3dnowext   (real*, int, mpg123_handle*, int);
00052 int synth_1to1_altivec    (real*, int, mpg123_handle*, int);
00053 int synth_1to1_stereo_altivec(real*, real*, mpg123_handle*);
00054 int synth_1to1_x86_64     (real*, int, mpg123_handle*, int);
00055 int synth_1to1_stereo_x86_64(real*, real*, mpg123_handle*);
00056 int synth_1to1_arm        (real*, int, mpg123_handle*, int);
00057 /* This is different, special usage in layer3.c only.
00058    Hence, the name... and now forget about it.
00059    Never use it outside that special portion of code inside layer3.c! */
00060 int absynth_1to1_i486(real*, int, mpg123_handle*, int);
00061 /* These mono/stereo converters use one of the above for the grunt work. */
00062 int synth_1to1_mono       (real*, mpg123_handle*);
00063 int synth_1to1_mono2stereo(real*, mpg123_handle*);
00064 
00065 /* Sample rate decimation comes in less flavours. */
00066 #ifndef NO_DOWNSAMPLE
00067 int synth_2to1            (real*, int, mpg123_handle*, int);
00068 int synth_2to1_dither     (real*, int, mpg123_handle*, int);
00069 int synth_2to1_i386       (real*, int, mpg123_handle*, int);
00070 int synth_2to1_mono       (real*, mpg123_handle*);
00071 int synth_2to1_mono2stereo(real*, mpg123_handle*);
00072 int synth_4to1            (real *,int, mpg123_handle*, int);
00073 int synth_4to1_dither     (real *,int, mpg123_handle*, int);
00074 int synth_4to1_i386       (real*, int, mpg123_handle*, int);
00075 int synth_4to1_mono       (real*, mpg123_handle*);
00076 int synth_4to1_mono2stereo(real*, mpg123_handle*);
00077 #endif
00078 #ifndef NO_NTOM
00079 /* NtoM is really just one implementation. */
00080 int synth_ntom (real *,int, mpg123_handle*, int);
00081 int synth_ntom_mono (real *, mpg123_handle *);
00082 int synth_ntom_mono2stereo (real *, mpg123_handle *);
00083 #endif
00084 #endif
00085 
00086 #ifndef NO_8BIT
00087 /* The 8bit-producing variants. */
00088 /* There are direct 8-bit synths and wrappers over a possibly optimized 16bit one. */
00089 int synth_1to1_8bit            (real*, int, mpg123_handle*, int);
00090 int synth_1to1_8bit_i386       (real*, int, mpg123_handle*, int);
00091 #ifndef NO_16BIT
00092 int synth_1to1_8bit_wrap       (real*, int, mpg123_handle*, int);
00093 int synth_1to1_8bit_mono       (real*, mpg123_handle*);
00094 #endif
00095 int synth_1to1_8bit_mono2stereo(real*, mpg123_handle*);
00096 #ifndef NO_16BIT
00097 int synth_1to1_8bit_wrap_mono       (real*, mpg123_handle*);
00098 int synth_1to1_8bit_wrap_mono2stereo(real*, mpg123_handle*);
00099 #endif
00100 #ifndef NO_DOWNSAMPLE
00101 int synth_2to1_8bit            (real*, int, mpg123_handle*, int);
00102 int synth_2to1_8bit_i386       (real*, int, mpg123_handle*, int);
00103 int synth_2to1_8bit_mono       (real*, mpg123_handle*);
00104 int synth_2to1_8bit_mono2stereo(real*, mpg123_handle*);
00105 int synth_4to1_8bit            (real*, int, mpg123_handle*, int);
00106 int synth_4to1_8bit_i386       (real*, int, mpg123_handle*, int);
00107 int synth_4to1_8bit_mono       (real*, mpg123_handle*);
00108 int synth_4to1_8bit_mono2stereo(real*, mpg123_handle*);
00109 #endif
00110 #ifndef NO_NTOM
00111 int synth_ntom_8bit            (real*, int, mpg123_handle*, int);
00112 int synth_ntom_8bit_mono       (real*, mpg123_handle*);
00113 int synth_ntom_8bit_mono2stereo(real*, mpg123_handle*);
00114 #endif
00115 #endif
00116 
00117 #ifndef REAL_IS_FIXED
00118 
00119 #ifndef NO_REAL
00120 /* The real-producing variants. */
00121 int synth_1to1_real            (real*, int, mpg123_handle*, int);
00122 int synth_1to1_real_i386       (real*, int, mpg123_handle*, int);
00123 int synth_1to1_real_sse        (real*, int, mpg123_handle*, int);
00124 int synth_1to1_real_stereo_sse (real*, real*, mpg123_handle*);
00125 int synth_1to1_real_x86_64     (real*, int, mpg123_handle*, int);
00126 int synth_1to1_real_stereo_x86_64(real*, real*, mpg123_handle*);
00127 int synth_1to1_real_altivec    (real*, int, mpg123_handle*, int);
00128 int synth_1to1_real_stereo_altivec(real*, real*, mpg123_handle*);
00129 int synth_1to1_real_mono       (real*, mpg123_handle*);
00130 int synth_1to1_real_mono2stereo(real*, mpg123_handle*);
00131 #ifndef NO_DOWNSAMPLE
00132 int synth_2to1_real            (real*, int, mpg123_handle*, int);
00133 int synth_2to1_real_i386       (real*, int, mpg123_handle*, int);
00134 int synth_2to1_real_mono       (real*, mpg123_handle*);
00135 int synth_2to1_real_mono2stereo(real*, mpg123_handle*);
00136 int synth_4to1_real            (real*, int, mpg123_handle*, int);
00137 int synth_4to1_real_i386       (real*, int, mpg123_handle*, int);
00138 int synth_4to1_real_mono       (real*, mpg123_handle*);
00139 int synth_4to1_real_mono2stereo(real*, mpg123_handle*);
00140 #endif
00141 #ifndef NO_NTOM
00142 int synth_ntom_real            (real*, int, mpg123_handle*, int);
00143 int synth_ntom_real_mono       (real*, mpg123_handle*);
00144 int synth_ntom_real_mono2stereo(real*, mpg123_handle*);
00145 #endif
00146 #endif
00147 
00148 #ifndef NO_32BIT
00149 /* 32bit integer */
00150 int synth_1to1_s32            (real*, int, mpg123_handle*, int);
00151 int synth_1to1_s32_i386       (real*, int, mpg123_handle*, int);
00152 int synth_1to1_s32_sse        (real*, int, mpg123_handle*, int);
00153 int synth_1to1_s32_stereo_sse (real*, real*, mpg123_handle*);
00154 int synth_1to1_s32_x86_64     (real*, int, mpg123_handle*, int);
00155 int synth_1to1_s32_stereo_x86_64(real*, real*, mpg123_handle*);
00156 int synth_1to1_s32_altivec    (real*, int, mpg123_handle*, int);
00157 int synth_1to1_s32_stereo_altivec(real*, real*, mpg123_handle*);
00158 int synth_1to1_s32_mono       (real*, mpg123_handle*);
00159 int synth_1to1_s32_mono2stereo(real*, mpg123_handle*);
00160 #ifndef NO_DOWNSAMPLE
00161 int synth_2to1_s32            (real*, int, mpg123_handle*, int);
00162 int synth_2to1_s32_i386       (real*, int, mpg123_handle*, int);
00163 int synth_2to1_s32_mono       (real*, mpg123_handle*);
00164 int synth_2to1_s32_mono2stereo(real*, mpg123_handle*);
00165 int synth_4to1_s32            (real*, int, mpg123_handle*, int);
00166 int synth_4to1_s32_i386       (real*, int, mpg123_handle*, int);
00167 int synth_4to1_s32_mono       (real*, mpg123_handle*);
00168 int synth_4to1_s32_mono2stereo(real*, mpg123_handle*);
00169 #endif
00170 #ifndef NO_NTOM
00171 int synth_ntom_s32            (real*, int, mpg123_handle*, int);
00172 int synth_ntom_s32_mono       (real*, mpg123_handle*);
00173 int synth_ntom_s32_mono2stereo(real*, mpg123_handle*);
00174 #endif
00175 #endif
00176 
00177 #endif /* FIXED */
00178 
00179 
00180 /* Inside these synth functions, some dct64 variants may be used.
00181    The special optimized ones that only appear in assembler code are not mentioned here.
00182    And, generally, these functions are only employed in a matching synth function. */
00183 void dct64        (real *,real *,real *);
00184 void dct64_i386   (real *,real *,real *);
00185 void dct64_altivec(real *,real *,real *);
00186 void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/
00187 
00188 /* This is used by the layer 3 decoder, one generic function and 3DNow variants. */
00189 void dct36         (real *,real *,real *,real *,real *);
00190 void dct36_3dnow   (real *,real *,real *,real *,real *);
00191 void dct36_3dnowext(real *,real *,real *,real *,real *);
00192 
00193 /* Tools for NtoM resampling synth, defined in ntom.c . */
00194 int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */
00195 unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */
00196 /* Frame and sample offsets. */
00197 #ifndef NO_NTOM
00198 /*
00199     Outsamples of _this_ frame.
00200     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.
00201 */
00202 off_t ntom_frame_outsamples(mpg123_handle *fr);
00203 /* Total out/insample offset. */
00204 off_t ntom_frmouts(mpg123_handle *fr, off_t frame);
00205 off_t ntom_ins2outs(mpg123_handle *fr, off_t ins);
00206 off_t ntom_frameoff(mpg123_handle *fr, off_t soff);
00207 #endif
00208 
00209 /* Initialization of any static data that majy be needed at runtime.
00210    Make sure you call these once before it is too late. */
00211 #ifndef NO_LAYER3
00212 void init_layer3(void);
00213 real init_layer3_gainpow2(mpg123_handle *fr, int i);
00214 void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i));
00215 #endif
00216 #ifndef NO_LAYER12
00217 void  init_layer12(void);
00218 real* init_layer12_table(mpg123_handle *fr, real *table, int m);
00219 void  init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m));
00220 #endif
00221 
00222 void prepare_decode_tables(void);
00223 
00224 extern real *pnts[5]; /* tabinit provides, dct64 needs */
00225 
00226 /* Runtime (re)init functions; needed more often. */
00227 void make_decode_tables(mpg123_handle *fr); /* For every volume change. */
00228 /* Stuff needed after updating synth setup (see set_synth_functions()). */
00229 
00230 #ifdef OPT_MMXORSSE
00231 /* Special treatment for mmx-like decoders, these functions go into the slots below. */
00232 void make_decode_tables_mmx(mpg123_handle *fr);
00233 #ifndef NO_LAYER3
00234 real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i);
00235 #endif
00236 #ifndef NO_LAYER12
00237 real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m);
00238 #endif
00239 #endif
00240 
00241 #ifndef NO_8BIT
00242 /* Needed when switching to 8bit output. */
00243 int make_conv16to8_table(mpg123_handle *fr);
00244 #endif
00245 
00246 /* These are the actual workers.
00247    They operate on the parsed frame data and handle decompression to audio samples.
00248    The synth functions defined above are called from inside the layer handlers. */
00249 
00250 #ifndef NO_LAYER3
00251 int do_layer3(mpg123_handle *fr);
00252 #endif
00253 #ifndef NO_LAYER2
00254 int do_layer2(mpg123_handle *fr);
00255 #endif
00256 #ifndef NO_LAYER1
00257 int do_layer1(mpg123_handle *fr);
00258 #endif
00259 /* There's an 3DNow counterpart in asm. */
00260 void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]);
00261 
00262 #endif

Generated on Fri May 25 2012 04:31:41 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.