home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Sound / LAME / Source / encoder.h < prev    next >
C/C++ Source or Header  |  1999-05-31  |  6KB  |  175 lines

  1. /**********************************************************************
  2.  * ISO MPEG Audio Subgroup Software Simulation Group (1996)
  3.  * ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
  4.  *
  5.  * $Id: encoder.h,v 1.1 1996/02/14 04:04:23 rowlands Exp $
  6.  *
  7.  * $Log: encoder.h,v $
  8.  * Revision 1.1  1996/02/14 04:04:23  rowlands
  9.  * Initial revision
  10.  *
  11.  * Received from Mike Coleman
  12.  **********************************************************************/
  13.  
  14. #ifndef ENCODER_DOT_H
  15. #define ENCODER_DOT_H
  16. /***********************************************************************
  17. *
  18. *  Encoder Include Files
  19. *
  20. ***********************************************************************/
  21.  
  22. /***********************************************************************
  23. *
  24. *  Encoder Definitions
  25. *
  26. ***********************************************************************/
  27.  
  28. /* General Definitions */
  29.  
  30. /* Default Input Arguments (for command line control) */
  31.  
  32. #define DFLT_LAY        3      /* default encoding layer is III */
  33. #define DFLT_MOD        'j'    /* default mode is stereo */
  34. #define DFLT_PSY        2      /* default psych model is 2 */
  35. #define DFLT_SFQ        44.1   /* default input sampling rate is 44.1 kHz */
  36. #define DFLT_EMP        'n'    /* default de-emphasis is none */
  37. #define DFLT_EXT        ".mp3" /* default output file extension */
  38.  
  39. #define FILETYPE_ENCODE 'TEXT'
  40. #define CREATOR_ENCODE  'MpgD'
  41.  
  42. /* This is the smallest MNR a subband can have before it is counted
  43.    as 'noisy' by the logic which chooses the number of JS subbands */
  44.  
  45. #define NOISY_MIN_MNR   0.0
  46.  
  47. /* Psychoacoustic Model 2 Definitions */
  48.  
  49. #define LOGBLKSIZE      10
  50. #define BLKSIZE         1024
  51. #define HBLKSIZE        513
  52. #define CBANDS          63
  53. #define LXMIN           32.0
  54.  
  55. /***********************************************************************
  56. *
  57. *  Encoder Type Definitions
  58. *
  59. ***********************************************************************/
  60.  
  61.  
  62. /* Psychoacoustic Model 2 Type Definitions */
  63.  
  64. typedef int        ICB[CBANDS];
  65. typedef int        IHBLK[HBLKSIZE];
  66. typedef FLOAT      F32[32];
  67. typedef FLOAT      F2_32[2][32];
  68. typedef FLOAT      FCB[CBANDS];
  69. typedef FLOAT      FCBCB[CBANDS][CBANDS];
  70. typedef FLOAT      FBLK[BLKSIZE];
  71. typedef FLOAT      FHBLK[HBLKSIZE];
  72. typedef FLOAT      F2HBLK[2][HBLKSIZE];
  73. typedef FLOAT      F22HBLK[2][2][HBLKSIZE];
  74. typedef double     DCB[CBANDS];
  75.  
  76. extern int iswav;
  77. /***********************************************************************
  78. *
  79. *  Encoder Function Prototype Declarations
  80. *
  81. ***********************************************************************/
  82.  
  83. /* The following functions are in the file "musicin.c" */
  84.  
  85. #ifdef        PROTO_ARGS
  86. extern void   obtain_parameters(frame_params*, int*, unsigned long*,
  87.                            char[MAX_NAME_SIZE], char[MAX_NAME_SIZE]);
  88. extern void   parse_args(int, char**, frame_params*, int*, unsigned long*,
  89.                            char[MAX_NAME_SIZE], char[MAX_NAME_SIZE]);
  90. extern void   print_config(frame_params*, int*,
  91.                            char[MAX_NAME_SIZE], char[MAX_NAME_SIZE]);
  92. extern void   aiff_check(char*, IFF_AIFF*, int*);
  93. #else
  94. extern void   obtain_parameters();
  95. extern void   parse_args();
  96. extern void   print_config();
  97. extern void   aiff_check();
  98. #endif
  99.  
  100. /* The following functions are in the file "encode.c" */
  101.  
  102. #ifdef        PROTO_ARGS
  103. extern unsigned long    read_samples(FILE*, short[2304], unsigned long,
  104.                            unsigned long);
  105. #if 0
  106. /*
  107. extern unsigned long    get_audio(FILE*, short[2][1152], unsigned long,
  108.                            int, int);
  109. */
  110. extern unsigned long    get_audio(FILE*, short [1152],short [1152], unsigned long,
  111.                            int, int);
  112. #else
  113. extern unsigned long    get_audio(FILE*, short[2][1152], unsigned long,
  114.                            int, layer* info);
  115. #endif
  116. extern void   read_ana_window(double[HAN_SIZE]);
  117. extern void   window_subband(short**, double[HAN_SIZE], int);
  118. extern void   create_ana_filter(double[SBLIMIT][64]);
  119. extern void   filter_subband(double[HAN_SIZE], double[SBLIMIT]);
  120. extern void   encode_info(frame_params*, Bit_stream_struc*);
  121. extern double mod(double);
  122. extern void   pick_scale(unsigned int[2][3][SBLIMIT], frame_params*,
  123.                            double[2][SBLIMIT]);
  124. extern void   put_scale(unsigned int[2][3][SBLIMIT], frame_params*,
  125.                            double[2][SBLIMIT]);
  126. #else
  127. extern unsigned long  read_samples();
  128. extern unsigned long  get_audio();
  129. extern void        read_ana_window();
  130. extern void        window_subband();
  131. extern void        create_ana_filter();
  132. extern void        filter_subband();
  133. extern void        encode_info();
  134. extern double      mod();
  135. extern void        pick_scale();
  136. extern void        put_scale();
  137. #endif
  138.  
  139. /* The following functions are in the file "tonal.c" */
  140.  
  141. #ifdef     PROTO_ARGS
  142. extern void        make_map(mask[HAN_SIZE], g_thres*);
  143. extern double      add_db(double, double);
  144. extern void        noise_label(mask*, int*, g_thres*);
  145. extern void        subsampling(mask[HAN_SIZE], g_thres*, int*, int*);
  146. extern void        threshold(mask[HAN_SIZE], g_thres*, int*, int*, int);
  147. #else
  148. extern void        make_map();
  149. extern double      add_db();
  150. extern void        noise_label();
  151. extern void        subsampling();
  152. extern void        threshold();
  153. #endif
  154.  
  155. /* The following functions are in the file "psy.c" */
  156.  
  157. #ifdef     PROTO_ARGS
  158. extern void        psycho_anal(short int*, short int[1056], int, int,
  159.                            FLOAT[32], double);
  160. #else
  161. extern void        psycho_anal();
  162. #endif
  163.  
  164. /* The following functions are in the file "subs.c" */
  165.  
  166. #ifdef     PROTO_ARGS
  167. extern void        fft(FLOAT[BLKSIZE], FLOAT[BLKSIZE],
  168.                            FLOAT[BLKSIZE], int );
  169. extern double fft_side( FLOAT in[2][1024], int s);
  170. #else
  171. extern void        fft();
  172. extern double fft_side();
  173. #endif
  174. #endif
  175.