r864: Merge 2.1:
[cinelerra_cv.git] / toolame-02l / encoder.h
blob035eb4412256b61f9bc2321e29b04356a4fcc6a0
1 #ifndef ENCODER_DOT_H
2 #define ENCODER_DOT_H
3 #include "options.h"
5 /* General Definitions */
7 /* Default Input Arguments (for command line control) */
9 #define DFLT_LAY 2 /* default encoding layer is II */
10 #define DFLT_MOD 'j' /* default mode is joint stereo */
11 #define DFLT_PSY 1 /* default psych model is 1 */
12 #define DFLT_SFQ 44.1 /* default input sampling rate is 44.1 kHz */
13 #define DFLT_EMP 'n' /* default de-emphasis is none */
14 #define DFLT_EXT ".mp2" /* default output file extension */
15 #define DFLT_BRI 10 /* default bitrate_index = 10 (192kbps) */
17 #define FILETYPE_ENCODE 'TEXT'
18 #define CREATOR_ENCODE 'MpgD'
20 /* This is the smallest MNR a subband can have before it is counted
21 as 'noisy' by the logic which chooses the number of JS subbands */
23 #define NOISY_MIN_MNR 0.0
25 /* Psychacoustic Model 1 Definitions */
27 #define CB_FRACTION 0.33
28 #define MAX_SNR 1000
29 #define NOISE 10
30 #define TONE 20
31 #define DBMIN -200.0
32 #define LAST -1
33 #define STOP -100
34 #define POWERNORM 90.3090 /* = 20 * log10(32768) to normalize */
35 /* max output power to 96 dB per spec */
37 /* Psychoacoustic Model 2 Definitions */
39 #define LOGBLKSIZE 10
40 #define BLKSIZE 1024
41 #define HBLKSIZE 513
42 #define CBANDS 64
43 #define LXMIN 32.0
45 /***********************************************************************
47 * Encoder Type Definitions
49 ***********************************************************************/
51 /* Psychoacoustic Model 1 Type Definitions */
53 typedef int IFFT2[FFT_SIZE / 2];
54 typedef int IFFT[FFT_SIZE];
55 typedef double D9[9];
56 typedef double D10[10];
57 typedef double D640[640];
58 typedef double D1408[1408];
59 typedef double DFFT2[FFT_SIZE / 2];
60 typedef double DFFT[FFT_SIZE];
61 typedef double DSBL[SBLIMIT];
62 typedef double D2SBL[2][SBLIMIT];
64 typedef struct
66 int line;
67 double bark, hear, x;
69 g_thres, *g_ptr;
71 typedef struct
73 double x;
74 int type, next, map;
76 mask, *mask_ptr;
78 /* Psychoacoustic Model 2 Type Definitions */
80 typedef int ICB[CBANDS];
81 typedef int IHBLK[HBLKSIZE];
82 typedef FLOAT F32[32];
83 typedef FLOAT F2_32[2][32];
84 typedef FLOAT FCB[CBANDS];
85 typedef FLOAT FCBCB[CBANDS][CBANDS];
86 typedef FLOAT FBLK[BLKSIZE];
87 typedef FLOAT FHBLK[HBLKSIZE];
88 typedef FLOAT F2HBLK[2][HBLKSIZE];
89 typedef FLOAT F22HBLK[2][2][HBLKSIZE];
90 typedef double DCB[CBANDS];
92 #endif