DECODER.H
上传用户:dshsh2009
上传日期:2007-01-07
资源大小:155k
文件大小:8k
源码类别:

mpeg/mp3

开发平台:

Unix_Linux

  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, 708-538-5671, e-mail: pan@ukraine.corp.mot.com        *
  10.  *                                                                    *
  11.  * VERSION 4.3                                                        *
  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.  * 11/04/94 Jon Rowlands        fix protos for usage() and            *
  37.  *                              recover_CRC_error()                   *
  38.  **********************************************************************/
  39. /***********************************************************************
  40. *
  41. *  Decoder Include Files
  42. *
  43. ***********************************************************************/
  44. /***********************************************************************
  45. *
  46. *  Decoder Definitions
  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. #define   SYNC_WORD         (long) 0xfff
  72. #define   SYNC_WORD_LNGTH   12
  73. #define   MUTE              0
  74. /***********************************************************************
  75. *
  76. *  Decoder Type Definitions
  77. *
  78. ***********************************************************************/
  79. /***********************************************************************
  80. *
  81. *  Decoder Variable External Declarations
  82. *
  83. ***********************************************************************/
  84. /***********************************************************************
  85. *
  86. *  Decoder Function Prototype Declarations
  87. *
  88. ***********************************************************************/
  89. /* The following functions are in the file "musicout.c" */
  90. #ifdef   PROTO_ARGS
  91. static void   usage(void);
  92. #else
  93. static void   usage();
  94. #endif
  95. /* The following functions are in the file "decode.c" */
  96. #ifdef   PROTO_ARGS
  97. extern void   decode_info(Bit_stream_struc*, frame_params*);
  98. extern void   II_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  99.                        frame_params*);
  100. extern void   I_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  101.                        frame_params*);
  102. extern void   I_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  103.                        unsigned int[2][3][SBLIMIT], frame_params*);
  104. extern void   II_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  105.                        unsigned int[2][SBLIMIT], unsigned int[2][3][SBLIMIT],
  106.                        frame_params*);
  107. extern void   I_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  108.                        unsigned int[2][SBLIMIT], frame_params*);
  109. extern void   II_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  110.                        unsigned int[2][SBLIMIT], frame_params*);
  111. extern void   read_quantizer_table(double[17], double[17]);
  112. extern void   II_dequantize_sample(unsigned int[2][3][SBLIMIT], 
  113.                        unsigned int[2][SBLIMIT], double[2][3][SBLIMIT],
  114.                        frame_params*);
  115. extern void   I_dequantize_sample(unsigned int[2][3][SBLIMIT],
  116.                        double[2][3][SBLIMIT], unsigned int[2][SBLIMIT],
  117.                        frame_params*);
  118. extern void   read_scale_factor(double[SCALE_RANGE]);
  119. extern void   II_denormalize_sample(double[2][3][SBLIMIT],
  120.                        unsigned int[2][3][SBLIMIT], frame_params*, int);
  121. extern void   I_denormalize_sample(double[2][3][SBLIMIT],
  122.                        unsigned int[2][3][SBLIMIT], frame_params*);
  123. extern void   create_syn_filter(double[64][SBLIMIT]);
  124. extern int    SubBandSynthesis (double*, int, short*);
  125. extern void   read_syn_window(double[HAN_SIZE]);
  126. extern void   window_sample(double*, double*);
  127. extern void   out_fifo(short[2][SSLIMIT][SBLIMIT], int, frame_params*, int,
  128.                        FILE*, unsigned long*);
  129. extern void   buffer_CRC(Bit_stream_struc*, unsigned int*);
  130. extern void   recover_CRC_error(short[2][SSLIMIT][SBLIMIT], int, frame_params*,
  131.                        FILE*, unsigned long*);
  132. extern void   III_dequantize_sample(long int[SBLIMIT][SSLIMIT],
  133. double [SBLIMIT][SSLIMIT], III_scalefac_t *,
  134.                         struct gr_info_s *, int, frame_params *);
  135. extern void   III_antialias(double[SBLIMIT][SSLIMIT], double[SBLIMIT][SSLIMIT], 
  136.                           struct gr_info_s *, frame_params *);
  137. extern void   inv_mdct(double[18], double[36], int);
  138. extern void   III_hybrid(double[SSLIMIT], double[SSLIMIT] , int, int,
  139.                        struct gr_info_s *, frame_params *);
  140. #else
  141. extern void   decode_info();
  142. extern void   II_decode_bitalloc();
  143. extern void   I_decode_bitalloc();
  144. extern void   I_decode_scale();
  145. extern void   II_decode_scale();
  146. extern void   I_buffer_sample();
  147. extern void   II_buffer_sample();
  148. extern void   read_quantizer_table();
  149. extern void   II_dequantize_sample();
  150. extern void   I_dequantize_sample();
  151. extern void   read_scale_factor();
  152. extern void   II_denormalize_sample();
  153. extern void   I_denormalize_sample();
  154. extern void   create_syn_filter();
  155. extern int    SubBandSynthesis ();
  156. extern void   read_syn_window();
  157. extern void   window_sample();
  158. extern void   out_fifo();
  159. extern void   buffer_CRC();
  160. extern void   recover_CRC_error();
  161. extern void   III_dequantize_sample();
  162. extern void   III_antialias();
  163. extern void   inv_mdct();
  164. extern void   III_hybrid();
  165. #endif