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/opieplayer/libmad/huffman.c | |
parent | caa7ced77b9014526607f9f65c58aabe7e0ba631 (diff) | |
download | opie-7ea4abeb652e6787e57a938e1ca028d25fd249ce.zip opie-7ea4abeb652e6787e57a938e1ca028d25fd249ce.tar.gz opie-7ea4abeb652e6787e57a938e1ca028d25fd249ce.tar.bz2 |
new libmad version, less cpu usage
Diffstat (limited to 'core/multimedia/opieplayer/libmad/huffman.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmad/huffman.c | 21 |
1 files changed, 16 insertions, 5 deletions
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,8 +1,8 @@ | |||
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 |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 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 | 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 | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
@@ -31,14 +31,20 @@ | |||
31 | * These are the Huffman code words for Layer III. | 31 | * These are the Huffman code words for Layer III. |
32 | * The data for these tables are derived from Table B.7 of ISO/IEC 11172-3. | 32 | * The data for these tables are derived from Table B.7 of ISO/IEC 11172-3. |
33 | * | 33 | * |
34 | * These tables support decoding up to 4 Huffman code bits at a time. | 34 | * These tables support decoding up to 4 Huffman code bits at a time. |
35 | */ | 35 | */ |
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 | ||
40 | static | 46 | static |
41 | union huffquad const hufftabA[] = { | 47 | union huffquad const hufftabA[] = { |
42 | /* 0000 */ PTR(16, 2), | 48 | /* 0000 */ PTR(16, 2), |
43 | /* 0001 */ PTR(20, 2), | 49 | /* 0001 */ PTR(20, 2), |
44 | /* 0010 */ PTR(24, 1), | 50 | /* 0010 */ PTR(24, 1), |
@@ -97,14 +103,19 @@ union huffquad const hufftabB[] = { | |||
97 | /* 1111 */ V(0, 0, 0, 0, 4) | 103 | /* 1111 */ V(0, 0, 0, 0, 4) |
98 | }; | 104 | }; |
99 | 105 | ||
100 | # undef V | 106 | # undef V |
101 | # undef PTR | 107 | # undef PTR |
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 | ||
106 | static | 117 | static |
107 | union huffpair const hufftab0[] = { | 118 | union huffpair const hufftab0[] = { |
108 | /* */ V(0, 0, 0) | 119 | /* */ V(0, 0, 0) |
109 | }; | 120 | }; |
110 | 121 | ||