summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-02-22 21:02:57 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-02-22 21:02:57 +0000
commit3f5f3524d478743a4c2f470f0baf7b767ce8d1c2 (patch)
tree26a7df9071388e223c2f1b165dc84ae3bf4f5832 /apps/codecs
parent398b37124e870b3be69a03e5d89c5887204d6990 (diff)
downloadrockbox-3f5f3524d478743a4c2f470f0baf7b767ce8d1c2.zip
rockbox-3f5f3524d478743a4c2f470f0baf7b767ce8d1c2.tar.gz
rockbox-3f5f3524d478743a4c2f470f0baf7b767ce8d1c2.tar.bz2
rockbox-3f5f3524d478743a4c2f470f0baf7b767ce8d1c2.tar.xz
Change liba52 and libmad to the original 8-spaced tabbing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/liba52/a52.h6
-rw-r--r--apps/codecs/liba52/a52_internal.h84
-rw-r--r--apps/codecs/liba52/bit_allocate.c228
-rw-r--r--apps/codecs/liba52/bitstream.c10
-rw-r--r--apps/codecs/liba52/bitstream.h16
-rw-r--r--apps/codecs/liba52/downmix.c664
-rw-r--r--apps/codecs/liba52/imdct.c164
-rw-r--r--apps/codecs/liba52/imdct_lookups.h2
-rw-r--r--apps/codecs/liba52/mm_accel.h8
-rw-r--r--apps/codecs/liba52/parse.c1098
-rw-r--r--apps/codecs/libmad/bit.c26
-rw-r--r--apps/codecs/libmad/bit.h4
-rw-r--r--apps/codecs/libmad/decoder.c190
-rw-r--r--apps/codecs/libmad/decoder.h28
-rw-r--r--apps/codecs/libmad/fixed.c4
-rw-r--r--apps/codecs/libmad/fixed.h226
-rw-r--r--apps/codecs/libmad/frame.c46
-rw-r--r--apps/codecs/libmad/frame.h74
-rw-r--r--apps/codecs/libmad/huffman.c678
-rw-r--r--apps/codecs/libmad/layer12.c218
-rw-r--r--apps/codecs/libmad/layer3.c646
-rw-r--r--apps/codecs/libmad/mad.h452
-rw-r--r--apps/codecs/libmad/minimad.c18
-rw-r--r--apps/codecs/libmad/stream.c36
-rw-r--r--apps/codecs/libmad/stream.h46
-rw-r--r--apps/codecs/libmad/synth.c504
-rw-r--r--apps/codecs/libmad/synth.h14
-rw-r--r--apps/codecs/libmad/timer.c56
-rw-r--r--apps/codecs/libmad/timer.h28
-rw-r--r--apps/codecs/libmad/version.h26
30 files changed, 2800 insertions, 2800 deletions
diff --git a/apps/codecs/liba52/a52.h b/apps/codecs/liba52/a52.h
index cae9ae6..e852e8d 100644
--- a/apps/codecs/liba52/a52.h
+++ b/apps/codecs/liba52/a52.h
@@ -56,11 +56,11 @@ typedef struct a52_state_s a52_state_t;
a52_state_t * a52_init (uint32_t mm_accel);
sample_t * a52_samples (a52_state_t * state);
int a52_syncinfo (uint8_t * buf, int * flags,
- int * sample_rate, int * bit_rate);
+ int * sample_rate, int * bit_rate);
int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
- level_t * level, sample_t bias);
+ level_t * level, sample_t bias);
void a52_dynrng (a52_state_t * state,
- level_t (* call) (level_t, void *), void * data);
+ level_t (* call) (level_t, void *), void * data);
int a52_block (a52_state_t * state);
void a52_free (a52_state_t * state);
diff --git a/apps/codecs/liba52/a52_internal.h b/apps/codecs/liba52/a52_internal.h
index 48f2383..3b3d21c 100644
--- a/apps/codecs/liba52/a52_internal.h
+++ b/apps/codecs/liba52/a52_internal.h
@@ -22,62 +22,62 @@
*/
typedef struct {
- uint8_t bai; /* fine SNR offset, fast gain */
- uint8_t deltbae; /* delta bit allocation exists */
- int8_t deltba[50]; /* per-band delta bit allocation */
+ uint8_t bai; /* fine SNR offset, fast gain */
+ uint8_t deltbae; /* delta bit allocation exists */
+ int8_t deltba[50]; /* per-band delta bit allocation */
} ba_t;
typedef struct {
- uint8_t exp[256]; /* decoded channel exponents */
- int8_t bap[256]; /* derived channel bit allocation */
+ uint8_t exp[256]; /* decoded channel exponents */
+ int8_t bap[256]; /* derived channel bit allocation */
} expbap_t;
struct a52_state_s {
- uint8_t fscod; /* sample rate */
- uint8_t halfrate; /* halfrate factor */
- uint8_t acmod; /* coded channels */
- uint8_t lfeon; /* coded lfe channel */
- level_t clev; /* centre channel mix level */
- level_t slev; /* surround channels mix level */
-
- int output; /* type of output */
- level_t level; /* output level */
- sample_t bias; /* output bias */
-
- int dynrnge; /* apply dynamic range */
- level_t dynrng; /* dynamic range */
- void * dynrngdata; /* dynamic range callback funtion and data */
+ uint8_t fscod; /* sample rate */
+ uint8_t halfrate; /* halfrate factor */
+ uint8_t acmod; /* coded channels */
+ uint8_t lfeon; /* coded lfe channel */
+ level_t clev; /* centre channel mix level */
+ level_t slev; /* surround channels mix level */
+
+ int output; /* type of output */
+ level_t level; /* output level */
+ sample_t bias; /* output bias */
+
+ int dynrnge; /* apply dynamic range */
+ level_t dynrng; /* dynamic range */
+ void * dynrngdata; /* dynamic range callback funtion and data */
level_t (* dynrngcall) (level_t range, void * dynrngdata);
- uint8_t chincpl; /* channel coupled */
- uint8_t phsflginu; /* phase flags in use (stereo only) */
- uint8_t cplstrtmant; /* coupling channel start mantissa */
- uint8_t cplendmant; /* coupling channel end mantissa */
- uint32_t cplbndstrc; /* coupling band structure */
- level_t cplco[5][18]; /* coupling coordinates */
+ uint8_t chincpl; /* channel coupled */
+ uint8_t phsflginu; /* phase flags in use (stereo only) */
+ uint8_t cplstrtmant; /* coupling channel start mantissa */
+ uint8_t cplendmant; /* coupling channel end mantissa */
+ uint32_t cplbndstrc; /* coupling band structure */
+ level_t cplco[5][18]; /* coupling coordinates */
/* derived information */
- uint8_t cplstrtbnd; /* coupling start band (for bit allocation) */
- uint8_t ncplbnd; /* number of coupling bands */
+ uint8_t cplstrtbnd; /* coupling start band (for bit allocation) */
+ uint8_t ncplbnd; /* number of coupling bands */
- uint8_t rematflg; /* stereo rematrixing */
+ uint8_t rematflg; /* stereo rematrixing */
- uint8_t endmant[5]; /* channel end mantissa */
+ uint8_t endmant[5]; /* channel end mantissa */
- uint16_t bai; /* bit allocation information */
+ uint16_t bai; /* bit allocation information */
uint32_t * buffer_start;
- uint16_t lfsr_state; /* dither state */
+ uint16_t lfsr_state; /* dither state */
uint32_t bits_left;
uint32_t current_word;
- uint8_t csnroffst; /* coarse SNR offset */
- ba_t cplba; /* coupling bit allocation parameters */
- ba_t ba[5]; /* channel bit allocation parameters */
- ba_t lfeba; /* lfe bit allocation parameters */
+ uint8_t csnroffst; /* coarse SNR offset */
+ ba_t cplba; /* coupling bit allocation parameters */
+ ba_t ba[5]; /* channel bit allocation parameters */
+ ba_t lfeba; /* lfe bit allocation parameters */
- uint8_t cplfleak; /* coupling fast leak init */
- uint8_t cplsleak; /* coupling slow leak init */
+ uint8_t cplfleak; /* coupling fast leak init */
+ uint8_t cplsleak; /* coupling slow leak init */
expbap_t cpl_expbap;
expbap_t fbw_expbap[5];
@@ -104,15 +104,15 @@ struct a52_state_s {
#define DELTA_BIT_RESERVED (3)
void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart,
- int start, int end, int fastleak, int slowleak,
- expbap_t * expbap);
+ int start, int end, int fastleak, int slowleak,
+ expbap_t * expbap);
int a52_downmix_init (int input, int flags, level_t * level,
- level_t clev, level_t slev);
+ level_t clev, level_t slev);
int a52_downmix_coeff (level_t * coeff, int acmod, int output, level_t level,
- level_t clev, level_t slev);
+ level_t clev, level_t slev);
void a52_downmix (sample_t * samples, int acmod, int output,
- level_t clev, level_t slev);
+ level_t clev, level_t slev);
void a52_upmix (sample_t * samples, int acmod, int output);
void a52_imdct_init (uint32_t mm_accel);
diff --git a/apps/codecs/liba52/bit_allocate.c b/apps/codecs/liba52/bit_allocate.c
index 3f68c92..aaac245 100644
--- a/apps/codecs/liba52/bit_allocate.c
+++ b/apps/codecs/liba52/bit_allocate.c
@@ -68,12 +68,12 @@ static int8_t baptab[305] IDATA_ATTR = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 /* 148 padding elems */
+ 0, 0, 0, 0 /* 148 padding elems */
};
static int bndtab[30] IDATA_ATTR = {21, 22, 23, 24, 25, 26, 27, 28, 31, 34,
- 37, 40, 43, 46, 49, 55, 61, 67, 73, 79,
- 85, 97, 109, 121, 133, 157, 181, 205, 229, 253};
+ 37, 40, 43, 46, 49, 55, 61, 67, 73, 79,
+ 85, 97, 109, 121, 133, 157, 181, 205, 229, 253};
static int8_t latab[256] IDATA_ATTR = {
-64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53,
@@ -100,35 +100,35 @@ static int8_t latab[256] IDATA_ATTR = {
0, 0, 0, 0
};
-#define UPDATE_LEAK() \
-do { \
- fastleak += fdecay; \
+#define UPDATE_LEAK() \
+do { \
+ fastleak += fdecay; \
if (fastleak > psd + fgain) \
- fastleak = psd + fgain; \
- slowleak += sdecay; \
+ fastleak = psd + fgain; \
+ slowleak += sdecay; \
if (slowleak > psd + sgain) \
- slowleak = psd + sgain; \
+ slowleak = psd + sgain; \
} while (0)
-#define COMPUTE_MASK() \
-do { \
- if (psd > dbknee) \
- mask -= (psd - dbknee) >> 2; \
- if (mask > hth [i >> halfrate]) \
- mask = hth [i >> halfrate]; \
- mask -= snroffset + 128 * deltba[i]; \
- mask = (mask > 0) ? 0 : ((-mask) >> 5); \
- mask -= floor; \
+#define COMPUTE_MASK() \
+do { \
+ if (psd > dbknee) \
+ mask -= (psd - dbknee) >> 2; \
+ if (mask > hth [i >> halfrate]) \
+ mask = hth [i >> halfrate]; \
+ mask -= snroffset + 128 * deltba[i]; \
+ mask = (mask > 0) ? 0 : ((-mask) >> 5); \
+ mask -= floor; \
} while (0)
void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart,
- int start, int end, int fastleak, int slowleak,
- expbap_t * expbap)
+ int start, int end, int fastleak, int slowleak,
+ expbap_t * expbap)
{
static int slowgain[4] = {0x540, 0x4d8, 0x478, 0x410};
static int dbpbtab[4] = {0xc00, 0x500, 0x300, 0x100};
static int floortab[8] = {0x910, 0x950, 0x990, 0x9d0,
- 0xa10, 0xa90, 0xb10, 0x1400};
+ 0xa10, 0xa90, 0xb10, 0x1400};
int i, j;
uint8_t * exp;
@@ -141,17 +141,17 @@ void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart,
halfrate = state->halfrate;
fdecay = (63 + 20 * ((state->bai >> 7) & 3)) >> halfrate; /* fdcycod */
- fgain = 128 + 128 * (ba->bai & 7); /* fgaincod */
- sdecay = (15 + 2 * (state->bai >> 9)) >> halfrate; /* sdcycod */
- sgain = slowgain[(state->bai >> 5) & 3]; /* sgaincod */
- dbknee = dbpbtab[(state->bai >> 3) & 3]; /* dbpbcod */
+ fgain = 128 + 128 * (ba->bai & 7); /* fgaincod */
+ sdecay = (15 + 2 * (state->bai >> 9)) >> halfrate; /* sdcycod */
+ sgain = slowgain[(state->bai >> 5) & 3]; /* sgaincod */
+ dbknee = dbpbtab[(state->bai >> 3) & 3]; /* dbpbcod */
hth = hthtab[state->fscod];
/*
* if there is no delta bit allocation, make deltba point to an area
* known to contain zeroes. baptab+156 here.
*/
deltba = (ba->deltbae == DELTA_BIT_NONE) ? baptab + 156 : ba->deltba;
- floor = floortab[state->bai & 7]; /* floorcod */
+ floor = floortab[state->bai & 7]; /* floorcod */
snroffset = 960 - 64 * state->csnroffst - 4 * (ba->bai >> 3) + floor;
floor >>= 5;
@@ -161,105 +161,105 @@ void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart,
i = bndstart;
j = start;
if (start == 0) { /* not the coupling channel */
- int lowcomp;
+ int lowcomp;
- lowcomp = 0;
- j = end - 1;
- do {
- if (i < j) {
- if (exp[i+1] == exp[i] - 2)
- lowcomp = 384;
- else if (lowcomp && (exp[i+1] > exp[i]))
- lowcomp -= 64;
- }
- psd = 128 * exp[i];
- mask = psd + fgain + lowcomp;
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- } while ((i < 3) || ((i < 7) && (exp[i] > exp[i-1])));
- fastleak = psd + fgain;
- slowleak = psd + sgain;
+ lowcomp = 0;
+ j = end - 1;
+ do {
+ if (i < j) {
+ if (exp[i+1] == exp[i] - 2)
+ lowcomp = 384;
+ else if (lowcomp && (exp[i+1] > exp[i]))
+ lowcomp -= 64;
+ }
+ psd = 128 * exp[i];
+ mask = psd + fgain + lowcomp;
+ COMPUTE_MASK ();
+ bap[i] = (baptab+156)[mask + 4 * exp[i]];
+ i++;
+ } while ((i < 3) || ((i < 7) && (exp[i] > exp[i-1])));
+ fastleak = psd + fgain;
+ slowleak = psd + sgain;
- while (i < 7) {
- if (i < j) {
- if (exp[i+1] == exp[i] - 2)
- lowcomp = 384;
- else if (lowcomp && (exp[i+1] > exp[i]))
- lowcomp -= 64;
+ while (i < 7) {
+ if (i < j) {
+ if (exp[i+1] == exp[i] - 2)
+ lowcomp = 384;
+ else if (lowcomp && (exp[i+1] > exp[i]))
+ lowcomp -= 64;
+ }
+ psd = 128 * exp[i];
+ UPDATE_LEAK ();
+ mask = ((fastleak + lowcomp < slowleak) ?
+ fastleak + lowcomp : slowleak);
+ COMPUTE_MASK ();
+ bap[i] = (baptab+156)[mask + 4 * exp[i]];
+ i++;
}
- psd = 128 * exp[i];
- UPDATE_LEAK ();
- mask = ((fastleak + lowcomp < slowleak) ?
- fastleak + lowcomp : slowleak);
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- }
- if (end == 7) /* lfe channel */
- return;
+ if (end == 7) /* lfe channel */
+ return;
- do {
- if (exp[i+1] == exp[i] - 2)
- lowcomp = 320;
- else if (lowcomp && (exp[i+1] > exp[i]))
- lowcomp -= 64;
- psd = 128 * exp[i];
- UPDATE_LEAK ();
- mask = ((fastleak + lowcomp < slowleak) ?
- fastleak + lowcomp : slowleak);
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- } while (i < 20);
+ do {
+ if (exp[i+1] == exp[i] - 2)
+ lowcomp = 320;
+ else if (lowcomp && (exp[i+1] > exp[i]))
+ lowcomp -= 64;
+ psd = 128 * exp[i];
+ UPDATE_LEAK ();
+ mask = ((fastleak + lowcomp < slowleak) ?
+ fastleak + lowcomp : slowleak);
+ COMPUTE_MASK ();
+ bap[i] = (baptab+156)[mask + 4 * exp[i]];
+ i++;
+ } while (i < 20);
- while (lowcomp > 128) { /* two iterations maximum */
- lowcomp -= 128;
- psd = 128 * exp[i];
- UPDATE_LEAK ();
- mask = ((fastleak + lowcomp < slowleak) ?
- fastleak + lowcomp : slowleak);
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- }
- j = i;
+ while (lowcomp > 128) { /* two iterations maximum */
+ lowcomp -= 128;
+ psd = 128 * exp[i];
+ UPDATE_LEAK ();
+ mask = ((fastleak + lowcomp < slowleak) ?
+ fastleak + lowcomp : slowleak);
+ COMPUTE_MASK ();
+ bap[i] = (baptab+156)[mask + 4 * exp[i]];
+ i++;
+ }
+ j = i;
}
do {
- int startband, endband;
+ int startband, endband;
- startband = j;
- endband = (bndtab[i-20] < end) ? bndtab[i-20] : end;
- psd = 128 * exp[j++];
- while (j < endband) {
- int next, delta;
+ startband = j;
+ endband = (bndtab[i-20] < end) ? bndtab[i-20] : end;
+ psd = 128 * exp[j++];
+ while (j < endband) {
+ int next, delta;
- next = 128 * exp[j++];
- delta = next - psd;
- switch (delta >> 9) {
- case -6: case -5: case -4: case -3: case -2:
- psd = next;
- break;
- case -1:
- psd = next + latab[(-delta) >> 1];
- break;
- case 0:
- psd += latab[delta >> 1];
- break;
+ next = 128 * exp[j++];
+ delta = next - psd;
+ switch (delta >> 9) {
+ case -6: case -5: case -4: case -3: case -2:
+ psd = next;
+ break;
+ case -1:
+ psd = next + latab[(-delta) >> 1];
+ break;
+ case 0:
+ psd += latab[delta >> 1];
+ break;
+ }
}
- }
- /* minpsd = -289 */
- UPDATE_LEAK ();
- mask = (fastleak < slowleak) ? fastleak : slowleak;
- COMPUTE_MASK ();
- i++;
- j = startband;
- do {
- /* max(mask+4*exp)=147=-(minpsd+fgain-deltba-snroffset)>>5+4*exp */
- /* min(mask+4*exp)=-156=-(sgain-deltba-snroffset)>>5 */
- bap[j] = (baptab+156)[mask + 4 * exp[j]];
- } while (++j < endband);
+ /* minpsd = -289 */
+ UPDATE_LEAK ();
+ mask = (fastleak < slowleak) ? fastleak : slowleak;
+ COMPUTE_MASK ();
+ i++;
+ j = startband;
+ do {
+ /* max(mask+4*exp)=147=-(minpsd+fgain-deltba-snroffset)>>5+4*exp */
+ /* min(mask+4*exp)=-156=-(sgain-deltba-snroffset)>>5 */
+ bap[j] = (baptab+156)[mask + 4 * exp[j]];
+ } while (++j < endband);
} while (j < end);
}
diff --git a/apps/codecs/liba52/bitstream.c b/apps/codecs/liba52/bitstream.c
index f9f3ad7..155368f 100644
--- a/apps/codecs/liba52/bitstream.c
+++ b/apps/codecs/liba52/bitstream.c
@@ -66,12 +66,12 @@ uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits)
num_bits -= state->bits_left;
result = ((state->current_word << (32 - state->bits_left)) >>
- (32 - state->bits_left));
+ (32 - state->bits_left));
bitstream_fill_current (state);
if (num_bits != 0)
- result = (result << num_bits) | (state->current_word >> (32 - num_bits));
+ result = (result << num_bits) | (state->current_word >> (32 - num_bits));
state->bits_left = 32 - num_bits;
@@ -84,13 +84,13 @@ int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits)
num_bits -= state->bits_left;
result = ((((int32_t)state->current_word) << (32 - state->bits_left)) >>
- (32 - state->bits_left));
+ (32 - state->bits_left));
bitstream_fill_current(state);
if (num_bits != 0)
- result = (result << num_bits) | (state->current_word >> (32 - num_bits));
-
+ result = (result << num_bits) | (state->current_word >> (32 - num_bits));
+
state->bits_left = 32 - num_bits;
return result;
diff --git a/apps/codecs/liba52/bitstream.h b/apps/codecs/liba52/bitstream.h
index c316a97..56de157 100644
--- a/apps/codecs/liba52/bitstream.h
+++ b/apps/codecs/liba52/bitstream.h
@@ -30,11 +30,11 @@ int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits);
static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits)
{
uint32_t result;
-
+
if (num_bits < state->bits_left) {
- result = (state->current_word << (32 - state->bits_left)) >> (32 - num_bits);
- state->bits_left -= num_bits;
- return result;
+ result = (state->current_word << (32 - state->bits_left)) >> (32 - num_bits);
+ state->bits_left -= num_bits;
+ return result;
}
return a52_bitstream_get_bh (state, num_bits);
@@ -43,11 +43,11 @@ static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits)
static inline int32_t bitstream_get_2 (a52_state_t * state, uint32_t num_bits)
{
int32_t result;
-
+
if (num_bits < state->bits_left) {
- result = (((int32_t)state->current_word) << (32 - state->bits_left)) >> (32 - num_bits);
- state->bits_left -= num_bits;
- return result;
+ result = (((int32_t)state->current_word) << (32 - state->bits_left)) >> (32 - num_bits);
+ state->bits_left -= num_bits;
+ return result;
}
return a52_bitstream_get_bh_2 (state, num_bits);
diff --git a/apps/codecs/liba52/downmix.c b/apps/codecs/liba52/downmix.c
index b9506de..dd2867c 100644
--- a/apps/codecs/liba52/downmix.c
+++ b/apps/codecs/liba52/downmix.c
@@ -32,135 +32,135 @@
#define CONVERT(acmod,output) (((output) << 3) + (acmod))
int a52_downmix_init (int input, int flags, level_t * level,
- level_t clev, level_t slev)
+ level_t clev, level_t slev)
{
static uint8_t table[11][8] = {
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
- {A52_MONO, A52_MONO, A52_MONO, A52_MONO,
- A52_MONO, A52_MONO, A52_MONO, A52_MONO},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
- A52_STEREO, A52_3F, A52_STEREO, A52_3F},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_2F1R, A52_2F1R, A52_2F1R, A52_2F1R},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_2F1R, A52_3F1R, A52_2F1R, A52_3F1R},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
- A52_2F2R, A52_2F2R, A52_2F2R, A52_2F2R},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
- A52_2F2R, A52_3F2R, A52_2F2R, A52_3F2R},
- {A52_CHANNEL1, A52_MONO, A52_MONO, A52_MONO,
- A52_MONO, A52_MONO, A52_MONO, A52_MONO},
- {A52_CHANNEL2, A52_MONO, A52_MONO, A52_MONO,
- A52_MONO, A52_MONO, A52_MONO, A52_MONO},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_DOLBY,
- A52_DOLBY, A52_DOLBY, A52_DOLBY, A52_DOLBY}
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
+ A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
+ {A52_MONO, A52_MONO, A52_MONO, A52_MONO,
+ A52_MONO, A52_MONO, A52_MONO, A52_MONO},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
+ A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
+ A52_STEREO, A52_3F, A52_STEREO, A52_3F},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
+ A52_2F1R, A52_2F1R, A52_2F1R, A52_2F1R},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
+ A52_2F1R, A52_3F1R, A52_2F1R, A52_3F1R},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
+ A52_2F2R, A52_2F2R, A52_2F2R, A52_2F2R},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
+ A52_2F2R, A52_3F2R, A52_2F2R, A52_3F2R},
+ {A52_CHANNEL1, A52_MONO, A52_MONO, A52_MONO,
+ A52_MONO, A52_MONO, A52_MONO, A52_MONO},
+ {A52_CHANNEL2, A52_MONO, A52_MONO, A52_MONO,
+ A52_MONO, A52_MONO, A52_MONO, A52_MONO},
+ {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_DOLBY,
+ A52_DOLBY, A52_DOLBY, A52_DOLBY, A52_DOLBY}
};
int output;
output = flags & A52_CHANNEL_MASK;
if (output > A52_DOLBY)
- return -1;
+ return -1;
output = table[output][input & 7];
if (output == A52_STEREO &&
- (input == A52_DOLBY || (input == A52_3F && clev == LEVEL (LEVEL_3DB))))
- output = A52_DOLBY;
+ (input == A52_DOLBY || (input == A52_3F && clev == LEVEL (LEVEL_3DB))))
+ output = A52_DOLBY;
if (flags & A52_ADJUST_LEVEL) {
- level_t adjust;
-
- switch (CONVERT (input & 7, output)) {
-
- case CONVERT (A52_3F, A52_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + clev);
- break;
-
- case CONVERT (A52_STEREO, A52_MONO):
- case CONVERT (A52_2F2R, A52_2F1R):
- case CONVERT (A52_3F2R, A52_3F1R):
- level_3db:
- adjust = LEVEL (LEVEL_3DB);
- break;
-
- case CONVERT (A52_3F2R, A52_2F1R):
- if (clev < LEVEL (LEVEL_PLUS3DB - 1))
- goto level_3db;
- /* break thru */
- case CONVERT (A52_3F, A52_STEREO):
- case CONVERT (A52_3F1R, A52_2F1R):
- case CONVERT (A52_3F1R, A52_2F2R):
- case CONVERT (A52_3F2R, A52_2F2R):
- adjust = DIV (1, LEVEL (1) + clev);
- break;
-
- case CONVERT (A52_2F1R, A52_MONO):
- adjust = DIV (LEVEL_PLUS3DB, LEVEL (2) + slev);
- break;
-
- case CONVERT (A52_2F1R, A52_STEREO):
- case CONVERT (A52_3F1R, A52_3F):
- adjust = DIV (1, LEVEL (1) + MUL_C (slev, LEVEL_3DB));
- break;
-
- case CONVERT (A52_3F1R, A52_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + MUL_C (slev, 0.5));
- break;
-
- case CONVERT (A52_3F1R, A52_STEREO):
- adjust = DIV (1, LEVEL (1) + clev + MUL_C (slev, LEVEL_3DB));
- break;
-
- case CONVERT (A52_2F2R, A52_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + slev);
- break;
-
- case CONVERT (A52_2F2R, A52_STEREO):
- case CONVERT (A52_3F2R, A52_3F):
- adjust = DIV (1, LEVEL (1) + slev);
- break;
-
- case CONVERT (A52_3F2R, A52_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + slev);
- break;
-
- case CONVERT (A52_3F2R, A52_STEREO):
- adjust = DIV (1, LEVEL (1) + clev + slev);
- break;
-
- case CONVERT (A52_MONO, A52_DOLBY):
- adjust = LEVEL (LEVEL_PLUS3DB);
- break;
-
- case CONVERT (A52_3F, A52_DOLBY):
- case CONVERT (A52_2F1R, A52_DOLBY):
- adjust = LEVEL (1 / (1 + LEVEL_3DB));
- break;
-
- case CONVERT (A52_3F1R, A52_DOLBY):
- case CONVERT (A52_2F2R, A52_DOLBY):
- adjust = LEVEL (1 / (1 + 2 * LEVEL_3DB));
- break;
-
- case CONVERT (A52_3F2R, A52_DOLBY):
- adjust = LEVEL (1 / (1 + 3 * LEVEL_3DB));
- break;
-
- default:
- return output;
- }
-
- *level = MUL_L (*level, adjust);
+ level_t adjust;
+
+ switch (CONVERT (input & 7, output)) {
+
+ case CONVERT (A52_3F, A52_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + clev);
+ break;
+
+ case CONVERT (A52_STEREO, A52_MONO):
+ case CONVERT (A52_2F2R, A52_2F1R):
+ case CONVERT (A52_3F2R, A52_3F1R):
+ level_3db:
+ adjust = LEVEL (LEVEL_3DB);
+ break;
+
+ case CONVERT (A52_3F2R, A52_2F1R):
+ if (clev < LEVEL (LEVEL_PLUS3DB - 1))
+ goto level_3db;
+ /* break thru */
+ case CONVERT (A52_3F, A52_STEREO):
+ case CONVERT (A52_3F1R, A52_2F1R):
+ case CONVERT (A52_3F1R, A52_2F2R):
+ case CONVERT (A52_3F2R, A52_2F2R):
+ adjust = DIV (1, LEVEL (1) + clev);
+ break;
+
+ case CONVERT (A52_2F1R, A52_MONO):
+ adjust = DIV (LEVEL_PLUS3DB, LEVEL (2) + slev);
+ break;
+
+ case CONVERT (A52_2F1R, A52_STEREO):
+ case CONVERT (A52_3F1R, A52_3F):
+ adjust = DIV (1, LEVEL (1) + MUL_C (slev, LEVEL_3DB));
+ break;
+
+ case CONVERT (A52_3F1R, A52_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + MUL_C (slev, 0.5));
+ break;
+
+ case CONVERT (A52_3F1R, A52_STEREO):
+ adjust = DIV (1, LEVEL (1) + clev + MUL_C (slev, LEVEL_3DB));
+ break;
+
+ case CONVERT (A52_2F2R, A52_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + slev);
+ break;
+
+ case CONVERT (A52_2F2R, A52_STEREO):
+ case CONVERT (A52_3F2R, A52_3F):
+ adjust = DIV (1, LEVEL (1) + slev);
+ break;
+
+ case CONVERT (A52_3F2R, A52_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + slev);
+ break;
+
+ case CONVERT (A52_3F2R, A52_STEREO):
+ adjust = DIV (1, LEVEL (1) + clev + slev);
+ break;
+
+ case CONVERT (A52_MONO, A52_DOLBY):
+ adjust = LEVEL (LEVEL_PLUS3DB);
+ break;
+
+ case CONVERT (A52_3F, A52_DOLBY):
+ case CONVERT (A52_2F1R, A52_DOLBY):
+ adjust = LEVEL (1 / (1 + LEVEL_3DB));
+ break;
+
+ case CONVERT (A52_3F1R, A52_DOLBY):
+ case CONVERT (A52_2F2R, A52_DOLBY):
+ adjust = LEVEL (1 / (1 + 2 * LEVEL_3DB));
+ break;
+
+ case CONVERT (A52_3F2R, A52_DOLBY):
+ adjust = LEVEL (1 / (1 + 3 * LEVEL_3DB));
+ break;
+
+ default:
+ return output;
+ }
+
+ *level = MUL_L (*level, adjust);
}
return output;
}
int a52_downmix_coeff (level_t * coeff, int acmod, int output, level_t level,
- level_t clev, level_t slev)
+ level_t clev, level_t slev)
{
level_t level_3db;
@@ -177,153 +177,153 @@ int a52_downmix_coeff (level_t * coeff, int acmod, int output, level_t level,
case CONVERT (A52_2F2R, A52_2F2R):
case CONVERT (A52_3F2R, A52_3F2R):
case CONVERT (A52_STEREO, A52_DOLBY):
- coeff[0] = coeff[1] = coeff[2] = coeff[3] = coeff[4] = level;
- return 0;
+ coeff[0] = coeff[1] = coeff[2] = coeff[3] = coeff[4] = level;
+ return 0;
case CONVERT (A52_CHANNEL, A52_MONO):
- coeff[0] = coeff[1] = MUL_C (level, LEVEL_6DB);
- return 3;
+ coeff[0] = coeff[1] = MUL_C (level, LEVEL_6DB);
+ return 3;
case CONVERT (A52_STEREO, A52_MONO):
- coeff[0] = coeff[1] = level_3db;
- return 3;
+ coeff[0] = coeff[1] = level_3db;
+ return 3;
case CONVERT (A52_3F, A52_MONO):
- coeff[0] = coeff[2] = level_3db;
- coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
- return 7;
+ coeff[0] = coeff[2] = level_3db;
+ coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
+ return 7;
case CONVERT (A52_2F1R, A52_MONO):
- coeff[0] = coeff[1] = level_3db;
- coeff[2] = MUL_L (level_3db, slev);
- return 7;
+ coeff[0] = coeff[1] = level_3db;
+ coeff[2] = MUL_L (level_3db, slev);
+ return 7;
case CONVERT (A52_2F2R, A52_MONO):
- coeff[0] = coeff[1] = level_3db;
- coeff[2] = coeff[3] = MUL_L (level_3db, slev);
- return 15;
+ coeff[0] = coeff[1] = level_3db;
+ coeff[2] = coeff[3] = MUL_L (level_3db, slev);
+ return 15;
case CONVERT (A52_3F1R, A52_MONO):
- coeff[0] = coeff[2] = level_3db;
- coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
- coeff[3] = MUL_L (level_3db, slev);
- return 15;
+ coeff[0] = coeff[2] = level_3db;
+ coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
+ coeff[3] = MUL_L (level_3db, slev);
+ return 15;
case CONVERT (A52_3F2R, A52_MONO):
- coeff[0] = coeff[2] = level_3db;
- coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
- coeff[3] = coeff[4] = MUL_L (level_3db, slev);
- return 31;
+ coeff[0] = coeff[2] = level_3db;
+ coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
+ coeff[3] = coeff[4] = MUL_L (level_3db, slev);
+ return 31;
case CONVERT (A52_MONO, A52_DOLBY):
- coeff[0] = level_3db;
- return 0;
+ coeff[0] = level_3db;
+ return 0;
case CONVERT (A52_3F, A52_DOLBY):
- coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
- coeff[1] = level_3db;
- return 7;
+ coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
+ coeff[1] = level_3db;
+ return 7;
case CONVERT (A52_3F, A52_STEREO):
case CONVERT (A52_3F1R, A52_2F1R):
case CONVERT (A52_3F2R, A52_2F2R):
- coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
- coeff[1] = MUL_L (level, clev);
- return 7;
+ coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
+ coeff[1] = MUL_L (level, clev);
+ return 7;
case CONVERT (A52_2F1R, A52_DOLBY):
- coeff[0] = coeff[1] = level;
- coeff[2] = level_3db;
- return 7;
+ coeff[0] = coeff[1] = level;
+ coeff[2] = level_3db;
+ return 7;
case CONVERT (A52_2F1R, A52_STEREO):
- coeff[0] = coeff[1] = level;
- coeff[2] = MUL_L (level_3db, slev);
- return 7;
+ coeff[0] = coeff[1] = level;
+ coeff[2] = MUL_L (level_3db, slev);
+ return 7;
case CONVERT (A52_3F1R, A52_DOLBY):
- coeff[0] = coeff[2] = level;
- coeff[1] = coeff[3] = level_3db;
- return 15;
+ coeff[0] = coeff[2] = level;
+ coeff[1] = coeff[3] = level_3db;
+ return 15;
case CONVERT (A52_3F1R, A52_STEREO):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = MUL_L (level_3db, slev);
- return 15;
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = MUL_L (level_3db, slev);
+ return 15;
case CONVERT (A52_2F2R, A52_DOLBY):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = level_3db;
- return 15;
+ coeff[0] = coeff[1] = level;
+ coeff[2] = coeff[3] = level_3db;
+ return 15;
case CONVERT (A52_2F2R, A52_STEREO):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = MUL_L (level, slev);
- return 15;
+ coeff[0] = coeff[1] = level;
+ coeff[2] = coeff[3] = MUL_L (level, slev);
+ return 15;
case CONVERT (A52_3F2R, A52_DOLBY):
- coeff[0] = coeff[2] = level;
- coeff[1] = coeff[3] = coeff[4] = level_3db;
- return 31;
+ coeff[0] = coeff[2] = level;
+ coeff[1] = coeff[3] = coeff[4] = level_3db;
+ return 31;
case CONVERT (A52_3F2R, A52_2F1R):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = coeff[4] = level_3db;
- return 31;
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = coeff[4] = level_3db;
+ return 31;
case CONVERT (A52_3F2R, A52_STEREO):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = coeff[4] = MUL_L (level, slev);
- return 31;
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = coeff[4] = MUL_L (level, slev);
+ return 31;
case CONVERT (A52_3F1R, A52_3F):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = MUL_L (level_3db, slev);
- return 13;
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = MUL_L (level_3db, slev);
+ return 13;
case CONVERT (A52_3F2R, A52_3F):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = coeff[4] = MUL_L (level, slev);
- return 29;
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = coeff[4] = MUL_L (level, slev);
+ return 29;
case CONVERT (A52_2F2R, A52_2F1R):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = level_3db;
- return 12;
+ coeff[0] = coeff[1] = level;
+ coeff[2] = coeff[3] = level_3db;
+ return 12;
case CONVERT (A52_3F2R, A52_3F1R):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = coeff[4] = level_3db;
- return 24;
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = coeff[4] = level_3db;
+ return 24;
case CONVERT (A52_2F1R, A52_2F2R):
- coeff[0] = coeff[1] = level;
- coeff[2] = level_3db;
- return 0;
+ coeff[0] = coeff[1] = level;
+ coeff[2] = level_3db;
+ return 0;
case CONVERT (A52_3F1R, A52_2F2R):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = level_3db;
- return 7;
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = level_3db;
+ return 7;
case CONVERT (A52_3F1R, A52_3F2R):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = level_3db;
- return 0;
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = level_3db;
+ return 0;
case CONVERT (A52_CHANNEL, A52_CHANNEL1):
- coeff[0] = level;
- coeff[1] = 0;
- return 0;
+ coeff[0] = level;
+ coeff[1] = 0;
+ return 0;
case CONVERT (A52_CHANNEL, A52_CHANNEL2):
- coeff[0] = 0;
- coeff[1] = level;
- return 0;
+ coeff[0] = 0;
+ coeff[1] = level;
+ return 0;
}
return -1; /* NOTREACHED */
@@ -334,7 +334,7 @@ static void mix2to1 (sample_t * dest, sample_t * src)
int i;
for (i = 0; i < 256; i++)
- dest[i] += BIAS (src[i]);
+ dest[i] += BIAS (src[i]);
}
static void mix3to1 (sample_t * samples)
@@ -342,7 +342,7 @@ static void mix3to1 (sample_t * samples)
int i;
for (i = 0; i < 256; i++)
- samples[i] += BIAS (samples[i + 256] + samples[i + 512]);
+ samples[i] += BIAS (samples[i + 256] + samples[i + 512]);
}
static void mix4to1 (sample_t * samples)
@@ -350,8 +350,8 @@ static void mix4to1 (sample_t * samples)
int i;
for (i = 0; i < 256; i++)
- samples[i] += BIAS (samples[i + 256] + samples[i + 512] +
- samples[i + 768]);
+ samples[i] += BIAS (samples[i + 256] + samples[i + 512] +
+ samples[i + 768]);
}
static void mix5to1 (sample_t * samples)
@@ -359,8 +359,8 @@ static void mix5to1 (sample_t * samples)
int i;
for (i = 0; i < 256; i++)
- samples[i] += BIAS (samples[i + 256] + samples[i + 512] +
- samples[i + 768] + samples[i + 1024]);
+ samples[i] += BIAS (samples[i + 256] + samples[i + 512] +
+ samples[i + 768] + samples[i + 1024]);
}
static void mix3to2 (sample_t * samples)
@@ -369,9 +369,9 @@ static void mix3to2 (sample_t * samples)
sample_t common;
for (i = 0; i < 256; i++) {
- common = BIAS (samples[i + 256]);
- samples[i] += common;
- samples[i + 256] = samples[i + 512] + common;
+ common = BIAS (samples[i + 256]);
+ samples[i] += common;
+ samples[i + 256] = samples[i + 512] + common;
}
}
@@ -381,9 +381,9 @@ static void mix21to2 (sample_t * left, sample_t * right)
sample_t common;
for (i = 0; i < 256; i++) {
- common = BIAS (right[i + 256]);
- left[i] += common;
- right[i] += common;
+ common = BIAS (right[i + 256]);
+ left[i] += common;
+ right[i] += common;
}
}
@@ -393,9 +393,9 @@ static void mix21toS (sample_t * samples)
sample_t surround;
for (i = 0; i < 256; i++) {
- surround = samples[i + 512];
- samples[i] += BIAS (-surround);
- samples[i + 256] += BIAS (surround);
+ surround = samples[i + 512];
+ samples[i] += BIAS (-surround);
+ samples[i + 256] += BIAS (surround);
}
}
@@ -405,9 +405,9 @@ static void mix31to2 (sample_t * samples)
sample_t common;
for (i = 0; i < 256; i++) {
- common = BIAS (samples[i + 256] + samples[i + 768]);
- samples[i] += common;
- samples[i + 256] = samples[i + 512] + common;
+ common = BIAS (samples[i + 256] + samples[i + 768]);
+ samples[i] += common;
+ samples[i + 256] = samples[i + 512] + common;
}
}
@@ -417,10 +417,10 @@ static void mix31toS (sample_t * samples)
sample_t common, surround;
for (i = 0; i < 256; i++) {
- common = BIAS (samples[i + 256]);
- surround = samples[i + 768];
- samples[i] += common - surround;
- samples[i + 256] = samples[i + 512] + common + surround;
+ common = BIAS (samples[i + 256]);
+ surround = samples[i + 768];
+ samples[i] += common - surround;
+ samples[i + 256] = samples[i + 512] + common + surround;
}
}
@@ -430,9 +430,9 @@ static void mix22toS (sample_t * samples)
sample_t surround;
for (i = 0; i < 256; i++) {
- surround = samples[i + 512] + samples[i + 768];
- samples[i] += BIAS (-surround);
- samples[i + 256] += BIAS (surround);
+ surround = samples[i + 512] + samples[i + 768];
+ samples[i] += BIAS (-surround);
+ samples[i + 256] += BIAS (surround);
}
}
@@ -442,9 +442,9 @@ static void mix32to2 (sample_t * samples)
sample_t common;
for (i = 0; i < 256; i++) {
- common = BIAS (samples[i + 256]);
- samples[i] += common + samples[i + 768];
- samples[i + 256] = common + samples[i + 512] + samples[i + 1024];
+ common = BIAS (samples[i + 256]);
+ samples[i] += common + samples[i + 768];
+ samples[i + 256] = common + samples[i + 512] + samples[i + 1024];
}
}
@@ -454,10 +454,10 @@ static void mix32toS (sample_t * samples)
sample_t common, surround;
for (i = 0; i < 256; i++) {
- common = BIAS (samples[i + 256]);
- surround = samples[i + 768] + samples[i + 1024];
- samples[i] += common - surround;
- samples[i + 256] = samples[i + 512] + common + surround;
+ common = BIAS (samples[i + 256]);
+ surround = samples[i + 768] + samples[i + 1024];
+ samples[i] += common - surround;
+ samples[i + 256] = samples[i + 512] + common + surround;
}
}
@@ -466,7 +466,7 @@ static void move2to1 (sample_t * src, sample_t * dest)
int i;
for (i = 0; i < 256; i++)
- dest[i] = BIAS (src[i] + src[i + 256]);
+ dest[i] = BIAS (src[i] + src[i + 256]);
}
static void zero (sample_t * samples)
@@ -474,11 +474,11 @@ static void zero (sample_t * samples)
int i;
for (i = 0; i < 256; i++)
- samples[i] = 0;
+ samples[i] = 0;
}
void a52_downmix (sample_t * samples, int acmod, int output,
- level_t clev, level_t slev)
+ level_t clev, level_t slev)
{
/* avoid compiler warning */
(void)clev;
@@ -486,138 +486,138 @@ void a52_downmix (sample_t * samples, int acmod, int output,
switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
case CONVERT (A52_CHANNEL, A52_CHANNEL2):
- memcpy (samples, samples + 256, 256 * sizeof (sample_t));
- break;
+ memcpy (samples, samples + 256, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_CHANNEL, A52_MONO):
case CONVERT (A52_STEREO, A52_MONO):
mix_2to1:
- mix2to1 (samples, samples + 256);
- break;
+ mix2to1 (samples, samples + 256);
+ break;
case CONVERT (A52_2F1R, A52_MONO):
- if (slev == 0)
- goto mix_2to1;
+ if (slev == 0)
+ goto mix_2to1;
case CONVERT (A52_3F, A52_MONO):
mix_3to1:
- mix3to1 (samples);
- break;
+ mix3to1 (samples);
+ break;
case CONVERT (A52_3F1R, A52_MONO):
- if (slev == 0)
- goto mix_3to1;
+ if (slev == 0)
+ goto mix_3to1;
case CONVERT (A52_2F2R, A52_MONO):
- if (slev == 0)
- goto mix_2to1;
- mix4to1 (samples);
- break;
+ if (slev == 0)
+ goto mix_2to1;
+ mix4to1 (samples);
+ break;
case CONVERT (A52_3F2R, A52_MONO):
- if (slev == 0)
- goto mix_3to1;
- mix5to1 (samples);
- break;
+ if (slev == 0)
+ goto mix_3to1;
+ mix5to1 (samples);
+ break;
case CONVERT (A52_MONO, A52_DOLBY):
- memcpy (samples + 256, samples, 256 * sizeof (sample_t));
- break;
+ memcpy (samples + 256, samples, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_3F, A52_STEREO):
case CONVERT (A52_3F, A52_DOLBY):
mix_3to2:
- mix3to2 (samples);
- break;
+ mix3to2 (samples);
+ break;
case CONVERT (A52_2F1R, A52_STEREO):
- if (slev == 0)
+ if (slev == 0)
+ break;
+ mix21to2 (samples, samples + 256);
break;
- mix21to2 (samples, samples + 256);
- break;
case CONVERT (A52_2F1R, A52_DOLBY):
- mix21toS (samples);
- break;
+ mix21toS (samples);
+ break;
case CONVERT (A52_3F1R, A52_STEREO):
- if (slev == 0)
- goto mix_3to2;
- mix31to2 (samples);
- break;
+ if (slev == 0)
+ goto mix_3to2;
+ mix31to2 (samples);
+ break;
case CONVERT (A52_3F1R, A52_DOLBY):
- mix31toS (samples);
- break;
+ mix31toS (samples);
+ break;
case CONVERT (A52_2F2R, A52_STEREO):
- if (slev == 0)
+ if (slev == 0)
+ break;
+ mix2to1 (samples, samples + 512);
+ mix2to1 (samples + 256, samples + 768);
break;
- mix2to1 (samples, samples + 512);
- mix2to1 (samples + 256, samples + 768);
- break;
case CONVERT (A52_2F2R, A52_DOLBY):
- mix22toS (samples);
- break;
+ mix22toS (samples);
+ break;
case CONVERT (A52_3F2R, A52_STEREO):
- if (slev == 0)
- goto mix_3to2;
- mix32to2 (samples);
- break;
+ if (slev == 0)
+ goto mix_3to2;
+ mix32to2 (samples);
+ break;
case CONVERT (A52_3F2R, A52_DOLBY):
- mix32toS (samples);
- break;
+ mix32toS (samples);
+ break;
case CONVERT (A52_3F1R, A52_3F):
- if (slev == 0)
+ if (slev == 0)
+ break;
+ mix21to2 (samples, samples + 512);
break;
- mix21to2 (samples, samples + 512);
- break;
case CONVERT (A52_3F2R, A52_3F):
- if (slev == 0)
+ if (slev == 0)
+ break;
+ mix2to1 (samples, samples + 768);
+ mix2to1 (samples + 512, samples + 1024);
break;
- mix2to1 (samples, samples + 768);
- mix2to1 (samples + 512, samples + 1024);
- break;
case CONVERT (A52_3F1R, A52_2F1R):
- mix3to2 (samples);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- break;
+ mix3to2 (samples);
+ memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_2F2R, A52_2F1R):
- mix2to1 (samples + 512, samples + 768);
- break;
+ mix2to1 (samples + 512, samples + 768);
+ break;
case CONVERT (A52_3F2R, A52_2F1R):
- mix3to2 (samples);
- move2to1 (samples + 768, samples + 512);
- break;
+ mix3to2 (samples);
+ move2to1 (samples + 768, samples + 512);
+ break;
case CONVERT (A52_3F2R, A52_3F1R):
- mix2to1 (samples + 768, samples + 1024);
- break;
+ mix2to1 (samples + 768, samples + 1024);
+ break;
case CONVERT (A52_2F1R, A52_2F2R):
- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
- break;
+ memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_3F1R, A52_2F2R):
- mix3to2 (samples);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- break;
+ mix3to2 (samples);
+ memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_3F2R, A52_2F2R):
- mix3to2 (samples);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t));
- break;
+ mix3to2 (samples);
+ memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
+ memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_3F1R, A52_3F2R):
- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
- break;
+ memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
+ break;
}
}
@@ -626,63 +626,63 @@ void a52_upmix (sample_t * samples, int acmod, int output)
switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
case CONVERT (A52_CHANNEL, A52_CHANNEL2):
- memcpy (samples + 256, samples, 256 * sizeof (sample_t));
- break;
+ memcpy (samples + 256, samples, 256 * sizeof (sample_t));
+ break;
case CONVERT (A52_3F2R, A52_MONO):
- zero (samples + 1024);
+ zero (samples + 1024);
case CONVERT (A52_3F1R, A52_MONO):
case CONVERT (A52_2F2R, A52_MONO):
- zero (samples + 768);
+ zero (samples + 768);
case CONVERT (A52_3F, A52_MONO):
case CONVERT (A52_2F1R, A52_MONO):
- zero (samples + 512);
+ zero (samples + 512);
case CONVERT (A52_CHANNEL, A52_MONO):
case CONVERT (A52_STEREO, A52_MONO):
- zero (samples + 256);
- break;
+ zero (samples + 256);
+ break;
case CONVERT (A52_3F2R, A52_STEREO):
case CONVERT (A52_3F2R, A52_DOLBY):
- zero (samples + 1024);
+ zero (samples + 1024);
case CONVERT (A52_3F1R, A52_STEREO):
case CONVERT (A52_3F1R, A52_DOLBY):
- zero (samples + 768);
+ zero (samples + 768);
case CONVERT (A52_3F, A52_STEREO):
case CONVERT (A52_3F, A52_DOLBY):
mix_3to2:
- memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t));
- zero (samples + 256);
- break;
+ memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t));
+ zero (samples + 256);
+ break;
case CONVERT (A52_2F2R, A52_STEREO):
case CONVERT (A52_2F2R, A52_DOLBY):
- zero (samples + 768);
+ zero (samples + 768);
case CONVERT (A52_2F1R, A52_STEREO):
case CONVERT (A52_2F1R, A52_DOLBY):
- zero (samples + 512);
- break;
+ zero (samples + 512);
+ break;
case CONVERT (A52_3F2R, A52_3F):
- zero (samples + 1024);
+ zero (samples + 1024);
case CONVERT (A52_3F1R, A52_3F):
case CONVERT (A52_2F2R, A52_2F1R):
- zero (samples + 768);
- break;
+ zero (samples + 768);
+ break;
case CONVERT (A52_3F2R, A52_3F1R):
- zero (samples + 1024);
- break;
+ zero (samples + 1024);
+ break;
case CONVERT (A52_3F2R, A52_2F1R):
- zero (samples + 1024);
+ zero (samples + 1024);
case CONVERT (A52_3F1R, A52_2F1R):
mix_31to21:
- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
- goto mix_3to2;
+ memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
+ goto mix_3to2;
case CONVERT (A52_3F2R, A52_2F2R):
- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
- goto mix_31to21;
+ memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
+ goto mix_31to21;
}
}
diff --git a/apps/codecs/liba52/imdct.c b/apps/codecs/liba52/imdct.c
index 9aaa9d8..e93424c 100644
--- a/apps/codecs/liba52/imdct.c
+++ b/apps/codecs/liba52/imdct.c
@@ -114,73 +114,73 @@ static inline void ifft4 (complex_t * buf)
*/
/* basic radix-2 ifft butterfly */
-#define BUTTERFLY_0(t0,t1,W0,W1,d0,d1) do { \
- t0 = MUL (W1, d1) + MUL (W0, d0); \
- t1 = MUL (W0, d1) - MUL (W1, d0); \
+#define BUTTERFLY_0(t0,t1,W0,W1,d0,d1) do { \
+ t0 = MUL (W1, d1) + MUL (W0, d0); \
+ t1 = MUL (W0, d1) - MUL (W1, d0); \
} while (0)
/* radix-2 ifft butterfly with bias */
-#define BUTTERFLY_B(t0,t1,W0,W1,d0,d1) do { \
+#define BUTTERFLY_B(t0,t1,W0,W1,d0,d1) do { \
t0 = BIAS (MUL (d1, W1) + MUL (d0, W0)); \
t1 = BIAS (MUL (d1, W0) - MUL (d0, W1)); \
} while (0)
/* the basic split-radix ifft butterfly */
-#define BUTTERFLY(a0,a1,a2,a3,wr,wi) do { \
+#define BUTTERFLY(a0,a1,a2,a3,wr,wi) do { \
BUTTERFLY_0 (tmp5, tmp6, wr, wi, a2.real, a2.imag); \
BUTTERFLY_0 (tmp8, tmp7, wr, wi, a3.imag, a3.real); \
- tmp1 = tmp5 + tmp7; \
- tmp2 = tmp6 + tmp8; \
- tmp3 = tmp6 - tmp8; \
- tmp4 = tmp7 - tmp5; \
- a2.real = a0.real - tmp1; \
- a2.imag = a0.imag - tmp2; \
- a3.real = a1.real - tmp3; \
- a3.imag = a1.imag - tmp4; \
- a0.real += tmp1; \
- a0.imag += tmp2; \
- a1.real += tmp3; \
- a1.imag += tmp4; \
+ tmp1 = tmp5 + tmp7; \
+ tmp2 = tmp6 + tmp8; \
+ tmp3 = tmp6 - tmp8; \
+ tmp4 = tmp7 - tmp5; \
+ a2.real = a0.real - tmp1; \
+ a2.imag = a0.imag - tmp2; \
+ a3.real = a1.real - tmp3; \
+ a3.imag = a1.imag - tmp4; \
+ a0.real += tmp1; \
+ a0.imag += tmp2; \
+ a1.real += tmp3; \
+ a1.imag += tmp4; \
} while (0)
/* split-radix ifft butterfly, specialized for wr=1 wi=0 */
-#define BUTTERFLY_ZERO(a0,a1,a2,a3) do { \
- tmp1 = a2.real + a3.real; \
- tmp2 = a2.imag + a3.imag; \
- tmp3 = a2.imag - a3.imag; \
- tmp4 = a3.real - a2.real; \
- a2.real = a0.real - tmp1; \
- a2.imag = a0.imag - tmp2; \
- a3.real = a1.real - tmp3; \
- a3.imag = a1.imag - tmp4; \
- a0.real += tmp1; \
- a0.imag += tmp2; \
- a1.real += tmp3; \
- a1.imag += tmp4; \
+#define BUTTERFLY_ZERO(a0,a1,a2,a3) do { \
+ tmp1 = a2.real + a3.real; \
+ tmp2 = a2.imag + a3.imag; \
+ tmp3 = a2.imag - a3.imag; \
+ tmp4 = a3.real - a2.real; \
+ a2.real = a0.real - tmp1; \
+ a2.imag = a0.imag - tmp2; \
+ a3.real = a1.real - tmp3; \
+ a3.imag = a1.imag - tmp4; \
+ a0.real += tmp1; \
+ a0.imag += tmp2; \
+ a1.real += tmp3; \
+ a1.imag += tmp4; \
} while (0)
/* split-radix ifft butterfly, specialized for wr=wi */
/*
-#define BUTTERFLY_HALF(a0,a1,a2,a3,w) do { \
- tmp5 = MUL (a2.real + a2.imag, w); \
- tmp6 = MUL (a2.imag - a2.real, w); \
- tmp7 = MUL (a3.real - a3.imag, w); \
- tmp8 = MUL (a3.imag + a3.real, w); \
- tmp1 = tmp5 + tmp7; \
- tmp2 = tmp6 + tmp8; \
- tmp3 = tmp6 - tmp8; \
- tmp4 = tmp7 - tmp5; \
- a2.real = a0.real - tmp1; \
- a2.imag = a0.imag - tmp2; \
- a3.real = a1.real - tmp3; \
- a3.imag = a1.imag - tmp4; \
- a0.real += tmp1; \
- a0.imag += tmp2; \
- a1.real += tmp3; \
- a1.imag += tmp4; \
+#define BUTTERFLY_HALF(a0,a1,a2,a3,w) do { \
+ tmp5 = MUL (a2.real + a2.imag, w); \
+ tmp6 = MUL (a2.imag - a2.real, w); \
+ tmp7 = MUL (a3.real - a3.imag, w); \
+ tmp8 = MUL (a3.imag + a3.real, w); \
+ tmp1 = tmp5 + tmp7; \
+ tmp2 = tmp6 + tmp8; \
+ tmp3 = tmp6 - tmp8; \
+ tmp4 = tmp7 - tmp5; \
+ a2.real = a0.real - tmp1; \
+ a2.imag = a0.imag - tmp2; \
+ a3.real = a1.real - tmp3; \
+ a3.imag = a1.imag - tmp4; \
+ a0.real += tmp1; \
+ a0.imag += tmp2; \
+ a1.real += tmp3; \
+ a1.imag += tmp4; \
} while (0)
static inline void ifft8 (complex_t * buf)
@@ -212,13 +212,13 @@ static void ifft_pass (complex_t * buf, const sample_t * weight, int n)
i = n - 1;
do {
- BUTTERFLY (buf[0], buf1[0], buf2[0], buf3[0],
- weight[0], weight[2*i-n]);
- buf++;
- buf1++;
- buf2++;
- buf3++;
- weight++;
+ BUTTERFLY (buf[0], buf1[0], buf2[0], buf3[0],
+ weight[0], weight[2*i-n]);
+ buf++;
+ buf1++;
+ buf2++;
+ buf3++;
+ weight++;
} while (--i);
}
@@ -264,7 +264,7 @@ void a52_imdct_512 (sample_t * data, sample_t * delay)
sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2;
const sample_t * window = a52_imdct_window;
FFTComplex buf[128];
-
+
for (i = 0; i < 128; i++) {
k = fftorder[i];
t_r = pre1[i].real;
@@ -357,7 +357,7 @@ static double besselI0 (double x)
int i = 100;
do
- bessel = bessel * x / (i * i) + 1;
+ bessel = bessel * x / (i * i) + 1;
while (--i);
return bessel;
}
@@ -376,13 +376,13 @@ void a52_imdct_init (uint32_t mm_accel)
/* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */
/* sum = 0;
for (i = 0; i < 256; i++) {
- sum += besselI0 (i * (256 - i) * (5 * M_PI / 256) * (5 * M_PI / 256));
- local_imdct_window[i] = sum;
+ sum += besselI0 (i * (256 - i) * (5 * M_PI / 256) * (5 * M_PI / 256));
+ local_imdct_window[i] = sum;
}
sum++;
*/
/* for (i = 0; i < 256; i++)
- a52_imdct_window[i] = SAMPLE (sqrt (local_imdct_window[i] / sum));
+ a52_imdct_window[i] = SAMPLE (sqrt (local_imdct_window[i] / sum));
printf("static sample_t a52_imdct_window[256]={");
for (i=0;i<256;i++) {
@@ -393,26 +393,26 @@ void a52_imdct_init (uint32_t mm_accel)
*/
/* for (i = 0; i < 3; i++)
- roots16[i] = SAMPLE (cos ((M_PI / 8) * (i + 1)));
+ roots16[i] = SAMPLE (cos ((M_PI / 8) * (i + 1)));
printf("static sample_t roots16[3]={%d,%d,%d};\n\n",roots16[0],roots16[1],roots16[2]);
for (i = 0; i < 7; i++)
- roots32[i] = SAMPLE (cos ((M_PI / 16) * (i + 1)));
+ roots32[i] = SAMPLE (cos ((M_PI / 16) * (i + 1)));
printf("static sample_t roots32[7]={");
for (i=0;i<7;i++) { printf("%d%s",roots32[i],(i < 6 ? "," : "")); }
printf("};\n");
for (i = 0; i < 15; i++)
- roots64[i] = SAMPLE (cos ((M_PI / 32) * (i + 1)));
+ roots64[i] = SAMPLE (cos ((M_PI / 32) * (i + 1)));
printf("static sample_t roots64[15]={");
for (i=0;i<15;i++) { printf("%d%s",roots64[i],(i < 14 ? "," : "")); }
printf("};\n");
for (i = 0; i < 31; i++)
- roots128[i] = SAMPLE (cos ((M_PI / 64) * (i + 1)));
+ roots128[i] = SAMPLE (cos ((M_PI / 64) * (i + 1)));
printf("static sample_t roots128[31]={");
for (i=0;i<31;i++) { printf("%d%s",roots128[i],(i < 30 ? "," : "")); }
@@ -420,15 +420,15 @@ void a52_imdct_init (uint32_t mm_accel)
*/
/*
for (i = 0; i < 64; i++) {
- k = fftorder[i] / 2 + 64;
- pre1[i].real = SAMPLE (cos ((M_PI / 256) * (k - 0.25)));
- pre1[i].imag = SAMPLE (sin ((M_PI / 256) * (k - 0.25)));
+ k = fftorder[i] / 2 + 64;
+ pre1[i].real = SAMPLE (cos ((M_PI / 256) * (k - 0.25)));
+ pre1[i].imag = SAMPLE (sin ((M_PI / 256) * (k - 0.25)));
}
for (i = 64; i < 128; i++) {
- k = fftorder[i] / 2 + 64;
- pre1[i].real = SAMPLE (-cos ((M_PI / 256) * (k - 0.25)));
- pre1[i].imag = SAMPLE (-sin ((M_PI / 256) * (k - 0.25)));
+ k = fftorder[i] / 2 + 64;
+ pre1[i].real = SAMPLE (-cos ((M_PI / 256) * (k - 0.25)));
+ pre1[i].imag = SAMPLE (-sin ((M_PI / 256) * (k - 0.25)));
}
printf("static complex_t pre1[128]={");
@@ -437,8 +437,8 @@ void a52_imdct_init (uint32_t mm_accel)
*/
/*
for (i = 0; i < 64; i++) {
- post1[i].real = SAMPLE (cos ((M_PI / 256) * (i + 0.5)));
- post1[i].imag = SAMPLE (sin ((M_PI / 256) * (i + 0.5)));
+ post1[i].real = SAMPLE (cos ((M_PI / 256) * (i + 0.5)));
+ post1[i].imag = SAMPLE (sin ((M_PI / 256) * (i + 0.5)));
}
printf("static complex_t post1[64]={");
@@ -448,9 +448,9 @@ void a52_imdct_init (uint32_t mm_accel)
/*
for (i = 0; i < 64; i++) {
- k = fftorder[i] / 4;
- pre2[i].real = SAMPLE (cos ((M_PI / 128) * (k - 0.25)));
- pre2[i].imag = SAMPLE (sin ((M_PI / 128) * (k - 0.25)));
+ k = fftorder[i] / 4;
+ pre2[i].real = SAMPLE (cos ((M_PI / 128) * (k - 0.25)));
+ pre2[i].imag = SAMPLE (sin ((M_PI / 128) * (k - 0.25)));
}
printf("static complex_t pre2[64]={");
@@ -458,8 +458,8 @@ void a52_imdct_init (uint32_t mm_accel)
printf("};\n");
for (i = 0; i < 32; i++) {
- post2[i].real = SAMPLE (cos ((M_PI / 128) * (i + 0.5)));
- post2[i].imag = SAMPLE (sin ((M_PI / 128) * (i + 0.5)));
+ post2[i].real = SAMPLE (cos ((M_PI / 128) * (i + 0.5)));
+ post2[i].imag = SAMPLE (sin ((M_PI / 128) * (i + 0.5)));
}
printf("static complex_t post2[32]={");
@@ -470,17 +470,17 @@ void a52_imdct_init (uint32_t mm_accel)
#ifdef LIBA52_DJBFFT
if (mm_accel & MM_ACCEL_DJBFFT) {
#ifndef LIBA52_DOUBLE
- ifft128 = (void (*) (complex_t *)) fftc4_un128;
- ifft64 = (void (*) (complex_t *)) fftc4_un64;
+ ifft128 = (void (*) (complex_t *)) fftc4_un128;
+ ifft64 = (void (*) (complex_t *)) fftc4_un64;
#else
- ifft128 = (void (*) (complex_t *)) fftc8_un128;
- ifft64 = (void (*) (complex_t *)) fftc8_un64;
+ ifft128 = (void (*) (complex_t *)) fftc8_un128;
+ ifft64 = (void (*) (complex_t *)) fftc8_un64;
#endif
} else
#endif
{
- ifft128 = ifft128_c;
- ifft64 = ifft64_c;
+ ifft128 = ifft128_c;
+ ifft64 = ifft64_c;
}
*/
}
diff --git a/apps/codecs/liba52/imdct_lookups.h b/apps/codecs/liba52/imdct_lookups.h
index 769623f..9d14fe2 100644
--- a/apps/codecs/liba52/imdct_lookups.h
+++ b/apps/codecs/liba52/imdct_lookups.h
@@ -1,5 +1,5 @@
static const sample_t a52_imdct_window[256]ICONST_ATTR={
- 146020,261886,393529,545197,719447,918478,1144416,1399394,1685589,2005234,2360623,2754115,3188134,3665170,4187773,4758556, 5380193,6055411,6786995,7577779,8430645,9348521,10334375,11391212,12522071,13730020,15018150,16389576,17847424,19394833,21034947,22770912, 24605865,26542938,28585242,30735872,32997891,35374332,37868188,40482408,43219889,46083473,49075937,52199993,55458273,58853331,62387636,66063559, 69883377,73849259,77963266,82227341,86643307,91212859,95937560,100818835,105857968,111056092,116414194,121933098,127613474,133455822,139460477,145627601, 151957182,158449029,165102772,171917855,178893540,186028900,193322822,200774000,208380940,216141958,224055176,232118527,240329753,248686407,257185854,265825270, 274601649,283511802,292552357,301719768,311010314,320420105,329945084,339581031,349323572,359168178,369110174,379144743,389266934,399471665,409753732,420107815, 430528483,441010205,451547355,462134219,472765003,483433845,494134818,504861939,515609181,526370480,537139740,547910849,558677680,569434108,580174011,590891284, 601579849,612233658,622846709,633413050,643926788,654382103,664773249,675094567,685340494,695505569,705584441,715571877,725462772,735252152,744935184,754507184, 763963620,773300119,782512477,791596659,800548807,809365245,818042484,826577226,834966364,843206992,851296404,859232096,867011771,874633340,882094922,889394844, 896531647,903504079,910311101,916951881,923425798,929732436,935871584,941843233,947647575,953284997,958756080,964061593,969202490,974179906,978995149,983649698, 988145195,992483442,996666390,1000696136,1004574919,1008305104,1011889185,1015329772,1018629583,1021791439,1024818257,1027713038,1030478862,1033118881,1035636308,1038034411, 1040316504,1042485942,1044546109,1046500412,1048352275,1050105129,1051762405,1053327531,1054803917,1056194958,1057504020,1058734435,1059889501,1060972468,1061986539,1062934861, 1063820523,1064646551,1065415903,1066131467,1066796055,1067412403,1067983168,1068510924,1068998160,1069447282,1069860607,1070240366,1070588702,1070907668,1071199230,1071465266, 1071707567,1071927836,1072127692,1072308670,1072472221,1072619716,1072752449,1072871635,1072978415,1073073858,1073158963,1073234663,1073301826,1073361257,1073413702,1073459852, 1073500344,1073535763,1073566646,1073593486,1073616731,1073636791,1073654036,1073668804,1073681398,1073692090,1073701126,1073708726,1073715084,1073720373,1073724748,1073728344, 1073731279,1073733657,1073735568,1073737090,1073738291,1073739229,1073739951,1073740500,1073740912,1073741214,1073741431,1073741582,1073741685,1073741751,1073741792,1073741814
+ 146020,261886,393529,545197,719447,918478,1144416,1399394,1685589,2005234,2360623,2754115,3188134,3665170,4187773,4758556, 5380193,6055411,6786995,7577779,8430645,9348521,10334375,11391212,12522071,13730020,15018150,16389576,17847424,19394833,21034947,22770912, 24605865,26542938,28585242,30735872,32997891,35374332,37868188,40482408,43219889,46083473,49075937,52199993,55458273,58853331,62387636,66063559, 69883377,73849259,77963266,82227341,86643307,91212859,95937560,100818835,105857968,111056092,116414194,121933098,127613474,133455822,139460477,145627601, 151957182,158449029,165102772,171917855,178893540,186028900,193322822,200774000,208380940,216141958,224055176,232118527,240329753,248686407,257185854,265825270, 274601649,283511802,292552357,301719768,311010314,320420105,329945084,339581031,349323572,359168178,369110174,379144743,389266934,399471665,409753732,420107815, 430528483,441010205,451547355,462134219,472765003,483433845,494134818,504861939,515609181,526370480,537139740,547910849,558677680,569434108,580174011,590891284, 601579849,612233658,622846709,633413050,643926788,654382103,664773249,675094567,685340494,695505569,705584441,715571877,725462772,735252152,744935184,754507184, 763963620,773300119,782512477,791596659,800548807,809365245,818042484,826577226,834966364,843206992,851296404,859232096,867011771,874633340,882094922,889394844, 896531647,903504079,910311101,916951881,923425798,929732436,935871584,941843233,947647575,953284997,958756080,964061593,969202490,974179906,978995149,983649698, 988145195,992483442,996666390,1000696136,1004574919,1008305104,1011889185,1015329772,1018629583,1021791439,1024818257,1027713038,1030478862,1033118881,1035636308,1038034411, 1040316504,1042485942,1044546109,1046500412,1048352275,1050105129,1051762405,1053327531,1054803917,1056194958,1057504020,1058734435,1059889501,1060972468,1061986539,1062934861, 1063820523,1064646551,1065415903,1066131467,1066796055,1067412403,1067983168,1068510924,1068998160,1069447282,1069860607,1070240366,1070588702,1070907668,1071199230,1071465266, 1071707567,1071927836,1072127692,1072308670,1072472221,1072619716,1072752449,1072871635,1072978415,1073073858,1073158963,1073234663,1073301826,1073361257,1073413702,1073459852, 1073500344,1073535763,1073566646,1073593486,1073616731,1073636791,1073654036,1073668804,1073681398,1073692090,1073701126,1073708726,1073715084,1073720373,1073724748,1073728344, 1073731279,1073733657,1073735568,1073737090,1073738291,1073739229,1073739951,1073740500,1073740912,1073741214,1073741431,1073741582,1073741685,1073741751,1073741792,1073741814
};
static const sample_t roots16[3]ICONST_ATTR={992008094,759250124,410903206};
diff --git a/apps/codecs/liba52/mm_accel.h b/apps/codecs/liba52/mm_accel.h
index 8005930..aafc3fe 100644
--- a/apps/codecs/liba52/mm_accel.h
+++ b/apps/codecs/liba52/mm_accel.h
@@ -25,12 +25,12 @@
#define MM_ACCEL_H
/* generic accelerations */
-#define MM_ACCEL_DJBFFT 0x00000001
+#define MM_ACCEL_DJBFFT 0x00000001
/* x86 accelerations */
-#define MM_ACCEL_X86_MMX 0x80000000
-#define MM_ACCEL_X86_3DNOW 0x40000000
-#define MM_ACCEL_X86_MMXEXT 0x20000000
+#define MM_ACCEL_X86_MMX 0x80000000
+#define MM_ACCEL_X86_3DNOW 0x40000000
+#define MM_ACCEL_X86_MMXEXT 0x20000000
uint32_t mm_accel (void);
diff --git a/apps/codecs/liba52/parse.c b/apps/codecs/liba52/parse.c
index fd7e130..c61c13c 100644
--- a/apps/codecs/liba52/parse.c
+++ b/apps/codecs/liba52/parse.c
@@ -66,19 +66,19 @@ a52_state_t * a52_init (uint32_t mm_accel)
simultenously. NOTE, you also need to remove comments in a52_free.
state = (a52_state_t *) malloc (sizeof (a52_state_t));
if (state == NULL)
- return NULL;
+ return NULL;
state->samples = (sample_t *) memalign (16, 256 * 12 * sizeof (sample_t));
if (state->samples == NULL) {
- free (state);
- return NULL;
+ free (state);
+ return NULL;
}
*/
state = &istate;
state->samples = isamples;
for (i = 0; i < 256 * 12; i++)
- state->samples[i] = 0;
+ state->samples[i] = 0;
state->downmixed = 1;
@@ -95,11 +95,11 @@ sample_t * a52_samples (a52_state_t * state)
}
int a52_syncinfo (uint8_t * buf, int * flags,
- int * sample_rate, int * bit_rate)
+ int * sample_rate, int * bit_rate)
{
static int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112,
- 128, 160, 192, 224, 256, 320, 384, 448,
- 512, 576, 640};
+ 128, 160, 192, 224, 256, 320, 384, 448,
+ 512, 576, 640};
static uint8_t lfeon[8] = {0x10, 0x10, 0x04, 0x04, 0x04, 0x01, 0x04, 0x01};
int frmsizecod;
int bitrate;
@@ -107,45 +107,45 @@ int a52_syncinfo (uint8_t * buf, int * flags,
int acmod;
if ((buf[0] != 0x0b) || (buf[1] != 0x77)) /* syncword */
- return 0;
+ return 0;
- if (buf[5] >= 0x60) /* bsid >= 12 */
- return 0;
+ if (buf[5] >= 0x60) /* bsid >= 12 */
+ return 0;
half = halfrate[buf[5] >> 3];
/* acmod, dsurmod and lfeon */
acmod = buf[6] >> 5;
*flags = ((((buf[6] & 0xf8) == 0x50) ? A52_DOLBY : acmod) |
- ((buf[6] & lfeon[acmod]) ? A52_LFE : 0));
+ ((buf[6] & lfeon[acmod]) ? A52_LFE : 0));
frmsizecod = buf[4] & 63;
if (frmsizecod >= 38)
- return 0;
+ return 0;
bitrate = rate [frmsizecod >> 1];
*bit_rate = (bitrate * 1000) >> half;
switch (buf[4] & 0xc0) {
case 0:
- *sample_rate = 48000 >> half;
- return 4 * bitrate;
+ *sample_rate = 48000 >> half;
+ return 4 * bitrate;
case 0x40:
- *sample_rate = 44100 >> half;
- return 2 * (320 * bitrate / 147 + (frmsizecod & 1));
+ *sample_rate = 44100 >> half;
+ return 2 * (320 * bitrate / 147 + (frmsizecod & 1));
case 0x80:
- *sample_rate = 32000 >> half;
- return 6 * bitrate;
+ *sample_rate = 32000 >> half;
+ return 6 * bitrate;
default:
- return 0;
+ return 0;
}
}
int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
- level_t * level, sample_t bias)
+ level_t * level, sample_t bias)
{
static level_t clev[4] = { LEVEL (LEVEL_3DB), LEVEL (LEVEL_45DB),
- LEVEL (LEVEL_6DB), LEVEL (LEVEL_45DB) };
+ LEVEL (LEVEL_6DB), LEVEL (LEVEL_45DB) };
static level_t slev[4] = { LEVEL (LEVEL_3DB), LEVEL (LEVEL_6DB),
- 0, LEVEL (LEVEL_6DB) };
+ 0, LEVEL (LEVEL_6DB) };
int chaninfo;
int acmod;
@@ -156,25 +156,25 @@ int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
a52_bitstream_set_ptr (state, buf + 6);
bitstream_get (state, 3); /* skip acmod we already parsed */
- if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */
- acmod = A52_DOLBY;
+ if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */
+ acmod = A52_DOLBY;
state->clev = state->slev = 0;
if ((acmod & 1) && (acmod != 1))
- state->clev = clev[bitstream_get (state, 2)]; /* cmixlev */
+ state->clev = clev[bitstream_get (state, 2)]; /* cmixlev */
if (acmod & 4)
- state->slev = slev[bitstream_get (state, 2)]; /* surmixlev */
+ state->slev = slev[bitstream_get (state, 2)]; /* surmixlev */
state->lfeon = bitstream_get (state, 1);
state->output = a52_downmix_init (acmod, *flags, level,
- state->clev, state->slev);
+ state->clev, state->slev);
if (state->output < 0)
- return 1;
+ return 1;
if (state->lfeon && (*flags & A52_LFE))
- state->output |= A52_LFE;
+ state->output |= A52_LFE;
*flags = state->output;
/* the 2* compensates for differences in imdct */
state->dynrng = state->level = MUL_C (*level, 2);
@@ -183,98 +183,98 @@ int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
state->dynrngcall = NULL;
state->cplba.deltbae = DELTA_BIT_NONE;
state->ba[0].deltbae = state->ba[1].deltbae = state->ba[2].deltbae =
- state->ba[3].deltbae = state->ba[4].deltbae = DELTA_BIT_NONE;
+ state->ba[3].deltbae = state->ba[4].deltbae = DELTA_BIT_NONE;
chaninfo = !acmod;
do {
- bitstream_get (state, 5); /* dialnorm */
- if (bitstream_get (state, 1)) /* compre */
- bitstream_get (state, 8); /* compr */
- if (bitstream_get (state, 1)) /* langcode */
- bitstream_get (state, 8); /* langcod */
- if (bitstream_get (state, 1)) /* audprodie */
- bitstream_get (state, 7); /* mixlevel + roomtyp */
+ bitstream_get (state, 5); /* dialnorm */
+ if (bitstream_get (state, 1)) /* compre */
+ bitstream_get (state, 8); /* compr */
+ if (bitstream_get (state, 1)) /* langcode */
+ bitstream_get (state, 8); /* langcod */
+ if (bitstream_get (state, 1)) /* audprodie */
+ bitstream_get (state, 7); /* mixlevel + roomtyp */
} while (chaninfo--);
- bitstream_get (state, 2); /* copyrightb + origbs */
+ bitstream_get (state, 2); /* copyrightb + origbs */
- if (bitstream_get (state, 1)) /* timecod1e */
- bitstream_get (state, 14); /* timecod1 */
- if (bitstream_get (state, 1)) /* timecod2e */
- bitstream_get (state, 14); /* timecod2 */
+ if (bitstream_get (state, 1)) /* timecod1e */
+ bitstream_get (state, 14); /* timecod1 */
+ if (bitstream_get (state, 1)) /* timecod2e */
+ bitstream_get (state, 14); /* timecod2 */
- if (bitstream_get (state, 1)) { /* addbsie */
- int addbsil;
+ if (bitstream_get (state, 1)) { /* addbsie */
+ int addbsil;
- addbsil = bitstream_get (state, 6);
- do {
- bitstream_get (state, 8); /* addbsi */
- } while (addbsil--);
+ addbsil = bitstream_get (state, 6);
+ do {
+ bitstream_get (state, 8); /* addbsi */
+ } while (addbsil--);
}
return 0;
}
void a52_dynrng (a52_state_t * state,
- level_t (* call) (level_t, void *), void * data)
+ level_t (* call) (level_t, void *), void * data)
{
state->dynrnge = 0;
if (call) {
- state->dynrnge = 1;
- state->dynrngcall = call;
- state->dynrngdata = data;
+ state->dynrnge = 1;
+ state->dynrngcall = call;
+ state->dynrngdata = data;
}
}
static int parse_exponents (a52_state_t * state, int expstr, int ngrps,
- uint8_t exponent, uint8_t * dest)
+ uint8_t exponent, uint8_t * dest)
{
int exps;
while (ngrps--) {
- exps = bitstream_get (state, 7);
+ exps = bitstream_get (state, 7);
- exponent += exp_1[exps];
- if (exponent > 24)
- return 1;
+ exponent += exp_1[exps];
+ if (exponent > 24)
+ return 1;
- switch (expstr) {
- case EXP_D45:
- *(dest++) = exponent;
- *(dest++) = exponent;
- case EXP_D25:
- *(dest++) = exponent;
- case EXP_D15:
- *(dest++) = exponent;
- }
+ switch (expstr) {
+ case EXP_D45:
+ *(dest++) = exponent;
+ *(dest++) = exponent;
+ case EXP_D25:
+ *(dest++) = exponent;
+ case EXP_D15:
+ *(dest++) = exponent;
+ }
- exponent += exp_2[exps];
- if (exponent > 24)
- return 1;
+ exponent += exp_2[exps];
+ if (exponent > 24)
+ return 1;
- switch (expstr) {
- case EXP_D45:
- *(dest++) = exponent;
- *(dest++) = exponent;
- case EXP_D25:
- *(dest++) = exponent;
- case EXP_D15:
- *(dest++) = exponent;
- }
+ switch (expstr) {
+ case EXP_D45:
+ *(dest++) = exponent;
+ *(dest++) = exponent;
+ case EXP_D25:
+ *(dest++) = exponent;
+ case EXP_D15:
+ *(dest++) = exponent;
+ }
- exponent += exp_3[exps];
- if (exponent > 24)
- return 1;
+ exponent += exp_3[exps];
+ if (exponent > 24)
+ return 1;
- switch (expstr) {
- case EXP_D45:
- *(dest++) = exponent;
- *(dest++) = exponent;
- case EXP_D25:
- *(dest++) = exponent;
- case EXP_D15:
- *(dest++) = exponent;
- }
+ switch (expstr) {
+ case EXP_D45:
+ *(dest++) = exponent;
+ *(dest++) = exponent;
+ case EXP_D25:
+ *(dest++) = exponent;
+ case EXP_D15:
+ *(dest++) = exponent;
+ }
}
return 0;
@@ -289,16 +289,16 @@ static int parse_deltba (a52_state_t * state, int8_t * deltba)
deltnseg = bitstream_get (state, 3);
j = 0;
do {
- j += bitstream_get (state, 5);
- deltlen = bitstream_get (state, 4);
- delta = bitstream_get (state, 3);
- delta -= (delta >= 4) ? 3 : 4;
- if (!deltlen)
- continue;
- if (j + deltlen >= 50)
- return 1;
- while (deltlen--)
- deltba[j++] = delta;
+ j += bitstream_get (state, 5);
+ deltlen = bitstream_get (state, 4);
+ delta = bitstream_get (state, 3);
+ delta -= (delta >= 4) ? 3 : 4;
+ if (!deltlen)
+ continue;
+ if (j + deltlen >= 50)
+ return 1;
+ while (deltlen--)
+ deltba[j++] = delta;
} while (deltnseg--);
return 0;
@@ -309,12 +309,12 @@ static inline int zero_snr_offsets (int nfchans, a52_state_t * state)
int i;
if ((state->csnroffst) ||
- (state->chincpl && state->cplba.bai >> 3) || /* cplinu, fsnroffst */
- (state->lfeon && state->lfeba.bai >> 3)) /* fsnroffst */
- return 0;
- for (i = 0; i < nfchans; i++)
- if (state->ba[i].bai >> 3) /* fsnroffst */
+ (state->chincpl && state->cplba.bai >> 3) || /* cplinu, fsnroffst */
+ (state->lfeon && state->lfeba.bai >> 3)) /* fsnroffst */
return 0;
+ for (i = 0; i < nfchans; i++)
+ if (state->ba[i].bai >> 3) /* fsnroffst */
+ return 0;
return 1;
}
@@ -323,7 +323,7 @@ static inline int16_t dither_gen (a52_state_t * state)
int16_t nstate;
nstate = dither_lut[state->lfsr_state >> 8] ^ (state->lfsr_state << 8);
-
+
state->lfsr_state = (uint16_t) nstate;
return (3 * nstate) >> 2;
@@ -332,21 +332,21 @@ static inline int16_t dither_gen (a52_state_t * state)
#ifndef LIBA52_FIXED
#define COEFF(c,t,l,s,e) (c) = (t) * (s)[e]
#else
-#define COEFF(c,_t,_l,s,e) do { \
- quantizer_t t = (_t); \
- level_t l = (_l); \
- int shift = e - 5; \
+#define COEFF(c,_t,_l,s,e) do { \
+ quantizer_t t = (_t); \
+ level_t l = (_l); \
+ int shift = e - 5; \
sample_t tmp = t * (l >> 16) + ((t * (l & 0xffff)) >> 16); \
- if (shift >= 0) \
- (c) = tmp >> shift; \
- else \
- (c) = tmp << -shift; \
+ if (shift >= 0) \
+ (c) = tmp >> shift; \
+ else \
+ (c) = tmp << -shift; \
} while (0)
#endif
static void coeff_get (a52_state_t * state, sample_t * coeff,
- expbap_t * expbap, quantizer_set_t * quant,
- level_t level, int dither, int end)
+ expbap_t * expbap, quantizer_set_t * quant,
+ level_t level, int dither, int end)
{
int i;
uint8_t * exp;
@@ -356,96 +356,96 @@ static void coeff_get (a52_state_t * state, sample_t * coeff,
sample_t factor[25];
for (i = 0; i <= 24; i++)
- factor[i] = scale_factor[i] * level;
+ factor[i] = scale_factor[i] * level;
#endif
exp = expbap->exp;
bap = expbap->bap;
for (i = 0; i < end; i++) {
- int bapi;
-
- bapi = bap[i];
- switch (bapi) {
- case 0:
- if (dither) {
- COEFF (coeff[i], dither_gen (state), level, factor, exp[i]);
- continue;
- } else {
- coeff[i] = 0;
- continue;
- }
-
- case -1:
- if (quant->q1_ptr >= 0) {
- COEFF (coeff[i], quant->q1[quant->q1_ptr--], level,
- factor, exp[i]);
- continue;
- } else {
- int code;
-
- code = bitstream_get (state, 5);
-
- quant->q1_ptr = 1;
- quant->q1[0] = q_1_2[code];
- quant->q1[1] = q_1_1[code];
- COEFF (coeff[i], q_1_0[code], level, factor, exp[i]);
- continue;
- }
+ int bapi;
- case -2:
- if (quant->q2_ptr >= 0) {
- COEFF (coeff[i], quant->q2[quant->q2_ptr--], level,
- factor, exp[i]);
- continue;
- } else {
- int code;
+ bapi = bap[i];
+ switch (bapi) {
+ case 0:
+ if (dither) {
+ COEFF (coeff[i], dither_gen (state), level, factor, exp[i]);
+ continue;
+ } else {
+ coeff[i] = 0;
+ continue;
+ }
- code = bitstream_get (state, 7);
+ case -1:
+ if (quant->q1_ptr >= 0) {
+ COEFF (coeff[i], quant->q1[quant->q1_ptr--], level,
+ factor, exp[i]);
+ continue;
+ } else {
+ int code;
+
+ code = bitstream_get (state, 5);
+
+ quant->q1_ptr = 1;
+ quant->q1[0] = q_1_2[code];
+ quant->q1[1] = q_1_1[code];
+ COEFF (coeff[i], q_1_0[code], level, factor, exp[i]);
+ continue;
+ }
- quant->q2_ptr = 1;
- quant->q2[0] = q_2_2[code];
- quant->q2[1] = q_2_1[code];
- COEFF (coeff[i], q_2_0[code], level, factor, exp[i]);
- continue;
- }
+ case -2:
+ if (quant->q2_ptr >= 0) {
+ COEFF (coeff[i], quant->q2[quant->q2_ptr--], level,
+ factor, exp[i]);
+ continue;
+ } else {
+ int code;
+
+ code = bitstream_get (state, 7);
+
+ quant->q2_ptr = 1;
+ quant->q2[0] = q_2_2[code];
+ quant->q2[1] = q_2_1[code];
+ COEFF (coeff[i], q_2_0[code], level, factor, exp[i]);
+ continue;
+ }
- case 3:
- COEFF (coeff[i], q_3[bitstream_get (state, 3)], level,
- factor, exp[i]);
- continue;
+ case 3:
+ COEFF (coeff[i], q_3[bitstream_get (state, 3)], level,
+ factor, exp[i]);
+ continue;
- case -3:
- if (quant->q4_ptr == 0) {
- quant->q4_ptr = -1;
- COEFF (coeff[i], quant->q4, level, factor, exp[i]);
- continue;
- } else {
- int code;
+ case -3:
+ if (quant->q4_ptr == 0) {
+ quant->q4_ptr = -1;
+ COEFF (coeff[i], quant->q4, level, factor, exp[i]);
+ continue;
+ } else {
+ int code;
+
+ code = bitstream_get (state, 7);
+
+ quant->q4_ptr = 0;
+ quant->q4 = q_4_1[code];
+ COEFF (coeff[i], q_4_0[code], level, factor, exp[i]);
+ continue;
+ }
- code = bitstream_get (state, 7);
+ case 4:
+ COEFF (coeff[i], q_5[bitstream_get (state, 4)], level,
+ factor, exp[i]);
+ continue;
- quant->q4_ptr = 0;
- quant->q4 = q_4_1[code];
- COEFF (coeff[i], q_4_0[code], level, factor, exp[i]);
- continue;
+ default:
+ COEFF (coeff[i], bitstream_get_2 (state, bapi) << (16 - bapi),
+ level, factor, exp[i]);
}
-
- case 4:
- COEFF (coeff[i], q_5[bitstream_get (state, 4)], level,
- factor, exp[i]);
- continue;
-
- default:
- COEFF (coeff[i], bitstream_get_2 (state, bapi) << (16 - bapi),
- level, factor, exp[i]);
- }
}
}
static void coeff_get_coupling (a52_state_t * state, int nfchans,
- level_t * coeff, sample_t (* samples)[256],
- quantizer_set_t * quant, uint8_t dithflag[5])
+ level_t * coeff, sample_t (* samples)[256],
+ quantizer_set_t * quant, uint8_t dithflag[5])
{
int cplbndstrc, bnd, i, i_end, ch;
uint8_t * exp;
@@ -458,111 +458,111 @@ static void coeff_get_coupling (a52_state_t * state, int nfchans,
cplbndstrc = state->cplbndstrc;
i = state->cplstrtmant;
while (i < state->cplendmant) {
- i_end = i + 12;
- while (cplbndstrc & 1) {
+ i_end = i + 12;
+ while (cplbndstrc & 1) {
+ cplbndstrc >>= 1;
+ i_end += 12;
+ }
cplbndstrc >>= 1;
- i_end += 12;
- }
- cplbndstrc >>= 1;
- for (ch = 0; ch < nfchans; ch++)
- cplco[ch] = MUL_L (state->cplco[ch][bnd], coeff[ch]);
- bnd++;
-
- while (i < i_end) {
- quantizer_t cplcoeff;
- int bapi;
-
- bapi = bap[i];
- switch (bapi) {
- case 0:
for (ch = 0; ch < nfchans; ch++)
- if ((state->chincpl >> ch) & 1) {
- if (dithflag[ch])
+ cplco[ch] = MUL_L (state->cplco[ch][bnd], coeff[ch]);
+ bnd++;
+
+ while (i < i_end) {
+ quantizer_t cplcoeff;
+ int bapi;
+
+ bapi = bap[i];
+ switch (bapi) {
+ case 0:
+ for (ch = 0; ch < nfchans; ch++)
+ if ((state->chincpl >> ch) & 1) {
+ if (dithflag[ch])
#ifndef LIBA52_FIXED
- samples[ch][i] = (scale_factor[exp[i]] *
- cplco[ch] * dither_gen (state));
+ samples[ch][i] = (scale_factor[exp[i]] *
+ cplco[ch] * dither_gen (state));
#else
- COEFF (samples[ch][i], dither_gen (state),
- cplco[ch], scale_factor, exp[i]);
+ COEFF (samples[ch][i], dither_gen (state),
+ cplco[ch], scale_factor, exp[i]);
#endif
- else
- samples[ch][i] = 0;
+ else
+ samples[ch][i] = 0;
+ }
+ i++;
+ continue;
+
+ case -1:
+ if (quant->q1_ptr >= 0) {
+ cplcoeff = quant->q1[quant->q1_ptr--];
+ break;
+ } else {
+ int code;
+
+ code = bitstream_get (state, 5);
+
+ quant->q1_ptr = 1;
+ quant->q1[0] = q_1_2[code];
+ quant->q1[1] = q_1_1[code];
+ cplcoeff = q_1_0[code];
+ break;
+ }
+
+ case -2:
+ if (quant->q2_ptr >= 0) {
+ cplcoeff = quant->q2[quant->q2_ptr--];
+ break;
+ } else {
+ int code;
+
+ code = bitstream_get (state, 7);
+
+ quant->q2_ptr = 1;
+ quant->q2[0] = q_2_2[code];
+ quant->q2[1] = q_2_1[code];
+ cplcoeff = q_2_0[code];
+ break;
+ }
+
+ case 3:
+ cplcoeff = q_3[bitstream_get (state, 3)];
+ break;
+
+ case -3:
+ if (quant->q4_ptr == 0) {
+ quant->q4_ptr = -1;
+ cplcoeff = quant->q4;
+ break;
+ } else {
+ int code;
+
+ code = bitstream_get (state, 7);
+
+ quant->q4_ptr = 0;
+ quant->q4 = q_4_1[code];
+ cplcoeff = q_4_0[code];
+ break;
+ }
+
+ case 4:
+ cplcoeff = q_5[bitstream_get (state, 4)];
+ break;
+
+ default:
+ cplcoeff = bitstream_get_2 (state, bapi) << (16 - bapi);
}
- i++;
- continue;
-
- case -1:
- if (quant->q1_ptr >= 0) {
- cplcoeff = quant->q1[quant->q1_ptr--];
- break;
- } else {
- int code;
-
- code = bitstream_get (state, 5);
-
- quant->q1_ptr = 1;
- quant->q1[0] = q_1_2[code];
- quant->q1[1] = q_1_1[code];
- cplcoeff = q_1_0[code];
- break;
- }
-
- case -2:
- if (quant->q2_ptr >= 0) {
- cplcoeff = quant->q2[quant->q2_ptr--];
- break;
- } else {
- int code;
-
- code = bitstream_get (state, 7);
-
- quant->q2_ptr = 1;
- quant->q2[0] = q_2_2[code];
- quant->q2[1] = q_2_1[code];
- cplcoeff = q_2_0[code];
- break;
- }
-
- case 3:
- cplcoeff = q_3[bitstream_get (state, 3)];
- break;
-
- case -3:
- if (quant->q4_ptr == 0) {
- quant->q4_ptr = -1;
- cplcoeff = quant->q4;
- break;
- } else {
- int code;
-
- code = bitstream_get (state, 7);
-
- quant->q4_ptr = 0;
- quant->q4 = q_4_1[code];
- cplcoeff = q_4_0[code];
- break;
- }
-
- case 4:
- cplcoeff = q_5[bitstream_get (state, 4)];
- break;
-
- default:
- cplcoeff = bitstream_get_2 (state, bapi) << (16 - bapi);
- }
#ifndef LIBA52_FIXED
- cplcoeff *= scale_factor[exp[i]];
+ cplcoeff *= scale_factor[exp[i]];
#endif
- for (ch = 0; ch < nfchans; ch++)
- if ((state->chincpl >> ch) & 1)
+ for (ch = 0; ch < nfchans; ch++)
+ if ((state->chincpl >> ch) & 1)
#ifndef LIBA52_FIXED
- samples[ch][i] = cplcoeff * cplco[ch];
+ samples[ch][i] = cplcoeff * cplco[ch];
#else
- COEFF (samples[ch][i], cplcoeff, cplco[ch],
- scale_factor, exp[i]);
+ COEFF (samples[ch][i], cplcoeff, cplco[ch],
+ scale_factor, exp[i]);
#endif
- i++;
- }
+ i++;
+ }
}
}
@@ -581,366 +581,366 @@ int a52_block (a52_state_t * state)
nfchans = nfchans_tbl[state->acmod];
for (i = 0; i < nfchans; i++)
- blksw[i] = bitstream_get (state, 1);
+ blksw[i] = bitstream_get (state, 1);
for (i = 0; i < nfchans; i++)
- dithflag[i] = bitstream_get (state, 1);
+ dithflag[i] = bitstream_get (state, 1);
chaninfo = !state->acmod;
do {
- if (bitstream_get (state, 1)) { /* dynrnge */
- int dynrng;
+ if (bitstream_get (state, 1)) { /* dynrnge */
+ int dynrng;
- dynrng = bitstream_get_2 (state, 8);
- if (state->dynrnge) {
- level_t range;
+ dynrng = bitstream_get_2 (state, 8);
+ if (state->dynrnge) {
+ level_t range;
#if !defined(LIBA52_FIXED)
- range = ((((dynrng & 0x1f) | 0x20) << 13) *
- scale_factor[3 - (dynrng >> 5)]);
+ range = ((((dynrng & 0x1f) | 0x20) << 13) *
+ scale_factor[3 - (dynrng >> 5)]);
#else
- range = ((dynrng & 0x1f) | 0x20) << (21 + (dynrng >> 5));
+ range = ((dynrng & 0x1f) | 0x20) << (21 + (dynrng >> 5));
#endif
- if (state->dynrngcall)
- range = state->dynrngcall (range, state->dynrngdata);
- state->dynrng = MUL_L (state->level, range);
+ if (state->dynrngcall)
+ range = state->dynrngcall (range, state->dynrngdata);
+ state->dynrng = MUL_L (state->level, range);
+ }
}
- }
} while (chaninfo--);
- if (bitstream_get (state, 1)) { /* cplstre */
- state->chincpl = 0;
- if (bitstream_get (state, 1)) { /* cplinu */
- static uint8_t bndtab[16] = {31, 35, 37, 39, 41, 42, 43, 44,
- 45, 45, 46, 46, 47, 47, 48, 48};
- int cplbegf;
- int cplendf;
- int ncplsubnd;
-
- for (i = 0; i < nfchans; i++)
- state->chincpl |= bitstream_get (state, 1) << i;
- switch (state->acmod) {
- case 0: case 1:
- return 1;
- case 2:
- state->phsflginu = bitstream_get (state, 1);
- }
- cplbegf = bitstream_get (state, 4);
- cplendf = bitstream_get (state, 4);
-
- if (cplendf + 3 - cplbegf < 0)
- return 1;
- state->ncplbnd = ncplsubnd = cplendf + 3 - cplbegf;
- state->cplstrtbnd = bndtab[cplbegf];
- state->cplstrtmant = cplbegf * 12 + 37;
- state->cplendmant = cplendf * 12 + 73;
-
- state->cplbndstrc = 0;
- for (i = 0; i < ncplsubnd - 1; i++)
- if (bitstream_get (state, 1)) {
- state->cplbndstrc |= 1 << i;
- state->ncplbnd--;
+ if (bitstream_get (state, 1)) { /* cplstre */
+ state->chincpl = 0;
+ if (bitstream_get (state, 1)) { /* cplinu */
+ static uint8_t bndtab[16] = {31, 35, 37, 39, 41, 42, 43, 44,
+ 45, 45, 46, 46, 47, 47, 48, 48};
+ int cplbegf;
+ int cplendf;
+ int ncplsubnd;
+
+ for (i = 0; i < nfchans; i++)
+ state->chincpl |= bitstream_get (state, 1) << i;
+ switch (state->acmod) {
+ case 0: case 1:
+ return 1;
+ case 2:
+ state->phsflginu = bitstream_get (state, 1);
+ }
+ cplbegf = bitstream_get (state, 4);
+ cplendf = bitstream_get (state, 4);
+
+ if (cplendf + 3 - cplbegf < 0)
+ return 1;
+ state->ncplbnd = ncplsubnd = cplendf + 3 - cplbegf;
+ state->cplstrtbnd = bndtab[cplbegf];
+ state->cplstrtmant = cplbegf * 12 + 37;
+ state->cplendmant = cplendf * 12 + 73;
+
+ state->cplbndstrc = 0;
+ for (i = 0; i < ncplsubnd - 1; i++)
+ if (bitstream_get (state, 1)) {
+ state->cplbndstrc |= 1 << i;
+ state->ncplbnd--;
+ }
}
}
- }
- if (state->chincpl) { /* cplinu */
- int j, cplcoe;
+ if (state->chincpl) { /* cplinu */
+ int j, cplcoe;
- cplcoe = 0;
- for (i = 0; i < nfchans; i++)
- if ((state->chincpl) >> i & 1)
- if (bitstream_get (state, 1)) { /* cplcoe */
- int mstrcplco, cplcoexp, cplcomant;
-
- cplcoe = 1;
- mstrcplco = 3 * bitstream_get (state, 2);
- for (j = 0; j < state->ncplbnd; j++) {
- cplcoexp = bitstream_get (state, 4);
- cplcomant = bitstream_get (state, 4);
- if (cplcoexp == 15)
- cplcomant <<= 14;
- else
- cplcomant = (cplcomant | 0x10) << 13;
+ cplcoe = 0;
+ for (i = 0; i < nfchans; i++)
+ if ((state->chincpl) >> i & 1)
+ if (bitstream_get (state, 1)) { /* cplcoe */
+ int mstrcplco, cplcoexp, cplcomant;
+
+ cplcoe = 1;
+ mstrcplco = 3 * bitstream_get (state, 2);
+ for (j = 0; j < state->ncplbnd; j++) {
+ cplcoexp = bitstream_get (state, 4);
+ cplcomant = bitstream_get (state, 4);
+ if (cplcoexp == 15)
+ cplcomant <<= 14;
+ else
+ cplcomant = (cplcomant | 0x10) << 13;
#ifndef LIBA52_FIXED
- state->cplco[i][j] =
- cplcomant * scale_factor[cplcoexp + mstrcplco];
+ state->cplco[i][j] =
+ cplcomant * scale_factor[cplcoexp + mstrcplco];
#else
- state->cplco[i][j] = (cplcomant << 11) >> (cplcoexp + mstrcplco);
+ state->cplco[i][j] = (cplcomant << 11) >> (cplcoexp + mstrcplco);
#endif
- }
- }
- if ((state->acmod == 2) && state->phsflginu && cplcoe)
- for (j = 0; j < state->ncplbnd; j++)
- if (bitstream_get (state, 1)) /* phsflg */
- state->cplco[1][j] = -state->cplco[1][j];
+ }
+ }
+ if ((state->acmod == 2) && state->phsflginu && cplcoe)
+ for (j = 0; j < state->ncplbnd; j++)
+ if (bitstream_get (state, 1)) /* phsflg */
+ state->cplco[1][j] = -state->cplco[1][j];
}
if ((state->acmod == 2) && (bitstream_get (state, 1))) { /* rematstr */
- int end;
+ int end;
- state->rematflg = 0;
- end = (state->chincpl) ? state->cplstrtmant : 253; /* cplinu */
- i = 0;
- do
- state->rematflg |= bitstream_get (state, 1) << i;
- while (rematrix_band[i++] < end);
+ state->rematflg = 0;
+ end = (state->chincpl) ? state->cplstrtmant : 253; /* cplinu */
+ i = 0;
+ do
+ state->rematflg |= bitstream_get (state, 1) << i;
+ while (rematrix_band[i++] < end);
}
cplexpstr = EXP_REUSE;
lfeexpstr = EXP_REUSE;
if (state->chincpl) /* cplinu */
- cplexpstr = bitstream_get (state, 2);
+ cplexpstr = bitstream_get (state, 2);
for (i = 0; i < nfchans; i++)
- chexpstr[i] = bitstream_get (state, 2);
+ chexpstr[i] = bitstream_get (state, 2);
if (state->lfeon)
- lfeexpstr = bitstream_get (state, 1);
+ lfeexpstr = bitstream_get (state, 1);
for (i = 0; i < nfchans; i++)
- if (chexpstr[i] != EXP_REUSE) {
- if ((state->chincpl >> i) & 1)
- state->endmant[i] = state->cplstrtmant;
- else {
- int chbwcod;
-
- chbwcod = bitstream_get (state, 6);
- if (chbwcod > 60)
- return 1;
- state->endmant[i] = chbwcod * 3 + 73;
+ if (chexpstr[i] != EXP_REUSE) {
+ if ((state->chincpl >> i) & 1)
+ state->endmant[i] = state->cplstrtmant;
+ else {
+ int chbwcod;
+
+ chbwcod = bitstream_get (state, 6);
+ if (chbwcod > 60)
+ return 1;
+ state->endmant[i] = chbwcod * 3 + 73;
+ }
}
- }
do_bit_alloc = 0;
if (cplexpstr != EXP_REUSE) {
- int cplabsexp, ncplgrps;
-
- do_bit_alloc = 64;
- ncplgrps = ((state->cplendmant - state->cplstrtmant) /
- (3 << (cplexpstr - 1)));
- cplabsexp = bitstream_get (state, 4) << 1;
- if (parse_exponents (state, cplexpstr, ncplgrps, cplabsexp,
- state->cpl_expbap.exp + state->cplstrtmant))
- return 1;
+ int cplabsexp, ncplgrps;
+
+ do_bit_alloc = 64;
+ ncplgrps = ((state->cplendmant - state->cplstrtmant) /
+ (3 << (cplexpstr - 1)));
+ cplabsexp = bitstream_get (state, 4) << 1;
+ if (parse_exponents (state, cplexpstr, ncplgrps, cplabsexp,
+ state->cpl_expbap.exp + state->cplstrtmant))
+ return 1;
}
for (i = 0; i < nfchans; i++)
- if (chexpstr[i] != EXP_REUSE) {
- int grp_size, nchgrps;
-
- do_bit_alloc |= 1 << i;
- grp_size = 3 << (chexpstr[i] - 1);
- nchgrps = (state->endmant[i] + grp_size - 4) / grp_size;
- state->fbw_expbap[i].exp[0] = bitstream_get (state, 4);
- if (parse_exponents (state, chexpstr[i], nchgrps,
- state->fbw_expbap[i].exp[0],
- state->fbw_expbap[i].exp + 1))
- return 1;
- bitstream_get (state, 2); /* gainrng */
- }
+ if (chexpstr[i] != EXP_REUSE) {
+ int grp_size, nchgrps;
+
+ do_bit_alloc |= 1 << i;
+ grp_size = 3 << (chexpstr[i] - 1);
+ nchgrps = (state->endmant[i] + grp_size - 4) / grp_size;
+ state->fbw_expbap[i].exp[0] = bitstream_get (state, 4);
+ if (parse_exponents (state, chexpstr[i], nchgrps,
+ state->fbw_expbap[i].exp[0],
+ state->fbw_expbap[i].exp + 1))
+ return 1;
+ bitstream_get (state, 2); /* gainrng */
+ }
if (lfeexpstr != EXP_REUSE) {
- do_bit_alloc |= 32;
- state->lfe_expbap.exp[0] = bitstream_get (state, 4);
- if (parse_exponents (state, lfeexpstr, 2, state->lfe_expbap.exp[0],
- state->lfe_expbap.exp + 1))
- return 1;
+ do_bit_alloc |= 32;
+ state->lfe_expbap.exp[0] = bitstream_get (state, 4);
+ if (parse_exponents (state, lfeexpstr, 2, state->lfe_expbap.exp[0],
+ state->lfe_expbap.exp + 1))
+ return 1;
}
- if (bitstream_get (state, 1)) { /* baie */
- do_bit_alloc = 127;
- state->bai = bitstream_get (state, 11);
+ if (bitstream_get (state, 1)) { /* baie */
+ do_bit_alloc = 127;
+ state->bai = bitstream_get (state, 11);
}
- if (bitstream_get (state, 1)) { /* snroffste */
- do_bit_alloc = 127;
- state->csnroffst = bitstream_get (state, 6);
- if (state->chincpl) /* cplinu */
- state->cplba.bai = bitstream_get (state, 7);
- for (i = 0; i < nfchans; i++)
- state->ba[i].bai = bitstream_get (state, 7);
- if (state->lfeon)
- state->lfeba.bai = bitstream_get (state, 7);
+ if (bitstream_get (state, 1)) { /* snroffste */
+ do_bit_alloc = 127;
+ state->csnroffst = bitstream_get (state, 6);
+ if (state->chincpl) /* cplinu */
+ state->cplba.bai = bitstream_get (state, 7);
+ for (i = 0; i < nfchans; i++)
+ state->ba[i].bai = bitstream_get (state, 7);
+ if (state->lfeon)
+ state->lfeba.bai = bitstream_get (state, 7);
}
if ((state->chincpl) && (bitstream_get (state, 1))) { /* cplleake */
- do_bit_alloc |= 64;
- state->cplfleak = 9 - bitstream_get (state, 3);
- state->cplsleak = 9 - bitstream_get (state, 3);
+ do_bit_alloc |= 64;
+ state->cplfleak = 9 - bitstream_get (state, 3);
+ state->cplsleak = 9 - bitstream_get (state, 3);
}
- if (bitstream_get (state, 1)) { /* deltbaie */
- do_bit_alloc = 127;
- if (state->chincpl) /* cplinu */
- state->cplba.deltbae = bitstream_get (state, 2);
- for (i = 0; i < nfchans; i++)
- state->ba[i].deltbae = bitstream_get (state, 2);
- if (state->chincpl && /* cplinu */
- (state->cplba.deltbae == DELTA_BIT_NEW) &&
- parse_deltba (state, state->cplba.deltba))
- return 1;
- for (i = 0; i < nfchans; i++)
- if ((state->ba[i].deltbae == DELTA_BIT_NEW) &&
- parse_deltba (state, state->ba[i].deltba))
- return 1;
+ if (bitstream_get (state, 1)) { /* deltbaie */
+ do_bit_alloc = 127;
+ if (state->chincpl) /* cplinu */
+ state->cplba.deltbae = bitstream_get (state, 2);
+ for (i = 0; i < nfchans; i++)
+ state->ba[i].deltbae = bitstream_get (state, 2);
+ if (state->chincpl && /* cplinu */
+ (state->cplba.deltbae == DELTA_BIT_NEW) &&
+ parse_deltba (state, state->cplba.deltba))
+ return 1;
+ for (i = 0; i < nfchans; i++)
+ if ((state->ba[i].deltbae == DELTA_BIT_NEW) &&
+ parse_deltba (state, state->ba[i].deltba))
+ return 1;
}
if (do_bit_alloc) {
- if (zero_snr_offsets (nfchans, state)) {
- memset (state->cpl_expbap.bap, 0, sizeof (state->cpl_expbap.bap));
- for (i = 0; i < nfchans; i++)
- memset (state->fbw_expbap[i].bap, 0,
- sizeof (state->fbw_expbap[i].bap));
- memset (state->lfe_expbap.bap, 0, sizeof (state->lfe_expbap.bap));
- } else {
- if (state->chincpl && (do_bit_alloc & 64)) /* cplinu */
- a52_bit_allocate (state, &state->cplba, state->cplstrtbnd,
- state->cplstrtmant, state->cplendmant,
- state->cplfleak << 8, state->cplsleak << 8,
- &state->cpl_expbap);
- for (i = 0; i < nfchans; i++)
- if (do_bit_alloc & (1 << i))
- a52_bit_allocate (state, state->ba + i, 0, 0,
- state->endmant[i], 0, 0,
- state->fbw_expbap +i);
- if (state->lfeon && (do_bit_alloc & 32)) {
- state->lfeba.deltbae = DELTA_BIT_NONE;
- a52_bit_allocate (state, &state->lfeba, 0, 0, 7, 0, 0,
- &state->lfe_expbap);
+ if (zero_snr_offsets (nfchans, state)) {
+ memset (state->cpl_expbap.bap, 0, sizeof (state->cpl_expbap.bap));
+ for (i = 0; i < nfchans; i++)
+ memset (state->fbw_expbap[i].bap, 0,
+ sizeof (state->fbw_expbap[i].bap));
+ memset (state->lfe_expbap.bap, 0, sizeof (state->lfe_expbap.bap));
+ } else {
+ if (state->chincpl && (do_bit_alloc & 64)) /* cplinu */
+ a52_bit_allocate (state, &state->cplba, state->cplstrtbnd,
+ state->cplstrtmant, state->cplendmant,
+ state->cplfleak << 8, state->cplsleak << 8,
+ &state->cpl_expbap);
+ for (i = 0; i < nfchans; i++)
+ if (do_bit_alloc & (1 << i))
+ a52_bit_allocate (state, state->ba + i, 0, 0,
+ state->endmant[i], 0, 0,
+ state->fbw_expbap +i);
+ if (state->lfeon && (do_bit_alloc & 32)) {
+ state->lfeba.deltbae = DELTA_BIT_NONE;
+ a52_bit_allocate (state, &state->lfeba, 0, 0, 7, 0, 0,
+ &state->lfe_expbap);
+ }
}
}
- }
- if (bitstream_get (state, 1)) { /* skiple */
- i = bitstream_get (state, 9); /* skipl */
- while (i--)
- bitstream_get (state, 8);
+ if (bitstream_get (state, 1)) { /* skiple */
+ i = bitstream_get (state, 9); /* skipl */
+ while (i--)
+ bitstream_get (state, 8);
}
samples = state->samples;
if (state->output & A52_LFE)
- samples += 256; /* shift for LFE channel */
+ samples += 256; /* shift for LFE channel */
chanbias = a52_downmix_coeff (coeff, state->acmod, state->output,
- state->dynrng, state->clev, state->slev);
+ state->dynrng, state->clev, state->slev);
quant.q1_ptr = quant.q2_ptr = quant.q4_ptr = -1;
done_cpl = 0;
for (i = 0; i < nfchans; i++) {
- int j;
+ int j;
- coeff_get (state, samples + 256 * i, state->fbw_expbap +i, &quant,
- coeff[i], dithflag[i], state->endmant[i]);
+ coeff_get (state, samples + 256 * i, state->fbw_expbap +i, &quant,
+ coeff[i], dithflag[i], state->endmant[i]);
- if ((state->chincpl >> i) & 1) {
- if (!done_cpl) {
- done_cpl = 1;
- coeff_get_coupling (state, nfchans, coeff,
- (sample_t (*)[256])samples, &quant,
- dithflag);
- }
- j = state->cplendmant;
- } else
- j = state->endmant[i];
- do
- (samples + 256 * i)[j] = 0;
- while (++j < 256);
+ if ((state->chincpl >> i) & 1) {
+ if (!done_cpl) {
+ done_cpl = 1;
+ coeff_get_coupling (state, nfchans, coeff,
+ (sample_t (*)[256])samples, &quant,
+ dithflag);
+ }
+ j = state->cplendmant;
+ } else
+ j = state->endmant[i];
+ do
+ (samples + 256 * i)[j] = 0;
+ while (++j < 256);
}
if (state->acmod == 2) {
- int j, end, band, rematflg;
+ int j, end, band, rematflg;
- end = ((state->endmant[0] < state->endmant[1]) ?
- state->endmant[0] : state->endmant[1]);
+ end = ((state->endmant[0] < state->endmant[1]) ?
+ state->endmant[0] : state->endmant[1]);
- i = 0;
- j = 13;
- rematflg = state->rematflg;
- do {
- if (! (rematflg & 1)) {
- rematflg >>= 1;
- j = rematrix_band[i++];
- continue;
- }
- rematflg >>= 1;
- band = rematrix_band[i++];
- if (band > end)
- band = end;
+ i = 0;
+ j = 13;
+ rematflg = state->rematflg;
do {
- sample_t tmp0, tmp1;
-
- tmp0 = samples[j];
- tmp1 = (samples+256)[j];
- samples[j] = tmp0 + tmp1;
- (samples+256)[j] = tmp0 - tmp1;
- } while (++j < band);
- } while (j < end);
+ if (! (rematflg & 1)) {
+ rematflg >>= 1;
+ j = rematrix_band[i++];
+ continue;
+ }
+ rematflg >>= 1;
+ band = rematrix_band[i++];
+ if (band > end)
+ band = end;
+ do {
+ sample_t tmp0, tmp1;
+
+ tmp0 = samples[j];
+ tmp1 = (samples+256)[j];
+ samples[j] = tmp0 + tmp1;
+ (samples+256)[j] = tmp0 - tmp1;
+ } while (++j < band);
+ } while (j < end);
}
if (state->lfeon) {
- if (state->output & A52_LFE) {
- coeff_get (state, samples - 256, &state->lfe_expbap, &quant,
- state->dynrng, 0, 7);
- for (i = 7; i < 256; i++)
- (samples-256)[i] = 0;
- a52_imdct_512 (samples - 256, samples + 1536 - 256);
- } else {
- /* just skip the LFE coefficients */
- coeff_get (state, samples + 1280, &state->lfe_expbap, &quant,
- 0, 0, 7);
- }
+ if (state->output & A52_LFE) {
+ coeff_get (state, samples - 256, &state->lfe_expbap, &quant,
+ state->dynrng, 0, 7);
+ for (i = 7; i < 256; i++)
+ (samples-256)[i] = 0;
+ a52_imdct_512 (samples - 256, samples + 1536 - 256);
+ } else {
+ /* just skip the LFE coefficients */
+ coeff_get (state, samples + 1280, &state->lfe_expbap, &quant,
+ 0, 0, 7);
+ }
}
i = 0;
if (nfchans_tbl[state->output & A52_CHANNEL_MASK] < nfchans)
- for (i = 1; i < nfchans; i++)
- if (blksw[i] != blksw[0])
- break;
+ for (i = 1; i < nfchans; i++)
+ if (blksw[i] != blksw[0])
+ break;
if (i < nfchans) {
- if (state->downmixed) {
- state->downmixed = 0;
- a52_upmix (samples + 1536, state->acmod, state->output);
- }
+ if (state->downmixed) {
+ state->downmixed = 0;
+ a52_upmix (samples + 1536, state->acmod, state->output);
+ }
- for (i = 0; i < nfchans; i++) {
- sample_t bias;
+ for (i = 0; i < nfchans; i++) {
+ sample_t bias;
- bias = 0;
- if (!(chanbias & (1 << i)))
- bias = state->bias;
+ bias = 0;
+ if (!(chanbias & (1 << i)))
+ bias = state->bias;
- if (coeff[i]) {
- if (blksw[i])
- a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i);
- else
- a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i);
- } else {
- int j;
+ if (coeff[i]) {
+ if (blksw[i])
+ a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i);
+ else
+ a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i);
+ } else {
+ int j;
- for (j = 0; j < 256; j++)
- (samples + 256 * i)[j] = bias;
+ for (j = 0; j < 256; j++)
+ (samples + 256 * i)[j] = bias;
+ }
}
- }
- a52_downmix (samples, state->acmod, state->output,
- state->clev, state->slev);
+ a52_downmix (samples, state->acmod, state->output,
+ state->clev, state->slev);
} else {
- nfchans = nfchans_tbl[state->output & A52_CHANNEL_MASK];
+ nfchans = nfchans_tbl[state->output & A52_CHANNEL_MASK];
- a52_downmix (samples, state->acmod, state->output,
- state->clev, state->slev);
+ a52_downmix (samples, state->acmod, state->output,
+ state->clev, state->slev);
- if (!state->downmixed) {
- state->downmixed = 1;
- a52_downmix (samples + 1536, state->acmod, state->output,
- state->clev, state->slev);
- }
+ if (!state->downmixed) {
+ state->downmixed = 1;
+ a52_downmix (samples + 1536, state->acmod, state->output,
+ state->clev, state->slev);
+ }
- if (blksw[0])
- for (i = 0; i < nfchans; i++)
- a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i);
- else
- for (i = 0; i < nfchans; i++)
- a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i);
+ if (blksw[0])
+ for (i = 0; i < nfchans; i++)
+ a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i);
+ else
+ for (i = 0; i < nfchans; i++)
+ a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i);
}
return 0;
diff --git a/apps/codecs/libmad/bit.c b/apps/codecs/libmad/bit.c
index f3cca84..660c78d 100644
--- a/apps/codecs/libmad/bit.c
+++ b/apps/codecs/libmad/bit.c
@@ -87,7 +87,7 @@ unsigned short const crc_table[256] = {
#endif
/*
- * NAME: bit->init()
+ * NAME: bit->init()
* DESCRIPTION: initialize bit pointer struct
*/
void mad_bit_init(struct mad_bitptr *bitptr, unsigned char const *byte)
@@ -97,11 +97,11 @@ void mad_bit_init(struct mad_bitptr *bitptr, unsigned char const *byte)
}
/*
- * NAME: bit->length()
+ * NAME: bit->length()
* DESCRIPTION: return number of bits between start and end points
*/
unsigned int mad_bit_length(struct mad_bitptr const *begin,
- struct mad_bitptr const *end)
+ struct mad_bitptr const *end)
{
return end->readbit - begin->readbit;
}
@@ -111,7 +111,7 @@ unsigned char mad_bit_bitsleft(struct mad_bitptr const *bitptr)
return 8 - (bitptr->readbit & 7);
}
/*
- * NAME: bit->nextbyte()
+ * NAME: bit->nextbyte()
* DESCRIPTION: return pointer to next unprocessed byte
*/
unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *bitptr)
@@ -120,7 +120,7 @@ unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *bitptr)
}
/*
- * NAME: bit->skip()
+ * NAME: bit->skip()
* DESCRIPTION: advance bit pointer
*/
void mad_bit_skip(struct mad_bitptr *bitptr, unsigned int len)
@@ -129,7 +129,7 @@ void mad_bit_skip(struct mad_bitptr *bitptr, unsigned int len)
}
/*
- * NAME: bit->read()
+ * NAME: bit->read()
* DESCRIPTION: read an arbitrary number of bits and return their UIMSBF value
*/
@@ -154,11 +154,11 @@ uint32_t mad_bit_read(struct mad_bitptr *bitptr, unsigned int len)
# if 0
/*
- * NAME: bit->write()
+ * NAME: bit->write()
* DESCRIPTION: write an arbitrary number of bits
*/
void mad_bit_write(struct mad_bitptr *bitptr, unsigned int len,
- uint32_t value)
+ uint32_t value)
{
unsigned char *ptr;
@@ -169,11 +169,11 @@ void mad_bit_write(struct mad_bitptr *bitptr, unsigned int len,
# endif
/*
- * NAME: bit->crc()
+ * NAME: bit->crc()
* DESCRIPTION: compute CRC-check word
*/
unsigned short mad_bit_crc(struct mad_bitptr bitptr, unsigned int len,
- unsigned short init)
+ unsigned short init)
{
register unsigned int crc;
@@ -190,11 +190,11 @@ unsigned short mad_bit_crc(struct mad_bitptr bitptr, unsigned int len,
switch (len / 8) {
case 3: crc = (crc << 8) ^
- crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
+ crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
case 2: crc = (crc << 8) ^
- crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
+ crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
case 1: crc = (crc << 8) ^
- crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
+ crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
len %= 8;
diff --git a/apps/codecs/libmad/bit.h b/apps/codecs/libmad/bit.h
index ad13373..985109f 100644
--- a/apps/codecs/libmad/bit.h
+++ b/apps/codecs/libmad/bit.h
@@ -29,10 +29,10 @@ struct mad_bitptr {
void mad_bit_init(struct mad_bitptr *, unsigned char const *);
-# define mad_bit_finish(bitptr) /* nothing */
+# define mad_bit_finish(bitptr) /* nothing */
unsigned int mad_bit_length(struct mad_bitptr const *,
- struct mad_bitptr const *);
+ struct mad_bitptr const *);
unsigned char mad_bit_bitsleft(struct mad_bitptr const *bitptr);
unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *);
diff --git a/apps/codecs/libmad/decoder.c b/apps/codecs/libmad/decoder.c
index dfa45aa..46f4dfe 100644
--- a/apps/codecs/libmad/decoder.c
+++ b/apps/codecs/libmad/decoder.c
@@ -51,25 +51,25 @@
# include "decoder.h"
/*
- * NAME: decoder->init()
+ * NAME: decoder->init()
* DESCRIPTION: initialize a decoder object with callback routines
*/
void mad_decoder_init(struct mad_decoder *decoder, void *data,
- enum mad_flow (*input_func)(void *,
- struct mad_stream *),
- enum mad_flow (*header_func)(void *,
- struct mad_header const *),
- enum mad_flow (*filter_func)(void *,
- struct mad_stream const *,
- struct mad_frame *),
- enum mad_flow (*output_func)(void *,
- struct mad_header const *,
- struct mad_pcm *),
- enum mad_flow (*error_func)(void *,
- struct mad_stream *,
- struct mad_frame *),
- enum mad_flow (*message_func)(void *,
- void *, unsigned int *))
+ enum mad_flow (*input_func)(void *,
+ struct mad_stream *),
+ enum mad_flow (*header_func)(void *,
+ struct mad_header const *),
+ enum mad_flow (*filter_func)(void *,
+ struct mad_stream const *,
+ struct mad_frame *),
+ enum mad_flow (*output_func)(void *,
+ struct mad_header const *,
+ struct mad_pcm *),
+ enum mad_flow (*error_func)(void *,
+ struct mad_stream *,
+ struct mad_frame *),
+ enum mad_flow (*message_func)(void *,
+ void *, unsigned int *))
{
decoder->mode = -1;
@@ -237,9 +237,9 @@ enum mad_flow receive(int fd, void **message, unsigned int *size)
if (*size > 0) {
if (*message == 0) {
- *message = malloc(*size);
- if (*message == 0)
- return MAD_FLOW_BREAK;
+ *message = malloc(*size);
+ if (*message == 0)
+ return MAD_FLOW_BREAK;
}
result = receive_io_blocking(fd, *message, *size);
@@ -278,8 +278,8 @@ enum mad_flow check_message(struct mad_decoder *decoder)
result = decoder->message_func(decoder->cb_data, message, &size);
if (result == MAD_FLOW_IGNORE ||
- result == MAD_FLOW_BREAK)
- size = 0;
+ result == MAD_FLOW_BREAK)
+ size = 0;
}
if (send(decoder->async.out, message, size) != MAD_FLOW_CONTINUE)
@@ -295,7 +295,7 @@ enum mad_flow check_message(struct mad_decoder *decoder)
static
enum mad_flow error_default(void *data, struct mad_stream *stream,
- struct mad_frame *frame)
+ struct mad_frame *frame)
{
int *bad_last_frame = data;
@@ -361,92 +361,92 @@ int run_sync(struct mad_decoder *decoder)
while (1) {
# if defined(USE_ASYNC)
if (decoder->mode == MAD_DECODER_MODE_ASYNC) {
- switch (check_message(decoder)) {
- case MAD_FLOW_IGNORE:
- case MAD_FLOW_CONTINUE:
- break;
- case MAD_FLOW_BREAK:
- goto fail;
- case MAD_FLOW_STOP:
- goto done;
- }
+ switch (check_message(decoder)) {
+ case MAD_FLOW_IGNORE:
+ case MAD_FLOW_CONTINUE:
+ break;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_STOP:
+ goto done;
+ }
}
# endif
if (decoder->header_func) {
- if (mad_header_decode(&frame->header, stream) == -1) {
- if (!MAD_RECOVERABLE(stream->error))
- break;
-
- switch (error_func(error_data, stream, frame)) {
- case MAD_FLOW_STOP:
- goto done;
- case MAD_FLOW_BREAK:
- goto fail;
- case MAD_FLOW_IGNORE:
- case MAD_FLOW_CONTINUE:
- default:
- continue;
- }
- }
-
- switch (decoder->header_func(decoder->cb_data, &frame->header)) {
- case MAD_FLOW_STOP:
- goto done;
- case MAD_FLOW_BREAK:
- goto fail;
- case MAD_FLOW_IGNORE:
- continue;
- case MAD_FLOW_CONTINUE:
- break;
- }
+ if (mad_header_decode(&frame->header, stream) == -1) {
+ if (!MAD_RECOVERABLE(stream->error))
+ break;
+
+ switch (error_func(error_data, stream, frame)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ case MAD_FLOW_CONTINUE:
+ default:
+ continue;
+ }
+ }
+
+ switch (decoder->header_func(decoder->cb_data, &frame->header)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ continue;
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
}
if (mad_frame_decode(frame, stream) == -1) {
- if (!MAD_RECOVERABLE(stream->error))
- break;
-
- switch (error_func(error_data, stream, frame)) {
- case MAD_FLOW_STOP:
- goto done;
- case MAD_FLOW_BREAK:
- goto fail;
- case MAD_FLOW_IGNORE:
- break;
- case MAD_FLOW_CONTINUE:
- default:
- continue;
- }
+ if (!MAD_RECOVERABLE(stream->error))
+ break;
+
+ switch (error_func(error_data, stream, frame)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ break;
+ case MAD_FLOW_CONTINUE:
+ default:
+ continue;
+ }
}
else
- bad_last_frame = 0;
+ bad_last_frame = 0;
if (decoder->filter_func) {
- switch (decoder->filter_func(decoder->cb_data, stream, frame)) {
- case MAD_FLOW_STOP:
- goto done;
- case MAD_FLOW_BREAK:
- goto fail;
- case MAD_FLOW_IGNORE:
- continue;
- case MAD_FLOW_CONTINUE:
- break;
- }
+ switch (decoder->filter_func(decoder->cb_data, stream, frame)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ continue;
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
}
mad_synth_frame(synth, frame);
if (decoder->output_func) {
- switch (decoder->output_func(decoder->cb_data,
- &frame->header, &synth->pcm)) {
- case MAD_FLOW_STOP:
- goto done;
- case MAD_FLOW_BREAK:
- goto fail;
- case MAD_FLOW_IGNORE:
- case MAD_FLOW_CONTINUE:
- break;
- }
+ switch (decoder->output_func(decoder->cb_data,
+ &frame->header, &synth->pcm)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
}
}
}
@@ -528,7 +528,7 @@ int run_async(struct mad_decoder *decoder)
# endif
/*
- * NAME: decoder->run()
+ * NAME: decoder->run()
* DESCRIPTION: run the decoder thread either synchronously or asynchronously
*/
int mad_decoder_run(struct mad_decoder *decoder, enum mad_decoder_mode mode)
@@ -564,11 +564,11 @@ int mad_decoder_run(struct mad_decoder *decoder, enum mad_decoder_mode mode)
}
/*
- * NAME: decoder->message()
+ * NAME: decoder->message()
* DESCRIPTION: send a message to and receive a reply from the decoder process
*/
int mad_decoder_message(struct mad_decoder *decoder,
- void *message, unsigned int *len)
+ void *message, unsigned int *len)
{
# if defined(USE_ASYNC)
if (decoder->mode != MAD_DECODER_MODE_ASYNC ||
diff --git a/apps/codecs/libmad/decoder.h b/apps/codecs/libmad/decoder.h
index 1f02215..b9ea0b1 100644
--- a/apps/codecs/libmad/decoder.h
+++ b/apps/codecs/libmad/decoder.h
@@ -60,26 +60,26 @@ struct mad_decoder {
enum mad_flow (*input_func)(void *, struct mad_stream *);
enum mad_flow (*header_func)(void *, struct mad_header const *);
enum mad_flow (*filter_func)(void *,
- struct mad_stream const *, struct mad_frame *);
+ struct mad_stream const *, struct mad_frame *);
enum mad_flow (*output_func)(void *,
- struct mad_header const *, struct mad_pcm *);
+ struct mad_header const *, struct mad_pcm *);
enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *);
enum mad_flow (*message_func)(void *, void *, unsigned int *);
};
void mad_decoder_init(struct mad_decoder *, void *,
- enum mad_flow (*)(void *, struct mad_stream *),
- enum mad_flow (*)(void *, struct mad_header const *),
- enum mad_flow (*)(void *,
- struct mad_stream const *,
- struct mad_frame *),
- enum mad_flow (*)(void *,
- struct mad_header const *,
- struct mad_pcm *),
- enum mad_flow (*)(void *,
- struct mad_stream *,
- struct mad_frame *),
- enum mad_flow (*)(void *, void *, unsigned int *));
+ enum mad_flow (*)(void *, struct mad_stream *),
+ enum mad_flow (*)(void *, struct mad_header const *),
+ enum mad_flow (*)(void *,
+ struct mad_stream const *,
+ struct mad_frame *),
+ enum mad_flow (*)(void *,
+ struct mad_header const *,
+ struct mad_pcm *),
+ enum mad_flow (*)(void *,
+ struct mad_stream *,
+ struct mad_frame *),
+ enum mad_flow (*)(void *, void *, unsigned int *));
int mad_decoder_finish(struct mad_decoder *);
# define mad_decoder_options(decoder, opts) \
diff --git a/apps/codecs/libmad/fixed.c b/apps/codecs/libmad/fixed.c
index f2f0a3c..e839232 100644
--- a/apps/codecs/libmad/fixed.c
+++ b/apps/codecs/libmad/fixed.c
@@ -28,7 +28,7 @@
# include "fixed.h"
/*
- * NAME: fixed->abs()
+ * NAME: fixed->abs()
* DESCRIPTION: return absolute value of a fixed-point number
*/
mad_fixed_t mad_f_abs(mad_fixed_t x)
@@ -37,7 +37,7 @@ mad_fixed_t mad_f_abs(mad_fixed_t x)
}
/*
- * NAME: fixed->div()
+ * NAME: fixed->div()
* DESCRIPTION: perform division using fixed-point math
*/
mad_fixed_t mad_f_div(mad_fixed_t x, mad_fixed_t y)
diff --git a/apps/codecs/libmad/fixed.h b/apps/codecs/libmad/fixed.h
index 84bb595..c0b4c0f 100644
--- a/apps/codecs/libmad/fixed.h
+++ b/apps/codecs/libmad/fixed.h
@@ -64,50 +64,50 @@ typedef mad_fixed_t mad_sample_t;
* supported, and must be done with care.
*/
-# define MAD_F_FRACBITS 28
+# define MAD_F_FRACBITS 28
# if MAD_F_FRACBITS == 28
-# define MAD_F(x) ((mad_fixed_t) (x##L))
+# define MAD_F(x) ((mad_fixed_t) (x##L))
# else
# if MAD_F_FRACBITS < 28
# warning "MAD_F_FRACBITS < 28"
-# define MAD_F(x) ((mad_fixed_t) \
- (((x##L) + \
- (1L << (28 - MAD_F_FRACBITS - 1))) >> \
- (28 - MAD_F_FRACBITS)))
+# define MAD_F(x) ((mad_fixed_t) \
+ (((x##L) + \
+ (1L << (28 - MAD_F_FRACBITS - 1))) >> \
+ (28 - MAD_F_FRACBITS)))
# elif MAD_F_FRACBITS > 28
# error "MAD_F_FRACBITS > 28 not currently supported"
-# define MAD_F(x) ((mad_fixed_t) \
- ((x##L) << (MAD_F_FRACBITS - 28)))
+# define MAD_F(x) ((mad_fixed_t) \
+ ((x##L) << (MAD_F_FRACBITS - 28)))
# endif
# endif
-# define MAD_F_MIN ((mad_fixed_t) -0x80000000L)
-# define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL)
+# define MAD_F_MIN ((mad_fixed_t) -0x80000000L)
+# define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL)
-# define MAD_F_ONE MAD_F(0x10000000)
+# define MAD_F_ONE MAD_F(0x10000000)
-# define mad_f_tofixed(x) ((mad_fixed_t) \
- ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
-# define mad_f_todouble(x) ((double) \
- ((x) / (double) (1L << MAD_F_FRACBITS)))
+# define mad_f_tofixed(x) ((mad_fixed_t) \
+ ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
+# define mad_f_todouble(x) ((double) \
+ ((x) / (double) (1L << MAD_F_FRACBITS)))
-# define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS)
-# define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1))
- /* (x should be positive) */
+# define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS)
+# define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1))
+ /* (x should be positive) */
-# define mad_f_fromint(x) ((x) << MAD_F_FRACBITS)
+# define mad_f_fromint(x) ((x) << MAD_F_FRACBITS)
-# define mad_f_add(x, y) ((x) + (y))
-# define mad_f_sub(x, y) ((x) - (y))
+# define mad_f_add(x, y) ((x) + (y))
+# define mad_f_sub(x, y) ((x) - (y))
# if defined(FPM_FLOAT)
# error "FPM_FLOAT not yet supported"
# undef MAD_F
-# define MAD_F(x) mad_f_todouble(x)
+# define MAD_F(x) mad_f_todouble(x)
-# define mad_f_mul(x, y) ((x) * (y))
+# define mad_f_mul(x, y) ((x) * (y))
# define mad_f_scale64
# undef ASO_ZEROCHECK
@@ -154,7 +154,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
}
# pragma warning(pop)
-# define mad_f_mul mad_f_mul_inline
+# define mad_f_mul mad_f_mul_inline
# define mad_f_scale64
# else
/*
@@ -163,9 +163,9 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_MLX(hi, lo, x, y) \
asm ("imull %3" \
- : "=a" (lo), "=d" (hi) \
- : "%a" (x), "rm" (y) \
- : "cc")
+ : "=a" (lo), "=d" (hi) \
+ : "%a" (x), "rm" (y) \
+ : "cc")
# if defined(OPT_ACCURACY)
/*
@@ -176,10 +176,10 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
mad_fixed64lo_t __lo; \
MAD_F_MLX(__hi, __lo, (x), (y)); \
asm ("addl %2,%0\n\t" \
- "adcl %3,%1" \
- : "=rm" (lo), "=rm" (hi) \
- : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \
- : "cc"); \
+ "adcl %3,%1" \
+ : "=rm" (lo), "=rm" (hi) \
+ : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \
+ : "cc"); \
})
# endif /* OPT_ACCURACY */
@@ -192,15 +192,15 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
mad_fixed64lo_t __lo_; \
mad_fixed_t __result; \
asm ("addl %4,%2\n\t" \
- "adcl %5,%3" \
- : "=rm" (__lo_), "=rm" (__hi_) \
- : "0" (lo), "1" (hi), \
- "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \
- : "cc"); \
+ "adcl %5,%3" \
+ : "=rm" (__lo_), "=rm" (__hi_) \
+ : "0" (lo), "1" (hi), \
+ "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \
+ : "cc"); \
asm ("shrdl %3,%2,%1" \
- : "=rm" (__result) \
- : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \
- : "cc"); \
+ : "=rm" (__result) \
+ : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# elif defined(OPT_INTEL)
@@ -210,21 +210,21 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
asm ("shrl %3,%1\n\t" \
- "shll %4,%2\n\t" \
- "orl %2,%1" \
- : "=rm" (__result) \
- : "0" (lo), "r" (hi), \
- "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
+ "shll %4,%2\n\t" \
+ "orl %2,%1" \
+ : "=rm" (__result) \
+ : "0" (lo), "r" (hi), \
+ "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# else
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
asm ("shrdl %3,%2,%1" \
- : "=rm" (__result) \
- : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \
- : "cc"); \
+ : "=rm" (__result) \
+ : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# endif /* OPT_ACCURACY */
@@ -249,42 +249,42 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
({ mad_fixed64hi_t __hi; \
mad_fixed64lo_t __lo; \
mad_fixed_t __result; \
- asm ("smull %0, %1, %3, %4\n\t" \
- "movs %0, %0, lsr %5\n\t" \
- "adc %2, %0, %1, lsl %6" \
- : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
- : "%r" (x), "r" (y), \
- "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
+ asm ("smull %0, %1, %3, %4\n\t" \
+ "movs %0, %0, lsr %5\n\t" \
+ "adc %2, %0, %1, lsl %6" \
+ : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
+ : "%r" (x), "r" (y), \
+ "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# endif
# define MAD_F_MLX(hi, lo, x, y) \
asm ("smull %0, %1, %2, %3" \
- : "=&r" (lo), "=&r" (hi) \
- : "%r" (x), "r" (y))
+ : "=&r" (lo), "=&r" (hi) \
+ : "%r" (x), "r" (y))
# define MAD_F_MLA(hi, lo, x, y) \
asm ("smlal %0, %1, %2, %3" \
- : "+r" (lo), "+r" (hi) \
- : "%r" (x), "r" (y))
+ : "+r" (lo), "+r" (hi) \
+ : "%r" (x), "r" (y))
# define MAD_F_MLN(hi, lo) \
asm ("rsbs %0, %2, #0\n\t" \
- "rsc %1, %3, #0" \
- : "=r" (lo), "=r" (hi) \
- : "0" (lo), "1" (hi) \
- : "cc")
+ "rsc %1, %3, #0" \
+ : "=r" (lo), "=r" (hi) \
+ : "0" (lo), "1" (hi) \
+ : "cc")
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
- asm ("movs %0, %1, lsr %3\n\t" \
- "adc %0, %0, %2, lsl %4" \
- : "=&r" (__result) \
- : "r" (lo), "r" (hi), \
- "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
+ asm ("movs %0, %1, lsr %3\n\t" \
+ "adc %0, %0, %2, lsl %4" \
+ : "=&r" (__result) \
+ : "r" (lo), "r" (hi), \
+ "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
@@ -300,14 +300,14 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_MLX(hi, lo, x, y) \
asm ("mult %2,%3" \
- : "=l" (lo), "=h" (hi) \
- : "%r" (x), "r" (y))
+ : "=l" (lo), "=h" (hi) \
+ : "%r" (x), "r" (y))
# if defined(HAVE_MADD_ASM)
# define MAD_F_MLA(hi, lo, x, y) \
asm ("madd %2,%3" \
- : "+l" (lo), "+h" (hi) \
- : "%r" (x), "r" (y))
+ : "+l" (lo), "+h" (hi) \
+ : "%r" (x), "r" (y))
# elif defined(HAVE_MADD16_ASM)
/*
* This loses significant accuracy due to the 16-bit integer limit in the
@@ -315,12 +315,12 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_ML0(hi, lo, x, y) \
asm ("mult %2,%3" \
- : "=l" (lo), "=h" (hi) \
- : "%r" ((x) >> 12), "r" ((y) >> 16))
+ : "=l" (lo), "=h" (hi) \
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
# define MAD_F_MLA(hi, lo, x, y) \
- asm ("madd16 %2,%3" \
- : "+l" (lo), "+h" (hi) \
- : "%r" ((x) >> 12), "r" ((y) >> 16))
+ asm ("madd16 %2,%3" \
+ : "+l" (lo), "+h" (hi) \
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
# endif
@@ -340,9 +340,9 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_MLX(hi, lo, x, y) \
asm ("smul %2, %3, %0\n\t" \
- "rd %%y, %1" \
- : "=r" (lo), "=r" (hi) \
- : "%r" (x), "rI" (y))
+ "rd %%y, %1" \
+ : "=r" (lo), "=r" (hi) \
+ : "%r" (x), "rI" (y))
/* --- PowerPC ------------------------------------------------------------- */
@@ -355,11 +355,11 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define MAD_F_MLX(hi, lo, x, y) \
do { \
asm ("mullw %0,%1,%2" \
- : "=r" (lo) \
- : "%r" (x), "r" (y)); \
+ : "=r" (lo) \
+ : "%r" (x), "r" (y)); \
asm ("mulhw %0,%1,%2" \
- : "=r" (hi) \
- : "%r" (x), "r" (y)); \
+ : "=r" (hi) \
+ : "%r" (x), "r" (y)); \
} \
while (0)
@@ -372,11 +372,11 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
mad_fixed64lo_t __lo; \
MAD_F_MLX(__hi, __lo, (x), (y)); \
asm ("addc %0,%2,%3\n\t" \
- "adde %1,%4,%5" \
- : "=r" (lo), "=r" (hi) \
- : "%r" (lo), "r" (__lo), \
- "%r" (hi), "r" (__hi) \
- : "xer"); \
+ "adde %1,%4,%5" \
+ : "=r" (lo), "=r" (hi) \
+ : "%r" (lo), "r" (__lo), \
+ "%r" (hi), "r" (__hi) \
+ : "xer"); \
})
# endif
@@ -387,28 +387,28 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result, __round; \
asm ("rotrwi %0,%1,%2" \
- : "=r" (__result) \
- : "r" (lo), "i" (MAD_F_SCALEBITS)); \
+ : "=r" (__result) \
+ : "r" (lo), "i" (MAD_F_SCALEBITS)); \
asm ("extrwi %0,%1,1,0" \
- : "=r" (__round) \
- : "r" (__result)); \
+ : "=r" (__round) \
+ : "r" (__result)); \
asm ("insrwi %0,%1,%2,0" \
- : "+r" (__result) \
- : "r" (hi), "i" (MAD_F_SCALEBITS)); \
+ : "+r" (__result) \
+ : "r" (hi), "i" (MAD_F_SCALEBITS)); \
asm ("add %0,%1,%2" \
- : "=r" (__result) \
- : "%r" (__result), "r" (__round)); \
+ : "=r" (__result) \
+ : "%r" (__result), "r" (__round)); \
__result; \
})
# else
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
asm ("rotrwi %0,%1,%2" \
- : "=r" (__result) \
- : "r" (lo), "i" (MAD_F_SCALEBITS)); \
+ : "=r" (__result) \
+ : "r" (lo), "i" (MAD_F_SCALEBITS)); \
asm ("insrwi %0,%1,%2,0" \
- : "+r" (__result) \
- : "r" (hi), "i" (MAD_F_SCALEBITS)); \
+ : "+r" (__result) \
+ : "r" (hi), "i" (MAD_F_SCALEBITS)); \
__result; \
})
# endif
@@ -452,10 +452,10 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
* Pre-rounding is required to stay within the limits of compliance.
*/
# if defined(OPT_SPEED)
-# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16))
+# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16))
# else
-# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
- (((y) + (1L << 15)) >> 16))
+# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
+ (((y) + (1L << 15)) >> 16))
# endif
/* ------------------------------------------------------------------------- */
@@ -476,22 +476,22 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# endif
# if !defined(MAD_F_MLA)
-# define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y)))
-# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y)))
-# define MAD_F_MLN(hi, lo) ((lo) = -(lo))
-# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
+# define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y)))
+# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y)))
+# define MAD_F_MLN(hi, lo) ((lo) = -(lo))
+# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
# endif
# if !defined(MAD_F_ML0)
-# define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y))
+# define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y))
# endif
# if !defined(MAD_F_MLN)
-# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
+# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
# endif
# if !defined(MAD_F_MLZ)
-# define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo))
+# define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo))
# endif
# if !defined(mad_f_scale64)
@@ -499,7 +499,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
((((mad_fixed_t) \
(((hi) << (32 - (MAD_F_SCALEBITS - 1))) | \
- ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
+ ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
# else
# define mad_f_scale64(hi, lo) \
((mad_fixed_t) \
diff --git a/apps/codecs/libmad/frame.c b/apps/codecs/libmad/frame.c
index 85c2a20..7fd4235 100644
--- a/apps/codecs/libmad/frame.c
+++ b/apps/codecs/libmad/frame.c
@@ -61,7 +61,7 @@ int (*const decoder_table[3])(struct mad_stream *, struct mad_frame *) = {
};
/*
- * NAME: header->init()
+ * NAME: header->init()
* DESCRIPTION: initialize header struct
*/
void mad_header_init(struct mad_header *header)
@@ -84,7 +84,7 @@ void mad_header_init(struct mad_header *header)
}
/*
- * NAME: frame->init()
+ * NAME: frame->init()
* DESCRIPTION: initialize frame struct
*/
void mad_frame_init(struct mad_frame *frame)
@@ -98,7 +98,7 @@ void mad_frame_init(struct mad_frame *frame)
}
/*
- * NAME: frame->finish()
+ * NAME: frame->finish()
* DESCRIPTION: deallocate any dynamic memory associated with frame
*/
void mad_frame_finish(struct mad_frame *frame)
@@ -112,7 +112,7 @@ void mad_frame_finish(struct mad_frame *frame)
}
/*
- * NAME: decode_header()
+ * NAME: decode_header()
* DESCRIPTION: read header data and following CRC word
*/
static
@@ -231,7 +231,7 @@ int decode_header(struct mad_header *header, struct mad_stream *stream)
}
/*
- * NAME: free_bitrate()
+ * NAME: free_bitrate()
* DESCRIPTION: attempt to discover the bitstream's free bitrate
*/
static
@@ -246,7 +246,7 @@ int free_bitrate(struct mad_stream *stream, struct mad_header const *header)
pad_slot = (header->flags & MAD_FLAG_PADDING) ? 1 : 0;
slots_per_frame = (header->layer == MAD_LAYER_III &&
- (header->flags & MAD_FLAG_LSF_EXT)) ? 72 : 144;
+ (header->flags & MAD_FLAG_LSF_EXT)) ? 72 : 144;
while (mad_stream_sync(stream) == 0) {
struct mad_stream peek_stream;
@@ -256,8 +256,8 @@ int free_bitrate(struct mad_stream *stream, struct mad_header const *header)
peek_header = *header;
if (decode_header(&peek_header, &peek_stream) == 0 &&
- peek_header.layer == header->layer &&
- peek_header.samplerate == header->samplerate) {
+ peek_header.layer == header->layer &&
+ peek_header.samplerate == header->samplerate) {
unsigned int N;
ptr = mad_bit_nextbyte(&stream->ptr);
@@ -265,16 +265,16 @@ int free_bitrate(struct mad_stream *stream, struct mad_header const *header)
N = ptr - stream->this_frame;
if (header->layer == MAD_LAYER_I) {
- rate = (unsigned long) header->samplerate *
- (N - 4 * pad_slot + 4) / 48 / 1000;
+ rate = (unsigned long) header->samplerate *
+ (N - 4 * pad_slot + 4) / 48 / 1000;
}
else {
- rate = (unsigned long) header->samplerate *
- (N - pad_slot + 1) / slots_per_frame / 1000;
+ rate = (unsigned long) header->samplerate *
+ (N - pad_slot + 1) / slots_per_frame / 1000;
}
if (rate >= 8)
- break;
+ break;
}
mad_bit_skip(&stream->ptr, 8);
@@ -293,7 +293,7 @@ int free_bitrate(struct mad_stream *stream, struct mad_header const *header)
}
/*
- * NAME: header->decode()
+ * NAME: header->decode()
* DESCRIPTION: read the next frame header from the stream
*/
int mad_header_decode(struct mad_header *header, struct mad_stream *stream)
@@ -351,7 +351,7 @@ int mad_header_decode(struct mad_header *header, struct mad_stream *stream)
if (mad_stream_sync(stream) == -1) {
if (end - stream->next_frame >= MAD_BUFFER_GUARD)
- stream->next_frame = end - MAD_BUFFER_GUARD;
+ stream->next_frame = end - MAD_BUFFER_GUARD;
stream->error = MAD_ERROR_BUFLEN;
goto fail;
@@ -371,13 +371,13 @@ int mad_header_decode(struct mad_header *header, struct mad_stream *stream)
/* calculate frame duration */
mad_timer_set(&header->duration, 0,
- 32 * MAD_NSBSAMPLES(header), header->samplerate);
+ 32 * MAD_NSBSAMPLES(header), header->samplerate);
/* calculate free bit rate */
if (header->bitrate == 0) {
if ((stream->freerate == 0 || !stream->sync ||
- (header->layer == MAD_LAYER_III && stream->freerate > 640000)) &&
- free_bitrate(stream, header) == -1)
+ (header->layer == MAD_LAYER_III && stream->freerate > 640000)) &&
+ free_bitrate(stream, header) == -1)
goto fail;
header->bitrate = stream->freerate;
@@ -393,7 +393,7 @@ int mad_header_decode(struct mad_header *header, struct mad_stream *stream)
unsigned int slots_per_frame;
slots_per_frame = (header->layer == MAD_LAYER_III &&
- (header->flags & MAD_FLAG_LSF_EXT)) ? 72 : 144;
+ (header->flags & MAD_FLAG_LSF_EXT)) ? 72 : 144;
N = (slots_per_frame * header->bitrate / header->samplerate) + pad_slot;
}
@@ -431,7 +431,7 @@ int mad_header_decode(struct mad_header *header, struct mad_stream *stream)
}
/*
- * NAME: frame->decode()
+ * NAME: frame->decode()
* DESCRIPTION: decode a single frame from a bitstream
*/
int mad_frame_decode(struct mad_frame *frame, struct mad_stream *stream)
@@ -479,7 +479,7 @@ int mad_frame_decode(struct mad_frame *frame, struct mad_stream *stream)
}
/*
- * NAME: frame->mute()
+ * NAME: frame->mute()
* DESCRIPTION: zero all subband values so the frame becomes silent
*/
void mad_frame_mute(struct mad_frame *frame)
@@ -496,8 +496,8 @@ void mad_frame_mute(struct mad_frame *frame)
if (frame->overlap) {
for (s = 0; s < 18; ++s) {
for (sb = 0; sb < 32; ++sb) {
- (*frame->overlap)[0][sb][s] =
- (*frame->overlap)[1][sb][s] = 0;
+ (*frame->overlap)[0][sb][s] =
+ (*frame->overlap)[1][sb][s] = 0;
}
}
}
diff --git a/apps/codecs/libmad/frame.h b/apps/codecs/libmad/frame.h
index 4d23107..2693b0b 100644
--- a/apps/codecs/libmad/frame.h
+++ b/apps/codecs/libmad/frame.h
@@ -27,41 +27,41 @@
# include "stream.h"
enum mad_layer {
- MAD_LAYER_I = 1, /* Layer I */
- MAD_LAYER_II = 2, /* Layer II */
- MAD_LAYER_III = 3 /* Layer III */
+ MAD_LAYER_I = 1, /* Layer I */
+ MAD_LAYER_II = 2, /* Layer II */
+ MAD_LAYER_III = 3 /* Layer III */
};
enum mad_mode {
- MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */
- MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */
- MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */
- MAD_MODE_STEREO = 3 /* normal LR stereo */
+ MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */
+ MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */
+ MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */
+ MAD_MODE_STEREO = 3 /* normal LR stereo */
};
enum mad_emphasis {
- MAD_EMPHASIS_NONE = 0, /* no emphasis */
- MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */
- MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */
- MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */
+ MAD_EMPHASIS_NONE = 0, /* no emphasis */
+ MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */
+ MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */
+ MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */
};
struct mad_header {
- enum mad_layer layer; /* audio layer (1, 2, or 3) */
- enum mad_mode mode; /* channel mode (see above) */
- int mode_extension; /* additional mode info */
- enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
+ enum mad_layer layer; /* audio layer (1, 2, or 3) */
+ enum mad_mode mode; /* channel mode (see above) */
+ int mode_extension; /* additional mode info */
+ enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
- unsigned long bitrate; /* stream bitrate (bps) */
- unsigned int samplerate; /* sampling frequency (Hz) */
+ unsigned long bitrate; /* stream bitrate (bps) */
+ unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned short crc_check; /* frame CRC accumulator */
- unsigned short crc_target; /* final target CRC checksum */
+ unsigned short crc_check; /* frame CRC accumulator */
+ unsigned short crc_target; /* final target CRC checksum */
- int flags; /* flags (see below) */
- int private_bits; /* private bits (see below) */
+ int flags; /* flags (see below) */
+ int private_bits; /* private bits (see below) */
- mad_timer_t duration; /* audio playing time of frame */
+ mad_timer_t duration; /* audio playing time of frame */
};
struct mad_frame {
@@ -76,33 +76,33 @@ struct mad_frame {
mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */
};
-# define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1)
+# define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1)
# define MAD_NSBSAMPLES(header) \
((header)->layer == MAD_LAYER_I ? 12 : \
(((header)->layer == MAD_LAYER_III && \
((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36))
enum {
- MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
- MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
+ MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
+ MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
- MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
- MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
- MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
- MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
+ MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
+ MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
+ MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
+ MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
- MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
- MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
- MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
+ MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
+ MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
+ MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
- MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
- MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
- MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
+ MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
+ MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
+ MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
};
enum {
- MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
- MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
+ MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
+ MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
};
void mad_header_init(struct mad_header *);
diff --git a/apps/codecs/libmad/huffman.c b/apps/codecs/libmad/huffman.c
index db788e7..bec4443 100644
--- a/apps/codecs/libmad/huffman.c
+++ b/apps/codecs/libmad/huffman.c
@@ -36,10 +36,10 @@
# if defined(__GNUC__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
-# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
+# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
# define V(v, w, x, y, hlen) { .value = { 1, hlen, v, w, x, y } }
# else
-# define PTR(offs, bits) { { 0, bits, offs } }
+# define PTR(offs, bits) { { 0, bits, offs } }
# if defined(WORDS_BIGENDIAN)
# define V(v, w, x, y, hlen) { { 1, hlen, (v << 11) | (w << 10) | \
(x << 9) | (y << 8) } }
@@ -114,14 +114,14 @@ union huffquad const hufftabB[] ICONST_ATTR_MPA_HUFFMAN = {
# if defined(__GNUC__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
-# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
-# define V(x, y, hlen) { .value = { 1, hlen, x, y } }
+# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
+# define V(x, y, hlen) { .value = { 1, hlen, x, y } }
# else
-# define PTR(offs, bits) { { 0, bits, offs } }
+# define PTR(offs, bits) { { 0, bits, offs } }
# if defined(WORDS_BIGENDIAN)
-# define V(x, y, hlen) { { 1, hlen, (x << 8) | (y << 4) } }
+# define V(x, y, hlen) { { 1, hlen, (x << 8) | (y << 4) } }
# else
-# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } }
+# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } }
# endif
# endif
@@ -154,7 +154,7 @@ union huffpair const hufftab2[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(0, 0, 1),
/* 000 ... */
- /* 000 */ V(2, 2, 3), /* 8 */
+ /* 000 */ V(2, 2, 3), /* 8 */
/* 001 */ V(0, 2, 3),
/* 010 */ V(1, 2, 2),
/* 011 */ V(1, 2, 2),
@@ -176,7 +176,7 @@ union huffpair const hufftab3[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(0, 0, 2),
/* 000 ... */
- /* 000 */ V(2, 2, 3), /* 8 */
+ /* 000 */ V(2, 2, 3), /* 8 */
/* 001 */ V(0, 2, 3),
/* 010 */ V(1, 2, 2),
/* 011 */ V(1, 2, 2),
@@ -198,7 +198,7 @@ union huffpair const hufftab5[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(0, 0, 1),
/* 000 ... */
- /* 0000 */ PTR(24, 1), /* 8 */
+ /* 0000 */ PTR(24, 1), /* 8 */
/* 0001 */ V(3, 2, 4),
/* 0010 */ V(3, 1, 3),
/* 0011 */ V(3, 1, 3),
@@ -216,7 +216,7 @@ union huffpair const hufftab5[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(2, 0, 3),
/* 000 0000 ... */
- /* 0 */ V(3, 3, 1), /* 24 */
+ /* 0 */ V(3, 3, 1), /* 24 */
/* 1 */ V(2, 3, 1)
};
@@ -240,7 +240,7 @@ union huffpair const hufftab6[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 3),
/* 0000 ... */
- /* 000 */ V(3, 3, 3), /* 16 */
+ /* 000 */ V(3, 3, 3), /* 16 */
/* 001 */ V(0, 3, 3),
/* 010 */ V(2, 3, 2),
/* 011 */ V(2, 3, 2),
@@ -250,11 +250,11 @@ union huffpair const hufftab6[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(3, 0, 2),
/* 0001 ... */
- /* 0 */ V(1, 3, 1), /* 24 */
+ /* 0 */ V(1, 3, 1), /* 24 */
/* 1 */ V(3, 1, 1),
/* 0010 ... */
- /* 0 */ V(2, 2, 1), /* 26 */
+ /* 0 */ V(2, 2, 1), /* 26 */
/* 1 */ V(0, 2, 1)
};
@@ -278,7 +278,7 @@ union huffpair const hufftab7[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 1),
/* 0000 ... */
- /* 0000 */ PTR(52, 2), /* 16 */
+ /* 0000 */ PTR(52, 2), /* 16 */
/* 0001 */ PTR(56, 1),
/* 0010 */ PTR(58, 1),
/* 0011 */ V(1, 5, 4),
@@ -296,7 +296,7 @@ union huffpair const hufftab7[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(4, 0, 3),
/* 0001 ... */
- /* 0000 */ V(0, 4, 4), /* 32 */
+ /* 0000 */ V(0, 4, 4), /* 32 */
/* 0001 */ V(2, 3, 4),
/* 0010 */ V(3, 2, 4),
/* 0011 */ V(0, 3, 4),
@@ -314,31 +314,31 @@ union huffpair const hufftab7[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 2, 2),
/* 0010 ... */
- /* 00 */ V(2, 1, 1), /* 48 */
+ /* 00 */ V(2, 1, 1), /* 48 */
/* 01 */ V(2, 1, 1),
/* 10 */ V(0, 2, 2),
/* 11 */ V(2, 0, 2),
/* 0000 0000 ... */
- /* 00 */ V(5, 5, 2), /* 52 */
+ /* 00 */ V(5, 5, 2), /* 52 */
/* 01 */ V(4, 5, 2),
/* 10 */ V(5, 4, 2),
/* 11 */ V(5, 3, 2),
/* 0000 0001 ... */
- /* 0 */ V(3, 5, 1), /* 56 */
+ /* 0 */ V(3, 5, 1), /* 56 */
/* 1 */ V(4, 4, 1),
/* 0000 0010 ... */
- /* 0 */ V(2, 5, 1), /* 58 */
+ /* 0 */ V(2, 5, 1), /* 58 */
/* 1 */ V(5, 2, 1),
/* 0000 0101 ... */
- /* 0 */ V(0, 5, 1), /* 60 */
+ /* 0 */ V(0, 5, 1), /* 60 */
/* 1 */ V(3, 4, 1),
/* 0000 0111 ... */
- /* 0 */ V(4, 3, 1), /* 62 */
+ /* 0 */ V(4, 3, 1), /* 62 */
/* 1 */ V(3, 3, 1)
};
@@ -365,7 +365,7 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 2),
/* 0000 ... */
- /* 0000 */ PTR(36, 3), /* 16 */
+ /* 0000 */ PTR(36, 3), /* 16 */
/* 0001 */ PTR(44, 2),
/* 0010 */ PTR(48, 1),
/* 0011 */ V(1, 5, 4),
@@ -383,13 +383,13 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 2, 4),
/* 0001 ... */
- /* 00 */ PTR(54, 2), /* 32 */
+ /* 00 */ PTR(54, 2), /* 32 */
/* 01 */ V(2, 2, 2),
/* 10 */ V(0, 2, 2),
/* 11 */ V(2, 0, 2),
/* 0000 0000 ... */
- /* 000 */ V(5, 5, 3), /* 36 */
+ /* 000 */ V(5, 5, 3), /* 36 */
/* 001 */ V(5, 4, 3),
/* 010 */ V(4, 5, 2),
/* 011 */ V(4, 5, 2),
@@ -399,25 +399,25 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(5, 3, 1),
/* 0000 0001 ... */
- /* 00 */ V(3, 5, 2), /* 44 */
+ /* 00 */ V(3, 5, 2), /* 44 */
/* 01 */ V(4, 4, 2),
/* 10 */ V(2, 5, 1),
/* 11 */ V(2, 5, 1),
/* 0000 0010 ... */
- /* 0 */ V(5, 2, 1), /* 48 */
+ /* 0 */ V(5, 2, 1), /* 48 */
/* 1 */ V(0, 5, 1),
/* 0000 0101 ... */
- /* 0 */ V(3, 4, 1), /* 50 */
+ /* 0 */ V(3, 4, 1), /* 50 */
/* 1 */ V(4, 3, 1),
/* 0000 0110 ... */
- /* 0 */ V(5, 0, 1), /* 52 */
+ /* 0 */ V(5, 0, 1), /* 52 */
/* 1 */ V(3, 3, 1),
/* 0001 00 ... */
- /* 00 */ V(1, 3, 2), /* 54 */
+ /* 00 */ V(1, 3, 2), /* 54 */
/* 01 */ V(3, 1, 2),
/* 10 */ V(0, 3, 2),
/* 11 */ V(3, 0, 2),
@@ -443,7 +443,7 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 2),
/* 0000 ... */
- /* 0000 */ PTR(48, 3), /* 16 */
+ /* 0000 */ PTR(48, 3), /* 16 */
/* 0001 */ PTR(56, 2),
/* 0010 */ PTR(60, 1),
/* 0011 */ V(1, 5, 4),
@@ -461,7 +461,7 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 2, 4),
/* 0001 ... */
- /* 0000 */ V(1, 3, 4), /* 32 */
+ /* 0000 */ V(1, 3, 4), /* 32 */
/* 0001 */ V(3, 1, 4),
/* 0010 */ V(0, 3, 4),
/* 0011 */ V(3, 0, 4),
@@ -479,7 +479,7 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(2, 0, 2),
/* 0000 0000 ... */
- /* 000 */ V(5, 5, 3), /* 48 */
+ /* 000 */ V(5, 5, 3), /* 48 */
/* 001 */ V(5, 4, 3),
/* 010 */ V(4, 5, 2),
/* 011 */ V(4, 5, 2),
@@ -489,21 +489,21 @@ union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(5, 3, 1),
/* 0000 0001 ... */
- /* 00 */ V(3, 5, 2), /* 56 */
+ /* 00 */ V(3, 5, 2), /* 56 */
/* 01 */ V(4, 4, 2),
/* 10 */ V(2, 5, 1),
/* 11 */ V(2, 5, 1),
/* 0000 0010 ... */
- /* 0 */ V(5, 2, 1), /* 60 */
+ /* 0 */ V(5, 2, 1), /* 60 */
/* 1 */ V(0, 5, 1),
/* 0000 0101 ... */
- /* 0 */ V(3, 4, 1), /* 62 */
+ /* 0 */ V(3, 4, 1), /* 62 */
/* 1 */ V(4, 3, 1),
/* 0000 0110 ... */
- /* 0 */ V(5, 0, 1), /* 64 */
+ /* 0 */ V(5, 0, 1), /* 64 */
/* 1 */ V(3, 3, 1)
};
# endif
@@ -528,7 +528,7 @@ union huffpair const hufftab9[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 3),
/* 0000 ... */
- /* 0000 */ PTR(50, 1), /* 16 */
+ /* 0000 */ PTR(50, 1), /* 16 */
/* 0001 */ V(3, 5, 4),
/* 0010 */ V(5, 3, 4),
/* 0011 */ PTR(52, 1),
@@ -546,7 +546,7 @@ union huffpair const hufftab9[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 4, 4),
/* 0001 ... */
- /* 000 */ V(2, 4, 3), /* 32 */
+ /* 000 */ V(2, 4, 3), /* 32 */
/* 001 */ V(4, 2, 3),
/* 010 */ V(3, 3, 3),
/* 011 */ V(4, 0, 3),
@@ -556,27 +556,27 @@ union huffpair const hufftab9[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(4, 1, 2),
/* 0010 ... */
- /* 00 */ V(2, 3, 2), /* 40 */
+ /* 00 */ V(2, 3, 2), /* 40 */
/* 01 */ V(3, 2, 2),
/* 10 */ V(1, 3, 1),
/* 11 */ V(1, 3, 1),
/* 0011 ... */
- /* 00 */ V(3, 1, 1), /* 44 */
+ /* 00 */ V(3, 1, 1), /* 44 */
/* 01 */ V(3, 1, 1),
/* 10 */ V(0, 3, 2),
/* 11 */ V(3, 0, 2),
/* 0100 ... */
- /* 0 */ V(2, 2, 1), /* 48 */
+ /* 0 */ V(2, 2, 1), /* 48 */
/* 1 */ V(0, 2, 1),
/* 0000 0000 ... */
- /* 0 */ V(5, 5, 1), /* 50 */
+ /* 0 */ V(5, 5, 1), /* 50 */
/* 1 */ V(4, 5, 1),
/* 0000 0011 ... */
- /* 0 */ V(5, 4, 1), /* 52 */
+ /* 0 */ V(5, 4, 1), /* 52 */
/* 1 */ V(0, 5, 1)
};
@@ -600,7 +600,7 @@ union huffpair const hufftab10[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 1),
/* 0000 ... */
- /* 0000 */ PTR(52, 3), /* 16 */
+ /* 0000 */ PTR(52, 3), /* 16 */
/* 0001 */ PTR(60, 2),
/* 0010 */ PTR(64, 3),
/* 0011 */ PTR(72, 1),
@@ -618,7 +618,7 @@ union huffpair const hufftab10[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(96, 1),
/* 0001 ... */
- /* 0000 */ PTR(98, 1), /* 32 */
+ /* 0000 */ PTR(98, 1), /* 32 */
/* 0001 */ PTR(100, 1),
/* 0010 */ V(1, 4, 4),
/* 0011 */ V(4, 1, 4),
@@ -636,13 +636,13 @@ union huffpair const hufftab10[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(2, 2, 3),
/* 0010 ... */
- /* 00 */ V(1, 2, 2), /* 48 */
+ /* 00 */ V(1, 2, 2), /* 48 */
/* 01 */ V(2, 1, 2),
/* 10 */ V(0, 2, 2),
/* 11 */ V(2, 0, 2),
/* 0000 0000 ... */
- /* 000 */ V(7, 7, 3), /* 52 */
+ /* 000 */ V(7, 7, 3), /* 52 */
/* 001 */ V(6, 7, 3),
/* 010 */ V(7, 6, 3),
/* 011 */ V(5, 7, 3),
@@ -652,13 +652,13 @@ union huffpair const hufftab10[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(4, 7, 2),
/* 0000 0001 ... */
- /* 00 */ V(7, 4, 2), /* 60 */
+ /* 00 */ V(7, 4, 2), /* 60 */
/* 01 */ V(5, 6, 2),
/* 10 */ V(6, 5, 2),
/* 11 */ V(3, 7, 2),
/* 0000 0010 ... */
- /* 000 */ V(7, 3, 2), /* 64 */
+ /* 000 */ V(7, 3, 2), /* 64 */
/* 001 */ V(7, 3, 2),
/* 010 */ V(4, 6, 2),
/* 011 */ V(4, 6, 2),
@@ -668,53 +668,53 @@ union huffpair const hufftab10[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(6, 3, 2),
/* 0000 0011 ... */
- /* 0 */ V(2, 7, 1), /* 72 */
+ /* 0 */ V(2, 7, 1), /* 72 */
/* 1 */ V(7, 2, 1),
/* 0000 0100 ... */
- /* 00 */ V(6, 4, 2), /* 74 */
+ /* 00 */ V(6, 4, 2), /* 74 */
/* 01 */ V(0, 7, 2),
/* 10 */ V(7, 0, 1),
/* 11 */ V(7, 0, 1),
/* 0000 0101 ... */
- /* 00 */ V(6, 2, 1), /* 78 */
+ /* 00 */ V(6, 2, 1), /* 78 */
/* 01 */ V(6, 2, 1),
/* 10 */ V(4, 5, 2),
/* 11 */ V(3, 5, 2),
/* 0000 0110 ... */
- /* 00 */ V(0, 6, 1), /* 82 */
+ /* 00 */ V(0, 6, 1), /* 82 */
/* 01 */ V(0, 6, 1),
/* 10 */ V(5, 3, 2),
/* 11 */ V(4, 4, 2),
/* 0000 1001 ... */
- /* 0 */ V(3, 6, 1), /* 86 */
+ /* 0 */ V(3, 6, 1), /* 86 */
/* 1 */ V(2, 6, 1),
/* 0000 1010 ... */
- /* 00 */ V(2, 5, 2), /* 88 */
+ /* 00 */ V(2, 5, 2), /* 88 */
/* 01 */ V(5, 2, 2),
/* 10 */ V(1, 5, 1),
/* 11 */ V(1, 5, 1),
/* 0000 1011 ... */
- /* 00 */ V(5, 1, 1), /* 92 */
+ /* 00 */ V(5, 1, 1), /* 92 */
/* 01 */ V(5, 1, 1),
/* 10 */ V(3, 4, 2),
/* 11 */ V(4, 3, 2),
/* 0000 1111 ... */
- /* 0 */ V(0, 5, 1), /* 96 */
+ /* 0 */ V(0, 5, 1), /* 96 */
/* 1 */ V(5, 0, 1),
/* 0001 0000 ... */
- /* 0 */ V(2, 4, 1), /* 98 */
+ /* 0 */ V(2, 4, 1), /* 98 */
/* 1 */ V(4, 2, 1),
/* 0001 0001 ... */
- /* 0 */ V(3, 3, 1), /* 100 */
+ /* 0 */ V(3, 3, 1), /* 100 */
/* 1 */ V(0, 4, 1)
};
@@ -738,7 +738,7 @@ union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 2),
/* 0000 ... */
- /* 0000 */ PTR(74, 2), /* 16 */
+ /* 0000 */ PTR(74, 2), /* 16 */
/* 0001 */ PTR(78, 3),
/* 0010 */ PTR(86, 2),
/* 0011 */ PTR(90, 1),
@@ -756,7 +756,7 @@ union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(98, 1),
/* 0001 ... */
- /* 0000 */ PTR(100, 1), /* 32 */
+ /* 0000 */ PTR(100, 1), /* 32 */
/* 0001 */ V(1, 5, 4),
/* 0010 */ V(6, 2, 3),
/* 0011 */ V(6, 2, 3),
@@ -774,7 +774,7 @@ union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(4, 2, 4),
/* 0010 ... */
- /* 0000 */ V(1, 4, 4), /* 48 */
+ /* 0000 */ V(1, 4, 4), /* 48 */
/* 0001 */ V(4, 1, 4),
/* 0010 */ V(0, 4, 4),
/* 0011 */ V(4, 0, 4),
@@ -792,7 +792,7 @@ union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 1, 2),
/* 0011 ... */
- /* 000 */ V(0, 3, 3), /* 64 */
+ /* 000 */ V(0, 3, 3), /* 64 */
/* 001 */ V(3, 0, 3),
/* 010 */ V(2, 2, 2),
/* 011 */ V(2, 2, 2),
@@ -802,17 +802,17 @@ union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(2, 1, 1),
/* 0101 ... */
- /* 0 */ V(0, 2, 1), /* 72 */
+ /* 0 */ V(0, 2, 1), /* 72 */
/* 1 */ V(2, 0, 1),
/* 0000 0000 ... */
- /* 00 */ V(7, 7, 2), /* 74 */
+ /* 00 */ V(7, 7, 2), /* 74 */
/* 01 */ V(6, 7, 2),
/* 10 */ V(7, 6, 2),
/* 11 */ V(7, 5, 2),
/* 0000 0001 ... */
- /* 000 */ V(6, 6, 2), /* 78 */
+ /* 000 */ V(6, 6, 2), /* 78 */
/* 001 */ V(6, 6, 2),
/* 010 */ V(4, 7, 2),
/* 011 */ V(4, 7, 2),
@@ -822,35 +822,35 @@ union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(5, 5, 3),
/* 0000 0010 ... */
- /* 00 */ V(5, 6, 2), /* 86 */
+ /* 00 */ V(5, 6, 2), /* 86 */
/* 01 */ V(6, 5, 2),
/* 10 */ V(3, 7, 1),
/* 11 */ V(3, 7, 1),
/* 0000 0011 ... */
- /* 0 */ V(7, 3, 1), /* 90 */
+ /* 0 */ V(7, 3, 1), /* 90 */
/* 1 */ V(4, 6, 1),
/* 0000 0100 ... */
- /* 00 */ V(4, 5, 2), /* 92 */
+ /* 00 */ V(4, 5, 2), /* 92 */
/* 01 */ V(5, 4, 2),
/* 10 */ V(3, 5, 2),
/* 11 */ V(5, 3, 2),
/* 0000 0111 ... */
- /* 0 */ V(6, 4, 1), /* 96 */
+ /* 0 */ V(6, 4, 1), /* 96 */
/* 1 */ V(0, 7, 1),
/* 0000 1111 ... */
- /* 0 */ V(4, 4, 1), /* 98 */
+ /* 0 */ V(4, 4, 1), /* 98 */
/* 1 */ V(2, 5, 1),
/* 0001 0000 ... */
- /* 0 */ V(5, 2, 1), /* 100 */
+ /* 0 */ V(5, 2, 1), /* 100 */
/* 1 */ V(0, 5, 1),
/* 0001 1101 ... */
- /* 0 */ V(4, 3, 1), /* 102 */
+ /* 0 */ V(4, 3, 1), /* 102 */
/* 1 */ V(3, 3, 1)
};
@@ -874,7 +874,7 @@ union huffpair const hufftab12[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 0, 3),
/* 0000 ... */
- /* 0000 */ PTR(80, 2), /* 16 */
+ /* 0000 */ PTR(80, 2), /* 16 */
/* 0001 */ PTR(84, 1),
/* 0010 */ PTR(86, 1),
/* 0011 */ PTR(88, 1),
@@ -892,7 +892,7 @@ union huffpair const hufftab12[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(6, 3, 4),
/* 0001 ... */
- /* 0000 */ V(4, 5, 4), /* 32 */
+ /* 0000 */ V(4, 5, 4), /* 32 */
/* 0001 */ V(5, 4, 4),
/* 0010 */ V(4, 4, 4),
/* 0011 */ PTR(94, 1),
@@ -910,7 +910,7 @@ union huffpair const hufftab12[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(5, 2, 4),
/* 0010 ... */
- /* 0000 */ V(1, 5, 3), /* 48 */
+ /* 0000 */ V(1, 5, 3), /* 48 */
/* 0001 */ V(1, 5, 3),
/* 0010 */ V(5, 1, 3),
/* 0011 */ V(5, 1, 3),
@@ -928,13 +928,13 @@ union huffpair const hufftab12[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 4, 3),
/* 0011 ... */
- /* 00 */ V(3, 3, 2), /* 64 */
+ /* 00 */ V(3, 3, 2), /* 64 */
/* 01 */ V(4, 1, 2),
/* 10 */ V(2, 3, 2),
/* 11 */ V(3, 2, 2),
/* 0100 ... */
- /* 000 */ V(4, 0, 3), /* 68 */
+ /* 000 */ V(4, 0, 3), /* 68 */
/* 001 */ V(0, 3, 3),
/* 010 */ V(3, 0, 2),
/* 011 */ V(3, 0, 2),
@@ -944,41 +944,41 @@ union huffpair const hufftab12[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 3, 1),
/* 0101 ... */
- /* 0 */ V(3, 1, 1), /* 76 */
+ /* 0 */ V(3, 1, 1), /* 76 */
/* 1 */ V(2, 2, 1),
/* 1000 ... */
- /* 0 */ V(0, 2, 1), /* 78 */
+ /* 0 */ V(0, 2, 1), /* 78 */
/* 1 */ V(2, 0, 1),
/* 0000 0000 ... */
- /* 00 */ V(7, 7, 2), /* 80 */
+ /* 00 */ V(7, 7, 2), /* 80 */
/* 01 */ V(6, 7, 2),
/* 10 */ V(7, 6, 1),
/* 11 */ V(7, 6, 1),
/* 0000 0001 ... */
- /* 0 */ V(5, 7, 1), /* 84 */
+ /* 0 */ V(5, 7, 1), /* 84 */
/* 1 */ V(7, 5, 1),
/* 0000 0010 ... */
- /* 0 */ V(6, 6, 1), /* 86 */
+ /* 0 */ V(6, 6, 1), /* 86 */
/* 1 */ V(4, 7, 1),
/* 0000 0011 ... */
- /* 0 */ V(7, 4, 1), /* 88 */
+ /* 0 */ V(7, 4, 1), /* 88 */
/* 1 */ V(6, 5, 1),
/* 0000 0110 ... */
- /* 0 */ V(7, 3, 1), /* 90 */
+ /* 0 */ V(7, 3, 1), /* 90 */
/* 1 */ V(5, 5, 1),
/* 0000 1101 ... */
- /* 0 */ V(0, 7, 1), /* 92 */
+ /* 0 */ V(0, 7, 1), /* 92 */
/* 1 */ V(7, 0, 1),
/* 0001 0011 ... */
- /* 0 */ V(0, 6, 1), /* 94 */
+ /* 0 */ V(0, 6, 1), /* 94 */
/* 1 */ V(0, 5, 1)
};
@@ -1002,7 +1002,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 1),
/* 0000 ... */
- /* 0000 */ PTR(68, 4), /* 16 */
+ /* 0000 */ PTR(68, 4), /* 16 */
/* 0001 */ PTR(84, 4),
/* 0010 */ PTR(100, 4),
/* 0011 */ PTR(116, 4),
@@ -1020,7 +1020,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(226, 1),
/* 0001 ... */
- /* 0000 */ PTR(228, 2), /* 32 */
+ /* 0000 */ PTR(228, 2), /* 32 */
/* 0001 */ PTR(232, 2),
/* 0010 */ PTR(236, 2),
/* 0011 */ PTR(240, 2),
@@ -1038,7 +1038,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 4, 4),
/* 0010 ... */
- /* 0000 */ V(4, 1, 3), /* 48 */
+ /* 0000 */ V(4, 1, 3), /* 48 */
/* 0001 */ V(4, 1, 3),
/* 0010 */ V(0, 4, 4),
/* 0011 */ V(4, 0, 4),
@@ -1056,13 +1056,13 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(2, 2, 3),
/* 0011 ... */
- /* 00 */ V(1, 2, 2), /* 64 */
+ /* 00 */ V(1, 2, 2), /* 64 */
/* 01 */ V(2, 1, 2),
/* 10 */ V(0, 2, 2),
/* 11 */ V(2, 0, 2),
/* 0000 0000 ... */
- /* 0000 */ PTR(262, 4), /* 68 */
+ /* 0000 */ PTR(262, 4), /* 68 */
/* 0001 */ PTR(278, 4),
/* 0010 */ PTR(294, 4),
/* 0011 */ PTR(310, 3),
@@ -1080,7 +1080,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(15, 1, 4),
/* 0000 0001 ... */
- /* 0000 */ V(15, 0, 4), /* 84 */
+ /* 0000 */ V(15, 0, 4), /* 84 */
/* 0001 */ PTR(360, 1),
/* 0010 */ PTR(362, 1),
/* 0011 */ PTR(364, 1),
@@ -1098,7 +1098,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 13, 4),
/* 0000 0010 ... */
- /* 0000 */ PTR(380, 1), /* 100 */
+ /* 0000 */ PTR(380, 1), /* 100 */
/* 0001 */ V(2, 13, 4),
/* 0010 */ V(13, 2, 4),
/* 0011 */ V(1, 13, 4),
@@ -1116,7 +1116,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(10, 8, 4),
/* 0000 0011 ... */
- /* 0000 */ V(4, 12, 4), /* 116 */
+ /* 0000 */ V(4, 12, 4), /* 116 */
/* 0001 */ V(12, 4, 4),
/* 0010 */ V(6, 11, 4),
/* 0011 */ V(11, 6, 4),
@@ -1134,7 +1134,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 12, 3),
/* 0000 0100 ... */
- /* 0000 */ V(12, 1, 3), /* 132 */
+ /* 0000 */ V(12, 1, 3), /* 132 */
/* 0001 */ V(12, 1, 3),
/* 0010 */ V(9, 8, 4),
/* 0011 */ V(0, 12, 4),
@@ -1152,7 +1152,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(5, 10, 4),
/* 0000 0101 ... */
- /* 0000 */ V(2, 11, 3), /* 148 */
+ /* 0000 */ V(2, 11, 3), /* 148 */
/* 0001 */ V(2, 11, 3),
/* 0010 */ V(10, 5, 4),
/* 0011 */ V(6, 9, 4),
@@ -1170,7 +1170,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(11, 2, 2),
/* 0000 0110 ... */
- /* 000 */ V(1, 11, 2), /* 164 */
+ /* 000 */ V(1, 11, 2), /* 164 */
/* 001 */ V(1, 11, 2),
/* 010 */ V(11, 1, 2),
/* 011 */ V(11, 1, 2),
@@ -1180,7 +1180,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(4, 10, 3),
/* 0000 0111 ... */
- /* 000 */ V(3, 10, 3), /* 172 */
+ /* 000 */ V(3, 10, 3), /* 172 */
/* 001 */ V(10, 3, 3),
/* 010 */ V(5, 9, 3),
/* 011 */ V(9, 5, 3),
@@ -1190,7 +1190,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(10, 2, 2),
/* 0000 1000 ... */
- /* 000 */ V(1, 10, 2), /* 180 */
+ /* 000 */ V(1, 10, 2), /* 180 */
/* 001 */ V(1, 10, 2),
/* 010 */ V(10, 1, 2),
/* 011 */ V(10, 1, 2),
@@ -1200,7 +1200,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(10, 0, 2),
/* 0000 1001 ... */
- /* 000 */ V(8, 6, 3), /* 188 */
+ /* 000 */ V(8, 6, 3), /* 188 */
/* 001 */ V(4, 9, 3),
/* 010 */ V(9, 3, 2),
/* 011 */ V(9, 3, 2),
@@ -1210,7 +1210,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(6, 7, 3),
/* 0000 1010 ... */
- /* 000 */ V(2, 9, 2), /* 196 */
+ /* 000 */ V(2, 9, 2), /* 196 */
/* 001 */ V(2, 9, 2),
/* 010 */ V(9, 2, 2),
/* 011 */ V(9, 2, 2),
@@ -1220,7 +1220,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(3, 8, 2),
/* 0000 1011 ... */
- /* 000 */ V(8, 3, 2), /* 204 */
+ /* 000 */ V(8, 3, 2), /* 204 */
/* 001 */ V(8, 3, 2),
/* 010 */ V(6, 6, 3),
/* 011 */ V(4, 7, 3),
@@ -1230,17 +1230,17 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(7, 3, 3),
/* 0000 1100 ... */
- /* 0 */ V(1, 9, 1), /* 212 */
+ /* 0 */ V(1, 9, 1), /* 212 */
/* 1 */ V(9, 1, 1),
/* 0000 1101 ... */
- /* 00 */ V(0, 9, 2), /* 214 */
+ /* 00 */ V(0, 9, 2), /* 214 */
/* 01 */ V(9, 0, 2),
/* 10 */ V(4, 8, 2),
/* 11 */ V(8, 4, 2),
/* 0000 1110 ... */
- /* 000 */ V(7, 2, 2), /* 218 */
+ /* 000 */ V(7, 2, 2), /* 218 */
/* 001 */ V(7, 2, 2),
/* 010 */ V(4, 6, 3),
/* 011 */ V(6, 4, 3),
@@ -1250,69 +1250,69 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(2, 8, 1),
/* 0000 1111 ... */
- /* 0 */ V(8, 2, 1), /* 226 */
+ /* 0 */ V(8, 2, 1), /* 226 */
/* 1 */ V(1, 8, 1),
/* 0001 0000 ... */
- /* 00 */ V(3, 7, 2), /* 228 */
+ /* 00 */ V(3, 7, 2), /* 228 */
/* 01 */ V(2, 7, 2),
/* 10 */ V(1, 7, 1),
/* 11 */ V(1, 7, 1),
/* 0001 0001 ... */
- /* 00 */ V(7, 1, 1), /* 232 */
+ /* 00 */ V(7, 1, 1), /* 232 */
/* 01 */ V(7, 1, 1),
/* 10 */ V(5, 5, 2),
/* 11 */ V(0, 7, 2),
/* 0001 0010 ... */
- /* 00 */ V(7, 0, 2), /* 236 */
+ /* 00 */ V(7, 0, 2), /* 236 */
/* 01 */ V(3, 6, 2),
/* 10 */ V(6, 3, 2),
/* 11 */ V(4, 5, 2),
/* 0001 0011 ... */
- /* 00 */ V(5, 4, 2), /* 240 */
+ /* 00 */ V(5, 4, 2), /* 240 */
/* 01 */ V(2, 6, 2),
/* 10 */ V(6, 2, 2),
/* 11 */ V(3, 5, 2),
/* 0001 0101 ... */
- /* 0 */ V(0, 8, 1), /* 244 */
+ /* 0 */ V(0, 8, 1), /* 244 */
/* 1 */ V(8, 0, 1),
/* 0001 0110 ... */
- /* 0 */ V(1, 6, 1), /* 246 */
+ /* 0 */ V(1, 6, 1), /* 246 */
/* 1 */ V(6, 1, 1),
/* 0001 0111 ... */
- /* 0 */ V(0, 6, 1), /* 248 */
+ /* 0 */ V(0, 6, 1), /* 248 */
/* 1 */ V(6, 0, 1),
/* 0001 1000 ... */
- /* 00 */ V(5, 3, 2), /* 250 */
+ /* 00 */ V(5, 3, 2), /* 250 */
/* 01 */ V(4, 4, 2),
/* 10 */ V(2, 5, 1),
/* 11 */ V(2, 5, 1),
/* 0001 1001 ... */
- /* 0 */ V(5, 2, 1), /* 254 */
+ /* 0 */ V(5, 2, 1), /* 254 */
/* 1 */ V(0, 5, 1),
/* 0001 1100 ... */
- /* 0 */ V(3, 4, 1), /* 256 */
+ /* 0 */ V(3, 4, 1), /* 256 */
/* 1 */ V(4, 3, 1),
/* 0001 1101 ... */
- /* 0 */ V(5, 0, 1), /* 258 */
+ /* 0 */ V(5, 0, 1), /* 258 */
/* 1 */ V(2, 4, 1),
/* 0001 1110 ... */
- /* 0 */ V(4, 2, 1), /* 260 */
+ /* 0 */ V(4, 2, 1), /* 260 */
/* 1 */ V(3, 3, 1),
/* 0000 0000 0000 ... */
- /* 0000 */ PTR(388, 3), /* 262 */
+ /* 0000 */ PTR(388, 3), /* 262 */
/* 0001 */ V(15, 15, 4),
/* 0010 */ V(14, 15, 4),
/* 0011 */ V(13, 15, 4),
@@ -1330,7 +1330,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(13, 13, 3),
/* 0000 0000 0001 ... */
- /* 0000 */ V(15, 10, 4), /* 278 */
+ /* 0000 */ V(15, 10, 4), /* 278 */
/* 0001 */ V(12, 13, 4),
/* 0010 */ V(11, 14, 3),
/* 0011 */ V(11, 14, 3),
@@ -1348,7 +1348,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(13, 11, 3),
/* 0000 0000 0010 ... */
- /* 0000 */ V(8, 15, 3), /* 294 */
+ /* 0000 */ V(8, 15, 3), /* 294 */
/* 0001 */ V(8, 15, 3),
/* 0010 */ V(15, 8, 3),
/* 0011 */ V(15, 8, 3),
@@ -1366,7 +1366,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(15, 7, 2),
/* 0000 0000 0011 ... */
- /* 000 */ V(13, 10, 2), /* 310 */
+ /* 000 */ V(13, 10, 2), /* 310 */
/* 001 */ V(13, 10, 2),
/* 010 */ V(10, 13, 3),
/* 011 */ V(11, 12, 3),
@@ -1376,19 +1376,19 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(6, 15, 2),
/* 0000 0000 0100 ... */
- /* 00 */ V(14, 8, 2), /* 318 */
+ /* 00 */ V(14, 8, 2), /* 318 */
/* 01 */ V(5, 15, 2),
/* 10 */ V(9, 13, 2),
/* 11 */ V(13, 9, 2),
/* 0000 0000 0101 ... */
- /* 00 */ V(15, 5, 2), /* 322 */
+ /* 00 */ V(15, 5, 2), /* 322 */
/* 01 */ V(14, 7, 2),
/* 10 */ V(10, 12, 2),
/* 11 */ V(11, 11, 2),
/* 0000 0000 0110 ... */
- /* 000 */ V(4, 15, 2), /* 326 */
+ /* 000 */ V(4, 15, 2), /* 326 */
/* 001 */ V(4, 15, 2),
/* 010 */ V(15, 4, 2),
/* 011 */ V(15, 4, 2),
@@ -1398,103 +1398,103 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(15, 3, 2),
/* 0000 0000 0111 ... */
- /* 00 */ V(3, 15, 1), /* 334 */
+ /* 00 */ V(3, 15, 1), /* 334 */
/* 01 */ V(3, 15, 1),
/* 10 */ V(8, 13, 2),
/* 11 */ V(13, 8, 2),
/* 0000 0000 1000 ... */
- /* 0 */ V(2, 15, 1), /* 338 */
+ /* 0 */ V(2, 15, 1), /* 338 */
/* 1 */ V(15, 2, 1),
/* 0000 0000 1001 ... */
- /* 00 */ V(6, 14, 2), /* 340 */
+ /* 00 */ V(6, 14, 2), /* 340 */
/* 01 */ V(9, 12, 2),
/* 10 */ V(0, 15, 1),
/* 11 */ V(0, 15, 1),
/* 0000 0000 1010 ... */
- /* 00 */ V(12, 9, 2), /* 344 */
+ /* 00 */ V(12, 9, 2), /* 344 */
/* 01 */ V(5, 14, 2),
/* 10 */ V(10, 11, 1),
/* 11 */ V(10, 11, 1),
/* 0000 0000 1011 ... */
- /* 00 */ V(7, 13, 2), /* 348 */
+ /* 00 */ V(7, 13, 2), /* 348 */
/* 01 */ V(13, 7, 2),
/* 10 */ V(4, 14, 1),
/* 11 */ V(4, 14, 1),
/* 0000 0000 1100 ... */
- /* 00 */ V(12, 8, 2), /* 352 */
+ /* 00 */ V(12, 8, 2), /* 352 */
/* 01 */ V(13, 6, 2),
/* 10 */ V(3, 14, 1),
/* 11 */ V(3, 14, 1),
/* 0000 0000 1101 ... */
- /* 00 */ V(11, 9, 1), /* 356 */
+ /* 00 */ V(11, 9, 1), /* 356 */
/* 01 */ V(11, 9, 1),
/* 10 */ V(9, 11, 2),
/* 11 */ V(10, 10, 2),
/* 0000 0001 0001 ... */
- /* 0 */ V(11, 10, 1), /* 360 */
+ /* 0 */ V(11, 10, 1), /* 360 */
/* 1 */ V(14, 5, 1),
/* 0000 0001 0010 ... */
- /* 0 */ V(14, 4, 1), /* 362 */
+ /* 0 */ V(14, 4, 1), /* 362 */
/* 1 */ V(8, 12, 1),
/* 0000 0001 0011 ... */
- /* 0 */ V(6, 13, 1), /* 364 */
+ /* 0 */ V(6, 13, 1), /* 364 */
/* 1 */ V(14, 3, 1),
/* 0000 0001 0101 ... */
- /* 0 */ V(2, 14, 1), /* 366 */
+ /* 0 */ V(2, 14, 1), /* 366 */
/* 1 */ V(0, 14, 1),
/* 0000 0001 1000 ... */
- /* 0 */ V(14, 0, 1), /* 368 */
+ /* 0 */ V(14, 0, 1), /* 368 */
/* 1 */ V(5, 13, 1),
/* 0000 0001 1001 ... */
- /* 0 */ V(13, 5, 1), /* 370 */
+ /* 0 */ V(13, 5, 1), /* 370 */
/* 1 */ V(7, 12, 1),
/* 0000 0001 1010 ... */
- /* 0 */ V(12, 7, 1), /* 372 */
+ /* 0 */ V(12, 7, 1), /* 372 */
/* 1 */ V(4, 13, 1),
/* 0000 0001 1011 ... */
- /* 0 */ V(8, 11, 1), /* 374 */
+ /* 0 */ V(8, 11, 1), /* 374 */
/* 1 */ V(11, 8, 1),
/* 0000 0001 1100 ... */
- /* 0 */ V(13, 4, 1), /* 376 */
+ /* 0 */ V(13, 4, 1), /* 376 */
/* 1 */ V(9, 10, 1),
/* 0000 0001 1101 ... */
- /* 0 */ V(10, 9, 1), /* 378 */
+ /* 0 */ V(10, 9, 1), /* 378 */
/* 1 */ V(6, 12, 1),
/* 0000 0010 0000 ... */
- /* 0 */ V(13, 3, 1), /* 380 */
+ /* 0 */ V(13, 3, 1), /* 380 */
/* 1 */ V(7, 11, 1),
/* 0000 0010 0101 ... */
- /* 0 */ V(5, 12, 1), /* 382 */
+ /* 0 */ V(5, 12, 1), /* 382 */
/* 1 */ V(12, 5, 1),
/* 0000 0010 0110 ... */
- /* 0 */ V(9, 9, 1), /* 384 */
+ /* 0 */ V(9, 9, 1), /* 384 */
/* 1 */ V(7, 10, 1),
/* 0000 0010 1000 ... */
- /* 0 */ V(10, 7, 1), /* 386 */
+ /* 0 */ V(10, 7, 1), /* 386 */
/* 1 */ V(9, 7, 1),
/* 0000 0000 0000 0000 ... */
- /* 000 */ V(15, 14, 3), /* 388 */
+ /* 000 */ V(15, 14, 3), /* 388 */
/* 001 */ V(15, 12, 3),
/* 010 */ V(15, 13, 2),
/* 011 */ V(15, 13, 2),
@@ -1504,7 +1504,7 @@ union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(14, 13, 1),
/* 0000 0000 0000 1011 ... */
- /* 0 */ V(10, 15, 1), /* 396 */
+ /* 0 */ V(10, 15, 1), /* 396 */
/* 1 */ V(14, 9, 1)
};
@@ -1528,7 +1528,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 3),
/* 0000 ... */
- /* 0000 */ PTR(120, 4), /* 16 */
+ /* 0000 */ PTR(120, 4), /* 16 */
/* 0001 */ PTR(136, 4),
/* 0010 */ PTR(152, 4),
/* 0011 */ PTR(168, 4),
@@ -1546,7 +1546,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(284, 2),
/* 0001 ... */
- /* 0000 */ PTR(288, 2), /* 32 */
+ /* 0000 */ PTR(288, 2), /* 32 */
/* 0001 */ PTR(292, 2),
/* 0010 */ PTR(296, 2),
/* 0011 */ PTR(300, 2),
@@ -1564,7 +1564,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(338, 1),
/* 0010 ... */
- /* 0000 */ PTR(340, 1), /* 48 */
+ /* 0000 */ PTR(340, 1), /* 48 */
/* 0001 */ PTR(342, 1),
/* 0010 */ V(9, 1, 4),
/* 0011 */ PTR(344, 1),
@@ -1582,7 +1582,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(360, 1),
/* 0011 ... */
- /* 0000 */ V(2, 7, 4), /* 64 */
+ /* 0000 */ V(2, 7, 4), /* 64 */
/* 0001 */ V(7, 2, 4),
/* 0010 */ V(6, 4, 4),
/* 0011 */ V(1, 7, 4),
@@ -1600,7 +1600,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 5, 4),
/* 0100 ... */
- /* 0000 */ V(6, 1, 3), /* 80 */
+ /* 0000 */ V(6, 1, 3), /* 80 */
/* 0001 */ V(6, 1, 3),
/* 0010 */ V(5, 3, 4),
/* 0011 */ V(4, 4, 4),
@@ -1618,7 +1618,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 4, 3),
/* 0101 ... */
- /* 000 */ V(4, 3, 3), /* 96 */
+ /* 000 */ V(4, 3, 3), /* 96 */
/* 001 */ V(2, 4, 3),
/* 010 */ V(4, 2, 3),
/* 011 */ V(3, 3, 3),
@@ -1628,7 +1628,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(0, 4, 3),
/* 0110 ... */
- /* 000 */ V(2, 3, 2), /* 104 */
+ /* 000 */ V(2, 3, 2), /* 104 */
/* 001 */ V(2, 3, 2),
/* 010 */ V(3, 2, 2),
/* 011 */ V(3, 2, 2),
@@ -1638,21 +1638,21 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 3, 2),
/* 0111 ... */
- /* 00 */ V(3, 1, 2), /* 112 */
+ /* 00 */ V(3, 1, 2), /* 112 */
/* 01 */ V(3, 0, 2),
/* 10 */ V(2, 2, 1),
/* 11 */ V(2, 2, 1),
/* 1000 ... */
- /* 0 */ V(1, 2, 1), /* 116 */
+ /* 0 */ V(1, 2, 1), /* 116 */
/* 1 */ V(2, 1, 1),
/* 1001 ... */
- /* 0 */ V(0, 2, 1), /* 118 */
+ /* 0 */ V(0, 2, 1), /* 118 */
/* 1 */ V(2, 0, 1),
/* 0000 0000 ... */
- /* 0000 */ PTR(366, 1), /* 120 */
+ /* 0000 */ PTR(366, 1), /* 120 */
/* 0001 */ PTR(368, 1),
/* 0010 */ V(14, 14, 4),
/* 0011 */ PTR(370, 1),
@@ -1670,7 +1670,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(9, 15, 4),
/* 0000 0001 ... */
- /* 0000 */ V(15, 9, 4), /* 136 */
+ /* 0000 */ V(15, 9, 4), /* 136 */
/* 0001 */ V(14, 10, 4),
/* 0010 */ V(11, 13, 4),
/* 0011 */ V(13, 11, 4),
@@ -1688,7 +1688,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(378, 1),
/* 0000 0010 ... */
- /* 0000 */ V(12, 11, 3), /* 152 */
+ /* 0000 */ V(12, 11, 3), /* 152 */
/* 0001 */ V(12, 11, 3),
/* 0010 */ V(15, 6, 3),
/* 0011 */ V(15, 6, 3),
@@ -1706,7 +1706,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(10, 12, 3),
/* 0000 0011 ... */
- /* 0000 */ V(12, 10, 3), /* 168 */
+ /* 0000 */ V(12, 10, 3), /* 168 */
/* 0001 */ V(12, 10, 3),
/* 0010 */ V(11, 11, 3),
/* 0011 */ V(11, 11, 3),
@@ -1724,7 +1724,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(13, 8, 3),
/* 0000 0100 ... */
- /* 0000 */ V(14, 6, 3), /* 184 */
+ /* 0000 */ V(14, 6, 3), /* 184 */
/* 0001 */ V(14, 6, 3),
/* 0010 */ V(2, 15, 3),
/* 0011 */ V(2, 15, 3),
@@ -1742,7 +1742,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(12, 9, 3),
/* 0000 0101 ... */
- /* 000 */ V(5, 14, 3), /* 200 */
+ /* 000 */ V(5, 14, 3), /* 200 */
/* 001 */ V(10, 11, 3),
/* 010 */ V(11, 10, 3),
/* 011 */ V(14, 5, 3),
@@ -1752,7 +1752,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(14, 4, 3),
/* 0000 0110 ... */
- /* 000 */ V(8, 12, 3), /* 208 */
+ /* 000 */ V(8, 12, 3), /* 208 */
/* 001 */ V(12, 8, 3),
/* 010 */ V(3, 14, 3),
/* 011 */ V(6, 13, 3),
@@ -1762,7 +1762,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(11, 9, 3),
/* 0000 0111 ... */
- /* 0000 */ V(2, 14, 3), /* 216 */
+ /* 0000 */ V(2, 14, 3), /* 216 */
/* 0001 */ V(2, 14, 3),
/* 0010 */ V(10, 10, 3),
/* 0011 */ V(10, 10, 3),
@@ -1780,7 +1780,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(13, 5, 3),
/* 0000 1000 ... */
- /* 000 */ V(7, 12, 3), /* 232 */
+ /* 000 */ V(7, 12, 3), /* 232 */
/* 001 */ V(12, 7, 3),
/* 010 */ V(4, 13, 3),
/* 011 */ V(8, 11, 3),
@@ -1790,7 +1790,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(9, 10, 3),
/* 0000 1001 ... */
- /* 000 */ V(10, 9, 3), /* 240 */
+ /* 000 */ V(10, 9, 3), /* 240 */
/* 001 */ V(6, 12, 3),
/* 010 */ V(12, 6, 3),
/* 011 */ V(3, 13, 3),
@@ -1800,7 +1800,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(13, 2, 2),
/* 0000 1010 ... */
- /* 000 */ V(2, 13, 3), /* 248 */
+ /* 000 */ V(2, 13, 3), /* 248 */
/* 001 */ V(0, 13, 3),
/* 010 */ V(1, 13, 2),
/* 011 */ V(1, 13, 2),
@@ -1810,7 +1810,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(11, 7, 2),
/* 0000 1011 ... */
- /* 000 */ V(13, 1, 2), /* 256 */
+ /* 000 */ V(13, 1, 2), /* 256 */
/* 001 */ V(13, 1, 2),
/* 010 */ V(5, 12, 3),
/* 011 */ V(13, 0, 3),
@@ -1820,13 +1820,13 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(8, 10, 2),
/* 0000 1100 ... */
- /* 00 */ V(10, 8, 2), /* 264 */
+ /* 00 */ V(10, 8, 2), /* 264 */
/* 01 */ V(4, 12, 2),
/* 10 */ V(12, 4, 2),
/* 11 */ V(6, 11, 2),
/* 0000 1101 ... */
- /* 000 */ V(11, 6, 2), /* 268 */
+ /* 000 */ V(11, 6, 2), /* 268 */
/* 001 */ V(11, 6, 2),
/* 010 */ V(9, 9, 3),
/* 011 */ V(0, 12, 3),
@@ -1836,7 +1836,7 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(12, 3, 2),
/* 0000 1110 ... */
- /* 000 */ V(7, 10, 2), /* 276 */
+ /* 000 */ V(7, 10, 2), /* 276 */
/* 001 */ V(7, 10, 2),
/* 010 */ V(10, 7, 2),
/* 011 */ V(10, 7, 2),
@@ -1846,173 +1846,173 @@ union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(0, 11, 3),
/* 0000 1111 ... */
- /* 00 */ V(12, 2, 1), /* 284 */
+ /* 00 */ V(12, 2, 1), /* 284 */
/* 01 */ V(12, 2, 1),
/* 10 */ V(2, 12, 2),
/* 11 */ V(5, 11, 2),
/* 0001 0000 ... */
- /* 00 */ V(11, 5, 2), /* 288 */
+ /* 00 */ V(11, 5, 2), /* 288 */
/* 01 */ V(1, 12, 2),
/* 10 */ V(8, 9, 2),
/* 11 */ V(9, 8, 2),
/* 0001 0001 ... */
- /* 00 */ V(12, 1, 2), /* 292 */
+ /* 00 */ V(12, 1, 2), /* 292 */
/* 01 */ V(4, 11, 2),
/* 10 */ V(11, 4, 2),
/* 11 */ V(6, 10, 2),
/* 0001 0010 ... */
- /* 00 */ V(3, 11, 2), /* 296 */
+ /* 00 */ V(3, 11, 2), /* 296 */
/* 01 */ V(7, 9, 2),
/* 10 */ V(11, 3, 1),
/* 11 */ V(11, 3, 1),
/* 0001 0011 ... */
- /* 00 */ V(9, 7, 2), /* 300 */
+ /* 00 */ V(9, 7, 2), /* 300 */
/* 01 */ V(8, 8, 2),
/* 10 */ V(2, 11, 2),
/* 11 */ V(5, 10, 2),
/* 0001 0100 ... */
- /* 00 */ V(11, 2, 1), /* 304 */
+ /* 00 */ V(11, 2, 1), /* 304 */
/* 01 */ V(11, 2, 1),
/* 10 */ V(10, 5, 2),
/* 11 */ V(1, 11, 2),
/* 0001 0101 ... */
- /* 00 */ V(11, 1, 1), /* 308 */
+ /* 00 */ V(11, 1, 1), /* 308 */
/* 01 */ V(11, 1, 1),
/* 10 */ V(11, 0, 2),
/* 11 */ V(6, 9, 2),
/* 0001 0110 ... */
- /* 00 */ V(9, 6, 2), /* 312 */
+ /* 00 */ V(9, 6, 2), /* 312 */
/* 01 */ V(4, 10, 2),
/* 10 */ V(10, 4, 2),
/* 11 */ V(7, 8, 2),
/* 0001 0111 ... */
- /* 00 */ V(8, 7, 2), /* 316 */
+ /* 00 */ V(8, 7, 2), /* 316 */
/* 01 */ V(3, 10, 2),
/* 10 */ V(10, 3, 1),
/* 11 */ V(10, 3, 1),
/* 0001 1000 ... */
- /* 0 */ V(5, 9, 1), /* 320 */
+ /* 0 */ V(5, 9, 1), /* 320 */
/* 1 */ V(9, 5, 1),
/* 0001 1001 ... */
- /* 0 */ V(2, 10, 1), /* 322 */
+ /* 0 */ V(2, 10, 1), /* 322 */
/* 1 */ V(10, 2, 1),
/* 0001 1010 ... */
- /* 0 */ V(1, 10, 1), /* 324 */
+ /* 0 */ V(1, 10, 1), /* 324 */
/* 1 */ V(10, 1, 1),
/* 0001 1011 ... */
- /* 00 */ V(0, 10, 2), /* 326 */
+ /* 00 */ V(0, 10, 2), /* 326 */
/* 01 */ V(10, 0, 2),
/* 10 */ V(6, 8, 1),
/* 11 */ V(6, 8, 1),
/* 0001 1100 ... */
- /* 0 */ V(8, 6, 1), /* 330 */
+ /* 0 */ V(8, 6, 1), /* 330 */
/* 1 */ V(4, 9, 1),
/* 0001 1101 ... */
- /* 0 */ V(9, 4, 1), /* 332 */
+ /* 0 */ V(9, 4, 1), /* 332 */
/* 1 */ V(3, 9, 1),
/* 0001 1110 ... */
- /* 00 */ V(9, 3, 1), /* 334 */
+ /* 00 */ V(9, 3, 1), /* 334 */
/* 01 */ V(9, 3, 1),
/* 10 */ V(7, 7, 2),
/* 11 */ V(0, 9, 2),
/* 0001 1111 ... */
- /* 0 */ V(5, 8, 1), /* 338 */
+ /* 0 */ V(5, 8, 1), /* 338 */
/* 1 */ V(8, 5, 1),
/* 0010 0000 ... */
- /* 0 */ V(2, 9, 1), /* 340 */
+ /* 0 */ V(2, 9, 1), /* 340 */
/* 1 */ V(6, 7, 1),
/* 0010 0001 ... */
- /* 0 */ V(7, 6, 1), /* 342 */
+ /* 0 */ V(7, 6, 1), /* 342 */
/* 1 */ V(9, 2, 1),
/* 0010 0011 ... */
- /* 0 */ V(1, 9, 1), /* 344 */
+ /* 0 */ V(1, 9, 1), /* 344 */
/* 1 */ V(9, 0, 1),
/* 0010 0100 ... */
- /* 0 */ V(4, 8, 1), /* 346 */
+ /* 0 */ V(4, 8, 1), /* 346 */
/* 1 */ V(8, 4, 1),
/* 0010 0101 ... */
- /* 0 */ V(5, 7, 1), /* 348 */
+ /* 0 */ V(5, 7, 1), /* 348 */
/* 1 */ V(7, 5, 1),
/* 0010 0110 ... */
- /* 0 */ V(3, 8, 1), /* 350 */
+ /* 0 */ V(3, 8, 1), /* 350 */
/* 1 */ V(8, 3, 1),
/* 0010 0111 ... */
- /* 0 */ V(6, 6, 1), /* 352 */
+ /* 0 */ V(6, 6, 1), /* 352 */
/* 1 */ V(4, 7, 1),
/* 0010 1100 ... */
- /* 0 */ V(7, 4, 1), /* 354 */
+ /* 0 */ V(7, 4, 1), /* 354 */
/* 1 */ V(0, 8, 1),
/* 0010 1101 ... */
- /* 0 */ V(8, 0, 1), /* 356 */
+ /* 0 */ V(8, 0, 1), /* 356 */
/* 1 */ V(5, 6, 1),
/* 0010 1110 ... */
- /* 0 */ V(6, 5, 1), /* 358 */
+ /* 0 */ V(6, 5, 1), /* 358 */
/* 1 */ V(3, 7, 1),
/* 0010 1111 ... */
- /* 0 */ V(7, 3, 1), /* 360 */
+ /* 0 */ V(7, 3, 1), /* 360 */
/* 1 */ V(4, 6, 1),
/* 0011 0110 ... */
- /* 0 */ V(0, 7, 1), /* 362 */
+ /* 0 */ V(0, 7, 1), /* 362 */
/* 1 */ V(7, 0, 1),
/* 0011 1110 ... */
- /* 0 */ V(0, 6, 1), /* 364 */
+ /* 0 */ V(0, 6, 1), /* 364 */
/* 1 */ V(6, 0, 1),
/* 0000 0000 0000 ... */
- /* 0 */ V(15, 15, 1), /* 366 */
+ /* 0 */ V(15, 15, 1), /* 366 */
/* 1 */ V(14, 15, 1),
/* 0000 0000 0001 ... */
- /* 0 */ V(15, 14, 1), /* 368 */
+ /* 0 */ V(15, 14, 1), /* 368 */
/* 1 */ V(13, 15, 1),
/* 0000 0000 0011 ... */
- /* 0 */ V(15, 13, 1), /* 370 */
+ /* 0 */ V(15, 13, 1), /* 370 */
/* 1 */ V(12, 15, 1),
/* 0000 0000 0100 ... */
- /* 0 */ V(15, 12, 1), /* 372 */
+ /* 0 */ V(15, 12, 1), /* 372 */
/* 1 */ V(13, 14, 1),
/* 0000 0000 0101 ... */
- /* 0 */ V(14, 13, 1), /* 374 */
+ /* 0 */ V(14, 13, 1), /* 374 */
/* 1 */ V(11, 15, 1),
/* 0000 0000 0111 ... */
- /* 0 */ V(12, 14, 1), /* 376 */
+ /* 0 */ V(12, 14, 1), /* 376 */
/* 1 */ V(14, 12, 1),
/* 0000 0001 1111 ... */
- /* 0 */ V(10, 14, 1), /* 378 */
+ /* 0 */ V(10, 14, 1), /* 378 */
/* 1 */ V(0, 15, 1)
};
@@ -2036,7 +2036,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 1),
/* 0000 ... */
- /* 0000 */ PTR(68, 3), /* 16 */
+ /* 0000 */ PTR(68, 3), /* 16 */
/* 0001 */ PTR(76, 3),
/* 0010 */ PTR(84, 2),
/* 0011 */ V(15, 15, 4),
@@ -2054,7 +2054,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(176, 4),
/* 0001 ... */
- /* 0000 */ PTR(192, 4), /* 32 */
+ /* 0000 */ PTR(192, 4), /* 32 */
/* 0001 */ PTR(208, 3),
/* 0010 */ PTR(216, 3),
/* 0011 */ PTR(224, 3),
@@ -2072,7 +2072,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(284, 1),
/* 0010 ... */
- /* 0000 */ PTR(286, 1), /* 48 */
+ /* 0000 */ PTR(286, 1), /* 48 */
/* 0001 */ PTR(288, 1),
/* 0010 */ PTR(290, 1),
/* 0011 */ V(1, 4, 4),
@@ -2090,13 +2090,13 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(2, 2, 3),
/* 0011 ... */
- /* 00 */ V(1, 2, 2), /* 64 */
+ /* 00 */ V(1, 2, 2), /* 64 */
/* 01 */ V(2, 1, 2),
/* 10 */ V(0, 2, 2),
/* 11 */ V(2, 0, 2),
/* 0000 0000 ... */
- /* 000 */ V(14, 15, 3), /* 68 */
+ /* 000 */ V(14, 15, 3), /* 68 */
/* 001 */ V(15, 14, 3),
/* 010 */ V(13, 15, 3),
/* 011 */ V(15, 13, 3),
@@ -2106,7 +2106,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(15, 11, 3),
/* 0000 0001 ... */
- /* 000 */ V(10, 15, 2), /* 76 */
+ /* 000 */ V(10, 15, 2), /* 76 */
/* 001 */ V(10, 15, 2),
/* 010 */ V(15, 10, 3),
/* 011 */ V(9, 15, 3),
@@ -2116,23 +2116,23 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(8, 15, 2),
/* 0000 0010 ... */
- /* 00 */ V(7, 15, 2), /* 84 */
+ /* 00 */ V(7, 15, 2), /* 84 */
/* 01 */ V(15, 7, 2),
/* 10 */ V(6, 15, 2),
/* 11 */ V(15, 6, 2),
/* 0000 0100 ... */
- /* 00 */ V(5, 15, 2), /* 88 */
+ /* 00 */ V(5, 15, 2), /* 88 */
/* 01 */ V(15, 5, 2),
/* 10 */ V(4, 15, 1),
/* 11 */ V(4, 15, 1),
/* 0000 0101 ... */
- /* 0 */ V(15, 4, 1), /* 92 */
+ /* 0 */ V(15, 4, 1), /* 92 */
/* 1 */ V(15, 3, 1),
/* 0000 0110 ... */
- /* 0000 */ V(15, 0, 1), /* 94 */
+ /* 0000 */ V(15, 0, 1), /* 94 */
/* 0001 */ V(15, 0, 1),
/* 0010 */ V(15, 0, 1),
/* 0011 */ V(15, 0, 1),
@@ -2150,11 +2150,11 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(326, 3),
/* 0000 1000 ... */
- /* 0 */ V(2, 15, 1), /* 110 */
+ /* 0 */ V(2, 15, 1), /* 110 */
/* 1 */ V(0, 15, 1),
/* 0000 1011 ... */
- /* 0000 */ PTR(334, 2), /* 112 */
+ /* 0000 */ PTR(334, 2), /* 112 */
/* 0001 */ PTR(338, 2),
/* 0010 */ PTR(342, 2),
/* 0011 */ PTR(346, 1),
@@ -2172,7 +2172,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(380, 1),
/* 0000 1100 ... */
- /* 0000 */ PTR(382, 1), /* 128 */
+ /* 0000 */ PTR(382, 1), /* 128 */
/* 0001 */ PTR(384, 1),
/* 0010 */ PTR(386, 1),
/* 0011 */ V(0, 13, 4),
@@ -2190,7 +2190,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 14, 4),
/* 0000 1101 ... */
- /* 0000 */ V(13, 3, 4), /* 144 */
+ /* 0000 */ V(13, 3, 4), /* 144 */
/* 0001 */ V(2, 13, 4),
/* 0010 */ V(13, 2, 4),
/* 0011 */ V(13, 1, 4),
@@ -2208,7 +2208,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(11, 5, 4),
/* 0000 1110 ... */
- /* 0000 */ V(12, 1, 4), /* 160 */
+ /* 0000 */ V(12, 1, 4), /* 160 */
/* 0001 */ V(0, 12, 4),
/* 0010 */ V(4, 11, 4),
/* 0011 */ V(11, 4, 4),
@@ -2226,7 +2226,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 11, 3),
/* 0000 1111 ... */
- /* 0000 */ V(11, 1, 3), /* 176 */
+ /* 0000 */ V(11, 1, 3), /* 176 */
/* 0001 */ V(11, 1, 3),
/* 0010 */ V(0, 11, 4),
/* 0011 */ V(11, 0, 4),
@@ -2244,7 +2244,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(2, 10, 3),
/* 0001 0000 ... */
- /* 0000 */ V(9, 5, 4), /* 192 */
+ /* 0000 */ V(9, 5, 4), /* 192 */
/* 0001 */ V(6, 8, 4),
/* 0010 */ V(10, 1, 3),
/* 0011 */ V(10, 1, 3),
@@ -2262,7 +2262,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(10, 2, 2),
/* 0001 0001 ... */
- /* 000 */ V(1, 10, 2), /* 208 */
+ /* 000 */ V(1, 10, 2), /* 208 */
/* 001 */ V(1, 10, 2),
/* 010 */ V(0, 10, 3),
/* 011 */ V(10, 0, 3),
@@ -2272,7 +2272,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(8, 5, 3),
/* 0001 0010 ... */
- /* 000 */ V(2, 9, 2), /* 216 */
+ /* 000 */ V(2, 9, 2), /* 216 */
/* 001 */ V(2, 9, 2),
/* 010 */ V(9, 2, 2),
/* 011 */ V(9, 2, 2),
@@ -2282,7 +2282,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 9, 2),
/* 0001 0011 ... */
- /* 000 */ V(9, 1, 2), /* 224 */
+ /* 000 */ V(9, 1, 2), /* 224 */
/* 001 */ V(9, 1, 2),
/* 010 */ V(9, 0, 3),
/* 011 */ V(4, 8, 3),
@@ -2292,7 +2292,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(8, 3, 3),
/* 0001 0100 ... */
- /* 000 */ V(6, 6, 3), /* 232 */
+ /* 000 */ V(6, 6, 3), /* 232 */
/* 001 */ V(2, 8, 3),
/* 010 */ V(8, 2, 2),
/* 011 */ V(8, 2, 2),
@@ -2302,7 +2302,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 8, 2),
/* 0001 0101 ... */
- /* 000 */ V(8, 1, 2), /* 240 */
+ /* 000 */ V(8, 1, 2), /* 240 */
/* 001 */ V(8, 1, 2),
/* 010 */ V(8, 0, 2),
/* 011 */ V(8, 0, 2),
@@ -2312,7 +2312,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(3, 7, 2),
/* 0001 0110 ... */
- /* 000 */ V(7, 3, 2), /* 248 */
+ /* 000 */ V(7, 3, 2), /* 248 */
/* 001 */ V(7, 3, 2),
/* 010 */ V(6, 5, 3),
/* 011 */ V(4, 6, 3),
@@ -2322,7 +2322,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(7, 2, 2),
/* 0001 0111 ... */
- /* 000 */ V(6, 4, 3), /* 256 */
+ /* 000 */ V(6, 4, 3), /* 256 */
/* 001 */ V(5, 5, 3),
/* 010 */ V(0, 7, 2),
/* 011 */ V(0, 7, 2),
@@ -2332,59 +2332,59 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 7, 1),
/* 0001 1000 ... */
- /* 00 */ V(7, 1, 1), /* 264 */
+ /* 00 */ V(7, 1, 1), /* 264 */
/* 01 */ V(7, 1, 1),
/* 10 */ V(7, 0, 2),
/* 11 */ V(3, 6, 2),
/* 0001 1001 ... */
- /* 00 */ V(6, 3, 2), /* 268 */
+ /* 00 */ V(6, 3, 2), /* 268 */
/* 01 */ V(4, 5, 2),
/* 10 */ V(5, 4, 2),
/* 11 */ V(2, 6, 2),
/* 0001 1010 ... */
- /* 0 */ V(6, 2, 1), /* 272 */
+ /* 0 */ V(6, 2, 1), /* 272 */
/* 1 */ V(1, 6, 1),
/* 0001 1011 ... */
- /* 00 */ V(6, 1, 1), /* 274 */
+ /* 00 */ V(6, 1, 1), /* 274 */
/* 01 */ V(6, 1, 1),
/* 10 */ V(0, 6, 2),
/* 11 */ V(6, 0, 2),
/* 0001 1100 ... */
- /* 00 */ V(5, 3, 1), /* 278 */
+ /* 00 */ V(5, 3, 1), /* 278 */
/* 01 */ V(5, 3, 1),
/* 10 */ V(3, 5, 2),
/* 11 */ V(4, 4, 2),
/* 0001 1101 ... */
- /* 0 */ V(2, 5, 1), /* 282 */
+ /* 0 */ V(2, 5, 1), /* 282 */
/* 1 */ V(5, 2, 1),
/* 0001 1111 ... */
- /* 0 */ V(1, 5, 1), /* 284 */
+ /* 0 */ V(1, 5, 1), /* 284 */
/* 1 */ V(0, 5, 1),
/* 0010 0000 ... */
- /* 0 */ V(3, 4, 1), /* 286 */
+ /* 0 */ V(3, 4, 1), /* 286 */
/* 1 */ V(4, 3, 1),
/* 0010 0001 ... */
- /* 0 */ V(5, 0, 1), /* 288 */
+ /* 0 */ V(5, 0, 1), /* 288 */
/* 1 */ V(2, 4, 1),
/* 0010 0010 ... */
- /* 0 */ V(4, 2, 1), /* 290 */
+ /* 0 */ V(4, 2, 1), /* 290 */
/* 1 */ V(3, 3, 1),
/* 0010 0101 ... */
- /* 0 */ V(0, 4, 1), /* 292 */
+ /* 0 */ V(0, 4, 1), /* 292 */
/* 1 */ V(4, 0, 1),
/* 0000 0110 1100 ... */
- /* 0000 */ V(12, 14, 4), /* 294 */
+ /* 0000 */ V(12, 14, 4), /* 294 */
/* 0001 */ PTR(400, 1),
/* 0010 */ V(13, 14, 3),
/* 0011 */ V(13, 14, 3),
@@ -2402,7 +2402,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(14, 11, 3),
/* 0000 0110 1101 ... */
- /* 000 */ V(11, 14, 2), /* 310 */
+ /* 000 */ V(11, 14, 2), /* 310 */
/* 001 */ V(11, 14, 2),
/* 010 */ V(12, 13, 2),
/* 011 */ V(12, 13, 2),
@@ -2412,7 +2412,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(10, 14, 2),
/* 0000 0110 1110 ... */
- /* 000 */ V(12, 12, 2), /* 318 */
+ /* 000 */ V(12, 12, 2), /* 318 */
/* 001 */ V(12, 12, 2),
/* 010 */ V(10, 13, 3),
/* 011 */ V(13, 10, 3),
@@ -2422,7 +2422,7 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(12, 10, 2),
/* 0000 0110 1111 ... */
- /* 000 */ V(12, 9, 3), /* 326 */
+ /* 000 */ V(12, 9, 3), /* 326 */
/* 001 */ V(7, 13, 3),
/* 010 */ V(5, 14, 2),
/* 011 */ V(5, 14, 2),
@@ -2432,121 +2432,121 @@ union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(11, 13, 1),
/* 0000 1011 0000 ... */
- /* 00 */ V(9, 14, 1), /* 334 */
+ /* 00 */ V(9, 14, 1), /* 334 */
/* 01 */ V(9, 14, 1),
/* 10 */ V(11, 12, 2),
/* 11 */ V(12, 11, 2),
/* 0000 1011 0001 ... */
- /* 00 */ V(8, 14, 2), /* 338 */
+ /* 00 */ V(8, 14, 2), /* 338 */
/* 01 */ V(14, 8, 2),
/* 10 */ V(9, 13, 2),
/* 11 */ V(14, 7, 2),
/* 0000 1011 0010 ... */
- /* 00 */ V(11, 11, 2), /* 342 */
+ /* 00 */ V(11, 11, 2), /* 342 */
/* 01 */ V(8, 13, 2),
/* 10 */ V(13, 8, 2),
/* 11 */ V(6, 14, 2),
/* 0000 1011 0011 ... */
- /* 0 */ V(14, 6, 1), /* 346 */
+ /* 0 */ V(14, 6, 1), /* 346 */
/* 1 */ V(9, 12, 1),
/* 0000 1011 0100 ... */
- /* 00 */ V(10, 11, 2), /* 348 */
+ /* 00 */ V(10, 11, 2), /* 348 */
/* 01 */ V(11, 10, 2),
/* 10 */ V(14, 5, 2),
/* 11 */ V(13, 7, 2),
/* 0000 1011 0101 ... */
- /* 00 */ V(4, 14, 1), /* 352 */
+ /* 00 */ V(4, 14, 1), /* 352 */
/* 01 */ V(4, 14, 1),
/* 10 */ V(14, 4, 2),
/* 11 */ V(8, 12, 2),
/* 0000 1011 0110 ... */
- /* 0 */ V(12, 8, 1), /* 356 */
+ /* 0 */ V(12, 8, 1), /* 356 */
/* 1 */ V(3, 14, 1),
/* 0000 1011 0111 ... */
- /* 00 */ V(6, 13, 1), /* 358 */
+ /* 00 */ V(6, 13, 1), /* 358 */
/* 01 */ V(6, 13, 1),
/* 10 */ V(13, 6, 2),
/* 11 */ V(9, 11, 2),
/* 0000 1011 1000 ... */
- /* 00 */ V(11, 9, 2), /* 362 */
+ /* 00 */ V(11, 9, 2), /* 362 */
/* 01 */ V(10, 10, 2),
/* 10 */ V(14, 1, 1),
/* 11 */ V(14, 1, 1),
/* 0000 1011 1001 ... */
- /* 00 */ V(13, 4, 1), /* 366 */
+ /* 00 */ V(13, 4, 1), /* 366 */
/* 01 */ V(13, 4, 1),
/* 10 */ V(11, 8, 2),
/* 11 */ V(10, 9, 2),
/* 0000 1011 1010 ... */
- /* 00 */ V(7, 11, 1), /* 370 */
+ /* 00 */ V(7, 11, 1), /* 370 */
/* 01 */ V(7, 11, 1),
/* 10 */ V(11, 7, 2),
/* 11 */ V(13, 0, 2),
/* 0000 1011 1100 ... */
- /* 0 */ V(0, 14, 1), /* 374 */
+ /* 0 */ V(0, 14, 1), /* 374 */
/* 1 */ V(14, 0, 1),
/* 0000 1011 1101 ... */
- /* 0 */ V(5, 13, 1), /* 376 */
+ /* 0 */ V(5, 13, 1), /* 376 */
/* 1 */ V(13, 5, 1),
/* 0000 1011 1110 ... */
- /* 0 */ V(7, 12, 1), /* 378 */
+ /* 0 */ V(7, 12, 1), /* 378 */
/* 1 */ V(12, 7, 1),
/* 0000 1011 1111 ... */
- /* 0 */ V(4, 13, 1), /* 380 */
+ /* 0 */ V(4, 13, 1), /* 380 */
/* 1 */ V(8, 11, 1),
/* 0000 1100 0000 ... */
- /* 0 */ V(9, 10, 1), /* 382 */
+ /* 0 */ V(9, 10, 1), /* 382 */
/* 1 */ V(6, 12, 1),
/* 0000 1100 0001 ... */
- /* 0 */ V(12, 6, 1), /* 384 */
+ /* 0 */ V(12, 6, 1), /* 384 */
/* 1 */ V(3, 13, 1),
/* 0000 1100 0010 ... */
- /* 0 */ V(5, 12, 1), /* 386 */
+ /* 0 */ V(5, 12, 1), /* 386 */
/* 1 */ V(12, 5, 1),
/* 0000 1100 0100 ... */
- /* 0 */ V(8, 10, 1), /* 388 */
+ /* 0 */ V(8, 10, 1), /* 388 */
/* 1 */ V(10, 8, 1),
/* 0000 1100 0101 ... */
- /* 0 */ V(9, 9, 1), /* 390 */
+ /* 0 */ V(9, 9, 1), /* 390 */
/* 1 */ V(4, 12, 1),
/* 0000 1100 0110 ... */
- /* 0 */ V(11, 6, 1), /* 392 */
+ /* 0 */ V(11, 6, 1), /* 392 */
/* 1 */ V(7, 10, 1),
/* 0000 1100 1000 ... */
- /* 0 */ V(5, 11, 1), /* 394 */
+ /* 0 */ V(5, 11, 1), /* 394 */
/* 1 */ V(8, 9, 1),
/* 0000 1100 1011 ... */
- /* 0 */ V(9, 8, 1), /* 396 */
+ /* 0 */ V(9, 8, 1), /* 396 */
/* 1 */ V(7, 9, 1),
/* 0000 1101 0101 ... */
- /* 0 */ V(9, 7, 1), /* 398 */
+ /* 0 */ V(9, 7, 1), /* 398 */
/* 1 */ V(8, 8, 1),
/* 0000 0110 1100 0001 ... */
- /* 0 */ V(14, 12, 1), /* 400 */
+ /* 0 */ V(14, 12, 1), /* 400 */
/* 1 */ V(13, 13, 1)
};
@@ -2570,7 +2570,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(0, 0, 4),
/* 0000 ... */
- /* 0000 */ V(14, 15, 4), /* 16 */
+ /* 0000 */ V(14, 15, 4), /* 16 */
/* 0001 */ V(15, 14, 4),
/* 0010 */ V(13, 15, 4),
/* 0011 */ V(15, 13, 4),
@@ -2588,7 +2588,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(15, 8, 3),
/* 0001 ... */
- /* 0000 */ V(8, 15, 4), /* 32 */
+ /* 0000 */ V(8, 15, 4), /* 32 */
/* 0001 */ V(7, 15, 4),
/* 0010 */ V(15, 7, 3),
/* 0011 */ V(15, 7, 3),
@@ -2606,7 +2606,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(15, 4, 3),
/* 0010 ... */
- /* 0000 */ V(3, 15, 3), /* 48 */
+ /* 0000 */ V(3, 15, 3), /* 48 */
/* 0001 */ V(3, 15, 3),
/* 0010 */ V(15, 3, 3),
/* 0011 */ V(15, 3, 3),
@@ -2624,7 +2624,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(196, 3),
/* 0100 ... */
- /* 0000 */ PTR(204, 4), /* 64 */
+ /* 0000 */ PTR(204, 4), /* 64 */
/* 0001 */ PTR(220, 3),
/* 0010 */ PTR(228, 3),
/* 0011 */ PTR(236, 3),
@@ -2642,7 +2642,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(292, 2),
/* 0101 ... */
- /* 0000 */ PTR(296, 2), /* 80 */
+ /* 0000 */ PTR(296, 2), /* 80 */
/* 0001 */ PTR(300, 3),
/* 0010 */ PTR(308, 2),
/* 0011 */ PTR(312, 3),
@@ -2660,7 +2660,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ PTR(348, 1),
/* 0110 ... */
- /* 0000 */ PTR(350, 1), /* 96 */
+ /* 0000 */ PTR(350, 1), /* 96 */
/* 0001 */ PTR(352, 1),
/* 0010 */ PTR(354, 1),
/* 0011 */ PTR(356, 1),
@@ -2678,7 +2678,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(7, 2, 4),
/* 0111 ... */
- /* 0000 */ V(4, 6, 4), /* 112 */
+ /* 0000 */ V(4, 6, 4), /* 112 */
/* 0001 */ V(6, 4, 4),
/* 0010 */ V(5, 5, 4),
/* 0011 */ V(7, 1, 4),
@@ -2696,7 +2696,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(4, 4, 4),
/* 1000 ... */
- /* 0000 */ V(2, 5, 4), /* 128 */
+ /* 0000 */ V(2, 5, 4), /* 128 */
/* 0001 */ V(5, 2, 4),
/* 0010 */ V(1, 5, 4),
/* 0011 */ PTR(384, 1),
@@ -2714,7 +2714,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(1, 4, 3),
/* 1001 ... */
- /* 0000 */ V(4, 1, 3), /* 144 */
+ /* 0000 */ V(4, 1, 3), /* 144 */
/* 0001 */ V(4, 1, 3),
/* 0010 */ V(0, 4, 4),
/* 0011 */ V(4, 0, 4),
@@ -2732,7 +2732,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(3, 1, 2),
/* 1010 ... */
- /* 000 */ V(0, 3, 3), /* 160 */
+ /* 000 */ V(0, 3, 3), /* 160 */
/* 001 */ V(3, 0, 3),
/* 010 */ V(2, 2, 2),
/* 011 */ V(2, 2, 2),
@@ -2742,13 +2742,13 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 2, 1),
/* 1011 ... */
- /* 00 */ V(2, 1, 1), /* 168 */
+ /* 00 */ V(2, 1, 1), /* 168 */
/* 01 */ V(2, 1, 1),
/* 10 */ V(0, 2, 2),
/* 11 */ V(2, 0, 2),
/* 0010 1100 ... */
- /* 000 */ V(0, 15, 1), /* 172 */
+ /* 000 */ V(0, 15, 1), /* 172 */
/* 001 */ V(0, 15, 1),
/* 010 */ V(0, 15, 1),
/* 011 */ V(0, 15, 1),
@@ -2758,7 +2758,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(12, 14, 3),
/* 0010 1101 ... */
- /* 000 */ V(14, 12, 3), /* 180 */
+ /* 000 */ V(14, 12, 3), /* 180 */
/* 001 */ V(13, 13, 3),
/* 010 */ V(11, 14, 3),
/* 011 */ V(14, 11, 3),
@@ -2768,7 +2768,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(14, 10, 3),
/* 0010 1110 ... */
- /* 000 */ V(11, 13, 3), /* 188 */
+ /* 000 */ V(11, 13, 3), /* 188 */
/* 001 */ V(13, 11, 3),
/* 010 */ V(12, 12, 3),
/* 011 */ V(9, 14, 3),
@@ -2778,7 +2778,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(11, 12, 3),
/* 0010 1111 ... */
- /* 000 */ V(12, 11, 3), /* 196 */
+ /* 000 */ V(12, 11, 3), /* 196 */
/* 001 */ V(8, 14, 3),
/* 010 */ V(14, 8, 3),
/* 011 */ V(9, 13, 3),
@@ -2788,7 +2788,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(10, 12, 3),
/* 0100 0000 ... */
- /* 0000 */ V(12, 10, 3), /* 204 */
+ /* 0000 */ V(12, 10, 3), /* 204 */
/* 0001 */ V(12, 10, 3),
/* 0010 */ V(11, 11, 3),
/* 0011 */ V(11, 11, 3),
@@ -2806,7 +2806,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 1111 */ V(14, 6, 2),
/* 0100 0001 ... */
- /* 000 */ V(6, 14, 3), /* 220 */
+ /* 000 */ V(6, 14, 3), /* 220 */
/* 001 */ V(9, 12, 3),
/* 010 */ V(12, 9, 2),
/* 011 */ V(12, 9, 2),
@@ -2816,7 +2816,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(11, 10, 2),
/* 0100 0010 ... */
- /* 000 */ V(14, 5, 2), /* 228 */
+ /* 000 */ V(14, 5, 2), /* 228 */
/* 001 */ V(14, 5, 2),
/* 010 */ V(10, 11, 3),
/* 011 */ V(7, 13, 3),
@@ -2826,7 +2826,7 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(14, 4, 2),
/* 0100 0011 ... */
- /* 000 */ V(8, 12, 2), /* 236 */
+ /* 000 */ V(8, 12, 2), /* 236 */
/* 001 */ V(8, 12, 2),
/* 010 */ V(12, 8, 2),
/* 011 */ V(12, 8, 2),
@@ -2836,61 +2836,61 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(3, 14, 2),
/* 0100 0100 ... */
- /* 00 */ V(6, 13, 2), /* 244 */
+ /* 00 */ V(6, 13, 2), /* 244 */
/* 01 */ V(13, 6, 2),
/* 10 */ V(14, 3, 2),
/* 11 */ V(9, 11, 2),
/* 0100 0101 ... */
- /* 00 */ V(11, 9, 2), /* 248 */
+ /* 00 */ V(11, 9, 2), /* 248 */
/* 01 */ V(10, 10, 2),
/* 10 */ V(14, 2, 2),
/* 11 */ V(1, 14, 2),
/* 0100 0110 ... */
- /* 00 */ V(14, 1, 2), /* 252 */
+ /* 00 */ V(14, 1, 2), /* 252 */
/* 01 */ V(5, 13, 2),
/* 10 */ V(13, 5, 2),
/* 11 */ V(7, 12, 2),
/* 0100 0111 ... */
- /* 00 */ V(12, 7, 2), /* 256 */
+ /* 00 */ V(12, 7, 2), /* 256 */
/* 01 */ V(4, 13, 2),
/* 10 */ V(8, 11, 2),
/* 11 */ V(11, 8, 2),
/* 0100 1000 ... */
- /* 00 */ V(13, 4, 2), /* 260 */
+ /* 00 */ V(13, 4, 2), /* 260 */
/* 01 */ V(9, 10, 2),
/* 10 */ V(10, 9, 2),
/* 11 */ V(6, 12, 2),
/* 0100 1001 ... */
- /* 00 */ V(12, 6, 2), /* 264 */
+ /* 00 */ V(12, 6, 2), /* 264 */
/* 01 */ V(3, 13, 2),
/* 10 */ V(13, 3, 2),
/* 11 */ V(2, 13, 2),
/* 0100 1010 ... */
- /* 00 */ V(13, 2, 2), /* 268 */
+ /* 00 */ V(13, 2, 2), /* 268 */
/* 01 */ V(1, 13, 2),
/* 10 */ V(7, 11, 2),
/* 11 */ V(11, 7, 2),
/* 0100 1011 ... */
- /* 00 */ V(13, 1, 2), /* 272 */
+ /* 00 */ V(13, 1, 2), /* 272 */
/* 01 */ V(5, 12, 2),
/* 10 */ V(12, 5, 2),
/* 11 */ V(8, 10, 2),
/* 0100 1100 ... */
- /* 00 */ V(10, 8, 2), /* 276 */
+ /* 00 */ V(10, 8, 2), /* 276 */
/* 01 */ V(9, 9, 2),
/* 10 */ V(4, 12, 2),
/* 11 */ V(12, 4, 2),
/* 0100 1101 ... */
- /* 000 */ V(6, 11, 2), /* 280 */
+ /* 000 */ V(6, 11, 2), /* 280 */
/* 001 */ V(6, 11, 2),
/* 010 */ V(11, 6, 2),
/* 011 */ V(11, 6, 2),
@@ -2900,25 +2900,25 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(3, 12, 2),
/* 0100 1110 ... */
- /* 00 */ V(12, 3, 2), /* 288 */
+ /* 00 */ V(12, 3, 2), /* 288 */
/* 01 */ V(7, 10, 2),
/* 10 */ V(10, 7, 2),
/* 11 */ V(2, 12, 2),
/* 0100 1111 ... */
- /* 00 */ V(12, 2, 2), /* 292 */
+ /* 00 */ V(12, 2, 2), /* 292 */
/* 01 */ V(5, 11, 2),
/* 10 */ V(11, 5, 2),
/* 11 */ V(1, 12, 2),
/* 0101 0000 ... */
- /* 00 */ V(8, 9, 2), /* 296 */
+ /* 00 */ V(8, 9, 2), /* 296 */
/* 01 */ V(9, 8, 2),
/* 10 */ V(12, 1, 2),
/* 11 */ V(4, 11, 2),
/* 0101 0001 ... */
- /* 000 */ V(12, 0, 3), /* 300 */
+ /* 000 */ V(12, 0, 3), /* 300 */
/* 001 */ V(0, 11, 3),
/* 010 */ V(3, 11, 2),
/* 011 */ V(3, 11, 2),
@@ -2928,13 +2928,13 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(1, 10, 2),
/* 0101 0010 ... */
- /* 00 */ V(11, 4, 1), /* 308 */
+ /* 00 */ V(11, 4, 1), /* 308 */
/* 01 */ V(11, 4, 1),
/* 10 */ V(6, 10, 2),
/* 11 */ V(10, 6, 2),
/* 0101 0011 ... */
- /* 000 */ V(7, 9, 2), /* 312 */
+ /* 000 */ V(7, 9, 2), /* 312 */
/* 001 */ V(7, 9, 2),
/* 010 */ V(9, 7, 2),
/* 011 */ V(9, 7, 2),
@@ -2944,125 +2944,125 @@ union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
/* 111 */ V(9, 0, 2),
/* 0101 0100 ... */
- /* 0 */ V(11, 3, 1), /* 320 */
+ /* 0 */ V(11, 3, 1), /* 320 */
/* 1 */ V(8, 8, 1),
/* 0101 0101 ... */
- /* 00 */ V(2, 11, 2), /* 322 */
+ /* 00 */ V(2, 11, 2), /* 322 */
/* 01 */ V(5, 10, 2),
/* 10 */ V(11, 2, 1),
/* 11 */ V(11, 2, 1),
/* 0101 0110 ... */
- /* 00 */ V(10, 5, 2), /* 326 */
+ /* 00 */ V(10, 5, 2), /* 326 */
/* 01 */ V(1, 11, 2),
/* 10 */ V(11, 1, 2),
/* 11 */ V(6, 9, 2),
/* 0101 0111 ... */
- /* 0 */ V(9, 6, 1), /* 330 */
+ /* 0 */ V(9, 6, 1), /* 330 */
/* 1 */ V(10, 4, 1),
/* 0101 1000 ... */
- /* 00 */ V(4, 10, 2), /* 332 */
+ /* 00 */ V(4, 10, 2), /* 332 */
/* 01 */ V(7, 8, 2),
/* 10 */ V(8, 7, 1),
/* 11 */ V(8, 7, 1),
/* 0101 1001 ... */
- /* 0 */ V(3, 10, 1), /* 336 */
+ /* 0 */ V(3, 10, 1), /* 336 */
/* 1 */ V(10, 3, 1),
/* 0101 1010 ... */
- /* 0 */ V(5, 9, 1), /* 338 */
+ /* 0 */ V(5, 9, 1), /* 338 */
/* 1 */ V(9, 5, 1),
/* 0101 1011 ... */
- /* 0 */ V(2, 10, 1), /* 340 */
+ /* 0 */ V(2, 10, 1), /* 340 */
/* 1 */ V(10, 2, 1),
/* 0101 1100 ... */
- /* 0 */ V(10, 1, 1), /* 342 */
+ /* 0 */ V(10, 1, 1), /* 342 */
/* 1 */ V(6, 8, 1),
/* 0101 1101 ... */
- /* 0 */ V(8, 6, 1), /* 344 */
+ /* 0 */ V(8, 6, 1), /* 344 */
/* 1 */ V(7, 7, 1),
/* 0101 1110 ... */
- /* 0 */ V(4, 9, 1), /* 346 */
+ /* 0 */ V(4, 9, 1), /* 346 */
/* 1 */ V(9, 4, 1),
/* 0101 1111 ... */
- /* 0 */ V(3, 9, 1), /* 348 */
+ /* 0 */ V(3, 9, 1), /* 348 */
/* 1 */ V(9, 3, 1),
/* 0110 0000 ... */
- /* 0 */ V(5, 8, 1), /* 350 */
+ /* 0 */ V(5, 8, 1), /* 350 */
/* 1 */ V(8, 5, 1),
/* 0110 0001 ... */
- /* 0 */ V(2, 9, 1), /* 352 */
+ /* 0 */ V(2, 9, 1), /* 352 */
/* 1 */ V(6, 7, 1),
/* 0110 0010 ... */
- /* 0 */ V(7, 6, 1), /* 354 */
+ /* 0 */ V(7, 6, 1), /* 354 */
/* 1 */ V(9, 2, 1),
/* 0110 0011 ... */
- /* 0 */ V(1, 9, 1), /* 356 */
+ /* 0 */ V(1, 9, 1), /* 356 */
/* 1 */ V(9, 1, 1),
/* 0110 0100 ... */
- /* 0 */ V(4, 8, 1), /* 358 */
+ /* 0 */ V(4, 8, 1), /* 358 */
/* 1 */ V(8, 4, 1),
/* 0110 0101 ... */
- /* 0 */ V(5, 7, 1), /* 360 */
+ /* 0 */ V(5, 7, 1), /* 360 */
/* 1 */ V(7, 5, 1),
/* 0110 0110 ... */
- /* 0 */ V(3, 8, 1), /* 362 */
+ /* 0 */ V(3, 8, 1), /* 362 */
/* 1 */ V(8, 3, 1),
/* 0110 0111 ... */
- /* 0 */ V(6, 6, 1), /* 364 */
+ /* 0 */ V(6, 6, 1), /* 364 */
/* 1 */ V(2, 8, 1),
/* 0110 1000 ... */
- /* 0 */ V(8, 2, 1), /* 366 */
+ /* 0 */ V(8, 2, 1), /* 366 */
/* 1 */ V(1, 8, 1),
/* 0110 1001 ... */
- /* 0 */ V(4, 7, 1), /* 368 */
+ /* 0 */ V(4, 7, 1), /* 368 */
/* 1 */ V(7, 4, 1),
/* 0110 1010 ... */
- /* 00 */ V(8, 1, 1), /* 370 */
+ /* 00 */ V(8, 1, 1), /* 370 */
/* 01 */ V(8, 1, 1),
/* 10 */ V(0, 8, 2),
/* 11 */ V(8, 0, 2),
/* 0110 1011 ... */
- /* 0 */ V(5, 6, 1), /* 374 */
+ /* 0 */ V(5, 6, 1), /* 374 */
/* 1 */ V(6, 5, 1),
/* 0110 1100 ... */
- /* 00 */ V(1, 7, 1), /* 376 */
+ /* 00 */ V(1, 7, 1), /* 376 */
/* 01 */ V(1, 7, 1),
/* 10 */ V(0, 7, 2),
/* 11 */ V(7, 0, 2),
/* 0110 1110 ... */
- /* 0 */ V(3, 7, 1), /* 380 */
+ /* 0 */ V(3, 7, 1), /* 380 */
/* 1 */ V(2, 7, 1),
/* 0111 1100 ... */
- /* 0 */ V(0, 6, 1), /* 382 */
+ /* 0 */ V(0, 6, 1), /* 382 */
/* 1 */ V(6, 0, 1),
/* 1000 0011 ... */
- /* 0 */ V(0, 5, 1), /* 384 */
+ /* 0 */ V(0, 5, 1), /* 384 */
/* 1 */ V(5, 0, 1)
};
diff --git a/apps/codecs/libmad/layer12.c b/apps/codecs/libmad/layer12.c
index d294266..e00bb64 100644
--- a/apps/codecs/libmad/layer12.c
+++ b/apps/codecs/libmad/layer12.c
@@ -69,7 +69,7 @@ mad_fixed_t const linear_table[14] ICONST_ATTR = {
};
/*
- * NAME: I_sample()
+ * NAME: I_sample()
* DESCRIPTION: decode one requantized Layer I sample from a bitstream
*/
static inline
@@ -99,7 +99,7 @@ mad_fixed_t I_sample(struct mad_bitptr *ptr, unsigned int nb)
}
/*
- * NAME: layer->I()
+ * NAME: layer->I()
* DESCRIPTION: decode a single Layer I frame
*/
int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame)
@@ -121,10 +121,10 @@ int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame)
if (header->flags & MAD_FLAG_PROTECTION) {
header->crc_check =
mad_bit_crc(stream->ptr, 4 * (bound * nch + (32 - bound)),
- header->crc_check);
+ header->crc_check);
if (header->crc_check != header->crc_target &&
- !(frame->options & MAD_OPTION_IGNORECRC)) {
+ !(frame->options & MAD_OPTION_IGNORECRC)) {
stream->error = MAD_ERROR_BADCRC;
return -1;
}
@@ -137,8 +137,8 @@ int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame)
nb = mad_bit_read(&stream->ptr, 4);
if (nb == 15) {
- stream->error = MAD_ERROR_BADBITALLOC;
- return -1;
+ stream->error = MAD_ERROR_BADBITALLOC;
+ return -1;
}
allocation[ch][sb] = nb ? nb + 1 : 0;
@@ -162,18 +162,18 @@ int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame)
for (sb = 0; sb < 32; ++sb) {
for (ch = 0; ch < nch; ++ch) {
if (allocation[ch][sb]) {
- scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);
+ scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);
# if defined(OPT_STRICT)
- /*
- * Scalefactor index 63 does not appear in Table B.1 of
- * ISO/IEC 11172-3. Nonetheless, other implementations accept it,
- * so we only reject it if OPT_STRICT is defined.
- */
- if (scalefactor[ch][sb] == 63) {
- stream->error = MAD_ERROR_BADSCALEFACTOR;
- return -1;
- }
+ /*
+ * Scalefactor index 63 does not appear in Table B.1 of
+ * ISO/IEC 11172-3. Nonetheless, other implementations accept it,
+ * so we only reject it if OPT_STRICT is defined.
+ */
+ if (scalefactor[ch][sb] == 63) {
+ stream->error = MAD_ERROR_BADSCALEFACTOR;
+ return -1;
+ }
# endif
}
}
@@ -184,27 +184,27 @@ int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame)
for (s = 0; s < 12; ++s) {
for (sb = 0; sb < bound; ++sb) {
for (ch = 0; ch < nch; ++ch) {
- nb = allocation[ch][sb];
- (*frame->sbsample)[ch][s][sb] = nb ?
- mad_f_mul(I_sample(&stream->ptr, nb),
- sf_table[scalefactor[ch][sb]]) : 0;
+ nb = allocation[ch][sb];
+ (*frame->sbsample)[ch][s][sb] = nb ?
+ mad_f_mul(I_sample(&stream->ptr, nb),
+ sf_table[scalefactor[ch][sb]]) : 0;
}
}
for (sb = bound; sb < 32; ++sb) {
if ((nb = allocation[0][sb])) {
- mad_fixed_t sample;
+ mad_fixed_t sample;
- sample = I_sample(&stream->ptr, nb);
+ sample = I_sample(&stream->ptr, nb);
- for (ch = 0; ch < nch; ++ch) {
- (*frame->sbsample)[ch][s][sb] =
- mad_f_mul(sample, sf_table[scalefactor[ch][sb]]);
- }
+ for (ch = 0; ch < nch; ++ch) {
+ (*frame->sbsample)[ch][s][sb] =
+ mad_f_mul(sample, sf_table[scalefactor[ch][sb]]);
+ }
}
else {
- for (ch = 0; ch < nch; ++ch)
- (*frame->sbsample)[ch][s][sb] = 0;
+ for (ch = 0; ch < nch; ++ch)
+ (*frame->sbsample)[ch][s][sb] = 0;
}
}
}
@@ -221,18 +221,18 @@ struct {
unsigned char const offsets[30];
} const sbquant_table[5] = {
/* ISO/IEC 11172-3 Table B.2a */
- { 27, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, /* 0 */
- 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0 } },
+ { 27, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, /* 0 */
+ 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0 } },
/* ISO/IEC 11172-3 Table B.2b */
- { 30, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, /* 1 */
- 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0 } },
+ { 30, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, /* 1 */
+ 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0 } },
/* ISO/IEC 11172-3 Table B.2c */
- { 8, { 5, 5, 2, 2, 2, 2, 2, 2 } }, /* 2 */
+ { 8, { 5, 5, 2, 2, 2, 2, 2, 2 } }, /* 2 */
/* ISO/IEC 11172-3 Table B.2d */
- { 12, { 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } }, /* 3 */
+ { 12, { 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } }, /* 3 */
/* ISO/IEC 13818-3 Table B.1 */
- { 30, { 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, /* 4 */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }
+ { 30, { 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, /* 4 */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }
};
/* bit allocation table */
@@ -275,13 +275,13 @@ struct quantclass {
};
/*
- * NAME: II_samples()
+ * NAME: II_samples()
* DESCRIPTION: decode three requantized Layer II samples from a bitstream
*/
static
void II_samples(struct mad_bitptr *ptr,
- struct quantclass const *quantclass,
- mad_fixed_t output[3])
+ struct quantclass const *quantclass,
+ mad_fixed_t output[3])
{
unsigned int nb, s, sample[3];
@@ -326,7 +326,7 @@ void II_samples(struct mad_bitptr *ptr,
}
/*
- * NAME: layer->II()
+ * NAME: layer->II()
* DESCRIPTION: decode a single Layer II frame
*/
int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
@@ -358,19 +358,19 @@ int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
* restriction. We enforce it if OPT_STRICT is defined.
*/
if (bitrate_per_channel <= 28000 || bitrate_per_channel == 40000) {
- stream->error = MAD_ERROR_BADMODE;
- return -1;
+ stream->error = MAD_ERROR_BADMODE;
+ return -1;
}
# endif
}
else { /* nch == 1 */
if (bitrate_per_channel > 192000) {
- /*
- * ISO/IEC 11172-3 does not allow single channel mode for 224, 256,
- * 320, or 384 kbps bitrates in Layer II.
- */
- stream->error = MAD_ERROR_BADMODE;
- return -1;
+ /*
+ * ISO/IEC 11172-3 does not allow single channel mode for 224, 256,
+ * 320, or 384 kbps bitrates in Layer II.
+ */
+ stream->error = MAD_ERROR_BADMODE;
+ return -1;
}
}
@@ -419,7 +419,7 @@ int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
for (sb = 0; sb < sblimit; ++sb) {
for (ch = 0; ch < nch; ++ch) {
if (allocation[ch][sb])
- scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);
+ scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);
}
}
@@ -428,10 +428,10 @@ int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
if (header->flags & MAD_FLAG_PROTECTION) {
header->crc_check =
mad_bit_crc(start, mad_bit_length(&start, &stream->ptr),
- header->crc_check);
+ header->crc_check);
if (header->crc_check != header->crc_target &&
- !(frame->options & MAD_OPTION_IGNORECRC)) {
+ !(frame->options & MAD_OPTION_IGNORECRC)) {
stream->error = MAD_ERROR_BADCRC;
return -1;
}
@@ -442,39 +442,39 @@ int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
for (sb = 0; sb < sblimit; ++sb) {
for (ch = 0; ch < nch; ++ch) {
if (allocation[ch][sb]) {
- scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);
-
- switch (scfsi[ch][sb]) {
- case 2:
- scalefactor[ch][sb][2] =
- scalefactor[ch][sb][1] =
- scalefactor[ch][sb][0];
- break;
-
- case 0:
- scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);
- /* fall through */
-
- case 1:
- case 3:
- scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);
- }
+ scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);
- if (scfsi[ch][sb] & 1)
- scalefactor[ch][sb][1] = scalefactor[ch][sb][scfsi[ch][sb] - 1];
+ switch (scfsi[ch][sb]) {
+ case 2:
+ scalefactor[ch][sb][2] =
+ scalefactor[ch][sb][1] =
+ scalefactor[ch][sb][0];
+ break;
+
+ case 0:
+ scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);
+ /* fall through */
+
+ case 1:
+ case 3:
+ scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);
+ }
+
+ if (scfsi[ch][sb] & 1)
+ scalefactor[ch][sb][1] = scalefactor[ch][sb][scfsi[ch][sb] - 1];
# if defined(OPT_STRICT)
- /*
- * Scalefactor index 63 does not appear in Table B.1 of
- * ISO/IEC 11172-3. Nonetheless, other implementations accept it,
- * so we only reject it if OPT_STRICT is defined.
- */
- if (scalefactor[ch][sb][0] == 63 ||
- scalefactor[ch][sb][1] == 63 ||
- scalefactor[ch][sb][2] == 63) {
- stream->error = MAD_ERROR_BADSCALEFACTOR;
- return -1;
- }
+ /*
+ * Scalefactor index 63 does not appear in Table B.1 of
+ * ISO/IEC 11172-3. Nonetheless, other implementations accept it,
+ * so we only reject it if OPT_STRICT is defined.
+ */
+ if (scalefactor[ch][sb][0] == 63 ||
+ scalefactor[ch][sb][1] == 63 ||
+ scalefactor[ch][sb][2] == 63) {
+ stream->error = MAD_ERROR_BADSCALEFACTOR;
+ return -1;
+ }
# endif
}
}
@@ -485,50 +485,50 @@ int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
for (gr = 0; gr < 12; ++gr) {
for (sb = 0; sb < bound; ++sb) {
for (ch = 0; ch < nch; ++ch) {
- if ((index = allocation[ch][sb])) {
+ if ((index = allocation[ch][sb])) {
int off = bitalloc_table[offsets[sb]].offset;
- index = offset_table[off][index - 1];
-
- II_samples(&stream->ptr, &qc_table[index], samples);
-
- for (s = 0; s < 3; ++s) {
- (*frame->sbsample)[ch][3 * gr + s][sb] =
- mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);
- }
- }
- else {
- for (s = 0; s < 3; ++s)
- (*frame->sbsample)[ch][3 * gr + s][sb] = 0;
- }
+ index = offset_table[off][index - 1];
+
+ II_samples(&stream->ptr, &qc_table[index], samples);
+
+ for (s = 0; s < 3; ++s) {
+ (*frame->sbsample)[ch][3 * gr + s][sb] =
+ mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);
+ }
+ }
+ else {
+ for (s = 0; s < 3; ++s)
+ (*frame->sbsample)[ch][3 * gr + s][sb] = 0;
+ }
}
}
for (sb = bound; sb < sblimit; ++sb) {
if ((index = allocation[0][sb])) {
int off = bitalloc_table[offsets[sb]].offset;
- index = offset_table[off][index - 1];
+ index = offset_table[off][index - 1];
- II_samples(&stream->ptr, &qc_table[index], samples);
+ II_samples(&stream->ptr, &qc_table[index], samples);
- for (ch = 0; ch < nch; ++ch) {
- for (s = 0; s < 3; ++s) {
- (*frame->sbsample)[ch][3 * gr + s][sb] =
- mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);
- }
- }
+ for (ch = 0; ch < nch; ++ch) {
+ for (s = 0; s < 3; ++s) {
+ (*frame->sbsample)[ch][3 * gr + s][sb] =
+ mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);
+ }
+ }
}
else {
- for (ch = 0; ch < nch; ++ch) {
- for (s = 0; s < 3; ++s)
- (*frame->sbsample)[ch][3 * gr + s][sb] = 0;
- }
+ for (ch = 0; ch < nch; ++ch) {
+ for (s = 0; s < 3; ++s)
+ (*frame->sbsample)[ch][3 * gr + s][sb] = 0;
+ }
}
}
for (ch = 0; ch < nch; ++ch) {
for (s = 0; s < 3; ++s) {
- for (sb = sblimit; sb < 32; ++sb)
- (*frame->sbsample)[ch][3 * gr + s][sb] = 0;
+ for (sb = sblimit; sb < 32; ++sb)
+ (*frame->sbsample)[ch][3 * gr + s][sb] = 0;
}
}
}
diff --git a/apps/codecs/libmad/layer3.c b/apps/codecs/libmad/layer3.c
index 2dcdeb9..752dbdb 100644
--- a/apps/codecs/libmad/layer3.c
+++ b/apps/codecs/libmad/layer3.c
@@ -57,7 +57,7 @@
enum {
count1table_select = 0x01,
scalefac_scale = 0x02,
- preflag = 0x04,
+ preflag = 0x04,
mixed_block_flag = 0x08
};
@@ -88,7 +88,7 @@ struct sideinfo {
unsigned char region1_count;
/* from main_data */
- unsigned char scalefac[39]; /* scalefac_l and/or scalefac_s */
+ unsigned char scalefac[39]; /* scalefac_l and/or scalefac_s */
} ch[2];
} gr[2];
};
@@ -502,14 +502,14 @@ mad_fixed_t const is_lsf_table[2][15] = {
};
/*
- * NAME: III_sideinfo()
+ * NAME: III_sideinfo()
* DESCRIPTION: decode frame side information from a bitstream
*/
static
enum mad_error III_sideinfo(struct mad_bitptr *ptr, unsigned int nch,
- int lsf, struct sideinfo *si,
- unsigned int *data_bitlen,
- unsigned int *priv_bitlen)
+ int lsf, struct sideinfo *si,
+ unsigned int *data_bitlen,
+ unsigned int *priv_bitlen)
{
unsigned int ngr, gr, ch, i;
enum mad_error result = MAD_ERROR_NONE;
@@ -542,46 +542,46 @@ enum mad_error III_sideinfo(struct mad_bitptr *ptr, unsigned int nch,
*data_bitlen += channel->part2_3_length;
if (channel->big_values > 288 && result == 0)
- result = MAD_ERROR_BADBIGVALUES;
+ result = MAD_ERROR_BADBIGVALUES;
channel->flags = 0;
/* window_switching_flag */
if (mad_bit_read(ptr, 1)) {
- channel->block_type = mad_bit_read(ptr, 2);
+ channel->block_type = mad_bit_read(ptr, 2);
- if (channel->block_type == 0 && result == 0)
- result = MAD_ERROR_BADBLOCKTYPE;
+ if (channel->block_type == 0 && result == 0)
+ result = MAD_ERROR_BADBLOCKTYPE;
- if (!lsf && channel->block_type == 2 && si->scfsi[ch] && result == 0)
- result = MAD_ERROR_BADSCFSI;
+ if (!lsf && channel->block_type == 2 && si->scfsi[ch] && result == 0)
+ result = MAD_ERROR_BADSCFSI;
- channel->region0_count = 7;
- channel->region1_count = 36;
+ channel->region0_count = 7;
+ channel->region1_count = 36;
- if (mad_bit_read(ptr, 1))
- channel->flags |= mixed_block_flag;
- else if (channel->block_type == 2)
- channel->region0_count = 8;
+ if (mad_bit_read(ptr, 1))
+ channel->flags |= mixed_block_flag;
+ else if (channel->block_type == 2)
+ channel->region0_count = 8;
- for (i = 0; i < 2; ++i)
- channel->table_select[i] = mad_bit_read(ptr, 5);
+ for (i = 0; i < 2; ++i)
+ channel->table_select[i] = mad_bit_read(ptr, 5);
# if defined(DEBUG)
- channel->table_select[2] = 4; /* not used */
+ channel->table_select[2] = 4; /* not used */
# endif
- for (i = 0; i < 3; ++i)
- channel->subblock_gain[i] = mad_bit_read(ptr, 3);
+ for (i = 0; i < 3; ++i)
+ channel->subblock_gain[i] = mad_bit_read(ptr, 3);
}
else {
- channel->block_type = 0;
+ channel->block_type = 0;
- for (i = 0; i < 3; ++i)
- channel->table_select[i] = mad_bit_read(ptr, 5);
+ for (i = 0; i < 3; ++i)
+ channel->table_select[i] = mad_bit_read(ptr, 5);
- channel->region0_count = mad_bit_read(ptr, 4);
- channel->region1_count = mad_bit_read(ptr, 3);
+ channel->region0_count = mad_bit_read(ptr, 4);
+ channel->region1_count = mad_bit_read(ptr, 3);
}
/* [preflag,] scalefac_scale, count1table_select */
@@ -593,13 +593,13 @@ enum mad_error III_sideinfo(struct mad_bitptr *ptr, unsigned int nch,
}
/*
- * NAME: III_scalefactors_lsf()
+ * NAME: III_scalefactors_lsf()
* DESCRIPTION: decode channel scalefactors for LSF from a bitstream
*/
static
unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr,
- struct channel *channel,
- struct channel *gr1ch, int mode_extension)
+ struct channel *channel,
+ struct channel *gr1ch, int mode_extension)
{
struct mad_bitptr start;
unsigned int scalefac_compress, index, slen[4], part, n, i;
@@ -646,7 +646,7 @@ unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr,
n = 0;
for (part = 0; part < 4; ++part) {
for (i = 0; i < nsfb[part]; ++i)
- channel->scalefac[n++] = mad_bit_read(ptr, slen[part]);
+ channel->scalefac[n++] = mad_bit_read(ptr, slen[part]);
}
while (n < 39)
@@ -691,10 +691,10 @@ unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr,
max = (1 << slen[part]) - 1;
for (i = 0; i < nsfb[part]; ++i) {
- is_pos = mad_bit_read(ptr, slen[part]);
+ is_pos = mad_bit_read(ptr, slen[part]);
- channel->scalefac[n] = is_pos;
- gr1ch->scalefac[n++] = (is_pos == max);
+ channel->scalefac[n] = is_pos;
+ gr1ch->scalefac[n++] = (is_pos == max);
}
}
@@ -708,12 +708,12 @@ unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr,
}
/*
- * NAME: III_scalefactors()
+ * NAME: III_scalefactors()
* DESCRIPTION: decode channel scalefactors of one granule from a bitstream
*/
static
unsigned int III_scalefactors(struct mad_bitptr *ptr, struct channel *channel,
- struct channel const *gr0ch, unsigned int scfsi)
+ struct channel const *gr0ch, unsigned int scfsi)
{
struct mad_bitptr start;
unsigned int slen1, slen2, sfbi;
@@ -743,38 +743,38 @@ unsigned int III_scalefactors(struct mad_bitptr *ptr, struct channel *channel,
else { /* channel->block_type != 2 */
if (scfsi & 0x8) {
for (sfbi = 0; sfbi < 6; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
+ channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
}
else {
for (sfbi = 0; sfbi < 6; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
+ channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
}
if (scfsi & 0x4) {
for (sfbi = 6; sfbi < 11; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
+ channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
}
else {
for (sfbi = 6; sfbi < 11; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
+ channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
}
if (scfsi & 0x2) {
for (sfbi = 11; sfbi < 16; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
+ channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
}
else {
for (sfbi = 11; sfbi < 16; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
+ channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
}
if (scfsi & 0x1) {
for (sfbi = 16; sfbi < 21; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
+ channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
}
else {
for (sfbi = 16; sfbi < 21; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
+ channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
}
channel->scalefac[21] = 0;
@@ -806,12 +806,12 @@ unsigned int III_scalefactors(struct mad_bitptr *ptr, struct channel *channel,
*/
/*
- * NAME: III_exponents()
+ * NAME: III_exponents()
* DESCRIPTION: calculate scalefactor exponents
*/
static
void III_exponents(struct channel const *channel,
- unsigned char const *sfbwidth, signed int exponents[39])
+ unsigned char const *sfbwidth, signed int exponents[39])
{
signed int gain;
unsigned int scalefac_multiplier, sfbi;
@@ -833,11 +833,11 @@ void III_exponents(struct channel const *channel,
/* long block subbands 0-1 */
while (l < 36) {
- exponents[sfbi] = gain -
- (signed int) ((channel->scalefac[sfbi] + (pretab[sfbi] & premask)) <<
- scalefac_multiplier);
+ exponents[sfbi] = gain -
+ (signed int) ((channel->scalefac[sfbi] + (pretab[sfbi] & premask)) <<
+ scalefac_multiplier);
- l += sfbwidth[sfbi++];
+ l += sfbwidth[sfbi++];
}
}
@@ -849,11 +849,11 @@ void III_exponents(struct channel const *channel,
while (l < 576) {
exponents[sfbi + 0] = gain0 -
- (signed int) (channel->scalefac[sfbi + 0] << scalefac_multiplier);
+ (signed int) (channel->scalefac[sfbi + 0] << scalefac_multiplier);
exponents[sfbi + 1] = gain1 -
- (signed int) (channel->scalefac[sfbi + 1] << scalefac_multiplier);
+ (signed int) (channel->scalefac[sfbi + 1] << scalefac_multiplier);
exponents[sfbi + 2] = gain2 -
- (signed int) (channel->scalefac[sfbi + 2] << scalefac_multiplier);
+ (signed int) (channel->scalefac[sfbi + 2] << scalefac_multiplier);
unsigned int w = sfbwidth[sfbi];
l += 3 * w;
sfbi += 3;
@@ -862,22 +862,22 @@ void III_exponents(struct channel const *channel,
else { /* channel->block_type != 2 */
if (channel->flags & preflag) {
for (sfbi = 0; sfbi < 22; ++sfbi) {
- exponents[sfbi] = gain -
- (signed int) ((channel->scalefac[sfbi] + pretab[sfbi]) <<
- scalefac_multiplier);
+ exponents[sfbi] = gain -
+ (signed int) ((channel->scalefac[sfbi] + pretab[sfbi]) <<
+ scalefac_multiplier);
}
}
else {
for (sfbi = 0; sfbi < 22; ++sfbi) {
- exponents[sfbi] = gain -
- (signed int) (channel->scalefac[sfbi] << scalefac_multiplier);
+ exponents[sfbi] = gain -
+ (signed int) (channel->scalefac[sfbi] << scalefac_multiplier);
}
}
}
}
/*
- * NAME: III_requantize()
+ * NAME: III_requantize()
* DESCRIPTION: requantize one (positive) value
*/
static
@@ -910,7 +910,7 @@ mad_fixed_t III_requantize(unsigned int value, signed int exp)
/* overflow */
# if defined(DEBUG)
fprintf(stderr, "requantize overflow (%f * 2^%d)\n",
- mad_f_todouble(requantized), exp);
+ mad_f_todouble(requantized), exp);
# endif
requantized = MAD_F_MAX;
}
@@ -939,14 +939,14 @@ mad_fixed_t III_requantize(unsigned int value, signed int exp)
((cache) & (1 << ((sz) - 1)))
/*
- * NAME: III_huffdecode()
+ * NAME: III_huffdecode()
* DESCRIPTION: decode Huffman code words of one channel of one granule
*/
static
enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
- struct channel *channel,
- unsigned char const *sfbwidth,
- unsigned int part2_length)
+ struct channel *channel,
+ unsigned char const *sfbwidth,
+ unsigned int part2_length)
{
unsigned int bits;
signed int exponents[39], exp;
@@ -999,23 +999,23 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
else
if(region == 0)
rcount = channel->region1_count + 1;
- else
+ else
rcount = 0; /* all remaining */
- entry = &mad_huff_pair_table[channel->table_select[++region]];
- table = entry->table;
- linbits = entry->linbits;
- startbits = entry->startbits;
+ entry = &mad_huff_pair_table[channel->table_select[++region]];
+ table = entry->table;
+ linbits = entry->linbits;
+ startbits = entry->startbits;
- if(table == 0)
- return MAD_ERROR_BADHUFFTABLE;
+ if(table == 0)
+ return MAD_ERROR_BADHUFFTABLE;
}
if(exp != *expptr)
{
- exp = *expptr;
+ exp = *expptr;
/* clear cache */
- memset(reqcache, 0, sizeof(reqcache));
+ memset(reqcache, 0, sizeof(reqcache));
}
++expptr;
@@ -1052,10 +1052,10 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
cachesz -= pair->value.hlen;
- /* x (0..14) */
- value = pair->value.x;
- if(value == 0)
- xr[0] = 0;
+ /* x (0..14) */
+ value = pair->value.x;
+ if(value == 0)
+ xr[0] = 0;
else
{
if(value == 15)
@@ -1071,24 +1071,24 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
cachesz += bits;
}
- requantized = III_requantize(15+MASK(bitcache, cachesz, linbits), exp);
- cachesz -= linbits;
+ requantized = III_requantize(15+MASK(bitcache, cachesz, linbits), exp);
+ cachesz -= linbits;
}
else
{
- if(reqcache[value])
- requantized = reqcache[value];
- else
- requantized = reqcache[value] = III_requantize(value, exp);
+ if(reqcache[value])
+ requantized = reqcache[value];
+ else
+ requantized = reqcache[value] = III_requantize(value, exp);
}
xr[0] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
}
- /* y (0..14) */
- value = pair->value.y;
- if(value == 0)
- xr[1] = 0;
+ /* y (0..14) */
+ value = pair->value.y;
+ if(value == 0)
+ xr[1] = 0;
else
{
if(value == 15)
@@ -1109,12 +1109,12 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
}
else
{
- if(reqcache[value])
- requantized = reqcache[value];
- else
- requantized = reqcache[value] = III_requantize(value, exp);
+ if(reqcache[value])
+ requantized = reqcache[value];
+ else
+ requantized = reqcache[value] = III_requantize(value, exp);
}
- xr[1] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
+ xr[1] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
}
}
}
@@ -1162,32 +1162,32 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
cachesz -= pair->value.hlen;
- /* x (0..1) */
- value = pair->value.x;
- if(value == 0)
- xr[0] = 0;
- else
+ /* x (0..1) */
+ value = pair->value.x;
+ if(value == 0)
+ xr[0] = 0;
+ else
{
- if(reqcache[value])
- requantized = reqcache[value];
- else
- requantized = reqcache[value] = III_requantize(value, exp);
+ if(reqcache[value])
+ requantized = reqcache[value];
+ else
+ requantized = reqcache[value] = III_requantize(value, exp);
- xr[0] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
+ xr[0] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
}
- /* y (0..1) */
- value = pair->value.y;
- if(value == 0)
- xr[1] = 0;
- else
+ /* y (0..1) */
+ value = pair->value.y;
+ if(value == 0)
+ xr[1] = 0;
+ else
{
- if(reqcache[value])
- requantized = reqcache[value];
- else
- requantized = reqcache[value] = III_requantize(value, exp);
+ if(reqcache[value])
+ requantized = reqcache[value];
+ else
+ requantized = reqcache[value] = III_requantize(value, exp);
- xr[1] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
+ xr[1] = MASK1BIT(bitcache, cachesz--) ? -requantized : requantized;
}
}
}
@@ -1218,9 +1218,9 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
if(cachesz < 0)
return MAD_ERROR_BADHUFFDATA; /* cache underrun */
- bits = MAXLSHIFT - cachesz;
+ bits = MAXLSHIFT - cachesz;
bitcache = (bitcache << bits) | mad_bit_read(&peek, bits);
- cachesz += bits;
+ cachesz += bits;
bits_left -= bits;
}
@@ -1228,53 +1228,53 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
/* quad tables guaranteed to have at most one extra lookup */
if (!quad->final) {
- cachesz -= 4;
+ cachesz -= 4;
- quad = &table[quad->ptr.offset +
- MASK(bitcache, cachesz, quad->ptr.bits)];
+ quad = &table[quad->ptr.offset +
+ MASK(bitcache, cachesz, quad->ptr.bits)];
}
cachesz -= quad->value.hlen;
if (xr == sfbound) {
- sfbound += *sfbwidth++;
+ sfbound += *sfbwidth++;
- if (exp != *expptr) {
- exp = *expptr;
- requantized = III_requantize(1, exp);
- }
+ if (exp != *expptr) {
+ exp = *expptr;
+ requantized = III_requantize(1, exp);
+ }
- ++expptr;
+ ++expptr;
}
/* v (0..1) */
xr[0] = quad->value.v ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
+ (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
/* w (0..1) */
xr[1] = quad->value.w ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
+ (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
xr += 2;
if (xr == sfbound) {
- sfbound += *sfbwidth++;
+ sfbound += *sfbwidth++;
- if (exp != *expptr) {
- exp = *expptr;
- requantized = III_requantize(1, exp);
- }
+ if (exp != *expptr) {
+ exp = *expptr;
+ requantized = III_requantize(1, exp);
+ }
- ++expptr;
+ ++expptr;
}
/* x (0..1) */
xr[0] = quad->value.x ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
+ (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
/* y (0..1) */
xr[1] = quad->value.y ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
+ (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
xr += 2;
}
@@ -1282,7 +1282,7 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
if(bits_left + cachesz < 0)
{
/* technically the bitstream is misformatted, but apparently
- some encoders are just a bit sloppy with stuffing bits */
+ some encoders are just a bit sloppy with stuffing bits */
xr -= 4;
}
}
@@ -1297,12 +1297,12 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xrarr[576],
# undef MASK1BIT
/*
- * NAME: III_reorder()
+ * NAME: III_reorder()
* DESCRIPTION: reorder frequency lines of a short block into subband order
*/
static
void III_reorder(mad_fixed_t xr[576], struct channel const *channel,
- unsigned char const sfbwidth[39])
+ unsigned char const sfbwidth[39])
{
mad_fixed_t tmp[32][3][6];
unsigned int sb, l, f, w, sbw[3], sw[3];
@@ -1345,14 +1345,14 @@ void III_reorder(mad_fixed_t xr[576], struct channel const *channel,
}
/*
- * NAME: III_stereo()
+ * NAME: III_stereo()
* DESCRIPTION: perform joint stereo processing on a granule
*/
static
enum mad_error III_stereo(mad_fixed_t xr[2][576],
- struct granule const *granule,
- struct mad_header *header,
- unsigned char const *sfbwidth)
+ struct granule const *granule,
+ struct mad_header *header,
+ unsigned char const *sfbwidth)
{
short modes[39];
unsigned int sfbi, l, n, i;
@@ -1385,55 +1385,55 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576],
sfbi = l = 0;
if (right_ch->flags & mixed_block_flag) {
- while (l < 36) {
- n = sfbwidth[sfbi++];
+ while (l < 36) {
+ n = sfbwidth[sfbi++];
- for (i = 0; i < n; ++i) {
- if (right_xr[i]) {
- lower = sfbi;
- break;
- }
- }
+ for (i = 0; i < n; ++i) {
+ if (right_xr[i]) {
+ lower = sfbi;
+ break;
+ }
+ }
- right_xr += n;
- l += n;
- }
+ right_xr += n;
+ l += n;
+ }
- start = sfbi;
+ start = sfbi;
}
w = 0;
while (l < 576) {
- n = sfbwidth[sfbi++];
+ n = sfbwidth[sfbi++];
- for (i = 0; i < n; ++i) {
- if (right_xr[i]) {
- max = bound[w] = sfbi;
- break;
- }
- }
+ for (i = 0; i < n; ++i) {
+ if (right_xr[i]) {
+ max = bound[w] = sfbi;
+ break;
+ }
+ }
- right_xr += n;
- l += n;
- w = (w + 1) % 3;
+ right_xr += n;
+ l += n;
+ w = (w + 1) % 3;
}
if (max)
- lower = start;
+ lower = start;
/* long blocks */
for (i = 0; i < lower; ++i)
- modes[i] = header->mode_extension & ~I_STEREO;
+ modes[i] = header->mode_extension & ~I_STEREO;
/* short blocks */
w = 0;
for (i = start; i < max; ++i) {
- if (i < bound[w])
- modes[i] = header->mode_extension & ~I_STEREO;
+ if (i < bound[w])
+ modes[i] = header->mode_extension & ~I_STEREO;
- w = (w + 1) % 3;
+ w = (w + 1) % 3;
}
}
else { /* right_ch->block_type != 2 */
@@ -1441,20 +1441,20 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576],
bound = 0;
for (sfbi = l = 0; l < 576; l += n) {
- n = sfbwidth[sfbi++];
+ n = sfbwidth[sfbi++];
- for (i = 0; i < n; ++i) {
- if (right_xr[i]) {
- bound = sfbi;
- break;
- }
- }
+ for (i = 0; i < n; ++i) {
+ if (right_xr[i]) {
+ bound = sfbi;
+ break;
+ }
+ }
- right_xr += n;
+ right_xr += n;
}
for (i = 0; i < bound; ++i)
- modes[i] = header->mode_extension & ~I_STEREO;
+ modes[i] = header->mode_extension & ~I_STEREO;
}
/* now do the actual processing */
@@ -1467,62 +1467,62 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576],
lsf_scale = is_lsf_table[right_ch->scalefac_compress & 0x1];
for (sfbi = l = 0; l < 576; ++sfbi, l += n) {
- n = sfbwidth[sfbi];
+ n = sfbwidth[sfbi];
- if (!(modes[sfbi] & I_STEREO))
- continue;
+ if (!(modes[sfbi] & I_STEREO))
+ continue;
- if (illegal_pos[sfbi]) {
- modes[sfbi] &= ~I_STEREO;
- continue;
- }
+ if (illegal_pos[sfbi]) {
+ modes[sfbi] &= ~I_STEREO;
+ continue;
+ }
- is_pos = right_ch->scalefac[sfbi];
+ is_pos = right_ch->scalefac[sfbi];
- for (i = 0; i < n; ++i) {
- register mad_fixed_t left;
+ for (i = 0; i < n; ++i) {
+ register mad_fixed_t left;
- left = xr[0][l + i];
+ left = xr[0][l + i];
- if (is_pos == 0)
- xr[1][l + i] = left;
- else {
- register mad_fixed_t opposite;
+ if (is_pos == 0)
+ xr[1][l + i] = left;
+ else {
+ register mad_fixed_t opposite;
- opposite = mad_f_mul(left, lsf_scale[(is_pos - 1) / 2]);
+ opposite = mad_f_mul(left, lsf_scale[(is_pos - 1) / 2]);
- if (is_pos & 1) {
- xr[0][l + i] = opposite;
- xr[1][l + i] = left;
+ if (is_pos & 1) {
+ xr[0][l + i] = opposite;
+ xr[1][l + i] = left;
+ }
+ else
+ xr[1][l + i] = opposite;
+ }
}
- else
- xr[1][l + i] = opposite;
- }
- }
}
}
else { /* !(header->flags & MAD_FLAG_LSF_EXT) */
for (sfbi = l = 0; l < 576; ++sfbi, l += n) {
- n = sfbwidth[sfbi];
+ n = sfbwidth[sfbi];
- if (!(modes[sfbi] & I_STEREO))
- continue;
+ if (!(modes[sfbi] & I_STEREO))
+ continue;
- is_pos = right_ch->scalefac[sfbi];
+ is_pos = right_ch->scalefac[sfbi];
- if (is_pos >= 7) { /* illegal intensity position */
- modes[sfbi] &= ~I_STEREO;
- continue;
- }
+ if (is_pos >= 7) { /* illegal intensity position */
+ modes[sfbi] &= ~I_STEREO;
+ continue;
+ }
- for (i = 0; i < n; ++i) {
- register mad_fixed_t left;
+ for (i = 0; i < n; ++i) {
+ register mad_fixed_t left;
- left = xr[0][l + i];
+ left = xr[0][l + i];
- xr[0][l + i] = mad_f_mul(left, is_table[ is_pos]);
- xr[1][l + i] = mad_f_mul(left, is_table[6 - is_pos]);
- }
+ xr[0][l + i] = mad_f_mul(left, is_table[ is_pos]);
+ xr[1][l + i] = mad_f_mul(left, is_table[6 - is_pos]);
+ }
}
}
}
@@ -1540,16 +1540,16 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576],
n = sfbwidth[sfbi];
if (modes[sfbi] != MS_STEREO)
- continue;
+ continue;
for (i = 0; i < n; ++i) {
- register mad_fixed_t m, s;
+ register mad_fixed_t m, s;
- m = xr[0][l + i];
- s = xr[1][l + i];
+ m = xr[0][l + i];
+ s = xr[1][l + i];
- xr[0][l + i] = mad_f_mul(m + s, invsqrt2); /* l = (m + s) / sqrt(2) */
- xr[1][l + i] = mad_f_mul(m - s, invsqrt2); /* r = (m - s) / sqrt(2) */
+ xr[0][l + i] = mad_f_mul(m + s, invsqrt2); /* l = (m + s) / sqrt(2) */
+ xr[1][l + i] = mad_f_mul(m - s, invsqrt2); /* r = (m - s) / sqrt(2) */
}
}
}
@@ -1561,7 +1561,7 @@ enum mad_error III_stereo(mad_fixed_t xr[2][576],
void III_aliasreduce(mad_fixed_t xr[576], int lines);
#else
/*
- * NAME: III_aliasreduce()
+ * NAME: III_aliasreduce()
* DESCRIPTION: perform frequency line alias reduction
*/
static
@@ -1598,15 +1598,15 @@ void III_aliasreduce(mad_fixed_t xr[576], int lines)
xr[-1 - i] = a;
xr[ i] = b;
# else
- MAD_F_ML0(hi, lo, a, cs[i]);
- MAD_F_MLA(hi, lo, -b, ca[i]);
+ MAD_F_ML0(hi, lo, a, cs[i]);
+ MAD_F_MLA(hi, lo, -b, ca[i]);
- xr[-1 - i] = MAD_F_MLZ(hi, lo);
+ xr[-1 - i] = MAD_F_MLZ(hi, lo);
- MAD_F_ML0(hi, lo, b, cs[i]);
- MAD_F_MLA(hi, lo, a, ca[i]);
+ MAD_F_ML0(hi, lo, b, cs[i]);
+ MAD_F_MLA(hi, lo, a, ca[i]);
- xr[ i] = MAD_F_MLZ(hi, lo);
+ xr[ i] = MAD_F_MLZ(hi, lo);
# endif
# if defined(ASO_ZEROCHECK)
}
@@ -1774,7 +1774,7 @@ void dctIV(mad_fixed_t const y[18], mad_fixed_t X[18])
}
/*
- * NAME: imdct36
+ * NAME: imdct36
* DESCRIPTION: perform X[18]->x[36] IMDCT using Szu-Wei Lee's fast algorithm
*/
static inline
@@ -1807,7 +1807,7 @@ void imdct36(mad_fixed_t const x[18], mad_fixed_t y[36])
}
# else
/*
- * NAME: imdct36
+ * NAME: imdct36
* DESCRIPTION: perform X[18]->x[36] IMDCT
*/
@@ -2737,12 +2737,12 @@ void imdct36(mad_fixed_t const X[18], mad_fixed_t x[36])
# endif
/*
- * NAME: III_imdct_l()
+ * NAME: III_imdct_l()
* DESCRIPTION: perform IMDCT and windowing for long blocks
*/
static
void III_imdct_l(mad_fixed_t const X[18], mad_fixed_t z[36],
- unsigned int block_type)
+ unsigned int block_type)
{
unsigned int i;
@@ -2762,10 +2762,10 @@ void III_imdct_l(mad_fixed_t const X[18], mad_fixed_t z[36],
tmp2 = window_l[1];
for (i = 0; i < 34; i += 2) {
- z[i + 0] = mad_f_mul(z[i + 0], tmp1);
- tmp1 = window_l[i + 2];
- z[i + 1] = mad_f_mul(z[i + 1], tmp2);
- tmp2 = window_l[i + 3];
+ z[i + 0] = mad_f_mul(z[i + 0], tmp1);
+ tmp1 = window_l[i + 2];
+ z[i + 1] = mad_f_mul(z[i + 1], tmp2);
+ tmp2 = window_l[i + 3];
}
z[34] = mad_f_mul(z[34], tmp1);
@@ -2779,9 +2779,9 @@ void III_imdct_l(mad_fixed_t const X[18], mad_fixed_t z[36],
tmp2 = window_l[0];
for (i = 0; i < 35; ++i) {
- z[i] = mad_f_mul(tmp1, tmp2);
- tmp1 = z[i + 1];
- tmp2 = window_l[i + 1];
+ z[i] = mad_f_mul(tmp1, tmp2);
+ tmp1 = z[i + 1];
+ tmp2 = window_l[i + 1];
}
z[35] = mad_f_mul(tmp1, tmp2);
@@ -2824,7 +2824,7 @@ void III_imdct_l(mad_fixed_t const X[18], mad_fixed_t z[36],
# endif /* ASO_IMDCT */
/*
- * NAME: III_imdct_s()
+ * NAME: III_imdct_s()
* DESCRIPTION: perform IMDCT and windowing for short blocks
*/
@@ -2911,16 +2911,16 @@ void III_imdct_s(mad_fixed_t const X[18], mad_fixed_t z[36])
#ifdef CPU_ARM
void III_overlap(mad_fixed_t const output[36], mad_fixed_t overlap[18],
- mad_fixed_t sample[18][32], unsigned int sb);
+ mad_fixed_t sample[18][32], unsigned int sb);
#else
/*
- * NAME: III_overlap()
+ * NAME: III_overlap()
* DESCRIPTION: perform overlap-add of windowed IMDCT outputs
*/
static
void III_overlap(mad_fixed_t const output[36], mad_fixed_t overlap[18],
- mad_fixed_t sample[18][32], unsigned int sb)
+ mad_fixed_t sample[18][32], unsigned int sb)
{
unsigned int i;
@@ -2964,12 +2964,12 @@ void III_overlap(mad_fixed_t const output[36], mad_fixed_t overlap[18],
#endif
/*
- * NAME: III_overlap_z()
+ * NAME: III_overlap_z()
* DESCRIPTION: perform "overlap-add" of zero IMDCT outputs
*/
static inline
void III_overlap_z(mad_fixed_t overlap[18],
- mad_fixed_t sample[18][32], unsigned int sb)
+ mad_fixed_t sample[18][32], unsigned int sb)
{
unsigned int i;
@@ -3004,7 +3004,7 @@ void III_overlap_z(mad_fixed_t overlap[18],
}
/*
- * NAME: III_freqinver()
+ * NAME: III_freqinver()
* DESCRIPTION: perform subband frequency inversion for odd sample lines
*/
static
@@ -3038,12 +3038,12 @@ void III_freqinver(mad_fixed_t sample[18][32], unsigned int sb)
}
/*
- * NAME: III_decode()
+ * NAME: III_decode()
* DESCRIPTION: decode frame main_data
*/
static
enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
- struct sideinfo *si, unsigned int nch)
+ struct sideinfo *si, unsigned int nch)
{
struct mad_header *header = &frame->header;
unsigned int sfreqi, ngr, gr;
@@ -3081,23 +3081,23 @@ enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
sfbwidth[ch] = sfbwidth_table[sfreqi].l;
if (channel->block_type == 2) {
- sfbwidth[ch] = (channel->flags & mixed_block_flag) ?
- sfbwidth_table[sfreqi].m : sfbwidth_table[sfreqi].s;
+ sfbwidth[ch] = (channel->flags & mixed_block_flag) ?
+ sfbwidth_table[sfreqi].m : sfbwidth_table[sfreqi].s;
}
if (header->flags & MAD_FLAG_LSF_EXT) {
- part2_length = III_scalefactors_lsf(ptr, channel,
- ch == 0 ? 0 : &si->gr[1].ch[1],
- header->mode_extension);
+ part2_length = III_scalefactors_lsf(ptr, channel,
+ ch == 0 ? 0 : &si->gr[1].ch[1],
+ header->mode_extension);
}
else {
- part2_length = III_scalefactors(ptr, channel, &si->gr[0].ch[ch],
- gr == 0 ? 0 : si->scfsi[ch]);
+ part2_length = III_scalefactors(ptr, channel, &si->gr[0].ch[ch],
+ gr == 0 ? 0 : si->scfsi[ch]);
}
error = III_huffdecode(ptr, xr[ch], channel, sfbwidth[ch], part2_length);
if (error)
- return error;
+ return error;
}
/* joint stereo processing */
@@ -3105,7 +3105,7 @@ enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
if (header->mode == MAD_MODE_JOINT_STEREO && header->mode_extension) {
error = III_stereo(xr, granule, header, sfbwidth[0]);
if (error)
- return error;
+ return error;
}
/* reordering, alias reduction, IMDCT, overlap-add, frequency inversion */
@@ -3117,46 +3117,46 @@ enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
mad_fixed_t output[36];
if (channel->block_type == 2) {
- III_reorder(xr[ch], channel, sfbwidth[ch]);
+ III_reorder(xr[ch], channel, sfbwidth[ch]);
# if !defined(OPT_STRICT)
- /*
- * According to ISO/IEC 11172-3, "Alias reduction is not applied for
- * granules with block_type == 2 (short block)." However, other
- * sources suggest alias reduction should indeed be performed on the
- * lower two subbands of mixed blocks. Most other implementations do
- * this, so by default we will too.
- */
- if (channel->flags & mixed_block_flag)
- III_aliasreduce(xr[ch], 36);
+ /*
+ * According to ISO/IEC 11172-3, "Alias reduction is not applied for
+ * granules with block_type == 2 (short block)." However, other
+ * sources suggest alias reduction should indeed be performed on the
+ * lower two subbands of mixed blocks. Most other implementations do
+ * this, so by default we will too.
+ */
+ if (channel->flags & mixed_block_flag)
+ III_aliasreduce(xr[ch], 36);
# endif
}
else
- III_aliasreduce(xr[ch], 576);
+ III_aliasreduce(xr[ch], 576);
l = 0;
/* subbands 0-1 */
if (channel->block_type != 2 || (channel->flags & mixed_block_flag)) {
- unsigned int block_type;
+ unsigned int block_type;
- block_type = channel->block_type;
- if (channel->flags & mixed_block_flag)
- block_type = 0;
+ block_type = channel->block_type;
+ if (channel->flags & mixed_block_flag)
+ block_type = 0;
- /* long blocks */
- for (sb = 0; sb < 2; ++sb, l += 18) {
- III_imdct_l(&xr[ch][l], output, block_type);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
- }
+ /* long blocks */
+ for (sb = 0; sb < 2; ++sb, l += 18) {
+ III_imdct_l(&xr[ch][l], output, block_type);
+ III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
+ }
}
else {
- /* short blocks */
- for (sb = 0; sb < 2; ++sb, l += 18) {
- III_imdct_s(&xr[ch][l], output);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
- }
+ /* short blocks */
+ for (sb = 0; sb < 2; ++sb, l += 18) {
+ III_imdct_s(&xr[ch][l], output);
+ III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
+ }
}
III_freqinver(sample, 1);
@@ -3166,7 +3166,7 @@ enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
/*
i = 576;
while (i > 36 && xr[ch][i - 1] == 0)
- --i;
+ --i;
*/
{
@@ -3181,33 +3181,33 @@ enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
sblimit = 32 - (576 - i) / 18;
if (channel->block_type != 2) {
- /* long blocks */
- for (sb = 2; sb < sblimit; ++sb, l += 18) {
- III_imdct_l(&xr[ch][l], output, channel->block_type);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
+ /* long blocks */
+ for (sb = 2; sb < sblimit; ++sb, l += 18) {
+ III_imdct_l(&xr[ch][l], output, channel->block_type);
+ III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
- if (sb & 1)
- III_freqinver(sample, sb);
- }
+ if (sb & 1)
+ III_freqinver(sample, sb);
+ }
}
else {
- /* short blocks */
- for (sb = 2; sb < sblimit; ++sb, l += 18) {
- III_imdct_s(&xr[ch][l], output);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
+ /* short blocks */
+ for (sb = 2; sb < sblimit; ++sb, l += 18) {
+ III_imdct_s(&xr[ch][l], output);
+ III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
- if (sb & 1)
- III_freqinver(sample, sb);
- }
+ if (sb & 1)
+ III_freqinver(sample, sb);
+ }
}
/* remaining (zero) subbands */
for (sb = sblimit; sb < 32; ++sb) {
- III_overlap_z((*frame->overlap)[ch][sb], sample, sb);
+ III_overlap_z((*frame->overlap)[ch][sb], sample, sb);
- if (sb & 1)
- III_freqinver(sample, sb);
+ if (sb & 1)
+ III_freqinver(sample, sb);
}
}
}
@@ -3216,7 +3216,7 @@ enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
}
/*
- * NAME: layer->III()
+ * NAME: layer->III()
* DESCRIPTION: decode a single Layer III frame
*/
int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
@@ -3268,7 +3268,7 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
mad_bit_crc(stream->ptr, si_len * CHAR_BIT, header->crc_check);
if (header->crc_check != header->crc_target &&
- !(frame->options & MAD_OPTION_IGNORECRC)) {
+ !(frame->options & MAD_OPTION_IGNORECRC)) {
stream->error = MAD_ERROR_BADCRC;
result = -1;
}
@@ -3277,7 +3277,7 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
/* decode frame side information */
error = III_sideinfo(&stream->ptr, nch, header->flags & MAD_FLAG_LSF_EXT,
- &si, &data_bitlen, &priv_bitlen);
+ &si, &data_bitlen, &priv_bitlen);
if (error && result == 0) {
stream->error = error;
result = -1;
@@ -3297,10 +3297,10 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
header = mad_bit_read(&peek, 32);
if ((header & 0xffe60000L) /* syncword | layer */ == 0xffe20000L) {
if (!(header & 0x00010000L)) /* protection_bit */
- mad_bit_skip(&peek, 16); /* crc_check */
+ mad_bit_skip(&peek, 16); /* crc_check */
next_md_begin =
- mad_bit_read(&peek, (header & 0x00080000L) /* ID */ ? 9 : 8);
+ mad_bit_read(&peek, (header & 0x00080000L) /* ID */ ? 9 : 8);
}
mad_bit_finish(&peek);
@@ -3326,22 +3326,22 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
else {
if (si.main_data_begin > stream->md_len) {
if (result == 0) {
- stream->error = MAD_ERROR_BADDATAPTR;
- result = -1;
+ stream->error = MAD_ERROR_BADDATAPTR;
+ result = -1;
}
}
else {
mad_bit_init(&ptr,
- *stream->main_data + stream->md_len - si.main_data_begin);
+ *stream->main_data + stream->md_len - si.main_data_begin);
if (md_len > si.main_data_begin) {
- assert(stream->md_len + md_len -
- si.main_data_begin <= MAD_BUFFER_MDLEN);
+ assert(stream->md_len + md_len -
+ si.main_data_begin <= MAD_BUFFER_MDLEN);
- memcpy(*stream->main_data + stream->md_len,
- mad_bit_nextbyte(&stream->ptr),
- frame_used = md_len - si.main_data_begin);
- stream->md_len += frame_used;
+ memcpy(*stream->main_data + stream->md_len,
+ mad_bit_nextbyte(&stream->ptr),
+ frame_used = md_len - si.main_data_begin);
+ stream->md_len += frame_used;
}
}
}
@@ -3365,17 +3365,17 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
# if 0 && defined(DEBUG)
fprintf(stderr,
- "main_data_begin:%u, md_len:%u, frame_free:%u, "
- "data_bitlen:%u, anc_bitlen: %u\n",
- si.main_data_begin, md_len, frame_free,
- data_bitlen, stream->anc_bitlen);
+ "main_data_begin:%u, md_len:%u, frame_free:%u, "
+ "data_bitlen:%u, anc_bitlen: %u\n",
+ si.main_data_begin, md_len, frame_free,
+ data_bitlen, stream->anc_bitlen);
# endif
/* preload main_data buffer with up to 511 bytes for next frame(s) */
if (frame_free >= next_md_begin) {
memcpy(*stream->main_data,
- stream->next_frame - next_md_begin, next_md_begin);
+ stream->next_frame - next_md_begin, next_md_begin);
stream->md_len = next_md_begin;
}
else {
@@ -3384,19 +3384,19 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
extra = si.main_data_begin - md_len;
if (extra + frame_free > next_md_begin)
- extra = next_md_begin - frame_free;
+ extra = next_md_begin - frame_free;
if (extra < stream->md_len) {
- memmove(*stream->main_data,
- *stream->main_data + stream->md_len - extra, extra);
- stream->md_len = extra;
+ memmove(*stream->main_data,
+ *stream->main_data + stream->md_len - extra, extra);
+ stream->md_len = extra;
}
}
else
stream->md_len = 0;
memcpy(*stream->main_data + stream->md_len,
- stream->next_frame - frame_free, frame_free);
+ stream->next_frame - frame_free, frame_free);
stream->md_len += frame_free;
}
diff --git a/apps/codecs/libmad/mad.h b/apps/codecs/libmad/mad.h
index 6e75e3b..81ac20c 100644
--- a/apps/codecs/libmad/mad.h
+++ b/apps/codecs/libmad/mad.h
@@ -27,28 +27,28 @@ extern "C" {
# endif
# define FPM_DEFAULT
-
+
/* Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp */
# ifndef LIBMAD_VERSION_H
# define LIBMAD_VERSION_H
-# define MAD_VERSION_MAJOR 0
-# define MAD_VERSION_MINOR 15
-# define MAD_VERSION_PATCH 1
-# define MAD_VERSION_EXTRA " (beta)"
+# define MAD_VERSION_MAJOR 0
+# define MAD_VERSION_MINOR 15
+# define MAD_VERSION_PATCH 1
+# define MAD_VERSION_EXTRA " (beta)"
-# define MAD_VERSION_STRINGIZE(str) #str
-# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num)
+# define MAD_VERSION_STRINGIZE(str) #str
+# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num)
-# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \
- MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \
- MAD_VERSION_STRING(MAD_VERSION_PATCH) \
- MAD_VERSION_EXTRA
+# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \
+ MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \
+ MAD_VERSION_STRING(MAD_VERSION_PATCH) \
+ MAD_VERSION_EXTRA
-# define MAD_PUBLISHYEAR "2000-2004"
-# define MAD_AUTHOR "Underbit Technologies, Inc."
-# define MAD_EMAIL "info@underbit.com"
+# define MAD_PUBLISHYEAR "2000-2004"
+# define MAD_AUTHOR "Underbit Technologies, Inc."
+# define MAD_EMAIL "info@underbit.com"
extern char const mad_version[];
extern char const mad_copyright[];
@@ -102,50 +102,50 @@ typedef mad_fixed_t mad_sample_t;
* supported, and must be done with care.
*/
-# define MAD_F_FRACBITS 28
+# define MAD_F_FRACBITS 28
# if MAD_F_FRACBITS == 28
-# define MAD_F(x) ((mad_fixed_t) (x##L))
+# define MAD_F(x) ((mad_fixed_t) (x##L))
# else
# if MAD_F_FRACBITS < 28
# warning "MAD_F_FRACBITS < 28"
-# define MAD_F(x) ((mad_fixed_t) \
- (((x##L) + \
- (1L << (28 - MAD_F_FRACBITS - 1))) >> \
- (28 - MAD_F_FRACBITS)))
+# define MAD_F(x) ((mad_fixed_t) \
+ (((x##L) + \
+ (1L << (28 - MAD_F_FRACBITS - 1))) >> \
+ (28 - MAD_F_FRACBITS)))
# elif MAD_F_FRACBITS > 28
# error "MAD_F_FRACBITS > 28 not currently supported"
-# define MAD_F(x) ((mad_fixed_t) \
- ((x##L) << (MAD_F_FRACBITS - 28)))
+# define MAD_F(x) ((mad_fixed_t) \
+ ((x##L) << (MAD_F_FRACBITS - 28)))
# endif
# endif
-# define MAD_F_MIN ((mad_fixed_t) -0x80000000L)
-# define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL)
+# define MAD_F_MIN ((mad_fixed_t) -0x80000000L)
+# define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL)
-# define MAD_F_ONE MAD_F(0x10000000)
+# define MAD_F_ONE MAD_F(0x10000000)
-# define mad_f_tofixed(x) ((mad_fixed_t) \
- ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
-# define mad_f_todouble(x) ((double) \
- ((x) / (double) (1L << MAD_F_FRACBITS)))
+# define mad_f_tofixed(x) ((mad_fixed_t) \
+ ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
+# define mad_f_todouble(x) ((double) \
+ ((x) / (double) (1L << MAD_F_FRACBITS)))
-# define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS)
-# define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1))
- /* (x should be positive) */
+# define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS)
+# define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1))
+ /* (x should be positive) */
-# define mad_f_fromint(x) ((x) << MAD_F_FRACBITS)
+# define mad_f_fromint(x) ((x) << MAD_F_FRACBITS)
-# define mad_f_add(x, y) ((x) + (y))
-# define mad_f_sub(x, y) ((x) - (y))
+# define mad_f_add(x, y) ((x) + (y))
+# define mad_f_sub(x, y) ((x) - (y))
# if defined(FPM_FLOAT)
# error "FPM_FLOAT not yet supported"
# undef MAD_F
-# define MAD_F(x) mad_f_todouble(x)
+# define MAD_F(x) mad_f_todouble(x)
-# define mad_f_mul(x, y) ((x) * (y))
+# define mad_f_mul(x, y) ((x) * (y))
# define mad_f_scale64
# undef ASO_ZEROCHECK
@@ -192,7 +192,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
}
# pragma warning(pop)
-# define mad_f_mul mad_f_mul_inline
+# define mad_f_mul mad_f_mul_inline
# define mad_f_scale64
# else
/*
@@ -201,9 +201,9 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_MLX(hi, lo, x, y) \
asm ("imull %3" \
- : "=a" (lo), "=d" (hi) \
- : "%a" (x), "rm" (y) \
- : "cc")
+ : "=a" (lo), "=d" (hi) \
+ : "%a" (x), "rm" (y) \
+ : "cc")
# if defined(OPT_ACCURACY)
/*
@@ -214,10 +214,10 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
mad_fixed64lo_t __lo; \
MAD_F_MLX(__hi, __lo, (x), (y)); \
asm ("addl %2,%0\n\t" \
- "adcl %3,%1" \
- : "=rm" (lo), "=rm" (hi) \
- : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \
- : "cc"); \
+ "adcl %3,%1" \
+ : "=rm" (lo), "=rm" (hi) \
+ : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \
+ : "cc"); \
})
# endif /* OPT_ACCURACY */
@@ -230,15 +230,15 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
mad_fixed64lo_t __lo_; \
mad_fixed_t __result; \
asm ("addl %4,%2\n\t" \
- "adcl %5,%3" \
- : "=rm" (__lo_), "=rm" (__hi_) \
- : "0" (lo), "1" (hi), \
- "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \
- : "cc"); \
+ "adcl %5,%3" \
+ : "=rm" (__lo_), "=rm" (__hi_) \
+ : "0" (lo), "1" (hi), \
+ "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \
+ : "cc"); \
asm ("shrdl %3,%2,%1" \
- : "=rm" (__result) \
- : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \
- : "cc"); \
+ : "=rm" (__result) \
+ : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# elif defined(OPT_INTEL)
@@ -248,21 +248,21 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
asm ("shrl %3,%1\n\t" \
- "shll %4,%2\n\t" \
- "orl %2,%1" \
- : "=rm" (__result) \
- : "0" (lo), "r" (hi), \
- "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
+ "shll %4,%2\n\t" \
+ "orl %2,%1" \
+ : "=rm" (__result) \
+ : "0" (lo), "r" (hi), \
+ "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# else
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
asm ("shrdl %3,%2,%1" \
- : "=rm" (__result) \
- : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \
- : "cc"); \
+ : "=rm" (__result) \
+ : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# endif /* OPT_ACCURACY */
@@ -287,42 +287,42 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
({ mad_fixed64hi_t __hi; \
mad_fixed64lo_t __lo; \
mad_fixed_t __result; \
- asm ("smull %0, %1, %3, %4\n\t" \
- "movs %0, %0, lsr %5\n\t" \
- "adc %2, %0, %1, lsl %6" \
- : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
- : "%r" (x), "r" (y), \
- "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
+ asm ("smull %0, %1, %3, %4\n\t" \
+ "movs %0, %0, lsr %5\n\t" \
+ "adc %2, %0, %1, lsl %6" \
+ : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
+ : "%r" (x), "r" (y), \
+ "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
# endif
# define MAD_F_MLX(hi, lo, x, y) \
asm ("smull %0, %1, %2, %3" \
- : "=&r" (lo), "=&r" (hi) \
- : "%r" (x), "r" (y))
+ : "=&r" (lo), "=&r" (hi) \
+ : "%r" (x), "r" (y))
# define MAD_F_MLA(hi, lo, x, y) \
asm ("smlal %0, %1, %2, %3" \
- : "+r" (lo), "+r" (hi) \
- : "%r" (x), "r" (y))
+ : "+r" (lo), "+r" (hi) \
+ : "%r" (x), "r" (y))
# define MAD_F_MLN(hi, lo) \
asm ("rsbs %0, %2, #0\n\t" \
- "rsc %1, %3, #0" \
- : "=r" (lo), "=r" (hi) \
- : "0" (lo), "1" (hi) \
- : "cc")
+ "rsc %1, %3, #0" \
+ : "=r" (lo), "=r" (hi) \
+ : "0" (lo), "1" (hi) \
+ : "cc")
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
- asm ("movs %0, %1, lsr %3\n\t" \
- "adc %0, %0, %2, lsl %4" \
- : "=&r" (__result) \
- : "r" (lo), "r" (hi), \
- "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
+ asm ("movs %0, %1, lsr %3\n\t" \
+ "adc %0, %0, %2, lsl %4" \
+ : "=&r" (__result) \
+ : "r" (lo), "r" (hi), \
+ "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
__result; \
})
@@ -338,14 +338,14 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_MLX(hi, lo, x, y) \
asm ("mult %2,%3" \
- : "=l" (lo), "=h" (hi) \
- : "%r" (x), "r" (y))
+ : "=l" (lo), "=h" (hi) \
+ : "%r" (x), "r" (y))
# if defined(HAVE_MADD_ASM)
# define MAD_F_MLA(hi, lo, x, y) \
asm ("madd %2,%3" \
- : "+l" (lo), "+h" (hi) \
- : "%r" (x), "r" (y))
+ : "+l" (lo), "+h" (hi) \
+ : "%r" (x), "r" (y))
# elif defined(HAVE_MADD16_ASM)
/*
* This loses significant accuracy due to the 16-bit integer limit in the
@@ -353,12 +353,12 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_ML0(hi, lo, x, y) \
asm ("mult %2,%3" \
- : "=l" (lo), "=h" (hi) \
- : "%r" ((x) >> 12), "r" ((y) >> 16))
+ : "=l" (lo), "=h" (hi) \
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
# define MAD_F_MLA(hi, lo, x, y) \
- asm ("madd16 %2,%3" \
- : "+l" (lo), "+h" (hi) \
- : "%r" ((x) >> 12), "r" ((y) >> 16))
+ asm ("madd16 %2,%3" \
+ : "+l" (lo), "+h" (hi) \
+ : "%r" ((x) >> 12), "r" ((y) >> 16))
# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
# endif
@@ -378,9 +378,9 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
*/
# define MAD_F_MLX(hi, lo, x, y) \
asm ("smul %2, %3, %0\n\t" \
- "rd %%y, %1" \
- : "=r" (lo), "=r" (hi) \
- : "%r" (x), "rI" (y))
+ "rd %%y, %1" \
+ : "=r" (lo), "=r" (hi) \
+ : "%r" (x), "rI" (y))
/* --- PowerPC ------------------------------------------------------------- */
@@ -393,11 +393,11 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define MAD_F_MLX(hi, lo, x, y) \
do { \
asm ("mullw %0,%1,%2" \
- : "=r" (lo) \
- : "%r" (x), "r" (y)); \
+ : "=r" (lo) \
+ : "%r" (x), "r" (y)); \
asm ("mulhw %0,%1,%2" \
- : "=r" (hi) \
- : "%r" (x), "r" (y)); \
+ : "=r" (hi) \
+ : "%r" (x), "r" (y)); \
} \
while (0)
@@ -410,11 +410,11 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
mad_fixed64lo_t __lo; \
MAD_F_MLX(__hi, __lo, (x), (y)); \
asm ("addc %0,%2,%3\n\t" \
- "adde %1,%4,%5" \
- : "=r" (lo), "=r" (hi) \
- : "%r" (lo), "r" (__lo), \
- "%r" (hi), "r" (__hi) \
- : "xer"); \
+ "adde %1,%4,%5" \
+ : "=r" (lo), "=r" (hi) \
+ : "%r" (lo), "r" (__lo), \
+ "%r" (hi), "r" (__hi) \
+ : "xer"); \
})
# endif
@@ -425,28 +425,28 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result, __round; \
asm ("rotrwi %0,%1,%2" \
- : "=r" (__result) \
- : "r" (lo), "i" (MAD_F_SCALEBITS)); \
+ : "=r" (__result) \
+ : "r" (lo), "i" (MAD_F_SCALEBITS)); \
asm ("extrwi %0,%1,1,0" \
- : "=r" (__round) \
- : "r" (__result)); \
+ : "=r" (__round) \
+ : "r" (__result)); \
asm ("insrwi %0,%1,%2,0" \
- : "+r" (__result) \
- : "r" (hi), "i" (MAD_F_SCALEBITS)); \
+ : "+r" (__result) \
+ : "r" (hi), "i" (MAD_F_SCALEBITS)); \
asm ("add %0,%1,%2" \
- : "=r" (__result) \
- : "%r" (__result), "r" (__round)); \
+ : "=r" (__result) \
+ : "%r" (__result), "r" (__round)); \
__result; \
})
# else
# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
asm ("rotrwi %0,%1,%2" \
- : "=r" (__result) \
- : "r" (lo), "i" (MAD_F_SCALEBITS)); \
+ : "=r" (__result) \
+ : "r" (lo), "i" (MAD_F_SCALEBITS)); \
asm ("insrwi %0,%1,%2,0" \
- : "+r" (__result) \
- : "r" (hi), "i" (MAD_F_SCALEBITS)); \
+ : "+r" (__result) \
+ : "r" (hi), "i" (MAD_F_SCALEBITS)); \
__result; \
})
# endif
@@ -467,10 +467,10 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
* Pre-rounding is required to stay within the limits of compliance.
*/
# if defined(OPT_SPEED)
-# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16))
+# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16))
# else
-# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
- (((y) + (1L << 15)) >> 16))
+# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
+ (((y) + (1L << 15)) >> 16))
# endif
/* ------------------------------------------------------------------------- */
@@ -491,22 +491,22 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# endif
# if !defined(MAD_F_MLA)
-# define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y)))
-# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y)))
-# define MAD_F_MLN(hi, lo) ((lo) = -(lo))
-# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
+# define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y)))
+# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y)))
+# define MAD_F_MLN(hi, lo) ((lo) = -(lo))
+# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
# endif
# if !defined(MAD_F_ML0)
-# define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y))
+# define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y))
# endif
# if !defined(MAD_F_MLN)
-# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
+# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
# endif
# if !defined(MAD_F_MLZ)
-# define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo))
+# define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo))
# endif
# if !defined(mad_f_scale64)
@@ -514,7 +514,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
# define mad_f_scale64(hi, lo) \
((((mad_fixed_t) \
(((hi) << (32 - (MAD_F_SCALEBITS - 1))) | \
- ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
+ ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
# else
# define mad_f_scale64(hi, lo) \
((mad_fixed_t) \
@@ -544,10 +544,10 @@ struct mad_bitptr {
void mad_bit_init(struct mad_bitptr *, unsigned char const *);
-# define mad_bit_finish(bitptr) /* nothing */
+# define mad_bit_finish(bitptr) /* nothing */
unsigned int mad_bit_length(struct mad_bitptr const *,
- struct mad_bitptr const *);
+ struct mad_bitptr const *);
# define mad_bit_bitsleft(bitptr) ((bitptr)->left)
unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *);
@@ -566,8 +566,8 @@ unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short);
# define LIBMAD_TIMER_H
typedef struct {
- signed long seconds; /* whole seconds */
- unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */
+ signed long seconds; /* whole seconds */
+ unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */
} mad_timer_t;
extern mad_timer_t const mad_timer_zero;
@@ -575,9 +575,9 @@ extern mad_timer_t const mad_timer_zero;
# define MAD_TIMER_RESOLUTION 352800000UL
enum mad_units {
- MAD_UNITS_HOURS = -2,
- MAD_UNITS_MINUTES = -1,
- MAD_UNITS_SECONDS = 0,
+ MAD_UNITS_HOURS = -2,
+ MAD_UNITS_MINUTES = -1,
+ MAD_UNITS_SECONDS = 0,
/* metric units */
@@ -587,7 +587,7 @@ enum mad_units {
/* audio sample units */
- MAD_UNITS_8000_HZ = 8000,
+ MAD_UNITS_8000_HZ = 8000,
MAD_UNITS_11025_HZ = 11025,
MAD_UNITS_12000_HZ = 12000,
@@ -601,16 +601,16 @@ enum mad_units {
/* video frame/field units */
- MAD_UNITS_24_FPS = 24,
- MAD_UNITS_25_FPS = 25,
- MAD_UNITS_30_FPS = 30,
- MAD_UNITS_48_FPS = 48,
- MAD_UNITS_50_FPS = 50,
- MAD_UNITS_60_FPS = 60,
+ MAD_UNITS_24_FPS = 24,
+ MAD_UNITS_25_FPS = 25,
+ MAD_UNITS_30_FPS = 30,
+ MAD_UNITS_48_FPS = 48,
+ MAD_UNITS_50_FPS = 50,
+ MAD_UNITS_60_FPS = 60,
/* CD audio frames */
- MAD_UNITS_75_FPS = 75,
+ MAD_UNITS_75_FPS = 75,
/* video drop-frame units */
@@ -638,7 +638,7 @@ void mad_timer_multiply(mad_timer_t *, signed long);
signed long mad_timer_count(mad_timer_t, enum mad_units);
unsigned long mad_timer_fraction(mad_timer_t, unsigned long);
void mad_timer_string(mad_timer_t, char *, char const *,
- enum mad_units, enum mad_units, unsigned long);
+ enum mad_units, enum mad_units, unsigned long);
# endif
@@ -648,16 +648,16 @@ void mad_timer_string(mad_timer_t, char *, char const *,
# define LIBMAD_STREAM_H
-# define MAD_BUFFER_GUARD 8
-# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
+# define MAD_BUFFER_GUARD 8
+# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
enum mad_error {
- MAD_ERROR_NONE = 0x0000, /* no error */
+ MAD_ERROR_NONE = 0x0000, /* no error */
- MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
- MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */
+ MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
+ MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */
- MAD_ERROR_NOMEM = 0x0031, /* not enough memory */
+ MAD_ERROR_NOMEM = 0x0031, /* not enough memory */
MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */
MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */
@@ -665,7 +665,7 @@ enum mad_error {
MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */
MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */
- MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */
+ MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */
MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */
MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */
MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */
@@ -677,32 +677,32 @@ enum mad_error {
MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */
MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */
MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */
- MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */
+ MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */
};
# define MAD_RECOVERABLE(error) ((error) & 0xff00)
struct mad_stream {
- unsigned char const *buffer; /* input bitstream buffer */
- unsigned char const *bufend; /* end of buffer */
- unsigned long skiplen; /* bytes to skip before next frame */
+ unsigned char const *buffer; /* input bitstream buffer */
+ unsigned char const *bufend; /* end of buffer */
+ unsigned long skiplen; /* bytes to skip before next frame */
- int sync; /* stream sync found */
- unsigned long freerate; /* free bitrate (fixed) */
+ int sync; /* stream sync found */
+ unsigned long freerate; /* free bitrate (fixed) */
- unsigned char const *this_frame; /* start of current frame */
- unsigned char const *next_frame; /* start of next frame */
- struct mad_bitptr ptr; /* current processing bit pointer */
+ unsigned char const *this_frame; /* start of current frame */
+ unsigned char const *next_frame; /* start of next frame */
+ struct mad_bitptr ptr; /* current processing bit pointer */
- struct mad_bitptr anc_ptr; /* ancillary bits pointer */
- unsigned int anc_bitlen; /* number of ancillary bits */
+ struct mad_bitptr anc_ptr; /* ancillary bits pointer */
+ unsigned int anc_bitlen; /* number of ancillary bits */
unsigned char (*main_data)[MAD_BUFFER_MDLEN];
- /* Layer III main_data() */
- unsigned int md_len; /* bytes in main_data */
+ /* Layer III main_data() */
+ unsigned int md_len; /* bytes in main_data */
- int options; /* decoding options (see below) */
- enum mad_error error; /* error code (see above) */
+ int options; /* decoding options (see below) */
+ enum mad_error error; /* error code (see above) */
};
enum {
@@ -722,7 +722,7 @@ void mad_stream_finish(struct mad_stream *);
((void) ((stream)->options = (opts)))
void mad_stream_buffer(struct mad_stream *,
- unsigned char const *, unsigned long);
+ unsigned char const *, unsigned long);
void mad_stream_skip(struct mad_stream *, unsigned long);
int mad_stream_sync(struct mad_stream *);
@@ -738,46 +738,46 @@ char const *mad_stream_errorstr(struct mad_stream const *);
enum mad_layer {
- MAD_LAYER_I = 1, /* Layer I */
- MAD_LAYER_II = 2, /* Layer II */
- MAD_LAYER_III = 3 /* Layer III */
+ MAD_LAYER_I = 1, /* Layer I */
+ MAD_LAYER_II = 2, /* Layer II */
+ MAD_LAYER_III = 3 /* Layer III */
};
enum mad_mode {
- MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */
- MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */
- MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */
- MAD_MODE_STEREO = 3 /* normal LR stereo */
+ MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */
+ MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */
+ MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */
+ MAD_MODE_STEREO = 3 /* normal LR stereo */
};
enum mad_emphasis {
- MAD_EMPHASIS_NONE = 0, /* no emphasis */
- MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */
- MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */
- MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */
+ MAD_EMPHASIS_NONE = 0, /* no emphasis */
+ MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */
+ MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */
+ MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */
};
struct mad_header {
- enum mad_layer layer; /* audio layer (1, 2, or 3) */
- enum mad_mode mode; /* channel mode (see above) */
- int mode_extension; /* additional mode info */
- enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
+ enum mad_layer layer; /* audio layer (1, 2, or 3) */
+ enum mad_mode mode; /* channel mode (see above) */
+ int mode_extension; /* additional mode info */
+ enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
- unsigned long bitrate; /* stream bitrate (bps) */
- unsigned int samplerate; /* sampling frequency (Hz) */
+ unsigned long bitrate; /* stream bitrate (bps) */
+ unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned short crc_check; /* frame CRC accumulator */
- unsigned short crc_target; /* final target CRC checksum */
+ unsigned short crc_check; /* frame CRC accumulator */
+ unsigned short crc_target; /* final target CRC checksum */
- int flags; /* flags (see below) */
- int private_bits; /* private bits (see below) */
+ int flags; /* flags (see below) */
+ int private_bits; /* private bits (see below) */
- mad_timer_t duration; /* audio playing time of frame */
+ mad_timer_t duration; /* audio playing time of frame */
};
struct mad_frame {
- struct mad_header header; /* MPEG audio header */
- int options; /* decoding options (from stream) */
+ struct mad_header header; /* MPEG audio header */
+ int options; /* decoding options (from stream) */
mad_fixed_t (*sbsample)[2][36][32]; /* synthesis subband filter samples */
mad_fixed_t (*sbsample_prev)[2][36][32]; /* synthesis subband filter samples
@@ -787,33 +787,33 @@ struct mad_frame {
mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */
};
-# define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1)
+# define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1)
# define MAD_NSBSAMPLES(header) \
((header)->layer == MAD_LAYER_I ? 12 : \
(((header)->layer == MAD_LAYER_III && \
((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36))
enum {
- MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
- MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
+ MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
+ MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
- MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
- MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
- MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
- MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
+ MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
+ MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
+ MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
+ MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
- MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
- MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
- MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
+ MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
+ MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
+ MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
- MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
- MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
- MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
+ MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
+ MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
+ MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
};
enum {
- MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
- MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
+ MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
+ MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
};
void mad_header_init(struct mad_header *);
@@ -838,19 +838,19 @@ void mad_frame_mute(struct mad_frame *);
struct mad_pcm {
- unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned short channels; /* number of channels */
- unsigned short length; /* number of samples per channel */
- mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */
+ unsigned int samplerate; /* sampling frequency (Hz) */
+ unsigned short channels; /* number of channels */
+ unsigned short length; /* number of samples per channel */
+ mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */
};
struct mad_synth {
mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */
- /* [ch][eo][peo][s][v] */
+ /* [ch][eo][peo][s][v] */
- unsigned int phase; /* current processing phase */
+ unsigned int phase; /* current processing phase */
- struct mad_pcm pcm; /* PCM output */
+ struct mad_pcm pcm; /* PCM output */
};
/* single channel PCM selector */
@@ -920,26 +920,26 @@ struct mad_decoder {
enum mad_flow (*input_func)(void *, struct mad_stream *);
enum mad_flow (*header_func)(void *, struct mad_header const *);
enum mad_flow (*filter_func)(void *,
- struct mad_stream const *, struct mad_frame *);
+ struct mad_stream const *, struct mad_frame *);
enum mad_flow (*output_func)(void *,
- struct mad_header const *, struct mad_pcm *);
+ struct mad_header const *, struct mad_pcm *);
enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *);
enum mad_flow (*message_func)(void *, void *, unsigned int *);
};
void mad_decoder_init(struct mad_decoder *, void *,
- enum mad_flow (*)(void *, struct mad_stream *),
- enum mad_flow (*)(void *, struct mad_header const *),
- enum mad_flow (*)(void *,
- struct mad_stream const *,
- struct mad_frame *),
- enum mad_flow (*)(void *,
- struct mad_header const *,
- struct mad_pcm *),
- enum mad_flow (*)(void *,
- struct mad_stream *,
- struct mad_frame *),
- enum mad_flow (*)(void *, void *, unsigned int *));
+ enum mad_flow (*)(void *, struct mad_stream *),
+ enum mad_flow (*)(void *, struct mad_header const *),
+ enum mad_flow (*)(void *,
+ struct mad_stream const *,
+ struct mad_frame *),
+ enum mad_flow (*)(void *,
+ struct mad_header const *,
+ struct mad_pcm *),
+ enum mad_flow (*)(void *,
+ struct mad_stream *,
+ struct mad_frame *),
+ enum mad_flow (*)(void *, void *, unsigned int *));
int mad_decoder_finish(struct mad_decoder *);
# define mad_decoder_options(decoder, opts) \
diff --git a/apps/codecs/libmad/minimad.c b/apps/codecs/libmad/minimad.c
index 6b443cf..7a23b34 100644
--- a/apps/codecs/libmad/minimad.c
+++ b/apps/codecs/libmad/minimad.c
@@ -82,7 +82,7 @@ struct buffer {
static
enum mad_flow input(void *data,
- struct mad_stream *stream)
+ struct mad_stream *stream)
{
struct buffer *buffer = data;
@@ -128,8 +128,8 @@ signed int scale(mad_fixed_t sample)
static
enum mad_flow output(void *data,
- struct mad_header const *header,
- struct mad_pcm *pcm)
+ struct mad_header const *header,
+ struct mad_pcm *pcm)
{
unsigned int nchannels, nsamples;
mad_fixed_t const *left_ch, *right_ch;
@@ -169,14 +169,14 @@ enum mad_flow output(void *data,
static
enum mad_flow error(void *data,
- struct mad_stream *stream,
- struct mad_frame *frame)
+ struct mad_stream *stream,
+ struct mad_frame *frame)
{
struct buffer *buffer = data;
fprintf(stderr, "decoding error 0x%04x (%s) at byte offset %u\n",
- stream->error, mad_stream_errorstr(stream),
- stream->this_frame - buffer->start);
+ stream->error, mad_stream_errorstr(stream),
+ stream->this_frame - buffer->start);
/* return MAD_FLOW_BREAK here to stop decoding (and propagate an error) */
@@ -207,8 +207,8 @@ int decode(unsigned char const *start, unsigned long length)
/* configure input, output, and error functions */
mad_decoder_init(&decoder, &buffer,
- input, 0 /* header */, 0 /* filter */, output,
- error, 0 /* message */);
+ input, 0 /* header */, 0 /* filter */, output,
+ error, 0 /* message */);
/* start decoding */
diff --git a/apps/codecs/libmad/stream.c b/apps/codecs/libmad/stream.c
index 2936736..adc9826 100644
--- a/apps/codecs/libmad/stream.c
+++ b/apps/codecs/libmad/stream.c
@@ -29,7 +29,7 @@
# include "stream.h"
/*
- * NAME: stream->init()
+ * NAME: stream->init()
* DESCRIPTION: initialize stream struct
*/
void mad_stream_init(struct mad_stream *stream)
@@ -56,7 +56,7 @@ void mad_stream_init(struct mad_stream *stream)
}
/*
- * NAME: stream->finish()
+ * NAME: stream->finish()
* DESCRIPTION: deallocate any dynamic memory associated with stream
*/
void mad_stream_finish(struct mad_stream *stream)
@@ -71,11 +71,11 @@ void mad_stream_finish(struct mad_stream *stream)
}
/*
- * NAME: stream->buffer()
+ * NAME: stream->buffer()
* DESCRIPTION: set stream buffer pointers
*/
void mad_stream_buffer(struct mad_stream *stream,
- unsigned char const *buffer, unsigned long length)
+ unsigned char const *buffer, unsigned long length)
{
stream->buffer = buffer;
stream->bufend = buffer + length;
@@ -89,7 +89,7 @@ void mad_stream_buffer(struct mad_stream *stream,
}
/*
- * NAME: stream->skip()
+ * NAME: stream->skip()
* DESCRIPTION: arrange to skip bytes before the next frame
*/
void mad_stream_skip(struct mad_stream *stream, unsigned long length)
@@ -98,7 +98,7 @@ void mad_stream_skip(struct mad_stream *stream, unsigned long length)
}
/*
- * NAME: stream->sync()
+ * NAME: stream->sync()
* DESCRIPTION: locate the next stream sync word
*/
int mad_stream_sync(struct mad_stream *stream)
@@ -109,7 +109,7 @@ int mad_stream_sync(struct mad_stream *stream)
end = stream->bufend;
while (ptr < end - 1 &&
- !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0))
+ !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0))
++ptr;
if (end - ptr < MAD_BUFFER_GUARD)
@@ -121,38 +121,38 @@ int mad_stream_sync(struct mad_stream *stream)
}
/*
- * NAME: stream->errorstr()
+ * NAME: stream->errorstr()
* DESCRIPTION: return a string description of the current error condition
*/
char const *mad_stream_errorstr(struct mad_stream const *stream)
{
switch (stream->error) {
- case MAD_ERROR_NONE: return "no error";
+ case MAD_ERROR_NONE: return "no error";
- case MAD_ERROR_BUFLEN: return "input buffer too small (or EOF)";
- case MAD_ERROR_BUFPTR: return "invalid (null) buffer pointer";
+ case MAD_ERROR_BUFLEN: return "input buffer too small (or EOF)";
+ case MAD_ERROR_BUFPTR: return "invalid (null) buffer pointer";
- case MAD_ERROR_NOMEM: return "not enough memory";
+ case MAD_ERROR_NOMEM: return "not enough memory";
- case MAD_ERROR_LOSTSYNC: return "lost synchronization";
- case MAD_ERROR_BADLAYER: return "reserved header layer value";
+ case MAD_ERROR_LOSTSYNC: return "lost synchronization";
+ case MAD_ERROR_BADLAYER: return "reserved header layer value";
case MAD_ERROR_BADBITRATE: return "forbidden bitrate value";
case MAD_ERROR_BADSAMPLERATE: return "reserved sample frequency value";
case MAD_ERROR_BADEMPHASIS: return "reserved emphasis value";
- case MAD_ERROR_BADCRC: return "CRC check failed";
+ case MAD_ERROR_BADCRC: return "CRC check failed";
case MAD_ERROR_BADBITALLOC: return "forbidden bit allocation value";
case MAD_ERROR_BADSCALEFACTOR: return "bad scalefactor index";
- case MAD_ERROR_BADMODE: return "bad bitrate/mode combination";
+ case MAD_ERROR_BADMODE: return "bad bitrate/mode combination";
case MAD_ERROR_BADFRAMELEN: return "bad frame length";
case MAD_ERROR_BADBIGVALUES: return "bad big_values count";
case MAD_ERROR_BADBLOCKTYPE: return "reserved block_type";
- case MAD_ERROR_BADSCFSI: return "bad scalefactor selection info";
+ case MAD_ERROR_BADSCFSI: return "bad scalefactor selection info";
case MAD_ERROR_BADDATAPTR: return "bad main_data_begin pointer";
case MAD_ERROR_BADPART3LEN: return "bad audio data length";
case MAD_ERROR_BADHUFFTABLE: return "bad Huffman table select";
case MAD_ERROR_BADHUFFDATA: return "Huffman data overrun";
- case MAD_ERROR_BADSTEREO: return "incompatible block_type for JS";
+ case MAD_ERROR_BADSTEREO: return "incompatible block_type for JS";
}
return 0;
diff --git a/apps/codecs/libmad/stream.h b/apps/codecs/libmad/stream.h
index c89c40e..be48edb 100644
--- a/apps/codecs/libmad/stream.h
+++ b/apps/codecs/libmad/stream.h
@@ -24,16 +24,16 @@
# include "bit.h"
-# define MAD_BUFFER_GUARD 8
-# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
+# define MAD_BUFFER_GUARD 8
+# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
enum mad_error {
- MAD_ERROR_NONE = 0x0000, /* no error */
+ MAD_ERROR_NONE = 0x0000, /* no error */
- MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
- MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */
+ MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
+ MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */
- MAD_ERROR_NOMEM = 0x0031, /* not enough memory */
+ MAD_ERROR_NOMEM = 0x0031, /* not enough memory */
MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */
MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */
@@ -41,7 +41,7 @@ enum mad_error {
MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */
MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */
- MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */
+ MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */
MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */
MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */
MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */
@@ -53,32 +53,32 @@ enum mad_error {
MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */
MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */
MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */
- MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */
+ MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */
};
# define MAD_RECOVERABLE(error) ((error) & 0xff00)
struct mad_stream {
- unsigned char const *buffer; /* input bitstream buffer */
- unsigned char const *bufend; /* end of buffer */
- unsigned long skiplen; /* bytes to skip before next frame */
+ unsigned char const *buffer; /* input bitstream buffer */
+ unsigned char const *bufend; /* end of buffer */
+ unsigned long skiplen; /* bytes to skip before next frame */
- int sync; /* stream sync found */
- unsigned long freerate; /* free bitrate (fixed) */
+ int sync; /* stream sync found */
+ unsigned long freerate; /* free bitrate (fixed) */
- unsigned char const *this_frame; /* start of current frame */
- unsigned char const *next_frame; /* start of next frame */
- struct mad_bitptr ptr; /* current processing bit pointer */
+ unsigned char const *this_frame; /* start of current frame */
+ unsigned char const *next_frame; /* start of next frame */
+ struct mad_bitptr ptr; /* current processing bit pointer */
- struct mad_bitptr anc_ptr; /* ancillary bits pointer */
- unsigned int anc_bitlen; /* number of ancillary bits */
+ struct mad_bitptr anc_ptr; /* ancillary bits pointer */
+ unsigned int anc_bitlen; /* number of ancillary bits */
unsigned char (*main_data)[MAD_BUFFER_MDLEN];
- /* Layer III main_data() */
- unsigned int md_len; /* bytes in main_data */
+ /* Layer III main_data() */
+ unsigned int md_len; /* bytes in main_data */
- int options; /* decoding options (see below) */
- enum mad_error error; /* error code (see above) */
+ int options; /* decoding options (see below) */
+ enum mad_error error; /* error code (see above) */
};
enum {
@@ -98,7 +98,7 @@ void mad_stream_finish(struct mad_stream *);
((void) ((stream)->options = (opts)))
void mad_stream_buffer(struct mad_stream *,
- unsigned char const *, unsigned long);
+ unsigned char const *, unsigned long);
void mad_stream_skip(struct mad_stream *, unsigned long);
int mad_stream_sync(struct mad_stream *);
diff --git a/apps/codecs/libmad/synth.c b/apps/codecs/libmad/synth.c
index 9b320b5..9d1bdb7 100644
--- a/apps/codecs/libmad/synth.c
+++ b/apps/codecs/libmad/synth.c
@@ -30,7 +30,7 @@
# include "synth.h"
/*
- * NAME: synth->init()
+ * NAME: synth->init()
* DESCRIPTION: initialize synth struct
*/
void mad_synth_init(struct mad_synth *synth)
@@ -50,7 +50,7 @@ void mad_synth_init(struct mad_synth *synth)
}
/*
- * NAME: synth->mute()
+ * NAME: synth->mute()
* DESCRIPTION: zero all polyphase filterbank values, resetting synthesis
*/
void mad_synth_mute(struct mad_synth *synth)
@@ -60,8 +60,8 @@ void mad_synth_mute(struct mad_synth *synth)
for (ch = 0; ch < 2; ++ch) {
for (s = 0; s < 16; ++s) {
for (v = 0; v < 8; ++v) {
- synth->filter[ch][0][0][s][v] = synth->filter[ch][0][1][s][v] =
- synth->filter[ch][1][0][s][v] = synth->filter[ch][1][1][s][v] = 0;
+ synth->filter[ch][0][0][s][v] = synth->filter[ch][0][1][s][v] =
+ synth->filter[ch][1][0][s][v] = synth->filter[ch][1][1][s][v] = 0;
}
}
}
@@ -142,12 +142,12 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
# endif
/*
- * NAME: dct32()
+ * NAME: dct32()
* DESCRIPTION: perform fast in[32]->out[32] DCT
*/
static
void dct32(mad_fixed_t const in[32], unsigned int slot,
- mad_fixed_t lo[16][8], mad_fixed_t hi[16][8])
+ mad_fixed_t lo[16][8], mad_fixed_t hi[16][8])
{
mad_fixed_t t0, t1, t2, t3, t4, t5, t6, t7;
mad_fixed_t t8, t9, t10, t11, t12, t13, t14, t15;
@@ -176,69 +176,69 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
/* costab[i] = cos(PI / (2 * 32) * i) */
# if defined(OPT_DCTO)
-# define costab1 MAD_F(0x7fd8878e)
-# define costab2 MAD_F(0x7f62368f)
-# define costab3 MAD_F(0x7e9d55fc)
-# define costab4 MAD_F(0x7d8a5f40)
-# define costab5 MAD_F(0x7c29fbee)
-# define costab6 MAD_F(0x7a7d055b)
-# define costab7 MAD_F(0x78848414)
-# define costab8 MAD_F(0x7641af3d)
-# define costab9 MAD_F(0x73b5ebd1)
-# define costab10 MAD_F(0x70e2cbc6)
-# define costab11 MAD_F(0x6dca0d14)
-# define costab12 MAD_F(0x6a5d98a4)
-# define costab13 MAD_F(0x66cf8120)
-# define costab14 MAD_F(0x62f201ac)
-# define costab15 MAD_F(0x5ed77c8a)
-# define costab16 MAD_F(0x5a82799a)
-# define costab17 MAD_F(0x55f5a4d2)
-# define costab18 MAD_F(0x5133cc94)
-# define costab19 MAD_F(0x4c3fdff4)
-# define costab20 MAD_F(0x471cece7)
-# define costab21 MAD_F(0x41ce1e65)
-# define costab22 MAD_F(0x3c56ba70)
-# define costab23 MAD_F(0x36ba2014)
-# define costab24 MAD_F(0x30fbc54d)
-# define costab25 MAD_F(0x2b1f34eb)
-# define costab26 MAD_F(0x25280c5e)
-# define costab27 MAD_F(0x1f19f97b)
-# define costab28 MAD_F(0x18f8b83c)
-# define costab29 MAD_F(0x12c8106f)
-# define costab30 MAD_F(0x0c8bd35e)
-# define costab31 MAD_F(0x0647d97c)
+# define costab1 MAD_F(0x7fd8878e)
+# define costab2 MAD_F(0x7f62368f)
+# define costab3 MAD_F(0x7e9d55fc)
+# define costab4 MAD_F(0x7d8a5f40)
+# define costab5 MAD_F(0x7c29fbee)
+# define costab6 MAD_F(0x7a7d055b)
+# define costab7 MAD_F(0x78848414)
+# define costab8 MAD_F(0x7641af3d)
+# define costab9 MAD_F(0x73b5ebd1)
+# define costab10 MAD_F(0x70e2cbc6)
+# define costab11 MAD_F(0x6dca0d14)
+# define costab12 MAD_F(0x6a5d98a4)
+# define costab13 MAD_F(0x66cf8120)
+# define costab14 MAD_F(0x62f201ac)
+# define costab15 MAD_F(0x5ed77c8a)
+# define costab16 MAD_F(0x5a82799a)
+# define costab17 MAD_F(0x55f5a4d2)
+# define costab18 MAD_F(0x5133cc94)
+# define costab19 MAD_F(0x4c3fdff4)
+# define costab20 MAD_F(0x471cece7)
+# define costab21 MAD_F(0x41ce1e65)
+# define costab22 MAD_F(0x3c56ba70)
+# define costab23 MAD_F(0x36ba2014)
+# define costab24 MAD_F(0x30fbc54d)
+# define costab25 MAD_F(0x2b1f34eb)
+# define costab26 MAD_F(0x25280c5e)
+# define costab27 MAD_F(0x1f19f97b)
+# define costab28 MAD_F(0x18f8b83c)
+# define costab29 MAD_F(0x12c8106f)
+# define costab30 MAD_F(0x0c8bd35e)
+# define costab31 MAD_F(0x0647d97c)
# else
-# define costab1 MAD_F(0x0ffb10f2) /* 0.998795456 */
-# define costab2 MAD_F(0x0fec46d2) /* 0.995184727 */
-# define costab3 MAD_F(0x0fd3aac0) /* 0.989176510 */
-# define costab4 MAD_F(0x0fb14be8) /* 0.980785280 */
-# define costab5 MAD_F(0x0f853f7e) /* 0.970031253 */
-# define costab6 MAD_F(0x0f4fa0ab) /* 0.956940336 */
-# define costab7 MAD_F(0x0f109082) /* 0.941544065 */
-# define costab8 MAD_F(0x0ec835e8) /* 0.923879533 */
-# define costab9 MAD_F(0x0e76bd7a) /* 0.903989293 */
-# define costab10 MAD_F(0x0e1c5979) /* 0.881921264 */
-# define costab11 MAD_F(0x0db941a3) /* 0.857728610 */
-# define costab12 MAD_F(0x0d4db315) /* 0.831469612 */
-# define costab13 MAD_F(0x0cd9f024) /* 0.803207531 */
-# define costab14 MAD_F(0x0c5e4036) /* 0.773010453 */
-# define costab15 MAD_F(0x0bdaef91) /* 0.740951125 */
-# define costab16 MAD_F(0x0b504f33) /* 0.707106781 */
-# define costab17 MAD_F(0x0abeb49a) /* 0.671558955 */
-# define costab18 MAD_F(0x0a267993) /* 0.634393284 */
-# define costab19 MAD_F(0x0987fbfe) /* 0.595699304 */
-# define costab20 MAD_F(0x08e39d9d) /* 0.555570233 */
-# define costab21 MAD_F(0x0839c3cd) /* 0.514102744 */
-# define costab22 MAD_F(0x078ad74e) /* 0.471396737 */
-# define costab23 MAD_F(0x06d74402) /* 0.427555093 */
-# define costab24 MAD_F(0x061f78aa) /* 0.382683432 */
-# define costab25 MAD_F(0x0563e69d) /* 0.336889853 */
-# define costab26 MAD_F(0x04a5018c) /* 0.290284677 */
-# define costab27 MAD_F(0x03e33f2f) /* 0.242980180 */
-# define costab28 MAD_F(0x031f1708) /* 0.195090322 */
-# define costab29 MAD_F(0x0259020e) /* 0.146730474 */
-# define costab30 MAD_F(0x01917a5c) /* 0.098017140 */
-# define costab31 MAD_F(0x00c8fb30) /* 0.049067674 */
+# define costab1 MAD_F(0x0ffb10f2) /* 0.998795456 */
+# define costab2 MAD_F(0x0fec46d2) /* 0.995184727 */
+# define costab3 MAD_F(0x0fd3aac0) /* 0.989176510 */
+# define costab4 MAD_F(0x0fb14be8) /* 0.980785280 */
+# define costab5 MAD_F(0x0f853f7e) /* 0.970031253 */
+# define costab6 MAD_F(0x0f4fa0ab) /* 0.956940336 */
+# define costab7 MAD_F(0x0f109082) /* 0.941544065 */
+# define costab8 MAD_F(0x0ec835e8) /* 0.923879533 */
+# define costab9 MAD_F(0x0e76bd7a) /* 0.903989293 */
+# define costab10 MAD_F(0x0e1c5979) /* 0.881921264 */
+# define costab11 MAD_F(0x0db941a3) /* 0.857728610 */
+# define costab12 MAD_F(0x0d4db315) /* 0.831469612 */
+# define costab13 MAD_F(0x0cd9f024) /* 0.803207531 */
+# define costab14 MAD_F(0x0c5e4036) /* 0.773010453 */
+# define costab15 MAD_F(0x0bdaef91) /* 0.740951125 */
+# define costab16 MAD_F(0x0b504f33) /* 0.707106781 */
+# define costab17 MAD_F(0x0abeb49a) /* 0.671558955 */
+# define costab18 MAD_F(0x0a267993) /* 0.634393284 */
+# define costab19 MAD_F(0x0987fbfe) /* 0.595699304 */
+# define costab20 MAD_F(0x08e39d9d) /* 0.555570233 */
+# define costab21 MAD_F(0x0839c3cd) /* 0.514102744 */
+# define costab22 MAD_F(0x078ad74e) /* 0.471396737 */
+# define costab23 MAD_F(0x06d74402) /* 0.427555093 */
+# define costab24 MAD_F(0x061f78aa) /* 0.382683432 */
+# define costab25 MAD_F(0x0563e69d) /* 0.336889853 */
+# define costab26 MAD_F(0x04a5018c) /* 0.290284677 */
+# define costab27 MAD_F(0x03e33f2f) /* 0.242980180 */
+# define costab28 MAD_F(0x031f1708) /* 0.195090322 */
+# define costab29 MAD_F(0x0259020e) /* 0.146730474 */
+# define costab30 MAD_F(0x01917a5c) /* 0.098017140 */
+# define costab31 MAD_F(0x00c8fb30) /* 0.049067674 */
# endif
t0 = in[0] + in[31]; t16 = MUL(in[0] - in[31], costab1);
@@ -395,7 +395,7 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
/* 8 */ hi[ 7][slot] = SHIFT(t143);
/* 24 */ lo[ 8][slot] =
- SHIFT((MUL(t141 - t142, costab16) * 2) - t143);
+ SHIFT((MUL(t141 - t142, costab16) * 2) - t143);
t144 = MUL(t73 - t74, costab8);
t145 = MUL(t75 - t76, costab24);
@@ -435,7 +435,7 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
/* 20 */ lo[ 4][slot] = SHIFT(t160);
/* 28 */ lo[12][slot] =
- SHIFT((((MUL(t157 - t158, costab16) * 2) - t159) * 2) - t160);
+ SHIFT((((MUL(t157 - t158, costab16) * 2) - t159) * 2) - t160);
t161 = MUL(t94 - t95, costab8);
t162 = MUL(t96 - t97, costab24);
@@ -473,8 +473,8 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
/* 26 */ lo[10][slot] = SHIFT(t170);
/* 30 */ lo[14][slot] =
- SHIFT((((((MUL(t166 - t167, costab16) * 2) -
- t168) * 2) - t169) * 2) - t170);
+ SHIFT((((((MUL(t166 - t167, costab16) * 2) -
+ t168) * 2) - t169) * 2) - t170);
t171 = MUL(t106 - t107, costab8);
t172 = MUL(t108 - t109, costab24);
@@ -521,12 +521,12 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
/* 27 */ lo[11][slot] = SHIFT(t165);
t176 = (((((MUL(t161 - t162, costab16) * 2) -
- t163) * 2) - t164) * 2) - t165;
+ t163) * 2) - t164) * 2) - t165;
/* 29 */ lo[13][slot] = SHIFT(t176);
/* 31 */ lo[15][slot] =
- SHIFT((((((((MUL(t171 - t172, costab16) * 2) -
- t173) * 2) - t174) * 2) - t175) * 2) - t176);
+ SHIFT((((((((MUL(t171 - t172, costab16) * 2) -
+ t173) * 2) - t174) * 2) - t175) * 2) - t176);
/*
* Totals:
@@ -548,24 +548,24 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
# if MAD_F_FRACBITS != 28
# error "MAD_F_FRACBITS must be 28 to use OPT_SSO"
# endif
-# define ML0(hi, lo, x, y) ((lo) = (x) * (y))
-# define MLA(hi, lo, x, y) ((lo) += (x) * (y))
-# define MLN(hi, lo) ((lo) = -(lo))
-# define MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
-# define SHIFT(x) ((x) >> 2)
-# define PRESHIFT(x) ((MAD_F(x) + (1L << 13)) >> 14)
+# define ML0(hi, lo, x, y) ((lo) = (x) * (y))
+# define MLA(hi, lo, x, y) ((lo) += (x) * (y))
+# define MLN(hi, lo) ((lo) = -(lo))
+# define MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
+# define SHIFT(x) ((x) >> 2)
+# define PRESHIFT(x) ((MAD_F(x) + (1L << 13)) >> 14)
# else
-# define ML0(hi, lo, x, y) MAD_F_ML0((hi), (lo), (x), (y))
-# define MLA(hi, lo, x, y) MAD_F_MLA((hi), (lo), (x), (y))
-# define MLN(hi, lo) MAD_F_MLN((hi), (lo))
-# define MLZ(hi, lo) MAD_F_MLZ((hi), (lo))
-# define SHIFT(x) (x)
+# define ML0(hi, lo, x, y) MAD_F_ML0((hi), (lo), (x), (y))
+# define MLA(hi, lo, x, y) MAD_F_MLA((hi), (lo), (x), (y))
+# define MLN(hi, lo) MAD_F_MLN((hi), (lo))
+# define MLZ(hi, lo) MAD_F_MLZ((hi), (lo))
+# define SHIFT(x) (x)
# if defined(MAD_F_SCALEBITS)
# undef MAD_F_SCALEBITS
-# define MAD_F_SCALEBITS (MAD_F_FRACBITS - 12)
-# define PRESHIFT(x) (MAD_F(x) >> 12)
+# define MAD_F_SCALEBITS (MAD_F_FRACBITS - 12)
+# define PRESHIFT(x) (MAD_F(x) >> 12)
# else
-# define PRESHIFT(x) MAD_F(x)
+# define PRESHIFT(x) MAD_F(x)
# endif
# endif
@@ -576,10 +576,10 @@ mad_fixed_t const D[17][32] ICONST_ATTR = {
# if defined(ASO_SYNTH)
void synth_full(struct mad_synth *, struct mad_frame const *,
- unsigned int, unsigned int);
+ unsigned int, unsigned int);
# else
/*
- * NAME: synth->full()
+ * NAME: synth->full()
* DESCRIPTION: perform full frequency PCM synthesis
*/
@@ -587,7 +587,7 @@ void synth_full(struct mad_synth *, struct mad_frame const *,
# ifdef FPM_COLDFIRE_EMAC
static
void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns)
+ unsigned int nch, unsigned int ns)
{
int sb;
unsigned int phase, ch, s, p;
@@ -606,7 +606,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
for (s = 0; s < ns; ++s) {
dct32((*sbsample)[s], phase >> 1,
- (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
+ (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
p = (phase - 1) & 0xf;
@@ -649,11 +649,11 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
pcm += 16;
for (sb = 15; sb; sb--, fo++) {
- ++fe;
- ++D0ptr;
- ++D1ptr;
+ ++fe;
+ ++D0ptr;
+ ++D1ptr;
- /* D[32 - sb][i] == -D[sb][31 - i] */
+ /* D[32 - sb][i] == -D[sb][31 - i] */
asm volatile (
"movem.l (%0), %%d0-%%d7\n\t"
"move.l 4(%2), %%a5\n\t"
@@ -697,8 +697,8 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
"movclr.l %%acc0, %0\n\t"
"movclr.l %%acc1, %1\n\t" : "=d" (hi0), "=d" (hi1) );
- pcm[-sb] = hi0 << 3;
- pcm[ sb] = hi1 << 3;
+ pcm[-sb] = hi0 << 3;
+ pcm[ sb] = hi1 << 3;
}
++D0ptr;
@@ -750,11 +750,11 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
pcm += 16;
for (sb = 15; sb; sb--, fo++) {
- ++fe;
- ++D0ptr;
- ++D1ptr;
+ ++fe;
+ ++D0ptr;
+ ++D1ptr;
- /* D[32 - sb][i] == -D[sb][31 - i] */
+ /* D[32 - sb][i] == -D[sb][31 - i] */
asm volatile (
"movem.l (%0), %%d0-%%d7\n\t"
"move.l (%2), %%a5\n\t"
@@ -798,8 +798,8 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
"movclr.l %%acc0, %0\n\t"
"movclr.l %%acc1, %1\n\t" : "=d" (hi0), "=d" (hi1) );
- pcm[-sb] = hi0 << 3;
- pcm[ sb] = hi1 << 3;
+ pcm[-sb] = hi0 << 3;
+ pcm[ sb] = hi1 << 3;
}
++D0ptr;
@@ -1045,10 +1045,10 @@ void synth_full2(mad_fixed_t *pcm, mad_fixed_t (*fo)[8], mad_fixed_t (*fe)[8],
static
void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns) ICODE_ATTR_MPA_SYNTH;
+ unsigned int nch, unsigned int ns) ICODE_ATTR_MPA_SYNTH;
static
void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns)
+ unsigned int nch, unsigned int ns)
{
int p;
unsigned int phase, ch, s;
@@ -1068,7 +1068,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
for (s = 0; s < ns; ++s) {
dct32((*sbsample)[s], phase >> 1,
- (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
+ (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
p = (phase - 1) & 0xf;
@@ -1189,7 +1189,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
static
void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns)
+ unsigned int nch, unsigned int ns)
{
int p, sb;
unsigned int phase, ch, s;
@@ -1209,7 +1209,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
for (s = 0; s < ns; ++s) {
dct32((*sbsample)[s], phase >> 1,
- (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
+ (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
p = (phase - 1) & 0xf;
@@ -1246,49 +1246,49 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
for (sb = 15; sb; sb--, fo++)
{
- ++fe;
- ++D0ptr;
- ++D1ptr;
-
- /* D[32 - sb][i] == -D[sb][31 - i] */
- ptr = *D0ptr;
- ML0(hi, lo, (*fo)[0], ptr[ 1]);
- MLA(hi, lo, (*fo)[1], ptr[15]);
- MLA(hi, lo, (*fo)[2], ptr[13]);
- MLA(hi, lo, (*fo)[3], ptr[11]);
- MLA(hi, lo, (*fo)[4], ptr[ 9]);
- MLA(hi, lo, (*fo)[5], ptr[ 7]);
- MLA(hi, lo, (*fo)[6], ptr[ 5]);
- MLA(hi, lo, (*fo)[7], ptr[ 3]);
- MLN(hi, lo);
- MLA(hi, lo, (*fe)[7], ptr[ 2]);
- MLA(hi, lo, (*fe)[6], ptr[ 4]);
- MLA(hi, lo, (*fe)[5], ptr[ 6]);
- MLA(hi, lo, (*fe)[4], ptr[ 8]);
- MLA(hi, lo, (*fe)[3], ptr[10]);
- MLA(hi, lo, (*fe)[2], ptr[12]);
- MLA(hi, lo, (*fe)[1], ptr[14]);
- MLA(hi, lo, (*fe)[0], ptr[ 0]);
- pcm[-sb] = SHIFT(MLZ(hi, lo));
-
- ptr = *D1ptr;
- ML0(hi, lo, (*fe)[0], ptr[31 - 16]);
- MLA(hi, lo, (*fe)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fe)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fe)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fe)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fe)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fe)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fe)[7], ptr[31 - 2]);
+ ++fe;
+ ++D0ptr;
+ ++D1ptr;
+
+ /* D[32 - sb][i] == -D[sb][31 - i] */
+ ptr = *D0ptr;
+ ML0(hi, lo, (*fo)[0], ptr[ 1]);
+ MLA(hi, lo, (*fo)[1], ptr[15]);
+ MLA(hi, lo, (*fo)[2], ptr[13]);
+ MLA(hi, lo, (*fo)[3], ptr[11]);
+ MLA(hi, lo, (*fo)[4], ptr[ 9]);
+ MLA(hi, lo, (*fo)[5], ptr[ 7]);
+ MLA(hi, lo, (*fo)[6], ptr[ 5]);
+ MLA(hi, lo, (*fo)[7], ptr[ 3]);
+ MLN(hi, lo);
+ MLA(hi, lo, (*fe)[7], ptr[ 2]);
+ MLA(hi, lo, (*fe)[6], ptr[ 4]);
+ MLA(hi, lo, (*fe)[5], ptr[ 6]);
+ MLA(hi, lo, (*fe)[4], ptr[ 8]);
+ MLA(hi, lo, (*fe)[3], ptr[10]);
+ MLA(hi, lo, (*fe)[2], ptr[12]);
+ MLA(hi, lo, (*fe)[1], ptr[14]);
+ MLA(hi, lo, (*fe)[0], ptr[ 0]);
+ pcm[-sb] = SHIFT(MLZ(hi, lo));
+
+ ptr = *D1ptr;
+ ML0(hi, lo, (*fe)[0], ptr[31 - 16]);
+ MLA(hi, lo, (*fe)[1], ptr[31 - 14]);
+ MLA(hi, lo, (*fe)[2], ptr[31 - 12]);
+ MLA(hi, lo, (*fe)[3], ptr[31 - 10]);
+ MLA(hi, lo, (*fe)[4], ptr[31 - 8]);
+ MLA(hi, lo, (*fe)[5], ptr[31 - 6]);
+ MLA(hi, lo, (*fe)[6], ptr[31 - 4]);
+ MLA(hi, lo, (*fe)[7], ptr[31 - 2]);
MLA(hi, lo, (*fo)[7], ptr[31 - 3]);
- MLA(hi, lo, (*fo)[6], ptr[31 - 5]);
- MLA(hi, lo, (*fo)[5], ptr[31 - 7]);
- MLA(hi, lo, (*fo)[4], ptr[31 - 9]);
- MLA(hi, lo, (*fo)[3], ptr[31 - 11]);
- MLA(hi, lo, (*fo)[2], ptr[31 - 13]);
- MLA(hi, lo, (*fo)[1], ptr[31 - 15]);
- MLA(hi, lo, (*fo)[0], ptr[31 - 1]);
- pcm[sb] = SHIFT(MLZ(hi, lo));
+ MLA(hi, lo, (*fo)[6], ptr[31 - 5]);
+ MLA(hi, lo, (*fo)[5], ptr[31 - 7]);
+ MLA(hi, lo, (*fo)[4], ptr[31 - 9]);
+ MLA(hi, lo, (*fo)[3], ptr[31 - 11]);
+ MLA(hi, lo, (*fo)[2], ptr[31 - 13]);
+ MLA(hi, lo, (*fo)[1], ptr[31 - 15]);
+ MLA(hi, lo, (*fo)[0], ptr[31 - 1]);
+ pcm[sb] = SHIFT(MLZ(hi, lo));
}
ptr = *(D0ptr + 1);
@@ -1327,49 +1327,49 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
for (sb = 15; sb; sb--, fo++)
{
- ++fe;
- ++D0ptr;
- ++D1ptr;
-
- /* D[32 - sb][i] == -D[sb][31 - i] */
- ptr = *D0ptr;
- ML0(hi, lo, (*fo)[0], ptr[ 0]);
- MLA(hi, lo, (*fo)[1], ptr[14]);
- MLA(hi, lo, (*fo)[2], ptr[12]);
- MLA(hi, lo, (*fo)[3], ptr[10]);
- MLA(hi, lo, (*fo)[4], ptr[ 8]);
- MLA(hi, lo, (*fo)[5], ptr[ 6]);
- MLA(hi, lo, (*fo)[6], ptr[ 4]);
- MLA(hi, lo, (*fo)[7], ptr[ 2]);
- MLN(hi, lo);
- MLA(hi, lo, (*fe)[7], ptr[ 3]);
- MLA(hi, lo, (*fe)[6], ptr[ 5]);
- MLA(hi, lo, (*fe)[5], ptr[ 7]);
- MLA(hi, lo, (*fe)[4], ptr[ 9]);
- MLA(hi, lo, (*fe)[3], ptr[11]);
- MLA(hi, lo, (*fe)[2], ptr[13]);
- MLA(hi, lo, (*fe)[1], ptr[15]);
- MLA(hi, lo, (*fe)[0], ptr[ 1]);
- pcm[-sb] = SHIFT(MLZ(hi, lo));
-
- ptr = *D1ptr;
- ML0(hi, lo, (*fe)[0], ptr[31 - 1]);
- MLA(hi, lo, (*fe)[1], ptr[31 - 15]);
- MLA(hi, lo, (*fe)[2], ptr[31 - 13]);
- MLA(hi, lo, (*fe)[3], ptr[31 - 11]);
- MLA(hi, lo, (*fe)[4], ptr[31 - 9]);
- MLA(hi, lo, (*fe)[5], ptr[31 - 7]);
- MLA(hi, lo, (*fe)[6], ptr[31 - 5]);
- MLA(hi, lo, (*fe)[7], ptr[31 - 3]);
- MLA(hi, lo, (*fo)[7], ptr[31 - 2]);
- MLA(hi, lo, (*fo)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fo)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fo)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fo)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fo)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fo)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fo)[0], ptr[31 - 16]);
- pcm[sb] = SHIFT(MLZ(hi, lo));
+ ++fe;
+ ++D0ptr;
+ ++D1ptr;
+
+ /* D[32 - sb][i] == -D[sb][31 - i] */
+ ptr = *D0ptr;
+ ML0(hi, lo, (*fo)[0], ptr[ 0]);
+ MLA(hi, lo, (*fo)[1], ptr[14]);
+ MLA(hi, lo, (*fo)[2], ptr[12]);
+ MLA(hi, lo, (*fo)[3], ptr[10]);
+ MLA(hi, lo, (*fo)[4], ptr[ 8]);
+ MLA(hi, lo, (*fo)[5], ptr[ 6]);
+ MLA(hi, lo, (*fo)[6], ptr[ 4]);
+ MLA(hi, lo, (*fo)[7], ptr[ 2]);
+ MLN(hi, lo);
+ MLA(hi, lo, (*fe)[7], ptr[ 3]);
+ MLA(hi, lo, (*fe)[6], ptr[ 5]);
+ MLA(hi, lo, (*fe)[5], ptr[ 7]);
+ MLA(hi, lo, (*fe)[4], ptr[ 9]);
+ MLA(hi, lo, (*fe)[3], ptr[11]);
+ MLA(hi, lo, (*fe)[2], ptr[13]);
+ MLA(hi, lo, (*fe)[1], ptr[15]);
+ MLA(hi, lo, (*fe)[0], ptr[ 1]);
+ pcm[-sb] = SHIFT(MLZ(hi, lo));
+
+ ptr = *D1ptr;
+ ML0(hi, lo, (*fe)[0], ptr[31 - 1]);
+ MLA(hi, lo, (*fe)[1], ptr[31 - 15]);
+ MLA(hi, lo, (*fe)[2], ptr[31 - 13]);
+ MLA(hi, lo, (*fe)[3], ptr[31 - 11]);
+ MLA(hi, lo, (*fe)[4], ptr[31 - 9]);
+ MLA(hi, lo, (*fe)[5], ptr[31 - 7]);
+ MLA(hi, lo, (*fe)[6], ptr[31 - 5]);
+ MLA(hi, lo, (*fe)[7], ptr[31 - 3]);
+ MLA(hi, lo, (*fo)[7], ptr[31 - 2]);
+ MLA(hi, lo, (*fo)[6], ptr[31 - 4]);
+ MLA(hi, lo, (*fo)[5], ptr[31 - 6]);
+ MLA(hi, lo, (*fo)[4], ptr[31 - 8]);
+ MLA(hi, lo, (*fo)[3], ptr[31 - 10]);
+ MLA(hi, lo, (*fo)[2], ptr[31 - 12]);
+ MLA(hi, lo, (*fo)[1], ptr[31 - 14]);
+ MLA(hi, lo, (*fo)[0], ptr[31 - 16]);
+ pcm[sb] = SHIFT(MLZ(hi, lo));
}
ptr = *(D0ptr + 1);
@@ -1394,12 +1394,12 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
# endif
/*
- * NAME: synth->half()
+ * NAME: synth->half()
* DESCRIPTION: perform half frequency PCM synthesis
*/
static
void synth_half(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns)
+ unsigned int nch, unsigned int ns)
{
unsigned int phase, ch, s, sb, pe, po;
mad_fixed_t *pcm1, *pcm2, (*filter)[2][2][16][8];
@@ -1417,7 +1417,7 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame,
for (s = 0; s < ns; ++s) {
dct32((*sbsample)[s], phase >> 1,
- (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
+ (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
pe = phase & ~1;
po = ((phase - 1) & 0xf) | 1;
@@ -1456,59 +1456,59 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame,
pcm2 = pcm1 + 14;
for (sb = 1; sb < 16; ++sb) {
- ++fe;
- ++Dptr;
-
- /* D[32 - sb][i] == -D[sb][31 - i] */
-
- if (!(sb & 1)) {
- ptr = *Dptr + po;
- ML0(hi, lo, (*fo)[0], ptr[ 0]);
- MLA(hi, lo, (*fo)[1], ptr[14]);
- MLA(hi, lo, (*fo)[2], ptr[12]);
- MLA(hi, lo, (*fo)[3], ptr[10]);
- MLA(hi, lo, (*fo)[4], ptr[ 8]);
- MLA(hi, lo, (*fo)[5], ptr[ 6]);
- MLA(hi, lo, (*fo)[6], ptr[ 4]);
- MLA(hi, lo, (*fo)[7], ptr[ 2]);
- MLN(hi, lo);
-
- ptr = *Dptr + pe;
- MLA(hi, lo, (*fe)[7], ptr[ 2]);
- MLA(hi, lo, (*fe)[6], ptr[ 4]);
- MLA(hi, lo, (*fe)[5], ptr[ 6]);
- MLA(hi, lo, (*fe)[4], ptr[ 8]);
- MLA(hi, lo, (*fe)[3], ptr[10]);
- MLA(hi, lo, (*fe)[2], ptr[12]);
- MLA(hi, lo, (*fe)[1], ptr[14]);
- MLA(hi, lo, (*fe)[0], ptr[ 0]);
-
- *pcm1++ = SHIFT(MLZ(hi, lo));
-
- ptr = *Dptr - po;
- ML0(hi, lo, (*fo)[7], ptr[31 - 2]);
- MLA(hi, lo, (*fo)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fo)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fo)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fo)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fo)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fo)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fo)[0], ptr[31 - 16]);
-
- ptr = *Dptr - pe;
- MLA(hi, lo, (*fe)[0], ptr[31 - 16]);
- MLA(hi, lo, (*fe)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fe)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fe)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fe)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fe)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fe)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fe)[7], ptr[31 - 2]);
-
- *pcm2-- = SHIFT(MLZ(hi, lo));
- }
+ ++fe;
+ ++Dptr;
+
+ /* D[32 - sb][i] == -D[sb][31 - i] */
+
+ if (!(sb & 1)) {
+ ptr = *Dptr + po;
+ ML0(hi, lo, (*fo)[0], ptr[ 0]);
+ MLA(hi, lo, (*fo)[1], ptr[14]);
+ MLA(hi, lo, (*fo)[2], ptr[12]);
+ MLA(hi, lo, (*fo)[3], ptr[10]);
+ MLA(hi, lo, (*fo)[4], ptr[ 8]);
+ MLA(hi, lo, (*fo)[5], ptr[ 6]);
+ MLA(hi, lo, (*fo)[6], ptr[ 4]);
+ MLA(hi, lo, (*fo)[7], ptr[ 2]);
+ MLN(hi, lo);
+
+ ptr = *Dptr + pe;
+ MLA(hi, lo, (*fe)[7], ptr[ 2]);
+ MLA(hi, lo, (*fe)[6], ptr[ 4]);
+ MLA(hi, lo, (*fe)[5], ptr[ 6]);
+ MLA(hi, lo, (*fe)[4], ptr[ 8]);
+ MLA(hi, lo, (*fe)[3], ptr[10]);
+ MLA(hi, lo, (*fe)[2], ptr[12]);
+ MLA(hi, lo, (*fe)[1], ptr[14]);
+ MLA(hi, lo, (*fe)[0], ptr[ 0]);
+
+ *pcm1++ = SHIFT(MLZ(hi, lo));
+
+ ptr = *Dptr - po;
+ ML0(hi, lo, (*fo)[7], ptr[31 - 2]);
+ MLA(hi, lo, (*fo)[6], ptr[31 - 4]);
+ MLA(hi, lo, (*fo)[5], ptr[31 - 6]);
+ MLA(hi, lo, (*fo)[4], ptr[31 - 8]);
+ MLA(hi, lo, (*fo)[3], ptr[31 - 10]);
+ MLA(hi, lo, (*fo)[2], ptr[31 - 12]);
+ MLA(hi, lo, (*fo)[1], ptr[31 - 14]);
+ MLA(hi, lo, (*fo)[0], ptr[31 - 16]);
+
+ ptr = *Dptr - pe;
+ MLA(hi, lo, (*fe)[0], ptr[31 - 16]);
+ MLA(hi, lo, (*fe)[1], ptr[31 - 14]);
+ MLA(hi, lo, (*fe)[2], ptr[31 - 12]);
+ MLA(hi, lo, (*fe)[3], ptr[31 - 10]);
+ MLA(hi, lo, (*fe)[4], ptr[31 - 8]);
+ MLA(hi, lo, (*fe)[5], ptr[31 - 6]);
+ MLA(hi, lo, (*fe)[6], ptr[31 - 4]);
+ MLA(hi, lo, (*fe)[7], ptr[31 - 2]);
+
+ *pcm2-- = SHIFT(MLZ(hi, lo));
+ }
- ++fo;
+ ++fo;
}
++Dptr;
@@ -1532,14 +1532,14 @@ void synth_half(struct mad_synth *synth, struct mad_frame const *frame,
}
/*
- * NAME: synth->frame()
+ * NAME: synth->frame()
* DESCRIPTION: perform PCM synthesis of frame subband samples
*/
void mad_synth_frame(struct mad_synth *synth, struct mad_frame const *frame)
{
unsigned int nch, ns;
void (*synth_frame)(struct mad_synth *, struct mad_frame const *,
- unsigned int, unsigned int);
+ unsigned int, unsigned int);
nch = MAD_NCHANNELS(&frame->header);
ns = MAD_NSBSAMPLES(&frame->header);
diff --git a/apps/codecs/libmad/synth.h b/apps/codecs/libmad/synth.h
index 74975b9..4cbcf73 100644
--- a/apps/codecs/libmad/synth.h
+++ b/apps/codecs/libmad/synth.h
@@ -26,19 +26,19 @@
# include "frame.h"
struct mad_pcm {
- unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned short channels; /* number of channels */
- unsigned short length; /* number of samples per channel */
- mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */
+ unsigned int samplerate; /* sampling frequency (Hz) */
+ unsigned short channels; /* number of channels */
+ unsigned short length; /* number of samples per channel */
+ mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */
};
struct mad_synth {
mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */
- /* [ch][eo][peo][s][v] */
+ /* [ch][eo][peo][s][v] */
- unsigned int phase; /* current processing phase */
+ unsigned int phase; /* current processing phase */
- struct mad_pcm pcm; /* PCM output */
+ struct mad_pcm pcm; /* PCM output */
};
/* single channel PCM selector */
diff --git a/apps/codecs/libmad/timer.c b/apps/codecs/libmad/timer.c
index 33ea4a6..a6c6479 100644
--- a/apps/codecs/libmad/timer.c
+++ b/apps/codecs/libmad/timer.c
@@ -36,7 +36,7 @@
mad_timer_t const mad_timer_zero = { 0, 0 };
/*
- * NAME: timer->compare()
+ * NAME: timer->compare()
* DESCRIPTION: indicate relative order of two timers
*/
int mad_timer_compare(mad_timer_t timer1, mad_timer_t timer2)
@@ -59,7 +59,7 @@ int mad_timer_compare(mad_timer_t timer1, mad_timer_t timer2)
}
/*
- * NAME: timer->negate()
+ * NAME: timer->negate()
* DESCRIPTION: invert the sign of a timer
*/
void mad_timer_negate(mad_timer_t *timer)
@@ -73,7 +73,7 @@ void mad_timer_negate(mad_timer_t *timer)
}
/*
- * NAME: timer->abs()
+ * NAME: timer->abs()
* DESCRIPTION: return the absolute value of a timer
*/
mad_timer_t mad_timer_abs(mad_timer_t timer)
@@ -85,7 +85,7 @@ mad_timer_t mad_timer_abs(mad_timer_t timer)
}
/*
- * NAME: reduce_timer()
+ * NAME: reduce_timer()
* DESCRIPTION: carry timer fraction into seconds
*/
static
@@ -96,7 +96,7 @@ void reduce_timer(mad_timer_t *timer)
}
/*
- * NAME: gcd()
+ * NAME: gcd()
* DESCRIPTION: compute greatest common denominator
*/
static
@@ -114,7 +114,7 @@ unsigned long gcd(unsigned long num1, unsigned long num2)
}
/*
- * NAME: reduce_rational()
+ * NAME: reduce_rational()
* DESCRIPTION: convert rational expression to lowest terms
*/
static
@@ -131,12 +131,12 @@ void reduce_rational(unsigned long *numer, unsigned long *denom)
}
/*
- * NAME: scale_rational()
+ * NAME: scale_rational()
* DESCRIPTION: solve numer/denom == ?/scale avoiding overflowing
*/
static
unsigned long scale_rational(unsigned long numer, unsigned long denom,
- unsigned long scale)
+ unsigned long scale)
{
reduce_rational(&numer, &denom);
reduce_rational(&scale, &denom);
@@ -152,11 +152,11 @@ unsigned long scale_rational(unsigned long numer, unsigned long denom,
}
/*
- * NAME: timer->set()
+ * NAME: timer->set()
* DESCRIPTION: set timer to specific (positive) value
*/
void mad_timer_set(mad_timer_t *timer, unsigned long seconds,
- unsigned long numer, unsigned long denom)
+ unsigned long numer, unsigned long denom)
{
timer->seconds = seconds;
if (numer >= denom && denom > 0) {
@@ -224,7 +224,7 @@ void mad_timer_set(mad_timer_t *timer, unsigned long seconds,
}
/*
- * NAME: timer->add()
+ * NAME: timer->add()
* DESCRIPTION: add one timer to another
*/
void mad_timer_add(mad_timer_t *timer, mad_timer_t incr)
@@ -237,7 +237,7 @@ void mad_timer_add(mad_timer_t *timer, mad_timer_t incr)
}
/*
- * NAME: timer->multiply()
+ * NAME: timer->multiply()
* DESCRIPTION: multiply a timer by a scalar value
*/
void mad_timer_multiply(mad_timer_t *timer, signed long scalar)
@@ -264,7 +264,7 @@ void mad_timer_multiply(mad_timer_t *timer, signed long scalar)
}
/*
- * NAME: timer->count()
+ * NAME: timer->count()
* DESCRIPTION: return timer value in selected units
*/
signed long mad_timer_count(mad_timer_t timer, enum mad_units units)
@@ -302,7 +302,7 @@ signed long mad_timer_count(mad_timer_t timer, enum mad_units units)
case MAD_UNITS_75_FPS:
return timer.seconds * (signed long) units +
(signed long) scale_rational(timer.fraction, MAD_TIMER_RESOLUTION,
- units);
+ units);
case MAD_UNITS_23_976_FPS:
case MAD_UNITS_24_975_FPS:
@@ -318,7 +318,7 @@ signed long mad_timer_count(mad_timer_t timer, enum mad_units units)
}
/*
- * NAME: timer->fraction()
+ * NAME: timer->fraction()
* DESCRIPTION: return fractional part of timer in arbitrary terms
*/
unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom)
@@ -339,12 +339,12 @@ unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom)
}
/*
- * NAME: timer->string()
+ * NAME: timer->string()
* DESCRIPTION: write a string representation of a timer using a template
*/
void mad_timer_string(mad_timer_t timer,
- char *dest, char const *format, enum mad_units units,
- enum mad_units fracunits, unsigned long subparts)
+ char *dest, char const *format, enum mad_units units,
+ enum mad_units fracunits, unsigned long subparts)
{
unsigned long hours, minutes, seconds, sub;
unsigned int frac;
@@ -413,7 +413,7 @@ void mad_timer_string(mad_timer_t timer,
m = frame % cycle;
frame += (10 - 1) * 2 * d;
if (m > 2)
- frame += 2 * ((m - 2) / (cycle / 10));
+ frame += 2 * ((m - 2) / (cycle / 10));
frac = frame % -fracunits;
seconds = frame / -fracunits;
@@ -427,25 +427,25 @@ void mad_timer_string(mad_timer_t timer,
hours = minutes / 60;
// sprintf(dest, format,
-// hours,
-// (unsigned int) (minutes % 60),
-// (unsigned int) (seconds % 60),
-// frac, sub);
+// hours,
+// (unsigned int) (minutes % 60),
+// (unsigned int) (seconds % 60),
+// frac, sub);
break;
case MAD_UNITS_MINUTES:
minutes = seconds / 60;
// sprintf(dest, format,
-// minutes,
-// (unsigned int) (seconds % 60),
-// frac, sub);
+// minutes,
+// (unsigned int) (seconds % 60),
+// frac, sub);
break;
case MAD_UNITS_SECONDS:
// sprintf(dest, format,
-// seconds,
-// frac, sub);
+// seconds,
+// frac, sub);
break;
case MAD_UNITS_23_976_FPS:
diff --git a/apps/codecs/libmad/timer.h b/apps/codecs/libmad/timer.h
index 23fdccf..e890c48 100644
--- a/apps/codecs/libmad/timer.h
+++ b/apps/codecs/libmad/timer.h
@@ -23,8 +23,8 @@
# define LIBMAD_TIMER_H
typedef struct {
- signed long seconds; /* whole seconds */
- unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */
+ signed long seconds; /* whole seconds */
+ unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */
} mad_timer_t;
extern mad_timer_t const mad_timer_zero;
@@ -32,9 +32,9 @@ extern mad_timer_t const mad_timer_zero;
# define MAD_TIMER_RESOLUTION 352800000UL
enum mad_units {
- MAD_UNITS_HOURS = -2,
- MAD_UNITS_MINUTES = -1,
- MAD_UNITS_SECONDS = 0,
+ MAD_UNITS_HOURS = -2,
+ MAD_UNITS_MINUTES = -1,
+ MAD_UNITS_SECONDS = 0,
/* metric units */
@@ -44,7 +44,7 @@ enum mad_units {
/* audio sample units */
- MAD_UNITS_8000_HZ = 8000,
+ MAD_UNITS_8000_HZ = 8000,
MAD_UNITS_11025_HZ = 11025,
MAD_UNITS_12000_HZ = 12000,
@@ -58,16 +58,16 @@ enum mad_units {
/* video frame/field units */
- MAD_UNITS_24_FPS = 24,
- MAD_UNITS_25_FPS = 25,
- MAD_UNITS_30_FPS = 30,
- MAD_UNITS_48_FPS = 48,
- MAD_UNITS_50_FPS = 50,
- MAD_UNITS_60_FPS = 60,
+ MAD_UNITS_24_FPS = 24,
+ MAD_UNITS_25_FPS = 25,
+ MAD_UNITS_30_FPS = 30,
+ MAD_UNITS_48_FPS = 48,
+ MAD_UNITS_50_FPS = 50,
+ MAD_UNITS_60_FPS = 60,
/* CD audio frames */
- MAD_UNITS_75_FPS = 75,
+ MAD_UNITS_75_FPS = 75,
/* video drop-frame units */
@@ -95,6 +95,6 @@ void mad_timer_multiply(mad_timer_t *, signed long);
signed long mad_timer_count(mad_timer_t, enum mad_units);
unsigned long mad_timer_fraction(mad_timer_t, unsigned long);
void mad_timer_string(mad_timer_t, char *, char const *,
- enum mad_units, enum mad_units, unsigned long);
+ enum mad_units, enum mad_units, unsigned long);
# endif
diff --git a/apps/codecs/libmad/version.h b/apps/codecs/libmad/version.h
index 3a98543..0bf662f 100644
--- a/apps/codecs/libmad/version.h
+++ b/apps/codecs/libmad/version.h
@@ -22,22 +22,22 @@
# ifndef LIBMAD_VERSION_H
# define LIBMAD_VERSION_H
-# define MAD_VERSION_MAJOR 0
-# define MAD_VERSION_MINOR 15
-# define MAD_VERSION_PATCH 1
-# define MAD_VERSION_EXTRA " (beta)"
+# define MAD_VERSION_MAJOR 0
+# define MAD_VERSION_MINOR 15
+# define MAD_VERSION_PATCH 1
+# define MAD_VERSION_EXTRA " (beta)"
-# define MAD_VERSION_STRINGIZE(str) #str
-# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num)
+# define MAD_VERSION_STRINGIZE(str) #str
+# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num)
-# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \
- MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \
- MAD_VERSION_STRING(MAD_VERSION_PATCH) \
- MAD_VERSION_EXTRA
+# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \
+ MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \
+ MAD_VERSION_STRING(MAD_VERSION_PATCH) \
+ MAD_VERSION_EXTRA
-# define MAD_PUBLISHYEAR "2000-2004"
-# define MAD_AUTHOR "Underbit Technologies, Inc."
-# define MAD_EMAIL "info@underbit.com"
+# define MAD_PUBLISHYEAR "2000-2004"
+# define MAD_AUTHOR "Underbit Technologies, Inc."
+# define MAD_EMAIL "info@underbit.com"
extern char const mad_version[];
extern char const mad_copyright[];