home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1997 June / PC_Shareware-1997-06.iso / manga / mp2win95 / _setup.1 / HUFFMAN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-30  |  2.5 KB  |  60 lines

  1. /*
  2. Adopted from "huffman.h" from the ISO MPEG Audio Subgroup Software Simulation
  3. Group's public c source for its MPEG audio decoder. Miscellaneous changes by
  4. Jeff Tsay (ctsay@pasteur.eecs.berkeley.edu).
  5.  
  6. Last modified : 01/30/97 */
  7.  
  8. /**********************************************************************
  9. Copyright (c) 1991 MPEG/audio software simulation group, All Rights Reserved
  10. huffman.h
  11. **********************************************************************/
  12. /**********************************************************************
  13.  * MPEG/audio coding/decoding software, work in progress              *
  14.  *   NOT for public distribution until verified and approved by the   *
  15.  *   MPEG/audio committee.  For further information, please contact   *
  16.  *   Davis Pan, 508-493-2241, e-mail: pan@3d.enet.dec.com             *
  17.  *                                                                    *
  18.  * VERSION 4.1                                                        *
  19.  *   changes made since last update:                                  *
  20.  *   date   programmers                comment                        *
  21.  *  27.2.92 F.O.Witte (ITT Intermetall)                                   *
  22.  *  8/24/93 M. Iwadare          Changed for 1 pass decoding.          *
  23.  *  7/14/94 J. Koller        useless 'typedef' before huffcodetab           *
  24.  *                removed                                                                   *
  25.  *********************************************************************/
  26.  
  27. #ifndef HUFFMAN_H
  28. #define HUFFMAN_H
  29.  
  30. #include "all.h"
  31. #include "bit_res.h"
  32.  
  33. #define HUFFBITS uint32
  34. #define HTN    34
  35. #define MXOFF    250
  36.  
  37. struct huffcodetab {
  38.   char tablename[3];            /* string, containing table_description   */
  39.   uint32 xlen;                 /* max. x-index+                               */
  40.   uint32 ylen;                /* max. y-index+                               */
  41.   uint32 linbits;             /* number of linbits                           */
  42.   uint32 linmax;                /* max number to be stored in linbits       */
  43.   int32 ref;                    /* a positive value indicates a reference */
  44.   HUFFBITS *table;            /* pointer to array[xlen][ylen]              */
  45.   unsigned char *hlen;        /* pointer to array[xlen][ylen]              */
  46.   unsigned char(*val)[2];    /* decoder tree                               */
  47.   uint32 treelen;                /* length of decoder tree                    */
  48. };
  49.  
  50. extern struct huffcodetab ht[HTN];
  51.  
  52. int32 hexstr_to_int(char *hexstr);
  53.  
  54. int32 read_decoder_table(char *filename);
  55.  
  56. int32 huffman_decoder(struct huffcodetab *h, int32 *x, int32 *y, int32 *v,
  57.                       int32 *w, Bit_Reserve *br);
  58.  
  59. #endif
  60.