diff options
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/common/mpegplay.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/uisimulator/common/mpegplay.c b/uisimulator/common/mpegplay.c index 76e9655be6..09799ad176 100644 --- a/uisimulator/common/mpegplay.c +++ b/uisimulator/common/mpegplay.c | |||
@@ -117,54 +117,6 @@ signed int dither(mad_fixed_t sample, struct dither *dither) | |||
117 | return output >> scalebits; | 117 | return output >> scalebits; |
118 | } | 118 | } |
119 | 119 | ||
120 | /* | ||
121 | * NAME: pack_pcm() | ||
122 | * DESCRIPTION: scale and dither MAD output | ||
123 | */ | ||
124 | static | ||
125 | void pack_pcm(unsigned char **pcm, unsigned int nsamples, | ||
126 | mad_fixed_t const *ch1, mad_fixed_t const *ch2) | ||
127 | { | ||
128 | register signed int s0, s1; | ||
129 | static struct dither d0, d1; | ||
130 | |||
131 | if (ch2) { /* stereo */ | ||
132 | while (nsamples--) { | ||
133 | s0 = scale(*ch1++, &d0); | ||
134 | s1 = scale(*ch2++, &d1); | ||
135 | # if SAMPLE_DEPTH == 16 | ||
136 | (*pcm)[0 + 0] = s0 >> 0; | ||
137 | (*pcm)[0 + 1] = s0 >> 8; | ||
138 | (*pcm)[2 + 0] = s1 >> 0; | ||
139 | (*pcm)[2 + 1] = s1 >> 8; | ||
140 | |||
141 | *pcm += 2 * 2; | ||
142 | # elif SAMPLE_DEPTH == 8 | ||
143 | (*pcm)[0] = s0 ^ 0x80; | ||
144 | (*pcm)[1] = s1 ^ 0x80; | ||
145 | |||
146 | *pcm += 2; | ||
147 | # else | ||
148 | # error "bad SAMPLE_DEPTH" | ||
149 | # endif | ||
150 | } | ||
151 | } | ||
152 | else { /* mono */ | ||
153 | while (nsamples--) { | ||
154 | s0 = scale(*ch1++, &d0); | ||
155 | |||
156 | # if SAMPLE_DEPTH == 16 | ||
157 | (*pcm)[0] = s0 >> 0; | ||
158 | (*pcm)[1] = s0 >> 8; | ||
159 | |||
160 | *pcm += 2; | ||
161 | # elif SAMPLE_DEPTH == 8 | ||
162 | *(*pcm)++ = s0 ^ 0x80; | ||
163 | # endif | ||
164 | } | ||
165 | } | ||
166 | } | ||
167 | |||
168 | #define INPUT_BUFFER_SIZE (5*8192) | 120 | #define INPUT_BUFFER_SIZE (5*8192) |
169 | #define OUTPUT_BUFFER_SIZE 8192 /* Must be an integer multiple of 4. */ | 121 | #define OUTPUT_BUFFER_SIZE 8192 /* Must be an integer multiple of 4. */ |
170 | int mpeg_play(char* fname) | 122 | int mpeg_play(char* fname) |