home *** CD-ROM | disk | FTP | other *** search
/ Da Capo / da_capo_vol1.bin / programs / amiga / misc / mpegaudio / decoder.h < prev    next >
C/C++ Source or Header  |  1994-03-21  |  7KB  |  164 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@gauss.enet.dec.com          *
  10.  *                                                                    *
  11.  * VERSION 3.5                                                       *
  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.  **********************************************************************/
  36.  
  37. /***********************************************************************
  38. *
  39. *  Decoder Include Files
  40. *
  41. ***********************************************************************/
  42.  
  43. /***********************************************************************
  44. *
  45. *  Decoder Definitions
  46. *
  47. ***********************************************************************/
  48.  
  49. #define   DFLT_OPEXT        ".dec"  /* default output file name extension */
  50. /*
  51.  NOTE: The value of a multiple-character constant is
  52.  implementation-defined.
  53. */
  54. #if !defined(MS_DOS) && !defined(AIX)
  55. #define   FILTYP_DEC_AIFF   'AIFF'
  56. #define   FILTYP_DEC_BNRY   'TEXT'
  57. #define   CREATR_DEC_AIFF   'Sd2a'
  58. /*
  59.   The following character constant is ASCII '????'
  60.   It is declared in hex because the character
  61.   constant contains a trigraph, causing an error in
  62.   parsing with ANSI preprocessors.
  63. */
  64. #define   CREATR_DEC_BNRY   0x3f3f3f3f
  65. #else
  66. #define   FILTYP_DEC_AIFF   "AIFF"
  67. #define   FILTYP_DEC_BNRY   "TEXT"
  68. #define   CREATR_DEC_AIFF   "Sd2a"
  69. #define   CREATR_DEC_BNRY   "????"
  70. #endif
  71.  
  72. #define   SYNC_WORD         (long) 0xfff
  73. #define   SYNC_WORD_LNGTH   12
  74.  
  75. #define   MUTE              0
  76.  
  77. /***********************************************************************
  78. *
  79. *  Decoder Type Definitions
  80. *
  81. ***********************************************************************/
  82.  
  83. /***********************************************************************
  84. *
  85. *  Decoder Variable External Declarations
  86. *
  87. ***********************************************************************/
  88.  
  89. /***********************************************************************
  90. *
  91. *  Decoder Function Prototype Declarations
  92. *
  93. ***********************************************************************/
  94.  
  95. /* The following functions are in the file "musicout.c" */
  96.  
  97. #ifdef   PROTO_ARGS
  98. void   usage(void);
  99. #else
  100. void   usage();
  101. #endif
  102.  
  103. /* The following functions are in the file "decode.c" */
  104.  
  105. #ifdef   PROTO_ARGS
  106. extern void   decode_info(Bit_stream_struc*, frame_params*);
  107. extern void   II_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  108.                        frame_params*);
  109. extern void   I_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  110.                        frame_params*);
  111. extern void   I_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  112.                        unsigned int[2][3][SBLIMIT], frame_params*);
  113. extern void   II_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  114.                        unsigned int[2][SBLIMIT], unsigned int[2][3][SBLIMIT],
  115.                        frame_params*);
  116. extern void   I_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  117.                        unsigned int[2][SBLIMIT], frame_params*);
  118. extern void   II_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  119.                        unsigned int[2][SBLIMIT], frame_params*);
  120. extern void   read_quantizer_table(double[17], double[17]);
  121. extern void   II_dequantize_sample(unsigned int[2][3][SBLIMIT], 
  122.                        unsigned int[2][SBLIMIT], double[2][3][SBLIMIT],
  123.                        frame_params*);
  124. extern void   I_dequantize_sample(unsigned int[2][3][SBLIMIT],
  125.                        double[2][3][SBLIMIT], unsigned int[2][SBLIMIT],
  126.                        frame_params*);
  127. extern void   read_scale_factor(double[SCALE_RANGE]);
  128. extern void   II_denormalize_sample(double[2][3][SBLIMIT],
  129.                        unsigned int[2][3][SBLIMIT], frame_params*, int);
  130. extern void   I_denormalize_sample(double[2][3][SBLIMIT],
  131.                        unsigned int[2][3][SBLIMIT], frame_params*);
  132. extern void   create_syn_filter(double[64][SBLIMIT]);
  133. extern int    SubBandSynthesis (double*, int, short*);
  134. extern void   read_syn_window(double[HAN_SIZE]);
  135. extern void   window_sample(double*, double*);
  136. extern void   out_fifo(short[2][3][SBLIMIT], int, frame_params*, int, FILE*,
  137.                        unsigned long*);
  138. extern void   buffer_CRC(Bit_stream_struc*, unsigned int*);
  139. extern void   recover_CRC_error(short[2][3][SBLIMIT], int, frame_params*,
  140.                        FILE*, unsigned long*);
  141. #else
  142. extern void   decode_info();
  143. extern void   II_decode_bitalloc();
  144. extern void   I_decode_bitalloc();
  145. extern void   I_decode_scale();
  146. extern void   II_decode_scale();
  147. extern void   I_buffer_sample();
  148. extern void   II_buffer_sample();
  149. extern void   read_quantizer_table();
  150. extern void   II_dequantize_sample();
  151. extern void   I_dequantize_sample();
  152. extern void   read_scale_factor();
  153. extern void   II_denormalize_sample();
  154. extern void   I_denormalize_sample();
  155. extern void   create_syn_filter();
  156. extern int    SubBandSynthesis ();
  157. extern void   read_syn_window();
  158. extern void   window_sample();
  159. extern void   out_fifo();
  160. extern void   buffer_CRC();
  161. extern void   recover_CRC_error();
  162. #endif
  163.  
  164.