rtoss - Diff between revs 14 and 26

Subversion Repositories:
Rev:
Show entire file - Ignore whitespace
Rev 14 Rev 26
Line 1... Line 1...
1 /* 1 /*
2  * libmad - MPEG audio decoder library 2  * libmad - MPEG audio decoder library
3  * Copyright (C) 2000-2003 Underbit Technologies, Inc. -  
-   3  * Copyright (C) 2000-2004 Underbit Technologies, Inc.
4  * 4  *
5  * This program is free software; you can redistribute it and/or modify 5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by 6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or 7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version. 8  * (at your option) any later version.
Line 14... Line 14...
14  * 14  *
15  * You should have received a copy of the GNU General Public License 15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software 16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  * 18  *
19  * $Id: huffman.c,v 1.8 2003/05/27 22:40:36 rob Exp $ -  
-   19  * $Id: huffman.c,v 1.10 2004/01/23 09:41:32 rob Exp $
20  */ 20  */
21 21
22 # ifdef HAVE_CONFIG_H 22 # ifdef HAVE_CONFIG_H
23 #  include "config.h" 23 #  include "config.h"
24 # endif 24 # endif
Line 32... Line 32...
32  * The data for these tables are derived from Table B.7 of ISO/IEC 11172-3. 32  * The data for these tables are derived from Table B.7 of ISO/IEC 11172-3.
33  * 33  *
34  * These tables support decoding up to 4 Huffman code bits at a time. 34  * These tables support decoding up to 4 Huffman code bits at a time.
35  */ 35  */
36 36
37 # if defined(__GNUC__) -  
38 #  define PTR(offs, bits)       { ptr:   { 0, bits, offs       } } -  
39 #  define V(v, w, x, y, hlen)   { value: { 1, hlen, v, w, x, y } } -  
-   37 # if defined(__GNUC__) ||  \
-   38     (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
-   39 #  define PTR(offs, bits)       { .ptr   = { 0, bits, offs       } }
-   40 #  define V(v, w, x, y, hlen)   { .value = { 1, hlen, v, w, x, y } }
40 # else 41 # else
41 #  define PTR(offs, bits)       { { 0, bits, offs } } 42 #  define PTR(offs, bits)       { { 0, bits, offs } }
42 #  define V(v, w, x, y, hlen)   { { 1, hlen, (v << 0) | (w << 1) |  \ -  
43                                              (x << 2) | (y << 3) } } -  
-   43 #  if defined(WORDS_BIGENDIAN)
-   44 #   define V(v, w, x, y, hlen)  { { 1, hlen, (v << 11) | (w << 10) |  \
-   45                                              (x <<  9) | (y <<  8) } }
-   46 #  else
-   47 #   define V(v, w, x, y, hlen)  { { 1, hlen, (v <<  0) | (w <<  1) |  \
-   48                                              (x <<  2) | (y <<  3) } }
-   49 #  endif
44 # endif 50 # endif
45 51
46 static 52 static
47 union huffquad const hufftabA[] = { 53 union huffquad const hufftabA[] = {
48   /* 0000 */ PTR(16, 2), 54   /* 0000 */ PTR(16, 2),
Line 104... Line 110...
104 }; 110 };
105 111
106 # undef V 112 # undef V
107 # undef PTR 113 # undef PTR
108 114
109 # if defined(__GNUC__) -  
110 #  define PTR(offs, bits)       { ptr:   { 0, bits, offs } } -  
111 #  define V(x, y, hlen)         { value: { 1, hlen, x, y } } -  
-   115 # if defined(__GNUC__) ||  \
-   116     (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
-   117 #  define PTR(offs, bits)       { .ptr   = { 0, bits, offs } }
-   118 #  define V(x, y, hlen)         { .value = { 1, hlen, x, y } }
112 # else 119 # else
113 #  define PTR(offs, bits)       { { 0, bits, offs } } 120 #  define PTR(offs, bits)       { { 0, bits, offs } }
114 #  define V(x, y, hlen)         { { 1, hlen, (x << 0) | (y << 4) } } -  
-   121 #  if defined(WORDS_BIGENDIAN)
-   122 #   define V(x, y, hlen)        { { 1, hlen, (x << 8) | (y << 4) } }
-   123 #  else
-   124 #   define V(x, y, hlen)        { { 1, hlen, (x << 0) | (y << 4) } }
-   125 #  endif
115 # endif 126 # endif
116 127
117 static 128 static
118 union huffpair const hufftab0[] = { 129 union huffpair const hufftab0[] = {
119   /*      */ V(0, 0, 0) 130   /*      */ V(0, 0, 0)