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 */
7 typedef struct AC3EncodeContext {
13 int frame_size_min; /* minimum frame size in case rounding is necessary */
14 int frame_size; /* current frame size in words */
17 int fscod; /* frequency */
20 short last_samples[AC3_MAX_CHANNELS][256];
21 int chbwcod[AC3_MAX_CHANNELS];
22 int nb_coefs[AC3_MAX_CHANNELS];
24 /* bitrate allocation control */
25 int sgaincod, sdecaycod, fdecaycod, dbkneecod, floorcod;
26 int sgain, sdecay, fdecay, dbknee, floor;
28 int fgaincod[AC3_MAX_CHANNELS];
29 int fsnroffst[AC3_MAX_CHANNELS];
30 /* mantissa encoding */
31 int mant1_cnt, mant2_cnt, mant4_cnt;