You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0KB

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