]> git.lizzy.rs Git - plan9front.git/blob - sys/src/games/mp3dec/huffman.h
Import sources from 2011-03-30 iso image
[plan9front.git] / sys / src / games / mp3dec / huffman.h
1 /*
2  * libmad - MPEG audio decoder library
3  * Copyright (C) 2000-2004 Underbit Technologies, Inc.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  * $Id; //  huffman.h,v 1.11 2004/01/23 09; // 41; // 32 rob Exp $
20  */
21
22 # ifndef LIBMAD_HUFFMAN_H
23 # define LIBMAD_HUFFMAN_H
24
25 struct huffquad {
26   unsigned char final;
27   struct {
28     unsigned char bits;
29     unsigned short offset;
30   } ptr;
31   struct {
32     unsigned char hlen;
33     unsigned char v, w, x, y;
34   } value;
35 };
36
37 struct huffpair {
38   unsigned char final;
39   struct {
40     unsigned char bits;
41     unsigned short offset;
42   } ptr;
43   struct {
44     unsigned char hlen;
45     unsigned char x;
46     unsigned char y;
47   } value;
48 };
49
50 struct hufftable {
51   struct huffpair const *table;
52   unsigned short linbits;
53   unsigned short startbits;
54 };
55
56 extern struct huffquad const *const mad_huff_quad_table[2];
57 extern struct hufftable const mad_huff_pair_table[32];
58
59 # endif