author | harlekin <harlekin> | 2002-04-19 16:08:55 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-04-19 16:08:55 (UTC) |
commit | 7ea4abeb652e6787e57a938e1ca028d25fd249ce (patch) (unidiff) | |
tree | ee08f2d9d6aaa8adb1c5f07f4124da8a61eb8cd5 /core/multimedia | |
parent | caa7ced77b9014526607f9f65c58aabe7e0ba631 (diff) | |
download | opie-7ea4abeb652e6787e57a938e1ca028d25fd249ce.zip opie-7ea4abeb652e6787e57a938e1ca028d25fd249ce.tar.gz opie-7ea4abeb652e6787e57a938e1ca028d25fd249ce.tar.bz2 |
new libmad version, less cpu usage
30 files changed, 578 insertions, 354 deletions
diff --git a/core/multimedia/opieplayer/libmad/COPYRIGHT b/core/multimedia/opieplayer/libmad/COPYRIGHT new file mode 100644 index 0000000..f30a707 --- a/dev/null +++ b/core/multimedia/opieplayer/libmad/COPYRIGHT | |||
@@ -0,0 +1,21 @@ | |||
1 | |||
2 | libmad - MPEG audio decoder library | ||
3 | Copyright (C) 2000-2001 Robert Leslie | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | |||
19 | If you would like to negotiate alternate licensing terms, you may do | ||
20 | so by contacting the author: Robert Leslie <rob@mars.org> | ||
21 | |||
diff --git a/core/multimedia/opieplayer/libmad/D.dat b/core/multimedia/opieplayer/libmad/D.dat index f33d30c..c3ee74c 100644 --- a/core/multimedia/opieplayer/libmad/D.dat +++ b/core/multimedia/opieplayer/libmad/D.dat | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/bit.c b/core/multimedia/opieplayer/libmad/bit.c index 2466c5f..4a4661b 100644 --- a/core/multimedia/opieplayer/libmad/bit.c +++ b/core/multimedia/opieplayer/libmad/bit.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -199,18 +199,35 @@ unsigned short mad_bit_crc(struct mad_bitptr bitptr, unsigned int len, | |||
199 | { | 199 | { |
200 | register unsigned int crc, data; | 200 | register unsigned int crc; |
201 | 201 | ||
202 | # if CHAR_BIT == 8 | 202 | for (crc = init; len >= 32; len -= 32) { |
203 | for (crc = init; len >= 8; len -= 8) { | 203 | register unsigned long data; |
204 | crc = (crc << 8) ^ | 204 | |
205 | data = mad_bit_read(&bitptr, 32); | ||
206 | |||
207 | crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 24)) & 0xff]; | ||
208 | crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 16)) & 0xff]; | ||
209 | crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 8)) & 0xff]; | ||
210 | crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 0)) & 0xff]; | ||
211 | } | ||
212 | |||
213 | switch (len / 8) { | ||
214 | case 3: crc = (crc << 8) ^ | ||
215 | crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff]; | ||
216 | case 2: crc = (crc << 8) ^ | ||
217 | crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff]; | ||
218 | case 1: crc = (crc << 8) ^ | ||
205 | crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff]; | 219 | crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff]; |
220 | |||
221 | len %= 8; | ||
222 | |||
223 | case 0: break; | ||
206 | } | 224 | } |
207 | # else | ||
208 | crc = init; | ||
209 | # endif | ||
210 | 225 | ||
211 | while (len--) { | 226 | while (len--) { |
212 | data = mad_bit_read(&bitptr, 1) ^ (crc >> 15); | 227 | register unsigned int msb; |
228 | |||
229 | msb = mad_bit_read(&bitptr, 1) ^ (crc >> 15); | ||
213 | 230 | ||
214 | crc <<= 1; | 231 | crc <<= 1; |
215 | if (data & 1) | 232 | if (msb & 1) |
216 | crc ^= CRC_POLY; | 233 | crc ^= CRC_POLY; |
diff --git a/core/multimedia/opieplayer/libmad/bit.h b/core/multimedia/opieplayer/libmad/bit.h index f315bc9..3448d40 100644 --- a/core/multimedia/opieplayer/libmad/bit.h +++ b/core/multimedia/opieplayer/libmad/bit.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/decoder.c b/core/multimedia/opieplayer/libmad/decoder.c index dcf7cf3..b2b6cbb 100644 --- a/core/multimedia/opieplayer/libmad/decoder.c +++ b/core/multimedia/opieplayer/libmad/decoder.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -23,9 +23,2 @@ | |||
23 | # include "libmad_config.h" | 23 | # include "libmad_config.h" |
24 | # else | ||
25 | # ifndef WEXITSTATUS | ||
26 | # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) | ||
27 | # endif | ||
28 | # ifndef WIFEXITED | ||
29 | # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) | ||
30 | # endif | ||
31 | # endif | 24 | # endif |
@@ -34,3 +27,5 @@ | |||
34 | 27 | ||
28 | # ifdef HAVE_SYS_TYPES_H | ||
35 | # include <sys/types.h> | 29 | # include <sys/types.h> |
30 | # endif | ||
36 | 31 | ||
@@ -44,5 +39,11 @@ | |||
44 | 39 | ||
40 | # ifdef HAVE_FCNTL_H | ||
45 | # include <fcntl.h> | 41 | # include <fcntl.h> |
42 | # endif | ||
43 | |||
46 | # include <stdlib.h> | 44 | # include <stdlib.h> |
45 | |||
46 | # ifdef HAVE_ERRNO_H | ||
47 | # include <errno.h> | 47 | # include <errno.h> |
48 | # endif | ||
48 | 49 | ||
@@ -54,6 +55,9 @@ | |||
54 | void mad_decoder_init(struct mad_decoder *decoder, void *data, | 55 | void mad_decoder_init(struct mad_decoder *decoder, void *data, |
55 | enum mad_flow (*input_func)(void *, struct mad_stream *), | 56 | enum mad_flow (*input_func)(void *, |
57 | struct mad_stream *), | ||
56 | enum mad_flow (*header_func)(void *, | 58 | enum mad_flow (*header_func)(void *, |
57 | struct mad_header const *), | 59 | struct mad_header const *), |
58 | enum mad_flow (*filter_func)(void *, struct mad_frame *), | 60 | enum mad_flow (*filter_func)(void *, |
61 | struct mad_stream const *, | ||
62 | struct mad_frame *), | ||
59 | enum mad_flow (*output_func)(void *, | 63 | enum mad_flow (*output_func)(void *, |
@@ -61,3 +65,4 @@ void mad_decoder_init(struct mad_decoder *decoder, void *data, | |||
61 | struct mad_pcm *), | 65 | struct mad_pcm *), |
62 | enum mad_flow (*error_func)(void *, struct mad_stream *, | 66 | enum mad_flow (*error_func)(void *, |
67 | struct mad_stream *, | ||
63 | struct mad_frame *), | 68 | struct mad_frame *), |
@@ -88,2 +93,3 @@ int mad_decoder_finish(struct mad_decoder *decoder) | |||
88 | { | 93 | { |
94 | # if defined(USE_ASYNC) | ||
89 | if (decoder->mode == MAD_DECODER_MODE_ASYNC && decoder->async.pid) { | 95 | if (decoder->mode == MAD_DECODER_MODE_ASYNC && decoder->async.pid) { |
@@ -94,5 +100,4 @@ int mad_decoder_finish(struct mad_decoder *decoder) | |||
94 | 100 | ||
95 | do { | 101 | do |
96 | pid = waitpid(decoder->async.pid, &status, 0); | 102 | pid = waitpid(decoder->async.pid, &status, 0); |
97 | } | ||
98 | while (pid == -1 && errno == EINTR); | 103 | while (pid == -1 && errno == EINTR); |
@@ -112,2 +117,3 @@ int mad_decoder_finish(struct mad_decoder *decoder) | |||
112 | } | 117 | } |
118 | # endif | ||
113 | 119 | ||
@@ -116,2 +122,3 @@ int mad_decoder_finish(struct mad_decoder *decoder) | |||
116 | 122 | ||
123 | # if defined(USE_ASYNC) | ||
117 | static | 124 | static |
@@ -123,5 +130,4 @@ enum mad_flow send_io(int fd, void const *data, size_t len) | |||
123 | while (len) { | 130 | while (len) { |
124 | do { | 131 | do |
125 | count = write(fd, ptr, len); | 132 | count = write(fd, ptr, len); |
126 | } | ||
127 | while (count == -1 && errno == EINTR); | 133 | while (count == -1 && errno == EINTR); |
@@ -145,5 +151,4 @@ enum mad_flow receive_io(int fd, void *buffer, size_t len) | |||
145 | while (len) { | 151 | while (len) { |
146 | do { | 152 | do |
147 | count = read(fd, ptr, len); | 153 | count = read(fd, ptr, len); |
148 | } | ||
149 | while (count == -1 && errno == EINTR); | 154 | while (count == -1 && errno == EINTR); |
@@ -283,2 +288,3 @@ enum mad_flow check_message(struct mad_decoder *decoder) | |||
283 | } | 288 | } |
289 | # endif | ||
284 | 290 | ||
@@ -350,2 +356,3 @@ int run_sync(struct mad_decoder *decoder) | |||
350 | while (1) { | 356 | while (1) { |
357 | # if defined(USE_ASYNC) | ||
351 | if (decoder->mode == MAD_DECODER_MODE_ASYNC) { | 358 | if (decoder->mode == MAD_DECODER_MODE_ASYNC) { |
@@ -361,2 +368,3 @@ int run_sync(struct mad_decoder *decoder) | |||
361 | } | 368 | } |
369 | # endif | ||
362 | 370 | ||
@@ -411,3 +419,3 @@ int run_sync(struct mad_decoder *decoder) | |||
411 | if (decoder->filter_func) { | 419 | if (decoder->filter_func) { |
412 | switch (decoder->filter_func(decoder->cb_data, frame)) { | 420 | switch (decoder->filter_func(decoder->cb_data, stream, frame)) { |
413 | case MAD_FLOW_STOP: | 421 | case MAD_FLOW_STOP: |
@@ -452,2 +460,3 @@ int run_sync(struct mad_decoder *decoder) | |||
452 | 460 | ||
461 | # if defined(USE_ASYNC) | ||
453 | static | 462 | static |
@@ -513,2 +522,3 @@ int run_async(struct mad_decoder *decoder) | |||
513 | } | 522 | } |
523 | # endif | ||
514 | 524 | ||
@@ -525,3 +535,5 @@ int mad_decoder_run(struct mad_decoder *decoder, enum mad_decoder_mode mode) | |||
525 | case MAD_DECODER_MODE_ASYNC: | 535 | case MAD_DECODER_MODE_ASYNC: |
536 | # if defined(USE_ASYNC) | ||
526 | run = run_async; | 537 | run = run_async; |
538 | # endif | ||
527 | break; | 539 | break; |
@@ -547,2 +559,3 @@ int mad_decoder_message(struct mad_decoder *decoder, | |||
547 | { | 559 | { |
560 | # if defined(USE_ASYNC) | ||
548 | if (decoder->mode != MAD_DECODER_MODE_ASYNC || | 561 | if (decoder->mode != MAD_DECODER_MODE_ASYNC || |
@@ -553,2 +566,5 @@ int mad_decoder_message(struct mad_decoder *decoder, | |||
553 | return 0; | 566 | return 0; |
567 | # else | ||
568 | return -1; | ||
569 | # endif | ||
554 | } | 570 | } |
diff --git a/core/multimedia/opieplayer/libmad/decoder.h b/core/multimedia/opieplayer/libmad/decoder.h index dbacc1a..f34150d 100644 --- a/core/multimedia/opieplayer/libmad/decoder.h +++ b/core/multimedia/opieplayer/libmad/decoder.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -34,6 +34,6 @@ enum mad_decoder_mode { | |||
34 | enum mad_flow { | 34 | enum mad_flow { |
35 | MAD_FLOW_CONTINUE = 0x0000, | 35 | MAD_FLOW_CONTINUE = 0x0000,/* continue normally */ |
36 | MAD_FLOW_STOP = 0x0010, | 36 | MAD_FLOW_STOP = 0x0010,/* stop decoding normally */ |
37 | MAD_FLOW_BREAK = 0x0011, | 37 | MAD_FLOW_BREAK = 0x0011,/* stop decoding and signal an error */ |
38 | MAD_FLOW_IGNORE = 0x0020 | 38 | MAD_FLOW_IGNORE = 0x0020/* ignore the current frame */ |
39 | }; | 39 | }; |
@@ -61,3 +61,4 @@ struct mad_decoder { | |||
61 | enum mad_flow (*header_func)(void *, struct mad_header const *); | 61 | enum mad_flow (*header_func)(void *, struct mad_header const *); |
62 | enum mad_flow (*filter_func)(void *, struct mad_frame *); | 62 | enum mad_flow (*filter_func)(void *, |
63 | struct mad_stream const *, struct mad_frame *); | ||
63 | enum mad_flow (*output_func)(void *, | 64 | enum mad_flow (*output_func)(void *, |
@@ -71,3 +72,5 @@ void mad_decoder_init(struct mad_decoder *, void *, | |||
71 | enum mad_flow (*)(void *, struct mad_header const *), | 72 | enum mad_flow (*)(void *, struct mad_header const *), |
72 | enum mad_flow (*)(void *, struct mad_frame *), | 73 | enum mad_flow (*)(void *, |
74 | struct mad_stream const *, | ||
75 | struct mad_frame *), | ||
73 | enum mad_flow (*)(void *, | 76 | enum mad_flow (*)(void *, |
@@ -81,3 +84,4 @@ int mad_decoder_finish(struct mad_decoder *); | |||
81 | 84 | ||
82 | # define mad_decoder_options(decoder, opts) ((decoder)->options = (opts)) | 85 | # define mad_decoder_options(decoder, opts) \ |
86 | ((void) ((decoder)->options = (opts))) | ||
83 | 87 | ||
diff --git a/core/multimedia/opieplayer/libmad/fixed.c b/core/multimedia/opieplayer/libmad/fixed.c index be5c94e..af1e87e 100644 --- a/core/multimedia/opieplayer/libmad/fixed.c +++ b/core/multimedia/opieplayer/libmad/fixed.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/fixed.h b/core/multimedia/opieplayer/libmad/fixed.h index 00ade62..c9b98ca 100644 --- a/core/multimedia/opieplayer/libmad/fixed.h +++ b/core/multimedia/opieplayer/libmad/fixed.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -36,2 +36,14 @@ typedef unsigned long mad_fixed64lo_t; | |||
36 | 36 | ||
37 | # if defined(_MSC_VER) | ||
38 | # define mad_fixed64_t signed __int64 | ||
39 | # elif 1 || defined(__GNUC__) | ||
40 | # define mad_fixed64_t signed long long | ||
41 | # endif | ||
42 | |||
43 | # if defined(FPM_FLOAT) | ||
44 | typedef double mad_sample_t; | ||
45 | # else | ||
46 | typedef mad_fixed_t mad_sample_t; | ||
47 | # endif | ||
48 | |||
37 | /* | 49 | /* |
@@ -96,7 +108,18 @@ typedef unsigned long mad_fixed64lo_t; | |||
96 | 108 | ||
97 | # if defined(FPM_64BIT) | 109 | # if defined(FPM_FLOAT) |
110 | # error "FPM_FLOAT not yet supported" | ||
111 | |||
112 | # undef MAD_F | ||
113 | # define MAD_F(x) mad_f_todouble(x) | ||
114 | |||
115 | # define mad_f_mul(x, y)((x) * (y)) | ||
116 | # define mad_f_scale64 | ||
117 | |||
118 | # undef ASO_ZEROCHECK | ||
119 | |||
120 | # elif defined(FPM_64BIT) | ||
98 | 121 | ||
99 | /* | 122 | /* |
100 | * This version should be the most accurate if 64-bit (long long) types are | 123 | * This version should be the most accurate if 64-bit types are supported by |
101 | * supported by the compiler, although it may not be the most efficient. | 124 | * the compiler, although it may not be the most efficient. |
102 | */ | 125 | */ |
@@ -105,3 +128,3 @@ typedef unsigned long mad_fixed64lo_t; | |||
105 | ((mad_fixed_t) \ | 128 | ((mad_fixed_t) \ |
106 | ((((signed long long) (x) * (y)) + \ | 129 | ((((mad_fixed64_t) (x) * (y)) + \ |
107 | (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS)) | 130 | (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS)) |
@@ -109,3 +132,3 @@ typedef unsigned long mad_fixed64lo_t; | |||
109 | # define mad_f_mul(x, y) \ | 132 | # define mad_f_mul(x, y) \ |
110 | ((mad_fixed_t) (((signed long long) (x) * (y)) >> MAD_F_SCALEBITS)) | 133 | ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS)) |
111 | # endif | 134 | # endif |
@@ -118,2 +141,25 @@ typedef unsigned long mad_fixed64lo_t; | |||
118 | 141 | ||
142 | # if defined(_MSC_VER) | ||
143 | # pragma warning(push) | ||
144 | # pragma warning(disable: 4035) /* no return value */ | ||
145 | static __forceinline | ||
146 | mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) | ||
147 | { | ||
148 | enum { | ||
149 | fracbits = MAD_F_FRACBITS | ||
150 | }; | ||
151 | |||
152 | __asm { | ||
153 | mov eax, x | ||
154 | imul y | ||
155 | shrd eax, edx, fracbits | ||
156 | } | ||
157 | |||
158 | /* implicit return of eax */ | ||
159 | } | ||
160 | # pragma warning(pop) | ||
161 | |||
162 | # define mad_f_mul mad_f_mul_inline | ||
163 | # define mad_f_scale64 | ||
164 | # else | ||
119 | /* | 165 | /* |
@@ -176,2 +222,3 @@ typedef unsigned long mad_fixed64lo_t; | |||
176 | # define MAD_F_SCALEBITS MAD_F_FRACBITS | 222 | # define MAD_F_SCALEBITS MAD_F_FRACBITS |
223 | # endif | ||
177 | 224 | ||
@@ -219,2 +266,9 @@ typedef unsigned long mad_fixed64lo_t; | |||
219 | 266 | ||
267 | # define MAD_F_MLN(hi, lo) \ | ||
268 | asm ("rsbs%0, %2, #0\n\t" \ | ||
269 | "rsc%1, %3, #0" \ | ||
270 | : "=r" (lo), "=r" (hi) \ | ||
271 | : "0" (lo), "1" (hi) \ | ||
272 | : "cc") | ||
273 | |||
220 | # define mad_f_scale64(hi, lo) \ | 274 | # define mad_f_scale64(hi, lo) \ |
@@ -359,4 +413,8 @@ typedef unsigned long mad_fixed64lo_t; | |||
359 | */ | 413 | */ |
414 | # if defined(OPT_SPEED) | ||
415 | # define mad_f_mul(x, y)(((x) >> 12) * ((y) >> 16)) | ||
416 | # else | ||
360 | # define mad_f_mul(x, y)((((x) + (1L << 11)) >> 12) * \ | 417 | # define mad_f_mul(x, y)((((x) + (1L << 11)) >> 12) * \ |
361 | (((y) + (1L << 15)) >> 16)) | 418 | (((y) + (1L << 15)) >> 16)) |
419 | # endif | ||
362 | 420 | ||
@@ -382,2 +440,3 @@ typedef unsigned long mad_fixed64lo_t; | |||
382 | # define MAD_F_MLA(hi, lo, x, y)((lo) += mad_f_mul((x), (y))) | 440 | # define MAD_F_MLA(hi, lo, x, y)((lo) += mad_f_mul((x), (y))) |
441 | # define MAD_F_MLN(hi, lo) ((lo) = -(lo)) | ||
383 | # define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo)) | 442 | # define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo)) |
@@ -389,2 +448,6 @@ typedef unsigned long mad_fixed64lo_t; | |||
389 | 448 | ||
449 | # if !defined(MAD_F_MLN) | ||
450 | # define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi)) | ||
451 | # endif | ||
452 | |||
390 | # if !defined(MAD_F_MLZ) | 453 | # if !defined(MAD_F_MLZ) |
diff --git a/core/multimedia/opieplayer/libmad/frame.c b/core/multimedia/opieplayer/libmad/frame.c index 4ebb80c..bf15e7f 100644 --- a/core/multimedia/opieplayer/libmad/frame.c +++ b/core/multimedia/opieplayer/libmad/frame.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -375,3 +375,3 @@ int mad_header_decode(struct mad_header *header, struct mad_stream *stream) | |||
375 | if (header->bitrate == 0) { | 375 | if (header->bitrate == 0) { |
376 | if ((!stream->sync || !stream->freerate) && | 376 | if ((stream->freerate == 0 || !stream->sync) && |
377 | free_bitrate(stream, header) == -1) | 377 | free_bitrate(stream, header) == -1) |
diff --git a/core/multimedia/opieplayer/libmad/frame.h b/core/multimedia/opieplayer/libmad/frame.h index e88d0c8..3b8e454 100644 --- a/core/multimedia/opieplayer/libmad/frame.h +++ b/core/multimedia/opieplayer/libmad/frame.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -47,3 +47,2 @@ enum mad_emphasis { | |||
47 | 47 | ||
48 | struct mad_frame { | ||
49 | struct mad_header { | 48 | struct mad_header { |
@@ -64,3 +63,6 @@ struct mad_frame { | |||
64 | mad_timer_t duration; /* audio playing time of frame */ | 63 | mad_timer_t duration; /* audio playing time of frame */ |
65 | } header; | 64 | }; |
65 | |||
66 | struct mad_frame { | ||
67 | struct mad_header header; /* MPEG audio header */ | ||
66 | 68 | ||
diff --git a/core/multimedia/opieplayer/libmad/huffman.c b/core/multimedia/opieplayer/libmad/huffman.c index 8ec9499..5ea6547 100644 --- a/core/multimedia/opieplayer/libmad/huffman.c +++ b/core/multimedia/opieplayer/libmad/huffman.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -36,4 +36,10 @@ | |||
36 | 36 | ||
37 | # define V(v, w, x, y, hlen){ { 1, hlen, v, w, x, y } } | 37 | # if defined(__GNUC__) |
38 | # define PTR(offs, bits){ ptr: { 0, bits, offs } } | 38 | # define PTR(offs, bits){ ptr: { 0, bits, offs } } |
39 | # define V(v, w, x, y, hlen){ value: { 1, hlen, v, w, x, y } } | ||
40 | # else | ||
41 | # define PTR(offs, bits){ { 0, bits, offs } } | ||
42 | # define V(v, w, x, y, hlen){ { 1, hlen, (v << 0) | (w << 1) | \ | ||
43 | (x << 2) | (y << 3) } } | ||
44 | # endif | ||
39 | 45 | ||
@@ -102,4 +108,9 @@ union huffquad const hufftabB[] = { | |||
102 | 108 | ||
103 | # define V(x, y, hlen) { { 1, hlen, x, y } } | 109 | # if defined(__GNUC__) |
104 | # define PTR(offs, bits){ ptr: { 0, bits, offs } } | 110 | # define PTR(offs, bits){ ptr: { 0, bits, offs } } |
111 | # define V(x, y, hlen) { value: { 1, hlen, x, y } } | ||
112 | # else | ||
113 | # define PTR(offs, bits){ { 0, bits, offs } } | ||
114 | # define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } } | ||
115 | # endif | ||
105 | 116 | ||
diff --git a/core/multimedia/opieplayer/libmad/huffman.h b/core/multimedia/opieplayer/libmad/huffman.h index 1801210..d051949 100644 --- a/core/multimedia/opieplayer/libmad/huffman.h +++ b/core/multimedia/opieplayer/libmad/huffman.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -27,2 +27,7 @@ union huffquad { | |||
27 | unsigned short final : 1; | 27 | unsigned short final : 1; |
28 | unsigned short bits : 3; | ||
29 | unsigned short offset : 12; | ||
30 | } ptr; | ||
31 | struct { | ||
32 | unsigned short final : 1; | ||
28 | unsigned short hlen : 3; | 33 | unsigned short hlen : 3; |
@@ -33,2 +38,6 @@ union huffquad { | |||
33 | } value; | 38 | } value; |
39 | unsigned short final : 1; | ||
40 | }; | ||
41 | |||
42 | union huffpair { | ||
34 | struct { | 43 | struct { |
@@ -38,6 +47,2 @@ union huffquad { | |||
38 | } ptr; | 47 | } ptr; |
39 | unsigned short final : 1; | ||
40 | }; | ||
41 | |||
42 | union huffpair { | ||
43 | struct { | 48 | struct { |
@@ -48,7 +53,2 @@ union huffpair { | |||
48 | } value; | 53 | } value; |
49 | struct { | ||
50 | unsigned short final : 1; | ||
51 | unsigned short bits : 3; | ||
52 | unsigned short offset : 12; | ||
53 | } ptr; | ||
54 | unsigned short final : 1; | 54 | unsigned short final : 1; |
diff --git a/core/multimedia/opieplayer/libmad/imdct_s.dat b/core/multimedia/opieplayer/libmad/imdct_s.dat index 00d62eb..ed70446 100644 --- a/core/multimedia/opieplayer/libmad/imdct_s.dat +++ b/core/multimedia/opieplayer/libmad/imdct_s.dat | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/layer12.c b/core/multimedia/opieplayer/libmad/layer12.c index 41b17ca..d291174 100644 --- a/core/multimedia/opieplayer/libmad/layer12.c +++ b/core/multimedia/opieplayer/libmad/layer12.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/layer12.h b/core/multimedia/opieplayer/libmad/layer12.h index d2c81ac..c673726 100644 --- a/core/multimedia/opieplayer/libmad/layer12.h +++ b/core/multimedia/opieplayer/libmad/layer12.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/layer3.c b/core/multimedia/opieplayer/libmad/layer3.c index 194fc7e..03f13fe 100644 --- a/core/multimedia/opieplayer/libmad/layer3.c +++ b/core/multimedia/opieplayer/libmad/layer3.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -29,3 +29,6 @@ | |||
29 | # include <string.h> | 29 | # include <string.h> |
30 | |||
31 | # ifdef HAVE_ASSERT_H | ||
30 | # include <assert.h> | 32 | # include <assert.h> |
33 | # endif | ||
31 | 34 | ||
@@ -53,2 +56,7 @@ enum { | |||
53 | 56 | ||
57 | enum { | ||
58 | I_STEREO = 0x1, | ||
59 | MS_STEREO = 0x2 | ||
60 | }; | ||
61 | |||
54 | struct sideinfo { | 62 | struct sideinfo { |
@@ -505,3 +513,3 @@ enum mad_error III_sideinfo(struct mad_bitptr *ptr, unsigned int nch, | |||
505 | unsigned int ngr, gr, ch, i; | 513 | unsigned int ngr, gr, ch, i; |
506 | enum mad_error result = 0; | 514 | enum mad_error result = MAD_ERROR_NONE; |
507 | 515 | ||
@@ -604,3 +612,3 @@ unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr, | |||
604 | 612 | ||
605 | if (!((mode_extension & 0x1) && gr1ch)) { | 613 | if (!((mode_extension & I_STEREO) && gr1ch)) { |
606 | if (scalefac_compress < 400) { | 614 | if (scalefac_compress < 400) { |
@@ -645,3 +653,3 @@ unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr, | |||
645 | } | 653 | } |
646 | else { /* (mode_extension & 0x1) && gr1ch (i.e. ch == 1) */ | 654 | else { /* (mode_extension & I_STEREO) && gr1ch (i.e. ch == 1) */ |
647 | scalefac_compress >>= 1; | 655 | scalefac_compress >>= 1; |
@@ -777,2 +785,24 @@ unsigned int III_scalefactors(struct mad_bitptr *ptr, struct channel *channel, | |||
777 | /* | 785 | /* |
786 | * The Layer III formula for requantization and scaling is defined by | ||
787 | * section 2.4.3.4.7.1 of ISO/IEC 11172-3, as follows: | ||
788 | * | ||
789 | * long blocks: | ||
790 | * xr[i] = sign(is[i]) * abs(is[i])^(4/3) * | ||
791 | * 2^((1/4) * (global_gain - 210)) * | ||
792 | * 2^-(scalefac_multiplier * | ||
793 | * (scalefac_l[sfb] + preflag * pretab[sfb])) | ||
794 | * | ||
795 | * short blocks: | ||
796 | * xr[i] = sign(is[i]) * abs(is[i])^(4/3) * | ||
797 | * 2^((1/4) * (global_gain - 210 - 8 * subblock_gain[w])) * | ||
798 | * 2^-(scalefac_multiplier * scalefac_s[sfb][w]) | ||
799 | * | ||
800 | * where: | ||
801 | * scalefac_multiplier = (scalefac_scale + 1) / 2 | ||
802 | * | ||
803 | * The routines III_exponents() and III_requantize() facilitate this | ||
804 | * calculation. | ||
805 | */ | ||
806 | |||
807 | /* | ||
778 | * NAME:III_exponents() | 808 | * NAME:III_exponents() |
@@ -858,19 +888,3 @@ mad_fixed_t III_requantize(unsigned int value, signed int exp) | |||
858 | 888 | ||
859 | /* | 889 | frac = exp % 4; /* assumes sign(frac) == sign(exp) */ |
860 | * long blocks: | ||
861 | * xr[i] = sign(is[i]) * abs(is[i])^(4/3) * | ||
862 | * 2^((1/4) * (global_gain - 210)) * | ||
863 | * 2^-(scalefac_multiplier * | ||
864 | * (scalefac_l[sfb] + preflag * pretab[sfb])) | ||
865 | * | ||
866 | * short blocks: | ||
867 | * xr[i] = sign(is[i]) * abs(is[i])^(4/3) * | ||
868 | * 2^((1/4) * (global_gain - 210 - 8 * subblock_gain[w])) * | ||
869 | * 2^-(scalefac_multiplier * scalefac_s[sfb][w]) | ||
870 | * | ||
871 | * where: | ||
872 | * scalefac_multiplier = (scalefac_scale + 1) / 2 | ||
873 | */ | ||
874 | |||
875 | frac = exp % 4; | ||
876 | exp /= 4; | 890 | exp /= 4; |
@@ -886,5 +900,7 @@ mad_fixed_t III_requantize(unsigned int value, signed int exp) | |||
886 | } | 900 | } |
887 | else | 901 | else { |
902 | requantized += 1L << (-exp - 1); | ||
888 | requantized >>= -exp; | 903 | requantized >>= -exp; |
889 | } | 904 | } |
905 | } | ||
890 | else { | 906 | else { |
@@ -1253,3 +1269,3 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xr[576], | |||
1253 | 1269 | ||
1254 | return 0; | 1270 | return MAD_ERROR_NONE; |
1255 | } | 1271 | } |
@@ -1268,3 +1284,3 @@ void III_reorder(mad_fixed_t xr[576], struct channel const *channel, | |||
1268 | mad_fixed_t tmp[32][3][6]; | 1284 | mad_fixed_t tmp[32][3][6]; |
1269 | unsigned int sb, l, sfbi, f, w, sbw[3], sw[3]; | 1285 | unsigned int sb, l, f, w, sbw[3], sw[3]; |
1270 | 1286 | ||
@@ -1272,6 +1288,10 @@ void III_reorder(mad_fixed_t xr[576], struct channel const *channel, | |||
1272 | 1288 | ||
1273 | if (channel->flags & mixed_block_flag) | 1289 | sb = 0; |
1274 | sb = 2, sfbi = 3 * 3; | 1290 | if (channel->flags & mixed_block_flag) { |
1275 | else | 1291 | sb = 2; |
1276 | sb = 0, sfbi = 0; | 1292 | |
1293 | l = 0; | ||
1294 | while (l < 36) | ||
1295 | l += *sfbwidth++; | ||
1296 | } | ||
1277 | 1297 | ||
@@ -1282,3 +1302,3 @@ void III_reorder(mad_fixed_t xr[576], struct channel const *channel, | |||
1282 | 1302 | ||
1283 | f = sfbwidth[sfbi]; | 1303 | f = *sfbwidth++; |
1284 | w = 0; | 1304 | w = 0; |
@@ -1286,2 +1306,7 @@ void III_reorder(mad_fixed_t xr[576], struct channel const *channel, | |||
1286 | for (l = 18 * sb; l < 576; ++l) { | 1306 | for (l = 18 * sb; l < 576; ++l) { |
1307 | if (f-- == 0) { | ||
1308 | f = *sfbwidth++ - 1; | ||
1309 | w = (w + 1) % 3; | ||
1310 | } | ||
1311 | |||
1287 | tmp[sbw[w]][w][sw[w]++] = xr[l]; | 1312 | tmp[sbw[w]][w][sw[w]++] = xr[l]; |
@@ -1292,9 +1317,2 @@ void III_reorder(mad_fixed_t xr[576], struct channel const *channel, | |||
1292 | } | 1317 | } |
1293 | |||
1294 | if (--f == 0) { | ||
1295 | if (++w == 3) | ||
1296 | w = 0; | ||
1297 | |||
1298 | f = sfbwidth[++sfbi]; | ||
1299 | } | ||
1300 | } | 1318 | } |
@@ -1317,7 +1335,2 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1317 | 1335 | ||
1318 | enum { | ||
1319 | i_stereo = 0x1, | ||
1320 | ms_stereo = 0x2 | ||
1321 | }; | ||
1322 | |||
1323 | if (granule->ch[0].block_type != | 1336 | if (granule->ch[0].block_type != |
@@ -1333,3 +1346,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1333 | 1346 | ||
1334 | if (header->mode_extension & i_stereo) { | 1347 | if (header->mode_extension & I_STEREO) { |
1335 | struct channel const *right_ch = &granule->ch[1]; | 1348 | struct channel const *right_ch = &granule->ch[1]; |
@@ -1389,3 +1402,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1389 | for (i = 0; i < lower; ++i) | 1402 | for (i = 0; i < lower; ++i) |
1390 | modes[i] = header->mode_extension & ~i_stereo; | 1403 | modes[i] = header->mode_extension & ~I_STEREO; |
1391 | 1404 | ||
@@ -1396,3 +1409,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1396 | if (i < bound[w]) | 1409 | if (i < bound[w]) |
1397 | modes[i] = header->mode_extension & ~i_stereo; | 1410 | modes[i] = header->mode_extension & ~I_STEREO; |
1398 | 1411 | ||
@@ -1419,3 +1432,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1419 | for (i = 0; i < bound; ++i) | 1432 | for (i = 0; i < bound; ++i) |
1420 | modes[i] = header->mode_extension & ~i_stereo; | 1433 | modes[i] = header->mode_extension & ~I_STEREO; |
1421 | } | 1434 | } |
@@ -1434,3 +1447,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1434 | 1447 | ||
1435 | if (!(modes[sfbi] & i_stereo)) | 1448 | if (!(modes[sfbi] & I_STEREO)) |
1436 | continue; | 1449 | continue; |
@@ -1438,3 +1451,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1438 | if (illegal_pos[sfbi]) { | 1451 | if (illegal_pos[sfbi]) { |
1439 | modes[sfbi] &= ~i_stereo; | 1452 | modes[sfbi] &= ~I_STEREO; |
1440 | continue; | 1453 | continue; |
@@ -1470,3 +1483,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1470 | 1483 | ||
1471 | if (!(modes[sfbi] & i_stereo)) | 1484 | if (!(modes[sfbi] & I_STEREO)) |
1472 | continue; | 1485 | continue; |
@@ -1476,3 +1489,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1476 | if (is_pos >= 7) { /* illegal intensity position */ | 1489 | if (is_pos >= 7) { /* illegal intensity position */ |
1477 | modes[sfbi] &= ~i_stereo; | 1490 | modes[sfbi] &= ~I_STEREO; |
1478 | continue; | 1491 | continue; |
@@ -1494,3 +1507,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1494 | 1507 | ||
1495 | if (header->mode_extension & ms_stereo) { | 1508 | if (header->mode_extension & MS_STEREO) { |
1496 | register mad_fixed_t invsqrt2; | 1509 | register mad_fixed_t invsqrt2; |
@@ -1504,3 +1517,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1504 | 1517 | ||
1505 | if (modes[sfbi] != ms_stereo) | 1518 | if (modes[sfbi] != MS_STEREO) |
1506 | continue; | 1519 | continue; |
@@ -1519,3 +1532,3 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576], | |||
1519 | 1532 | ||
1520 | return 0; | 1533 | return MAD_ERROR_NONE; |
1521 | } | 1534 | } |
@@ -1535,3 +1548,3 @@ void III_aliasreduce(mad_fixed_t xr[576], int lines) | |||
1535 | for (i = 0; i < 8; ++i) { | 1548 | for (i = 0; i < 8; ++i) { |
1536 | register mad_fixed_t *aptr, *bptr, a, b; | 1549 | register mad_fixed_t a, b; |
1537 | register mad_fixed64hi_t hi; | 1550 | register mad_fixed64hi_t hi; |
@@ -1539,7 +1552,4 @@ void III_aliasreduce(mad_fixed_t xr[576], int lines) | |||
1539 | 1552 | ||
1540 | aptr = &xr[-1 - i]; | 1553 | a = xr[-1 - i]; |
1541 | bptr = &xr[ i]; | 1554 | b = xr[ i]; |
1542 | |||
1543 | a = *aptr; | ||
1544 | b = *bptr; | ||
1545 | 1555 | ||
@@ -1551,3 +1561,3 @@ void III_aliasreduce(mad_fixed_t xr[576], int lines) | |||
1551 | 1561 | ||
1552 | *aptr = MAD_F_MLZ(hi, lo); | 1562 | xr[-1 - i] = MAD_F_MLZ(hi, lo); |
1553 | 1563 | ||
@@ -1556,3 +1566,3 @@ void III_aliasreduce(mad_fixed_t xr[576], int lines) | |||
1556 | 1566 | ||
1557 | *bptr = MAD_F_MLZ(hi, lo); | 1567 | xr[ i] = MAD_F_MLZ(hi, lo); |
1558 | # if defined(ASO_ZEROCHECK) | 1568 | # if defined(ASO_ZEROCHECK) |
@@ -2143,3 +2153,3 @@ void III_freqinver(mad_fixed_t sample[18][32], unsigned int sb) | |||
2143 | static | 2153 | static |
2144 | int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | 2154 | enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, |
2145 | struct sideinfo *si, unsigned int nch) | 2155 | struct sideinfo *si, unsigned int nch) |
@@ -2171,3 +2181,3 @@ int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | |||
2171 | struct granule *granule = &si->gr[gr]; | 2181 | struct granule *granule = &si->gr[gr]; |
2172 | unsigned char const *sfbwidth = 0; | 2182 | unsigned char const *sfbwidth[2]; |
2173 | mad_fixed_t xr[2][576]; | 2183 | mad_fixed_t xr[2][576]; |
@@ -2180,5 +2190,5 @@ int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | |||
2180 | 2190 | ||
2181 | sfbwidth = sfbwidth_table[sfreqi].l; | 2191 | sfbwidth[ch] = sfbwidth_table[sfreqi].l; |
2182 | if (channel->block_type == 2) { | 2192 | if (channel->block_type == 2) { |
2183 | sfbwidth = (channel->flags & mixed_block_flag) ? | 2193 | sfbwidth[ch] = (channel->flags & mixed_block_flag) ? |
2184 | sfbwidth_table[sfreqi].m : sfbwidth_table[sfreqi].s; | 2194 | sfbwidth_table[sfreqi].m : sfbwidth_table[sfreqi].s; |
@@ -2196,3 +2206,3 @@ int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | |||
2196 | 2206 | ||
2197 | error = III_huffdecode(ptr, xr[ch], channel, sfbwidth, part2_length); | 2207 | error = III_huffdecode(ptr, xr[ch], channel, sfbwidth[ch], part2_length); |
2198 | if (error) | 2208 | if (error) |
@@ -2204,3 +2214,3 @@ int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | |||
2204 | if (header->mode == MAD_MODE_JOINT_STEREO && header->mode_extension) { | 2214 | if (header->mode == MAD_MODE_JOINT_STEREO && header->mode_extension) { |
2205 | error = III_stereo(xr, granule, header, sfbwidth); | 2215 | error = III_stereo(xr, granule, header, sfbwidth[0]); |
2206 | if (error) | 2216 | if (error) |
@@ -2218,3 +2228,3 @@ int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | |||
2218 | if (channel->block_type == 2) { | 2228 | if (channel->block_type == 2) { |
2219 | III_reorder(xr[ch], channel, sfbwidth_table[sfreqi].s); | 2229 | III_reorder(xr[ch], channel, sfbwidth[ch]); |
2220 | 2230 | ||
@@ -2302,3 +2312,3 @@ int III_decode(struct mad_bitptr *ptr, struct mad_frame *frame, | |||
2302 | 2312 | ||
2303 | return 0; | 2313 | return MAD_ERROR_NONE; |
2304 | } | 2314 | } |
diff --git a/core/multimedia/opieplayer/libmad/layer3.h b/core/multimedia/opieplayer/libmad/layer3.h index 1fd83e2..c1a5c69 100644 --- a/core/multimedia/opieplayer/libmad/layer3.h +++ b/core/multimedia/opieplayer/libmad/layer3.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/libmad_global.h b/core/multimedia/opieplayer/libmad/libmad_global.h index f2a2a71..2c9c713 100644 --- a/core/multimedia/opieplayer/libmad/libmad_global.h +++ b/core/multimedia/opieplayer/libmad/libmad_global.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -44,2 +44,15 @@ | |||
44 | 44 | ||
45 | # if defined(HAVE_UNISTD_H) && defined(HAVE_WAITPID) && \ | ||
46 | defined(HAVE_FCNTL) && defined(HAVE_PIPE) && defined(HAVE_FORK) | ||
47 | # define USE_ASYNC | ||
48 | # endif | ||
49 | |||
50 | # if !defined(HAVE_ASSERT_H) | ||
51 | # if defined(NDEBUG) | ||
52 | # define assert(x)/* nothing */ | ||
53 | # else | ||
54 | # define assert(x)do { if (!(x)) abort(); } while (0) | ||
55 | # endif | ||
56 | # endif | ||
57 | |||
45 | # endif | 58 | # endif |
diff --git a/core/multimedia/opieplayer/libmad/libmad_version.h b/core/multimedia/opieplayer/libmad/libmad_version.h index f8ee1fa..9e684a7 100644 --- a/core/multimedia/opieplayer/libmad/libmad_version.h +++ b/core/multimedia/opieplayer/libmad/libmad_version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -25,4 +25,4 @@ | |||
25 | # define MAD_VERSION_MAJOR0 | 25 | # define MAD_VERSION_MAJOR0 |
26 | # define MAD_VERSION_MINOR13 | 26 | # define MAD_VERSION_MINOR14 |
27 | # define MAD_VERSION_PATCH0 | 27 | # define MAD_VERSION_PATCH2 |
28 | # define MAD_VERSION_EXTRA" (beta)" | 28 | # define MAD_VERSION_EXTRA" (beta)" |
diff --git a/core/multimedia/opieplayer/libmad/opie-libmadplugin.control b/core/multimedia/opieplayer/libmad/opie-libmadplugin.control index 941047f..42ea6c7 100644 --- a/core/multimedia/opieplayer/libmad/opie-libmadplugin.control +++ b/core/multimedia/opieplayer/libmad/opie-libmadplugin.control | |||
@@ -3,3 +3,3 @@ Priority: optional | |||
3 | Section: opie/plugins | 3 | Section: opie/plugins |
4 | Maintainer: John Ryland <jryland@trolltech.com> | 4 | Maintainer: Maximilian Reiss <max.reiss@gmx.de> |
5 | Architecture: arm | 5 | Architecture: arm |
diff --git a/core/multimedia/opieplayer/libmad/qc_table.dat b/core/multimedia/opieplayer/libmad/qc_table.dat index 92b7f38..5d9ca96 100644 --- a/core/multimedia/opieplayer/libmad/qc_table.dat +++ b/core/multimedia/opieplayer/libmad/qc_table.dat | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/rq_table.dat b/core/multimedia/opieplayer/libmad/rq_table.dat index b6d1634..803cf04 100644 --- a/core/multimedia/opieplayer/libmad/rq_table.dat +++ b/core/multimedia/opieplayer/libmad/rq_table.dat | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/sf_table.dat b/core/multimedia/opieplayer/libmad/sf_table.dat index 18e6202..bc368af 100644 --- a/core/multimedia/opieplayer/libmad/sf_table.dat +++ b/core/multimedia/opieplayer/libmad/sf_table.dat | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
diff --git a/core/multimedia/opieplayer/libmad/stream.c b/core/multimedia/opieplayer/libmad/stream.c index dea7b8e..4374de7 100644 --- a/core/multimedia/opieplayer/libmad/stream.c +++ b/core/multimedia/opieplayer/libmad/stream.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -56,3 +56,3 @@ void mad_stream_init(struct mad_stream *stream) | |||
56 | stream->options = 0; | 56 | stream->options = 0; |
57 | stream->error = 0; | 57 | stream->error = MAD_ERROR_NONE; |
58 | } | 58 | } |
@@ -123 +123,38 @@ int mad_stream_sync(struct mad_stream *stream) | |||
123 | } | 123 | } |
124 | |||
125 | /* | ||
126 | * NAME:stream->errorstr() | ||
127 | * DESCRIPTION:return a string description of the current error condition | ||
128 | */ | ||
129 | char const *mad_stream_errorstr(struct mad_stream const *stream) | ||
130 | { | ||
131 | switch (stream->error) { | ||
132 | case MAD_ERROR_NONE: return "no error"; | ||
133 | |||
134 | case MAD_ERROR_BUFLEN: return "input buffer too small (or EOF)"; | ||
135 | case MAD_ERROR_BUFPTR: return "invalid (null) buffer pointer"; | ||
136 | |||
137 | case MAD_ERROR_NOMEM: return "not enough memory"; | ||
138 | |||
139 | case MAD_ERROR_LOSTSYNC: return "lost synchronization"; | ||
140 | case MAD_ERROR_BADLAYER: return "reserved header layer value"; | ||
141 | case MAD_ERROR_BADBITRATE: return "forbidden bitrate value"; | ||
142 | case MAD_ERROR_BADSAMPLERATE: return "reserved sample frequency value"; | ||
143 | case MAD_ERROR_BADEMPHASIS: return "reserved emphasis value"; | ||
144 | |||
145 | case MAD_ERROR_BADCRC: return "CRC check failed"; | ||
146 | case MAD_ERROR_BADBITALLOC: return "forbidden bit allocation value"; | ||
147 | case MAD_ERROR_BADSCALEFACTOR: return "bad scalefactor index"; | ||
148 | case MAD_ERROR_BADFRAMELEN: return "bad frame length"; | ||
149 | case MAD_ERROR_BADBIGVALUES: return "bad big_values count"; | ||
150 | case MAD_ERROR_BADBLOCKTYPE: return "reserved block_type"; | ||
151 | case MAD_ERROR_BADSCFSI: return "bad scalefactor selection info"; | ||
152 | case MAD_ERROR_BADDATAPTR: return "bad main_data_begin pointer"; | ||
153 | case MAD_ERROR_BADPART3LEN: return "bad audio data length"; | ||
154 | case MAD_ERROR_BADHUFFTABLE: return "bad Huffman table select"; | ||
155 | case MAD_ERROR_BADHUFFDATA: return "Huffman data overrun"; | ||
156 | case MAD_ERROR_BADSTEREO: return "incompatible block_type for JS"; | ||
157 | } | ||
158 | |||
159 | return 0; | ||
160 | } | ||
diff --git a/core/multimedia/opieplayer/libmad/stream.h b/core/multimedia/opieplayer/libmad/stream.h index cf3280e..08e6dc5 100644 --- a/core/multimedia/opieplayer/libmad/stream.h +++ b/core/multimedia/opieplayer/libmad/stream.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -30,2 +30,4 @@ | |||
30 | enum mad_error { | 30 | enum mad_error { |
31 | MAD_ERROR_NONE = 0x0000,/* no error */ | ||
32 | |||
31 | MAD_ERROR_BUFLEN = 0x0001,/* input buffer too small (or EOF) */ | 33 | MAD_ERROR_BUFLEN = 0x0001,/* input buffer too small (or EOF) */ |
@@ -82,3 +84,3 @@ enum { | |||
82 | MAD_OPTION_IGNORECRC = 0x0001,/* ignore CRC errors */ | 84 | MAD_OPTION_IGNORECRC = 0x0001,/* ignore CRC errors */ |
83 | MAD_OPTION_HALFSAMPLERATE = 0x0002,/* generate PCM at 1/2 sample rate */ | 85 | MAD_OPTION_HALFSAMPLERATE = 0x0002/* generate PCM at 1/2 sample rate */ |
84 | # if 0 /* not yet implemented */ | 86 | # if 0 /* not yet implemented */ |
@@ -86,3 +88,3 @@ enum { | |||
86 | MAD_OPTION_RIGHTCHANNEL = 0x0020,/* decode right channel only */ | 88 | MAD_OPTION_RIGHTCHANNEL = 0x0020,/* decode right channel only */ |
87 | MAD_OPTION_SINGLECHANNEL = 0x0030,/* combine channels */ | 89 | MAD_OPTION_SINGLECHANNEL = 0x0030/* combine channels */ |
88 | # endif | 90 | # endif |
@@ -93,3 +95,4 @@ void mad_stream_finish(struct mad_stream *); | |||
93 | 95 | ||
94 | # define mad_stream_options(stream, opts) ((stream)->options = (opts)) | 96 | # define mad_stream_options(stream, opts) \ |
97 | ((void) ((stream)->options = (opts))) | ||
95 | 98 | ||
@@ -101,2 +104,4 @@ int mad_stream_sync(struct mad_stream *); | |||
101 | 104 | ||
105 | char const *mad_stream_errorstr(struct mad_stream const *); | ||
106 | |||
102 | # endif | 107 | # endif |
diff --git a/core/multimedia/opieplayer/libmad/synth.c b/core/multimedia/opieplayer/libmad/synth.c index e1914c9..cf3c1d5 100644 --- a/core/multimedia/opieplayer/libmad/synth.c +++ b/core/multimedia/opieplayer/libmad/synth.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -152,69 +152,65 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
152 | # if defined(OPT_DCTO) | 152 | # if defined(OPT_DCTO) |
153 | enum { | 153 | # define costab1MAD_F(0x7fd8878e) |
154 | costab1 = MAD_F(0x7fd8878e), | 154 | # define costab2MAD_F(0x7f62368f) |
155 | costab2 = MAD_F(0x7f62368f), | 155 | # define costab3MAD_F(0x7e9d55fc) |
156 | costab3 = MAD_F(0x7e9d55fc), | 156 | # define costab4MAD_F(0x7d8a5f40) |
157 | costab4 = MAD_F(0x7d8a5f40), | 157 | # define costab5MAD_F(0x7c29fbee) |
158 | costab5 = MAD_F(0x7c29fbee), | 158 | # define costab6MAD_F(0x7a7d055b) |
159 | costab6 = MAD_F(0x7a7d055b), | 159 | # define costab7MAD_F(0x78848414) |
160 | costab7 = MAD_F(0x78848414), | 160 | # define costab8MAD_F(0x7641af3d) |
161 | costab8 = MAD_F(0x7641af3d), | 161 | # define costab9MAD_F(0x73b5ebd1) |
162 | costab9 = MAD_F(0x73b5ebd1), | 162 | # define costab10MAD_F(0x70e2cbc6) |
163 | costab10 = MAD_F(0x70e2cbc6), | 163 | # define costab11MAD_F(0x6dca0d14) |
164 | costab11 = MAD_F(0x6dca0d14), | 164 | # define costab12MAD_F(0x6a6d98a4) |
165 | costab12 = MAD_F(0x6a6d98a4), | 165 | # define costab13MAD_F(0x66cf8120) |
166 | costab13 = MAD_F(0x66cf8120), | 166 | # define costab14MAD_F(0x62f201ac) |
167 | costab14 = MAD_F(0x62f201ac), | 167 | # define costab15MAD_F(0x5ed77c8a) |
168 | costab15 = MAD_F(0x5ed77c8a), | 168 | # define costab16MAD_F(0x5a82799a) |
169 | costab16 = MAD_F(0x5a82799a), | 169 | # define costab17MAD_F(0x55f5a4d2) |
170 | costab17 = MAD_F(0x55f5a4d2), | 170 | # define costab18MAD_F(0x5133cc94) |
171 | costab18 = MAD_F(0x5133cc94), | 171 | # define costab19MAD_F(0x4c3fdff4) |
172 | costab19 = MAD_F(0x4c3fdff4), | 172 | # define costab20MAD_F(0x471cece7) |
173 | costab20 = MAD_F(0x471cece7), | 173 | # define costab21MAD_F(0x41ce1e65) |
174 | costab21 = MAD_F(0x41ce1e65), | 174 | # define costab22MAD_F(0x3c56ba70) |
175 | costab22 = MAD_F(0x3c56ba70), | 175 | # define costab23MAD_F(0x36ba2014) |
176 | costab23 = MAD_F(0x36ba2014), | 176 | # define costab24MAD_F(0x30fbc54d) |
177 | costab24 = MAD_F(0x30fbc54d), | 177 | # define costab25MAD_F(0x2b1f34eb) |
178 | costab25 = MAD_F(0x2b1f34eb), | 178 | # define costab26MAD_F(0x25280c5e) |
179 | costab26 = MAD_F(0x25280c5e), | 179 | # define costab27MAD_F(0x1f19f97b) |
180 | costab27 = MAD_F(0x1f19f97b), | 180 | # define costab28MAD_F(0x18f8b83c) |
181 | costab28 = MAD_F(0x18f8b83c), | 181 | # define costab29MAD_F(0x12c8106f) |
182 | costab29 = MAD_F(0x12c8106f), | 182 | # define costab30MAD_F(0x0c8bd35e) |
183 | costab30 = MAD_F(0x0c8bd35e), | 183 | # define costab31MAD_F(0x0647d97c) |
184 | costab31 = MAD_F(0x0647d97c) | ||
185 | }; | ||
186 | # else | 184 | # else |
187 | enum { | 185 | # define costab1MAD_F(0x0ffb10f2) /* 0.998795456 */ |
188 | costab1 = MAD_F(0x0ffb10f2), /* 0.998795456 */ | 186 | # define costab2MAD_F(0x0fec46d2) /* 0.995184727 */ |
189 | costab2 = MAD_F(0x0fec46d2), /* 0.995184727 */ | 187 | # define costab3MAD_F(0x0fd3aac0) /* 0.989176510 */ |
190 | costab3 = MAD_F(0x0fd3aac0), /* 0.989176510 */ | 188 | # define costab4MAD_F(0x0fb14be8) /* 0.980785280 */ |
191 | costab4 = MAD_F(0x0fb14be8), /* 0.980785280 */ | 189 | # define costab5MAD_F(0x0f853f7e) /* 0.970031253 */ |
192 | costab5 = MAD_F(0x0f853f7e), /* 0.970031253 */ | 190 | # define costab6MAD_F(0x0f4fa0ab) /* 0.956940336 */ |
193 | costab6 = MAD_F(0x0f4fa0ab), /* 0.956940336 */ | 191 | # define costab7MAD_F(0x0f109082) /* 0.941544065 */ |
194 | costab7 = MAD_F(0x0f109082), /* 0.941544065 */ | 192 | # define costab8MAD_F(0x0ec835e8) /* 0.923879533 */ |
195 | costab8 = MAD_F(0x0ec835e8), /* 0.923879533 */ | 193 | # define costab9MAD_F(0x0e76bd7a) /* 0.903989293 */ |
196 | costab9 = MAD_F(0x0e76bd7a), /* 0.903989293 */ | 194 | # define costab10MAD_F(0x0e1c5979) /* 0.881921264 */ |
197 | costab10 = MAD_F(0x0e1c5979), /* 0.881921264 */ | 195 | # define costab11MAD_F(0x0db941a3) /* 0.857728610 */ |
198 | costab11 = MAD_F(0x0db941a3), /* 0.857728610 */ | 196 | # define costab12MAD_F(0x0d4db315) /* 0.831469612 */ |
199 | costab12 = MAD_F(0x0d4db315), /* 0.831469612 */ | 197 | # define costab13MAD_F(0x0cd9f024) /* 0.803207531 */ |
200 | costab13 = MAD_F(0x0cd9f024), /* 0.803207531 */ | 198 | # define costab14MAD_F(0x0c5e4036) /* 0.773010453 */ |
201 | costab14 = MAD_F(0x0c5e4036), /* 0.773010453 */ | 199 | # define costab15MAD_F(0x0bdaef91) /* 0.740951125 */ |
202 | costab15 = MAD_F(0x0bdaef91), /* 0.740951125 */ | 200 | # define costab16MAD_F(0x0b504f33) /* 0.707106781 */ |
203 | costab16 = MAD_F(0x0b504f33), /* 0.707106781 */ | 201 | # define costab17MAD_F(0x0abeb49a) /* 0.671558955 */ |
204 | costab17 = MAD_F(0x0abeb49a), /* 0.671558955 */ | 202 | # define costab18MAD_F(0x0a267993) /* 0.634393284 */ |
205 | costab18 = MAD_F(0x0a267993), /* 0.634393284 */ | 203 | # define costab19MAD_F(0x0987fbfe) /* 0.595699304 */ |
206 | costab19 = MAD_F(0x0987fbfe), /* 0.595699304 */ | 204 | # define costab20MAD_F(0x08e39d9d) /* 0.555570233 */ |
207 | costab20 = MAD_F(0x08e39d9d), /* 0.555570233 */ | 205 | # define costab21MAD_F(0x0839c3cd) /* 0.514102744 */ |
208 | costab21 = MAD_F(0x0839c3cd), /* 0.514102744 */ | 206 | # define costab22MAD_F(0x078ad74e) /* 0.471396737 */ |
209 | costab22 = MAD_F(0x078ad74e), /* 0.471396737 */ | 207 | # define costab23MAD_F(0x06d74402) /* 0.427555093 */ |
210 | costab23 = MAD_F(0x06d74402), /* 0.427555093 */ | 208 | # define costab24MAD_F(0x061f78aa) /* 0.382683432 */ |
211 | costab24 = MAD_F(0x061f78aa), /* 0.382683432 */ | 209 | # define costab25MAD_F(0x0563e69d) /* 0.336889853 */ |
212 | costab25 = MAD_F(0x0563e69d), /* 0.336889853 */ | 210 | # define costab26MAD_F(0x04a5018c) /* 0.290284677 */ |
213 | costab26 = MAD_F(0x04a5018c), /* 0.290284677 */ | 211 | # define costab27MAD_F(0x03e33f2f) /* 0.242980180 */ |
214 | costab27 = MAD_F(0x03e33f2f), /* 0.242980180 */ | 212 | # define costab28MAD_F(0x031f1708) /* 0.195090322 */ |
215 | costab28 = MAD_F(0x031f1708), /* 0.195090322 */ | 213 | # define costab29MAD_F(0x0259020e) /* 0.146730474 */ |
216 | costab29 = MAD_F(0x0259020e), /* 0.146730474 */ | 214 | # define costab30MAD_F(0x01917a6c) /* 0.098017140 */ |
217 | costab30 = MAD_F(0x01917a6c), /* 0.098017140 */ | 215 | # define costab31MAD_F(0x00c8fb30) /* 0.049067674 */ |
218 | costab31 = MAD_F(0x00c8fb30) /* 0.049067674 */ | ||
219 | }; | ||
220 | # endif | 216 | # endif |
@@ -329,3 +325,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
329 | 325 | ||
330 | t49 = (t67 << 1) - t32; | 326 | t49 = (t67 * 2) - t32; |
331 | 327 | ||
@@ -345,3 +341,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
345 | 341 | ||
346 | t68 = (t98 << 1) - t49; | 342 | t68 = (t98 * 2) - t49; |
347 | 343 | ||
@@ -354,3 +350,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
354 | 350 | ||
355 | t82 = (t104 << 1) - t58; | 351 | t82 = (t104 * 2) - t58; |
356 | 352 | ||
@@ -363,5 +359,5 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
363 | 359 | ||
364 | t87 = (t110 << 1) - t67; | 360 | t87 = (t110 * 2) - t67; |
365 | 361 | ||
366 | t77 = (t87 << 1) - t68; | 362 | t77 = (t87 * 2) - t68; |
367 | 363 | ||
@@ -375,3 +371,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
375 | /* 24 */ lo[ 8][slot] = | 371 | /* 24 */ lo[ 8][slot] = |
376 | SHIFT((MUL(t141 - t142, costab16) << 1) - t143); | 372 | SHIFT((MUL(t141 - t142, costab16) * 2) - t143); |
377 | 373 | ||
@@ -381,3 +377,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
381 | 377 | ||
382 | t88 = (t146 << 1) - t77; | 378 | t88 = (t146 * 2) - t77; |
383 | 379 | ||
@@ -389,3 +385,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
389 | 385 | ||
390 | t105 = (t150 << 1) - t82; | 386 | t105 = (t150 * 2) - t82; |
391 | 387 | ||
@@ -397,5 +393,5 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
397 | 393 | ||
398 | t111 = (t154 << 1) - t87; | 394 | t111 = (t154 * 2) - t87; |
399 | 395 | ||
400 | t99 = (t111 << 1) - t88; | 396 | t99 = (t111 * 2) - t88; |
401 | 397 | ||
@@ -407,3 +403,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
407 | 403 | ||
408 | t127 = (t159 << 1) - t93; | 404 | t127 = (t159 * 2) - t93; |
409 | 405 | ||
@@ -411,3 +407,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
411 | 407 | ||
412 | t160 = (MUL(t125 - t126, costab16) << 1) - t127; | 408 | t160 = (MUL(t125 - t126, costab16) * 2) - t127; |
413 | 409 | ||
@@ -415,3 +411,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
415 | /* 28 */ lo[12][slot] = | 411 | /* 28 */ lo[12][slot] = |
416 | SHIFT((((MUL(t157 - t158, costab16) << 1) - t159) << 1) - t160); | 412 | SHIFT((((MUL(t157 - t158, costab16) * 2) - t159) * 2) - t160); |
417 | 413 | ||
@@ -421,5 +417,5 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
421 | 417 | ||
422 | t130 = (t163 << 1) - t98; | 418 | t130 = (t163 * 2) - t98; |
423 | 419 | ||
424 | t112 = (t130 << 1) - t99; | 420 | t112 = (t130 * 2) - t99; |
425 | 421 | ||
@@ -427,3 +423,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
427 | 423 | ||
428 | t164 = (MUL(t128 - t129, costab16) << 1) - t130; | 424 | t164 = (MUL(t128 - t129, costab16) * 2) - t130; |
429 | 425 | ||
@@ -433,5 +429,5 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
433 | 429 | ||
434 | t134 = (t168 << 1) - t104; | 430 | t134 = (t168 * 2) - t104; |
435 | 431 | ||
436 | t120 = (t134 << 1) - t105; | 432 | t120 = (t134 * 2) - t105; |
437 | 433 | ||
@@ -439,3 +435,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
439 | 435 | ||
440 | t135 = (MUL(t118 - t119, costab16) << 1) - t120; | 436 | t135 = (MUL(t118 - t119, costab16) * 2) - t120; |
441 | 437 | ||
@@ -443,5 +439,5 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
443 | 439 | ||
444 | t169 = (MUL(t132 - t133, costab16) << 1) - t134; | 440 | t169 = (MUL(t132 - t133, costab16) * 2) - t134; |
445 | 441 | ||
446 | t151 = (t169 << 1) - t135; | 442 | t151 = (t169 * 2) - t135; |
447 | 443 | ||
@@ -449,3 +445,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
449 | 445 | ||
450 | t170 = (((MUL(t148 - t149, costab16) << 1) - t150) << 1) - t151; | 446 | t170 = (((MUL(t148 - t149, costab16) * 2) - t150) * 2) - t151; |
451 | 447 | ||
@@ -453,4 +449,4 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
453 | /* 30 */ lo[14][slot] = | 449 | /* 30 */ lo[14][slot] = |
454 | SHIFT((((((MUL(t166 - t167, costab16) << 1) - | 450 | SHIFT((((((MUL(t166 - t167, costab16) * 2) - |
455 | t168) << 1) - t169) << 1) - t170); | 451 | t168) * 2) - t169) * 2) - t170); |
456 | 452 | ||
@@ -460,9 +456,9 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
460 | 456 | ||
461 | t138 = (t173 << 1) - t110; | 457 | t138 = (t173 * 2) - t110; |
462 | 458 | ||
463 | t123 = (t138 << 1) - t111; | 459 | t123 = (t138 * 2) - t111; |
464 | 460 | ||
465 | t139 = (MUL(t121 - t122, costab16) << 1) - t123; | 461 | t139 = (MUL(t121 - t122, costab16) * 2) - t123; |
466 | 462 | ||
467 | t117 = (t123 << 1) - t112; | 463 | t117 = (t123 * 2) - t112; |
468 | 464 | ||
@@ -470,3 +466,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
470 | 466 | ||
471 | t124 = (MUL(t115 - t116, costab16) << 1) - t117; | 467 | t124 = (MUL(t115 - t116, costab16) * 2) - t117; |
472 | 468 | ||
@@ -474,3 +470,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
474 | 470 | ||
475 | t131 = (t139 << 1) - t124; | 471 | t131 = (t139 * 2) - t124; |
476 | 472 | ||
@@ -478,3 +474,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
478 | 474 | ||
479 | t140 = (t164 << 1) - t131; | 475 | t140 = (t164 * 2) - t131; |
480 | 476 | ||
@@ -482,7 +478,7 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
482 | 478 | ||
483 | t174 = (MUL(t136 - t137, costab16) << 1) - t138; | 479 | t174 = (MUL(t136 - t137, costab16) * 2) - t138; |
484 | 480 | ||
485 | t155 = (t174 << 1) - t139; | 481 | t155 = (t174 * 2) - t139; |
486 | 482 | ||
487 | t147 = (t155 << 1) - t140; | 483 | t147 = (t155 * 2) - t140; |
488 | 484 | ||
@@ -490,3 +486,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
490 | 486 | ||
491 | t156 = (((MUL(t144 - t145, costab16) << 1) - t146) << 1) - t147; | 487 | t156 = (((MUL(t144 - t145, costab16) * 2) - t146) * 2) - t147; |
492 | 488 | ||
@@ -494,5 +490,5 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
494 | 490 | ||
495 | t175 = (((MUL(t152 - t153, costab16) << 1) - t154) << 1) - t155; | 491 | t175 = (((MUL(t152 - t153, costab16) * 2) - t154) * 2) - t155; |
496 | 492 | ||
497 | t165 = (t175 << 1) - t156; | 493 | t165 = (t175 * 2) - t156; |
498 | 494 | ||
@@ -500,4 +496,4 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
500 | 496 | ||
501 | t176 = (((((MUL(t161 - t162, costab16) << 1) - | 497 | t176 = (((((MUL(t161 - t162, costab16) * 2) - |
502 | t163) << 1) - t164) << 1) - t165; | 498 | t163) * 2) - t164) * 2) - t165; |
503 | 499 | ||
@@ -505,4 +501,4 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
505 | /* 31 */ lo[15][slot] = | 501 | /* 31 */ lo[15][slot] = |
506 | SHIFT((((((((MUL(t171 - t172, costab16) << 1) - | 502 | SHIFT((((((((MUL(t171 - t172, costab16) * 2) - |
507 | t173) << 1) - t174) << 1) - t175) << 1) - t176); | 503 | t173) * 2) - t174) * 2) - t175) * 2) - t176); |
508 | 504 | ||
@@ -528,2 +524,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
528 | # define MLA(hi, lo, x, y)((lo) += (x) * (y)) | 524 | # define MLA(hi, lo, x, y)((lo) += (x) * (y)) |
525 | # define MLN(hi, lo) ((lo) = -(lo)) | ||
529 | # define MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo)) | 526 | # define MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo)) |
@@ -534,2 +531,3 @@ void dct32(mad_fixed_t const in[32], unsigned int slot, | |||
534 | # define MLA(hi, lo, x, y)MAD_F_MLA((hi), (lo), (x), (y)) | 531 | # define MLA(hi, lo, x, y)MAD_F_MLA((hi), (lo), (x), (y)) |
532 | # define MLN(hi, lo) MAD_F_MLN((hi), (lo)) | ||
535 | # define MLZ(hi, lo) MAD_F_MLZ((hi), (lo)) | 533 | # define MLZ(hi, lo) MAD_F_MLZ((hi), (lo)) |
@@ -591,4 +589,15 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
591 | 589 | ||
590 | ptr = *Dptr + po; | ||
591 | ML0(hi, lo, (*fx)[0], ptr[ 0]); | ||
592 | MLA(hi, lo, (*fx)[1], ptr[14]); | ||
593 | MLA(hi, lo, (*fx)[2], ptr[12]); | ||
594 | MLA(hi, lo, (*fx)[3], ptr[10]); | ||
595 | MLA(hi, lo, (*fx)[4], ptr[ 8]); | ||
596 | MLA(hi, lo, (*fx)[5], ptr[ 6]); | ||
597 | MLA(hi, lo, (*fx)[6], ptr[ 4]); | ||
598 | MLA(hi, lo, (*fx)[7], ptr[ 2]); | ||
599 | MLN(hi, lo); | ||
600 | |||
592 | ptr = *Dptr + pe; | 601 | ptr = *Dptr + pe; |
593 | ML0(hi, lo, (*fe)[0], ptr[ 0]); | 602 | MLA(hi, lo, (*fe)[0], ptr[ 0]); |
594 | MLA(hi, lo, (*fe)[1], ptr[14]); | 603 | MLA(hi, lo, (*fe)[1], ptr[14]); |
@@ -601,12 +610,2 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
601 | 610 | ||
602 | ptr = *Dptr + po; | ||
603 | MLA(hi, lo, (*fx)[0], -ptr[ 0]); | ||
604 | MLA(hi, lo, (*fx)[1], -ptr[14]); | ||
605 | MLA(hi, lo, (*fx)[2], -ptr[12]); | ||
606 | MLA(hi, lo, (*fx)[3], -ptr[10]); | ||
607 | MLA(hi, lo, (*fx)[4], -ptr[ 8]); | ||
608 | MLA(hi, lo, (*fx)[5], -ptr[ 6]); | ||
609 | MLA(hi, lo, (*fx)[6], -ptr[ 4]); | ||
610 | MLA(hi, lo, (*fx)[7], -ptr[ 2]); | ||
611 | |||
612 | *pcm1++ = SHIFT(MLZ(hi, lo)); | 611 | *pcm1++ = SHIFT(MLZ(hi, lo)); |
@@ -621,4 +620,15 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
621 | 620 | ||
621 | ptr = *Dptr + po; | ||
622 | ML0(hi, lo, (*fo)[0], ptr[ 0]); | ||
623 | MLA(hi, lo, (*fo)[1], ptr[14]); | ||
624 | MLA(hi, lo, (*fo)[2], ptr[12]); | ||
625 | MLA(hi, lo, (*fo)[3], ptr[10]); | ||
626 | MLA(hi, lo, (*fo)[4], ptr[ 8]); | ||
627 | MLA(hi, lo, (*fo)[5], ptr[ 6]); | ||
628 | MLA(hi, lo, (*fo)[6], ptr[ 4]); | ||
629 | MLA(hi, lo, (*fo)[7], ptr[ 2]); | ||
630 | MLN(hi, lo); | ||
631 | |||
622 | ptr = *Dptr + pe; | 632 | ptr = *Dptr + pe; |
623 | ML0(hi, lo, (*fe)[7], ptr[ 2]); | 633 | MLA(hi, lo, (*fe)[7], ptr[ 2]); |
624 | MLA(hi, lo, (*fe)[6], ptr[ 4]); | 634 | MLA(hi, lo, (*fe)[6], ptr[ 4]); |
@@ -631,26 +641,6 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
631 | 641 | ||
632 | ptr = *Dptr + po; | ||
633 | MLA(hi, lo, (*fo)[0], -ptr[ 0]); | ||
634 | MLA(hi, lo, (*fo)[1], -ptr[14]); | ||
635 | MLA(hi, lo, (*fo)[2], -ptr[12]); | ||
636 | MLA(hi, lo, (*fo)[3], -ptr[10]); | ||
637 | MLA(hi, lo, (*fo)[4], -ptr[ 8]); | ||
638 | MLA(hi, lo, (*fo)[5], -ptr[ 6]); | ||
639 | MLA(hi, lo, (*fo)[6], -ptr[ 4]); | ||
640 | MLA(hi, lo, (*fo)[7], -ptr[ 2]); | ||
641 | |||
642 | *pcm1++ = SHIFT(MLZ(hi, lo)); | 642 | *pcm1++ = SHIFT(MLZ(hi, lo)); |
643 | 643 | ||
644 | ptr = *Dptr - po; | ||
645 | ML0(hi, lo, (*fo)[7], ptr[31 - 2]); | ||
646 | MLA(hi, lo, (*fo)[6], ptr[31 - 4]); | ||
647 | MLA(hi, lo, (*fo)[5], ptr[31 - 6]); | ||
648 | MLA(hi, lo, (*fo)[4], ptr[31 - 8]); | ||
649 | MLA(hi, lo, (*fo)[3], ptr[31 - 10]); | ||
650 | MLA(hi, lo, (*fo)[2], ptr[31 - 12]); | ||
651 | MLA(hi, lo, (*fo)[1], ptr[31 - 14]); | ||
652 | MLA(hi, lo, (*fo)[0], ptr[31 - 16]); | ||
653 | |||
654 | ptr = *Dptr - pe; | 644 | ptr = *Dptr - pe; |
655 | MLA(hi, lo, (*fe)[0], ptr[31 - 16]); | 645 | ML0(hi, lo, (*fe)[0], ptr[31 - 16]); |
656 | MLA(hi, lo, (*fe)[1], ptr[31 - 14]); | 646 | MLA(hi, lo, (*fe)[1], ptr[31 - 14]); |
@@ -663,2 +653,12 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
663 | 653 | ||
654 | ptr = *Dptr - po; | ||
655 | MLA(hi, lo, (*fo)[7], ptr[31 - 2]); | ||
656 | MLA(hi, lo, (*fo)[6], ptr[31 - 4]); | ||
657 | MLA(hi, lo, (*fo)[5], ptr[31 - 6]); | ||
658 | MLA(hi, lo, (*fo)[4], ptr[31 - 8]); | ||
659 | MLA(hi, lo, (*fo)[3], ptr[31 - 10]); | ||
660 | MLA(hi, lo, (*fo)[2], ptr[31 - 12]); | ||
661 | MLA(hi, lo, (*fo)[1], ptr[31 - 14]); | ||
662 | MLA(hi, lo, (*fo)[0], ptr[31 - 16]); | ||
663 | |||
664 | *pcm2-- = SHIFT(MLZ(hi, lo)); | 664 | *pcm2-- = SHIFT(MLZ(hi, lo)); |
@@ -726,4 +726,15 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame, | |||
726 | 726 | ||
727 | ptr = *Dptr + po; | ||
728 | ML0(hi, lo, (*fx)[0], ptr[ 0]); | ||
729 | MLA(hi, lo, (*fx)[1], ptr[14]); | ||
730 | MLA(hi, lo, (*fx)[2], ptr[12]); | ||
731 | MLA(hi, lo, (*fx)[3], ptr[10]); | ||
732 | MLA(hi, lo, (*fx)[4], ptr[ 8]); | ||
733 | MLA(hi, lo, (*fx)[5], ptr[ 6]); | ||
734 | MLA(hi, lo, (*fx)[6], ptr[ 4]); | ||
735 | MLA(hi, lo, (*fx)[7], ptr[ 2]); | ||
736 | MLN(hi, lo); | ||
737 | |||
727 | ptr = *Dptr + pe; | 738 | ptr = *Dptr + pe; |
728 | ML0(hi, lo, (*fe)[0], ptr[ 0]); | 739 | MLA(hi, lo, (*fe)[0], ptr[ 0]); |
729 | MLA(hi, lo, (*fe)[1], ptr[14]); | 740 | MLA(hi, lo, (*fe)[1], ptr[14]); |
@@ -736,12 +747,2 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame, | |||
736 | 747 | ||
737 | ptr = *Dptr + po; | ||
738 | MLA(hi, lo, (*fx)[0], -ptr[ 0]); | ||
739 | MLA(hi, lo, (*fx)[1], -ptr[14]); | ||
740 | MLA(hi, lo, (*fx)[2], -ptr[12]); | ||
741 | MLA(hi, lo, (*fx)[3], -ptr[10]); | ||
742 | MLA(hi, lo, (*fx)[4], -ptr[ 8]); | ||
743 | MLA(hi, lo, (*fx)[5], -ptr[ 6]); | ||
744 | MLA(hi, lo, (*fx)[6], -ptr[ 4]); | ||
745 | MLA(hi, lo, (*fx)[7], -ptr[ 2]); | ||
746 | |||
747 | *pcm1++ = SHIFT(MLZ(hi, lo)); | 748 | *pcm1++ = SHIFT(MLZ(hi, lo)); |
@@ -757,4 +758,15 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame, | |||
757 | if (!(sb & 1)) { | 758 | if (!(sb & 1)) { |
759 | ptr = *Dptr + po; | ||
760 | ML0(hi, lo, (*fo)[0], ptr[ 0]); | ||
761 | MLA(hi, lo, (*fo)[1], ptr[14]); | ||
762 | MLA(hi, lo, (*fo)[2], ptr[12]); | ||
763 | MLA(hi, lo, (*fo)[3], ptr[10]); | ||
764 | MLA(hi, lo, (*fo)[4], ptr[ 8]); | ||
765 | MLA(hi, lo, (*fo)[5], ptr[ 6]); | ||
766 | MLA(hi, lo, (*fo)[6], ptr[ 4]); | ||
767 | MLA(hi, lo, (*fo)[7], ptr[ 2]); | ||
768 | MLN(hi, lo); | ||
769 | |||
758 | ptr = *Dptr + pe; | 770 | ptr = *Dptr + pe; |
759 | ML0(hi, lo, (*fe)[7], ptr[ 2]); | 771 | MLA(hi, lo, (*fe)[7], ptr[ 2]); |
760 | MLA(hi, lo, (*fe)[6], ptr[ 4]); | 772 | MLA(hi, lo, (*fe)[6], ptr[ 4]); |
@@ -767,12 +779,2 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame, | |||
767 | 779 | ||
768 | ptr = *Dptr + po; | ||
769 | MLA(hi, lo, (*fo)[0], -ptr[ 0]); | ||
770 | MLA(hi, lo, (*fo)[1], -ptr[14]); | ||
771 | MLA(hi, lo, (*fo)[2], -ptr[12]); | ||
772 | MLA(hi, lo, (*fo)[3], -ptr[10]); | ||
773 | MLA(hi, lo, (*fo)[4], -ptr[ 8]); | ||
774 | MLA(hi, lo, (*fo)[5], -ptr[ 6]); | ||
775 | MLA(hi, lo, (*fo)[6], -ptr[ 4]); | ||
776 | MLA(hi, lo, (*fo)[7], -ptr[ 2]); | ||
777 | |||
778 | *pcm1++ = SHIFT(MLZ(hi, lo)); | 780 | *pcm1++ = SHIFT(MLZ(hi, lo)); |
diff --git a/core/multimedia/opieplayer/libmad/synth.h b/core/multimedia/opieplayer/libmad/synth.h index 64f6a86..2c9d5c8 100644 --- a/core/multimedia/opieplayer/libmad/synth.h +++ b/core/multimedia/opieplayer/libmad/synth.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -27,2 +27,9 @@ | |||
27 | 27 | ||
28 | struct mad_pcm { | ||
29 | unsigned int samplerate; /* sampling frequency (Hz) */ | ||
30 | unsigned short channels; /* number of channels */ | ||
31 | unsigned short length; /* number of samples per channel */ | ||
32 | mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */ | ||
33 | }; | ||
34 | |||
28 | struct mad_synth { | 35 | struct mad_synth { |
@@ -33,8 +40,20 @@ struct mad_synth { | |||
33 | 40 | ||
34 | struct mad_pcm { | 41 | struct mad_pcm pcm; /* PCM output */ |
35 | unsigned int samplerate; /* sampling frequency (Hz) */ | 42 | }; |
36 | unsigned short channels; /* number of channels */ | 43 | |
37 | unsigned short length; /* number of samples per channel */ | 44 | /* single channel PCM selector */ |
38 | mad_fixed_t samples[2][1152];/* PCM output samples */ | 45 | enum { |
39 | } pcm; | 46 | MAD_PCM_CHANNEL_SINGLE = 0 |
47 | }; | ||
48 | |||
49 | /* dual channel PCM selector */ | ||
50 | enum { | ||
51 | MAD_PCM_CHANNEL_DUAL_1 = 0, | ||
52 | MAD_PCM_CHANNEL_DUAL_2 = 1 | ||
53 | }; | ||
54 | |||
55 | /* stereo PCM selector */ | ||
56 | enum { | ||
57 | MAD_PCM_CHANNEL_STEREO_LEFT = 0, | ||
58 | MAD_PCM_CHANNEL_STEREO_RIGHT = 1 | ||
40 | }; | 59 | }; |
diff --git a/core/multimedia/opieplayer/libmad/timer.c b/core/multimedia/opieplayer/libmad/timer.c index b30680c..299fe0b 100644 --- a/core/multimedia/opieplayer/libmad/timer.c +++ b/core/multimedia/opieplayer/libmad/timer.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -28,3 +28,6 @@ | |||
28 | # include <stdio.h> | 28 | # include <stdio.h> |
29 | |||
30 | # ifdef HAVE_ASSERT_H | ||
29 | # include <assert.h> | 31 | # include <assert.h> |
32 | # endif | ||
30 | 33 | ||
@@ -152,18 +155,16 @@ unsigned long scale_rational(unsigned long numer, unsigned long denom, | |||
152 | * NAME:timer->set() | 155 | * NAME:timer->set() |
153 | * DESCRIPTION:set timer to specific value | 156 | * DESCRIPTION:set timer to specific (positive) value |
154 | */ | 157 | */ |
155 | void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | 158 | void mad_timer_set(mad_timer_t *timer, unsigned long seconds, |
156 | unsigned long fraction, unsigned long fracparts) | 159 | unsigned long numer, unsigned long denom) |
157 | { | 160 | { |
158 | timer->seconds = seconds; | 161 | timer->seconds = seconds; |
159 | 162 | if (numer >= denom && denom > 0) { | |
160 | if (fraction == 0) | 163 | timer->seconds += numer / denom; |
161 | fracparts = 0; | 164 | numer %= denom; |
162 | else if (fracparts == 0) { | ||
163 | fracparts = fraction; | ||
164 | fraction = 1; | ||
165 | } | 165 | } |
166 | 166 | ||
167 | switch (fracparts) { | 167 | switch (denom) { |
168 | case 0: | 168 | case 0: |
169 | case 1: | ||
169 | timer->fraction = 0; | 170 | timer->fraction = 0; |
@@ -172,3 +173,7 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
172 | case MAD_TIMER_RESOLUTION: | 173 | case MAD_TIMER_RESOLUTION: |
173 | timer->fraction = fraction; | 174 | timer->fraction = numer; |
175 | break; | ||
176 | |||
177 | case 1000: | ||
178 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 1000); | ||
174 | break; | 179 | break; |
@@ -176,3 +181,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
176 | case 8000: | 181 | case 8000: |
177 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 8000); | 182 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 8000); |
178 | break; | 183 | break; |
@@ -180,3 +185,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
180 | case 11025: | 185 | case 11025: |
181 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 11025); | 186 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 11025); |
182 | break; | 187 | break; |
@@ -184,3 +189,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
184 | case 12000: | 189 | case 12000: |
185 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 12000); | 190 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 12000); |
186 | break; | 191 | break; |
@@ -188,3 +193,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
188 | case 16000: | 193 | case 16000: |
189 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 16000); | 194 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 16000); |
190 | break; | 195 | break; |
@@ -192,3 +197,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
192 | case 22050: | 197 | case 22050: |
193 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 22050); | 198 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 22050); |
194 | break; | 199 | break; |
@@ -196,3 +201,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
196 | case 24000: | 201 | case 24000: |
197 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 24000); | 202 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 24000); |
198 | break; | 203 | break; |
@@ -200,3 +205,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
200 | case 32000: | 205 | case 32000: |
201 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 32000); | 206 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 32000); |
202 | break; | 207 | break; |
@@ -204,3 +209,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
204 | case 44100: | 209 | case 44100: |
205 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 44100); | 210 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 44100); |
206 | break; | 211 | break; |
@@ -208,3 +213,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
208 | case 48000: | 213 | case 48000: |
209 | timer->fraction = fraction * (MAD_TIMER_RESOLUTION / 48000); | 214 | timer->fraction = numer * (MAD_TIMER_RESOLUTION / 48000); |
210 | break; | 215 | break; |
@@ -212,4 +217,3 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds, | |||
212 | default: | 217 | default: |
213 | timer->fraction = | 218 | timer->fraction = scale_rational(numer, denom, MAD_TIMER_RESOLUTION); |
214 | scale_rational(fraction, fracparts, MAD_TIMER_RESOLUTION); | ||
215 | break; | 219 | break; |
@@ -245,4 +249,4 @@ void mad_timer_multiply(mad_timer_t *timer, signed long scalar) | |||
245 | if (scalar < 0) { | 249 | if (scalar < 0) { |
246 | mad_timer_negate(timer); | ||
247 | factor = -scalar; | 250 | factor = -scalar; |
251 | mad_timer_negate(timer); | ||
248 | } | 252 | } |
@@ -319,3 +323,3 @@ signed long mad_timer_count(mad_timer_t timer, enum mad_units units) | |||
319 | */ | 323 | */ |
320 | unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long fracparts) | 324 | unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom) |
321 | { | 325 | { |
@@ -323,3 +327,3 @@ unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long fracparts) | |||
323 | 327 | ||
324 | switch (fracparts) { | 328 | switch (denom) { |
325 | case 0: | 329 | case 0: |
@@ -331,3 +335,3 @@ unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long fracparts) | |||
331 | default: | 335 | default: |
332 | return scale_rational(timer.fraction, MAD_TIMER_RESOLUTION, fracparts); | 336 | return scale_rational(timer.fraction, MAD_TIMER_RESOLUTION, denom); |
333 | } | 337 | } |
@@ -379,8 +383,8 @@ void mad_timer_string(mad_timer_t timer, | |||
379 | { | 383 | { |
380 | unsigned long fracparts; | 384 | unsigned long denom; |
381 | 385 | ||
382 | fracparts = MAD_TIMER_RESOLUTION / fracunits; | 386 | denom = MAD_TIMER_RESOLUTION / fracunits; |
383 | 387 | ||
384 | frac = timer.fraction / fracparts; | 388 | frac = timer.fraction / denom; |
385 | sub = scale_rational(timer.fraction % fracparts, fracparts, subparts); | 389 | sub = scale_rational(timer.fraction % denom, denom, subparts); |
386 | } | 390 | } |
diff --git a/core/multimedia/opieplayer/libmad/timer.h b/core/multimedia/opieplayer/libmad/timer.h index 67fe16a..f8afb8e 100644 --- a/core/multimedia/opieplayer/libmad/timer.h +++ b/core/multimedia/opieplayer/libmad/timer.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -81,3 +81,3 @@ enum mad_units { | |||
81 | 81 | ||
82 | # define mad_timer_reset(timer)(*(timer) = mad_timer_zero) | 82 | # define mad_timer_reset(timer)((void) (*(timer) = mad_timer_zero)) |
83 | 83 | ||
diff --git a/core/multimedia/opieplayer/libmad/version.c b/core/multimedia/opieplayer/libmad/version.c index 413d54b..fb126f4 100644 --- a/core/multimedia/opieplayer/libmad/version.c +++ b/core/multimedia/opieplayer/libmad/version.c | |||
@@ -1,3 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
@@ -29,3 +29,3 @@ | |||
29 | 29 | ||
30 | char const mad_version[] = "MPEG Audio Decoder version " MAD_VERSION; | 30 | char const mad_version[] = "MPEG Audio Decoder " MAD_VERSION; |
31 | char const mad_copyright[] = "Copyright (C) " MAD_PUBLISHYEAR " " MAD_AUTHOR; | 31 | char const mad_copyright[] = "Copyright (C) " MAD_PUBLISHYEAR " " MAD_AUTHOR; |
@@ -33,3 +33,3 @@ char const mad_author[] = MAD_AUTHOR " <" MAD_EMAIL ">"; | |||
33 | 33 | ||
34 | char const mad_build[] = | 34 | char const mad_build[] = "" |
35 | # if defined(FPM_64BIT) | 35 | # if defined(FPM_64BIT) |