mp3ancofl.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /***************************************************************************\
  2. *
  3. * MPEG Layer3-Audio Decoder
  4. * © 1997-2006 by Fraunhofer IIS
  5. * All Rights Reserved
  6. *
  7. * filename: mp3ancofl.h
  8. * project : MPEG Decoder
  9. * author : Dieter Weninger
  10. * date : 2003-05-14
  11. * contents: ancillary data and original file length - HEADER
  12. *
  13. \***************************************************************************/
  14. #ifndef __MP3ANCOFL_H__
  15. #define __MP3ANCOFL_H__
  16. #include "mpegbitstream.h"
  17. #define ID_OFL 0xB
  18. #define VERSION_0_LEN 8 /* bytes */
  19. #define VERSION_1_LEN 10 /* bytes */
  20. class CMp3AncOfl
  21. {
  22. public:
  23. CMp3AncOfl(CBitStream &__Db);
  24. ~CMp3AncOfl();
  25. void Reset(void);
  26. int getVersion(void);
  27. unsigned int getTotalLength(void);
  28. unsigned int getCodecDelay(void);
  29. unsigned int getAddDelay(void);
  30. bool validOfl(void);
  31. void fetchOfl(int oflOn,
  32. CBitStream &Db,
  33. int beforeScf,
  34. unsigned int* startDelay,
  35. unsigned int* totalLength);
  36. int readAnc(unsigned char *ancBytes,
  37. CBitStream &Db,
  38. const int numAncBits);
  39. int doReadBytes(){return m_readBytes;}
  40. private:
  41. void crcOfl(unsigned short crcPoly,
  42. unsigned short crcMask,
  43. unsigned long *crc,
  44. unsigned char byte);
  45. void cleanUp(void);
  46. bool isFhGAnc( int size);
  47. bool readOfl(CBitStream &Db, int beforeScaleFactors);
  48. bool isOfl(void);
  49. bool justSearched(void);
  50. int toSkip(void);
  51. void getOfl(CBitStream &Db, const int len);
  52. CBitStream &m_Db; // dynamic buffer
  53. unsigned char oflArray[10];
  54. bool m_valid;
  55. bool m_searched;
  56. bool m_semaphor;
  57. bool m_FhGAncChecked;
  58. bool m_collecting;
  59. bool m_mp3pro;
  60. unsigned char* m_FhGAncBuf;
  61. unsigned char* m_tmpAncBuf;
  62. int m_pFhGAncBuf;
  63. int m_FhGAncBufSize;
  64. // flag signalling byte- or bit-wise reading
  65. int m_readBytes;
  66. };
  67. #endif /* __MP3ANCOFL_H__ */