cannam@85: /* cannam@85: * libmad - MPEG audio decoder library cannam@85: * Copyright (C) 2000-2004 Underbit Technologies, Inc. cannam@85: * cannam@85: * This program is free software; you can redistribute it and/or modify cannam@85: * it under the terms of the GNU General Public License as published by cannam@85: * the Free Software Foundation; either version 2 of the License, or cannam@85: * (at your option) any later version. cannam@85: * cannam@85: * This program is distributed in the hope that it will be useful, cannam@85: * but WITHOUT ANY WARRANTY; without even the implied warranty of cannam@85: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the cannam@85: * GNU General Public License for more details. cannam@85: * cannam@85: * You should have received a copy of the GNU General Public License cannam@85: * along with this program; if not, write to the Free Software cannam@85: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA cannam@85: * cannam@85: * $Id: huffman.h,v 1.11 2004/01/23 09:41:32 rob Exp $ cannam@85: */ cannam@85: cannam@85: # ifndef LIBMAD_HUFFMAN_H cannam@85: # define LIBMAD_HUFFMAN_H cannam@85: cannam@85: union huffquad { cannam@85: struct { cannam@85: unsigned short final : 1; cannam@85: unsigned short bits : 3; cannam@85: unsigned short offset : 12; cannam@85: } ptr; cannam@85: struct { cannam@85: unsigned short final : 1; cannam@85: unsigned short hlen : 3; cannam@85: unsigned short v : 1; cannam@85: unsigned short w : 1; cannam@85: unsigned short x : 1; cannam@85: unsigned short y : 1; cannam@85: } value; cannam@85: unsigned short final : 1; cannam@85: }; cannam@85: cannam@85: union huffpair { cannam@85: struct { cannam@85: unsigned short final : 1; cannam@85: unsigned short bits : 3; cannam@85: unsigned short offset : 12; cannam@85: } ptr; cannam@85: struct { cannam@85: unsigned short final : 1; cannam@85: unsigned short hlen : 3; cannam@85: unsigned short x : 4; cannam@85: unsigned short y : 4; cannam@85: } value; cannam@85: unsigned short final : 1; cannam@85: }; cannam@85: cannam@85: struct hufftable { cannam@85: union huffpair const *table; cannam@85: unsigned short linbits; cannam@85: unsigned short startbits; cannam@85: }; cannam@85: cannam@85: extern union huffquad const *const mad_huff_quad_table[2]; cannam@85: extern struct hufftable const mad_huff_pair_table[32]; cannam@85: cannam@85: # endif