00001 /* 00002 * libmad - MPEG audio decoder library 00003 * Copyright (C) 2000-2008 Underbit Technologies, Inc. 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * $Id: huffman.h 88 2008-06-09 11:59:11Z mich $ 00020 */ 00025 # ifndef LIBMAD_HUFFMAN_H 00026 # define LIBMAD_HUFFMAN_H 00027 00028 union huffquad { 00029 struct { 00030 unsigned short final : 1; 00031 unsigned short bits : 3; 00032 unsigned short offset : 12; 00033 } ptr; 00034 struct { 00035 unsigned short final : 1; 00036 unsigned short hlen : 3; 00037 unsigned short v : 1; 00038 unsigned short w : 1; 00039 unsigned short x : 1; 00040 unsigned short y : 1; 00041 } value; 00042 unsigned short final : 1; 00043 }; 00044 00045 union huffpair { 00046 struct { 00047 unsigned short final : 1; 00048 unsigned short bits : 3; 00049 unsigned short offset : 12; 00050 } ptr; 00051 struct { 00052 unsigned short final : 1; 00053 unsigned short hlen : 3; 00054 unsigned short x : 4; 00055 unsigned short y : 4; 00056 } value; 00057 unsigned short final : 1; 00058 }; 00059 00060 struct hufftable { 00061 union huffpair const *table; 00062 unsigned short linbits; 00063 unsigned short startbits; 00064 }; 00065 00066 extern union huffquad const *const mad_huff_quad_table[2]; 00067 extern struct hufftable const mad_huff_pair_table[32]; 00068 00069 # endif