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.

32 lines
1.1KB

  1. /* max compressed frame size */
  2. #define MPA_MAX_CODED_FRAME_SIZE 1200
  3. #define MPA_FRAME_SIZE 1152
  4. #define SAMPLES_BUF_SIZE 4096
  5. #define SBLIMIT 32 /* number of subbands */
  6. #define DCT_BITS 14 /* number of bits for the DCT */
  7. #define MUL(a,b) (((a) * (b)) >> DCT_BITS)
  8. #define FIX(a) ((int)((a) * (1 << DCT_BITS)))
  9. typedef struct MpegAudioContext {
  10. PutBitContext pb;
  11. int freq, bit_rate;
  12. int lsf; /* 1 if mpeg2 low bitrate selected */
  13. int bitrate_index; /* bit rate */
  14. int freq_index;
  15. int frame_size; /* frame size, in bits, without padding */
  16. long long nb_samples; /* total number of samples encoded */
  17. /* padding computation */
  18. int frame_frac, frame_frac_incr, do_padding;
  19. short samples_buf[SAMPLES_BUF_SIZE]; /* buffer for filter */
  20. int samples_offset; /* offset in samples_buf */
  21. int sb_samples[3][12][SBLIMIT];
  22. unsigned char scale_factors[SBLIMIT][3]; /* scale factors */
  23. unsigned char scale_code[SBLIMIT]; /* code to group 3 scale factors */
  24. int sblimit; /* number of used subbands */
  25. const unsigned char *alloc_table;
  26. } MpegAudioContext;