home *** CD-ROM | disk | FTP | other *** search
/ 3D GFX / 3D GFX.iso / amiutils / m_p / mpegaudiodecoder / mpeg1_iis / decoder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-31  |  7.7 KB  |  177 lines

  1. /**********************************************************************
  2. Copyright (c) 1991 MPEG/audio software simulation group, All Rights Reserved
  3. decoder.h
  4. **********************************************************************/
  5. /**********************************************************************
  6.  * MPEG/audio coding/decoding software, work in progress              *
  7.  *   NOT for public distribution until verified and approved by the   *
  8.  *   MPEG/audio committee.  For further information, please contact   *
  9.  *   Davis Pan, 508-493-2241, e-mail: pan@3d.enet.dec.com             *
  10.  *                                                                    *
  11.  * VERSION 4.1                                                        *
  12.  *   changes made since last update:                                  *
  13.  *   date   programmers         comment                               *
  14.  * 2/25/91  Doulas Wong,        start of version 1.0 records          *
  15.  *          Davis Pan                                                 *
  16.  * 5/10/91  Vish (PRISM)        Renamed and regrouped all ".h" files  *
  17.  *                              into "common.h" and "decoder.h".      *
  18.  *                              Ported to Macintosh and Unix.         *
  19.  * 27jun91  dpwe (Aware)        New prototype for out_fifo()          *
  20.  *                              Moved "alloc_*" stuff to common.h     *
  21.  *                              Use ifdef PROTO_ARGS for prototypes   *
  22.  *                              prototypes reflect frame_params struct*
  23.  * 10/3/91  Don H. Lee          implemented CRC-16 error protection   *
  24.  * 2/11/92  W. Joseph Carter    Ported new code to Macintosh.  Most   *
  25.  *                              important fixes involved changing     *
  26.  *                              16-bit ints to long or unsigned in    *
  27.  *                              bit alloc routines for quant of 65535 *
  28.  *                              and passing proper function args.     *
  29.  *                              Removed "Other Joint Stereo" option   *
  30.  *                              and made bitrate be total channel     *
  31.  *                              bitrate, irrespective of the mode.    *
  32.  *                              Fixed many small bugs & reorganized.  *
  33.  *                              Modified some function prototypes.    *
  34.  * 08/07/92 Mike Coleman        Made small changes for portability    *
  35.  * 9/07/93  Toshiyuki Ishino    Integrated with Layer III.            *
  36.  **********************************************************************/
  37.  
  38. /***********************************************************************
  39. *
  40. *  Decoder Include Files
  41. *
  42. ***********************************************************************/
  43.  
  44. /***********************************************************************
  45. *
  46. *  Decoder Definitions
  47. *
  48. ***********************************************************************/
  49.  
  50. #define   DFLT_OPEXT        ".dec"  /* default output file name extension */
  51. /*
  52.  NOTE: The value of a multiple-character constant is
  53.  implementation-defined.
  54. */
  55. #if !defined(MS_DOS) && !defined(AIX)
  56. #define   FILTYP_DEC_AIFF   'AIFF'
  57. #define   FILTYP_DEC_BNRY   'TEXT'
  58. #define   CREATR_DEC_AIFF   'Sd2a'
  59. /*
  60.   The following character constant is ASCII '????'
  61.   It is declared in hex because the character
  62.   constant contains a trigraph, causing an error in
  63.   parsing with ANSI preprocessors.
  64. */
  65. #define   CREATR_DEC_BNRY   0x3f3f3f3f
  66. #else
  67. #define   FILTYP_DEC_AIFF   "AIFF"
  68. #define   FILTYP_DEC_BNRY   "TEXT"
  69. #define   CREATR_DEC_AIFF   "Sd2a"
  70. #define   CREATR_DEC_BNRY   "????"
  71. #endif
  72.  
  73. #define   SYNC_WORD         (long) 0xfff
  74. #define   SYNC_WORD_LNGTH   12
  75.  
  76. #define   MUTE              0
  77.  
  78. /***********************************************************************
  79. *
  80. *  Decoder Type Definitions
  81. *
  82. ***********************************************************************/
  83.  
  84. /***********************************************************************
  85. *
  86. *  Decoder Variable External Declarations
  87. *
  88. ***********************************************************************/
  89.  
  90. /***********************************************************************
  91. *
  92. *  Decoder Function Prototype Declarations
  93. *
  94. ***********************************************************************/
  95.  
  96. /* The following functions are in the file "musicout.c" */
  97.  
  98. #ifdef   PROTO_ARGS
  99. extern void   usage(void);
  100. #else
  101. extern void   usage();
  102. #endif
  103.  
  104. /* The following functions are in the file "decode.c" */
  105.  
  106. #ifdef   PROTO_ARGS
  107. extern void   decode_info(Bit_stream_struc*, frame_params*);
  108. extern void   II_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  109.                        frame_params*);
  110. extern void   I_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  111.                        frame_params*);
  112. extern void   I_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  113.                        unsigned int[2][3][SBLIMIT], frame_params*);
  114. extern void   II_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  115.                        unsigned int[2][SBLIMIT], unsigned int[2][3][SBLIMIT],
  116.                        frame_params*);
  117. extern void   I_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  118.                        unsigned int[2][SBLIMIT], frame_params*);
  119. extern void   II_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  120.                        unsigned int[2][SBLIMIT], frame_params*);
  121. extern void   read_quantizer_table(double[17], double[17]);
  122. extern void   II_dequantize_sample(unsigned int[2][3][SBLIMIT], 
  123.                        unsigned int[2][SBLIMIT], double[2][3][SBLIMIT],
  124.                        frame_params*);
  125. extern void   I_dequantize_sample(unsigned int[2][3][SBLIMIT],
  126.                        double[2][3][SBLIMIT], unsigned int[2][SBLIMIT],
  127.                        frame_params*);
  128. extern void   read_scale_factor(double[SCALE_RANGE]);
  129. extern void   II_denormalize_sample(double[2][3][SBLIMIT],
  130.                        unsigned int[2][3][SBLIMIT], frame_params*, int);
  131. extern void   I_denormalize_sample(double[2][3][SBLIMIT],
  132.                        unsigned int[2][3][SBLIMIT], frame_params*);
  133. extern void   create_syn_filter(double[64][SBLIMIT]);
  134. extern int    SubBandSynthesis (double*, int, short*);
  135. extern void   read_syn_window(double[HAN_SIZE]);
  136. extern void   window_sample(double*, double*);
  137. extern void   out_fifo(short[2][SSLIMIT][SBLIMIT], int, frame_params*, int,
  138.                        FILE*, unsigned long*);
  139. extern void   buffer_CRC(Bit_stream_struc*, unsigned int*);
  140. extern void   recover_CRC_error(short[2][3][SBLIMIT], int, frame_params*,
  141.                        FILE*, unsigned long*);
  142. extern void   III_dequantize_sample(long int[SBLIMIT][SSLIMIT],
  143.             double [SBLIMIT][SSLIMIT], III_scalefac_t *,
  144.                         struct gr_info_s *, int, frame_params *);
  145. extern void   III_antialias(double[SBLIMIT][SSLIMIT], double[SBLIMIT][SSLIMIT], 
  146.                           struct gr_info_s *, frame_params *);
  147. extern void   inv_mdct(double[18], double[36], int);
  148. extern void   III_hybrid(double[SSLIMIT], double[SSLIMIT] , int, int,
  149.                        struct gr_info_s *, frame_params *);
  150.  
  151. #else
  152. extern void   decode_info();
  153. extern void   II_decode_bitalloc();
  154. extern void   I_decode_bitalloc();
  155. extern void   I_decode_scale();
  156. extern void   II_decode_scale();
  157. extern void   I_buffer_sample();
  158. extern void   II_buffer_sample();
  159. extern void   read_quantizer_table();
  160. extern void   II_dequantize_sample();
  161. extern void   I_dequantize_sample();
  162. extern void   read_scale_factor();
  163. extern void   II_denormalize_sample();
  164. extern void   I_denormalize_sample();
  165. extern void   create_syn_filter();
  166. extern int    SubBandSynthesis ();
  167. extern void   read_syn_window();
  168. extern void   window_sample();
  169. extern void   out_fifo();
  170. extern void   buffer_CRC();
  171. extern void   recover_CRC_error();
  172. extern void   III_dequantize_sample();
  173. extern void   III_antialias();
  174. extern void   inv_mdct();
  175. extern void   III_hybrid();
  176. #endif
  177.