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