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

synth_8bit.c
Go to the documentation of this file.
00001 /*
00002     synth_8bit.c: The functions for synthesizing 8bit samples, at the end of decoding.
00003 
00004     copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
00005     see COPYING and AUTHORS files in distribution or http://mpg123.org
00006     initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
00007 */
00008 
00009 #include "mpg123lib_intern.h"
00010 #include "sample.h"
00011 #include "debug.h"
00012 
00013 /* 
00014     Part 2: All synth functions that produce 8bit output.
00015     What we need is just a special WRITE_SAMPLE. For the generic and i386 functions, that is.
00016     For the rather optimized synth_1to1, we will need the postprocessing 8bit converters from synth_8bit.h .
00017 */
00018 
00019 #define SAMPLE_T unsigned char
00020 #define WRITE_SAMPLE(samples,sum,clip) WRITE_8BIT_SAMPLE(samples,sum,clip)
00021 
00022 /* Part 2a: All straight 1to1 decoding functions */
00023 #define BLOCK 0x40 /* One decoding block is 64 samples. */
00024 
00025 #define SYNTH_NAME synth_1to1_8bit
00026 #include "synth.h"
00027 #undef SYNTH_NAME
00028 
00029 /* Mono-related synths; they wrap over _some_ synth_1to1_8bit (could be generic, could be i386). */
00030 #define SYNTH_NAME       fr->synths.plain[r_1to1][f_8]
00031 #define MONO_NAME        synth_1to1_8bit_mono
00032 #define MONO2STEREO_NAME synth_1to1_8bit_mono2stereo
00033 #include "synth_mono.h"
00034 #undef SYNTH_NAME
00035 #undef MONO_NAME
00036 #undef MONO2STEREO_NAME
00037 
00038 #ifdef OPT_X86
00039 #define NO_AUTOINCREMENT
00040 #define SYNTH_NAME synth_1to1_8bit_i386
00041 #include "synth.h"
00042 #undef SYNTH_NAME
00043 /* i386 uses the normal mono functions. */
00044 #undef NO_AUTOINCREMENT
00045 #endif
00046 
00047 /* But now, we need functions that take the 16bit output of optimized synth_1to1 and convert it.
00048    I suppose that is still faster than dropping the optimization altogether! */
00049 
00050 #define BASE_SYNTH_NAME  fr->synths.plain[r_1to1][f_16]
00051 #define SYNTH_NAME       synth_1to1_8bit_wrap
00052 #define MONO_NAME        synth_1to1_8bit_wrap_mono
00053 #define MONO2STEREO_NAME synth_1to1_8bit_wrap_mono2stereo
00054 #include "synth_8bit.h"
00055 #undef BASE_SYNTH_NAME
00056 #undef SYNTH_NAME
00057 #undef MONO_NAME
00058 #undef MONO2STEREO_NAME
00059 
00060 #undef BLOCK
00061 
00062 #ifndef NO_DOWNSAMPLE
00063 
00064 /*
00065     Part 2b: 2to1 synth. Only generic and i386.
00066 */
00067 #define BLOCK 0x20 /* One decoding block is 32 samples. */
00068 
00069 #define SYNTH_NAME synth_2to1_8bit
00070 #include "synth.h"
00071 #undef SYNTH_NAME
00072 
00073 /* Mono-related synths; they wrap over _some_ synth_2to1_8bit (could be generic, could be i386). */
00074 #define SYNTH_NAME       fr->synths.plain[r_2to1][f_8]
00075 #define MONO_NAME        synth_2to1_8bit_mono
00076 #define MONO2STEREO_NAME synth_2to1_8bit_mono2stereo
00077 #include "synth_mono.h"
00078 #undef SYNTH_NAME
00079 #undef MONO_NAME
00080 #undef MONO2STEREO_NAME
00081 
00082 #ifdef OPT_X86
00083 #define NO_AUTOINCREMENT
00084 #define SYNTH_NAME synth_2to1_8bit_i386
00085 #include "synth.h"
00086 #undef SYNTH_NAME
00087 /* i386 uses the normal mono functions. */
00088 #undef NO_AUTOINCREMENT
00089 #endif
00090 
00091 #undef BLOCK
00092 
00093 /*
00094     Part 2c: 4to1 synth. Only generic and i386.
00095 */
00096 #define BLOCK 0x10 /* One decoding block is 16 samples. */
00097 
00098 #define SYNTH_NAME synth_4to1_8bit
00099 #include "synth.h"
00100 #undef SYNTH_NAME
00101 
00102 /* Mono-related synths; they wrap over _some_ synth_4to1_8bit (could be generic, could be i386). */
00103 #define SYNTH_NAME       fr->synths.plain[r_4to1][f_8]
00104 #define MONO_NAME        synth_4to1_8bit_mono
00105 #define MONO2STEREO_NAME synth_4to1_8bit_mono2stereo
00106 #include "synth_mono.h"
00107 #undef SYNTH_NAME
00108 #undef MONO_NAME
00109 #undef MONO2STEREO_NAME
00110 
00111 #ifdef OPT_X86
00112 #define NO_AUTOINCREMENT
00113 #define SYNTH_NAME synth_4to1_8bit_i386
00114 #include "synth.h"
00115 #undef SYNTH_NAME
00116 /* i386 uses the normal mono functions. */
00117 #undef NO_AUTOINCREMENT
00118 #endif
00119 
00120 #undef BLOCK
00121 
00122 #endif /* NO_DOWNSAMPLE */
00123 
00124 #ifndef NO_NTOM
00125 /*
00126     Part 2d: ntom synth.
00127     Same procedure as above... Just no extra play anymore, straight synth that may use an optimized dct64.
00128 */
00129 
00130 /* These are all in one header, there's no flexibility to gain. */
00131 #define SYNTH_NAME       synth_ntom_8bit
00132 #define MONO_NAME        synth_ntom_8bit_mono
00133 #define MONO2STEREO_NAME synth_ntom_8bit_mono2stereo
00134 #include "synth_ntom.h"
00135 #undef SYNTH_NAME
00136 #undef MONO_NAME
00137 #undef MONO2STEREO_NAME
00138 
00139 #endif
00140 
00141 #undef SAMPLE_T
00142 #undef WRITE_SAMPLE

Generated on Sat May 26 2012 04:33:02 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.