diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-04-22 00:22:33 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-04-22 00:22:33 +0000 |
commit | 731bc970fbee83f5a8ea22d9dccbb684531daa05 (patch) | |
tree | 81bdefc6131ce1643d5b5a3cd40e5a7f0cefd744 /src/libmad/huffman.c | |
parent | 11499a3cce4288c13bb08294fad051f09191e105 (diff) | |
download | xine-lib-731bc970fbee83f5a8ea22d9dccbb684531daa05.tar.gz xine-lib-731bc970fbee83f5a8ea22d9dccbb684531daa05.tar.bz2 |
update libmad to 0.15.1b
CVS patchset: 6419
CVS date: 2004/04/22 00:22:33
Diffstat (limited to 'src/libmad/huffman.c')
-rw-r--r-- | src/libmad/huffman.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/libmad/huffman.c b/src/libmad/huffman.c index 58b8e7014..5d34c0142 100644 --- a/src/libmad/huffman.c +++ b/src/libmad/huffman.c @@ -1,6 +1,6 @@ /* * libmad - MPEG audio decoder library - * Copyright (C) 2000-2001 Robert Leslie + * Copyright (C) 2000-2004 Underbit Technologies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: huffman.c,v 1.3 2002/04/30 18:46:58 miguelfreitas Exp $ + * $Id: huffman.c,v 1.4 2004/04/22 00:22:36 miguelfreitas Exp $ */ # ifdef HAVE_CONFIG_H @@ -34,13 +34,19 @@ * These tables support decoding up to 4 Huffman code bits at a time. */ -# if defined(__GNUC__) -# define PTR(offs, bits) { ptr: { 0, bits, offs } } -# define V(v, w, x, y, hlen) { value: { 1, hlen, v, w, x, y } } +# if defined(__GNUC__) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901) +# 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 V(v, w, x, y, hlen) { { 1, hlen, (v << 0) | (w << 1) | \ - (x << 2) | (y << 3) } } +# if defined(WORDS_BIGENDIAN) +# define V(v, w, x, y, hlen) { { 1, hlen, (v << 11) | (w << 10) | \ + (x << 9) | (y << 8) } } +# else +# define V(v, w, x, y, hlen) { { 1, hlen, (v << 0) | (w << 1) | \ + (x << 2) | (y << 3) } } +# endif # endif static @@ -106,12 +112,17 @@ union huffquad const hufftabB[] = { # undef V # undef PTR -# if defined(__GNUC__) -# define PTR(offs, bits) { ptr: { 0, bits, offs } } -# define V(x, y, hlen) { value: { 1, hlen, x, y } } +# 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 } } # else # define PTR(offs, bits) { { 0, bits, offs } } -# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } } +# if defined(WORDS_BIGENDIAN) +# define V(x, y, hlen) { { 1, hlen, (x << 8) | (y << 4) } } +# else +# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } } +# endif # endif static |