adts_mp2.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef NULLSOFT_IN_MP3_ADTS_MP2_H
  2. #define NULLSOFT_IN_MP3_ADTS_MP2_H
  3. #include "adts.h"
  4. #include "api.h"
  5. #include "config.h"
  6. #ifndef NO_MP3SURROUND
  7. #include "../mp3/bccDecLinklib/include/bccDecLink.h" // Binaural Cue Coding (aka mp3 surround)
  8. #endif
  9. class ADTS_MP2 : public adts
  10. {
  11. public:
  12. ADTS_MP2();
  13. int Initialize(bool forceMono, bool reverse_stereo, bool allowSurround, int maxBits, bool allowRG, bool _useFloat, bool _useCRC);
  14. bool Open(ifc_mpeg_stream_reader *file);
  15. void Close();
  16. void GetOutputParameters(size_t *numBits, int *numChannels, int *sampleRate);
  17. void CalculateFrameSize(int *frameSize);
  18. void Flush(ifc_mpeg_stream_reader *file);
  19. size_t GetCurrentBitrate();
  20. size_t GetDecoderDelay();
  21. int Sync(ifc_mpeg_stream_reader *file, unsigned __int8 *output, size_t outputSize, size_t *outputWritten, size_t *bitrate);
  22. int Decode(ifc_mpeg_stream_reader *file, unsigned __int8 *output, size_t outputSize, size_t *outputWritten, size_t *bitrate, size_t *endCut);
  23. int GetLayer();
  24. void Release();
  25. void SetDecoderHooks(void *layer3_vis, void *layer2_eq, void *layer3_eq);
  26. <<<<<<< HEAD:in_mp3/adts_mp2.h
  27. =======
  28. >>>>>>> 5058463... fix old-school vis/eq mp3 stuff:mp3/adts_mp2.h
  29. private:
  30. DecoderHooks hooks;
  31. CMpgaDecoder *decoder;
  32. int outputFrameSize;
  33. size_t bitsPerSample;
  34. double gain;
  35. bool allowRG;
  36. bool useFloat;
  37. int channels;
  38. int sampleRate;
  39. unsigned int decoderDelay;
  40. unsigned int endcut;
  41. #ifndef NO_MP3SURROUND
  42. float delayline[1152*2];
  43. int delaylineSize;
  44. bool lineFilled;
  45. SADEC_HANDLE saDecHandle;
  46. SA_DEC_MODE saMode;
  47. #endif
  48. };
  49. #endif