2 #define AC3_FRAME_SIZE (6*256)
3 #define AC3_MAX_CODED_FRAME_SIZE 3840 /* in bytes */
4 #define AC3_MAX_CHANNELS 6
6 typedef struct AC3EncodeContext {
14 int frame_size_min; /* minimum frame size in case rounding is necessary */
15 int frame_size; /* current frame size in words */
18 int fscod; /* frequency */
22 short last_samples[AC3_MAX_CHANNELS][256];
23 int chbwcod[AC3_MAX_CHANNELS];
24 int nb_coefs[AC3_MAX_CHANNELS];
26 /* bitrate allocation control */
27 int sgaincod, sdecaycod, fdecaycod, dbkneecod, floorcod;
28 int sgain, sdecay, fdecay, dbknee, floor;
30 int fgaincod[AC3_MAX_CHANNELS];
31 int fsnroffst[AC3_MAX_CHANNELS];
32 /* mantissa encoding */
33 int mant1_cnt, mant2_cnt, mant4_cnt;