0
|
1
|
|
2 #define AC3_FRAME_SIZE (6*256)
|
|
3 #define AC3_MAX_CODED_FRAME_SIZE 3840 /* in bytes */
|
|
4 #define AC3_MAX_CHANNELS 2 /* we handle at most two channels, although
|
|
5 AC3 allows 6 channels */
|
|
6
|
|
7 typedef struct AC3EncodeContext {
|
|
8 PutBitContext pb;
|
|
9 int nb_channels;
|
|
10 int bit_rate;
|
|
11 int sample_rate;
|
|
12 int bsid;
|
|
13 int frame_size_min; /* minimum frame size in case rounding is necessary */
|
|
14 int frame_size; /* current frame size in words */
|
|
15 int halfratecod;
|
|
16 int frmsizecod;
|
|
17 int fscod; /* frequency */
|
|
18 int acmod;
|
|
19 int bsmod;
|
|
20 short last_samples[AC3_MAX_CHANNELS][256];
|
|
21 int chbwcod[AC3_MAX_CHANNELS];
|
|
22 int nb_coefs[AC3_MAX_CHANNELS];
|
|
23
|
|
24 /* bitrate allocation control */
|
|
25 int sgaincod, sdecaycod, fdecaycod, dbkneecod, floorcod;
|
|
26 int sgain, sdecay, fdecay, dbknee, floor;
|
|
27 int csnroffst;
|
|
28 int fgaincod[AC3_MAX_CHANNELS];
|
|
29 int fsnroffst[AC3_MAX_CHANNELS];
|
|
30 /* mantissa encoding */
|
|
31 int mant1_cnt, mant2_cnt, mant4_cnt;
|
|
32 } AC3EncodeContext;
|