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.

35 lines
1.2KB

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