bitstream_c.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /***************************************************************************\
  2. *
  3. * (C) copyright Fraunhofer - IIS (2000)
  4. * All Rights Reserved
  5. *
  6. * $Header: /cvs/root/winamp/aacdec/incs/mp4dec_helpers/bitstream_c.h,v 1.3 2012/05/08 20:16:50 audiodsp Exp $
  7. * project : MPEG-4 Audio Decoder
  8. * contents/description: bitstream module interface
  9. *
  10. * This software and/or program is protected by copyright law and
  11. * international treaties. Any reproduction or distribution of this
  12. * software and/or program, or any portion of it, may result in severe
  13. * civil and criminal penalties, and will be prosecuted to the maximum
  14. * extent possible under law.
  15. *
  16. \***************************************************************************/
  17. #ifndef __BITSTREAMC_H__
  18. #define __BITSTREAMC_H__
  19. #include "mp4dec_helpers/machine.h"
  20. /* CRC Markers for SetPositionMarker(). */
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. typedef enum CSBitStream_MarkerPosition
  25. {
  26. CSBitStream_ChannelElementStart,
  27. CSBitStream_ChannelElementStop,
  28. CSBitStream_AncillaryElementStart,
  29. CSBitStream_AncillaryElementStop,
  30. CSBitStream_SecondIndividualChannelStart,
  31. CSBitStream_CurrentPosition
  32. } CSBitStream_MarkerPosition;
  33. typedef enum {
  34. NO_EPCONF = -1,
  35. EPCONF0 = 0,
  36. EPCONF1 = 1,
  37. EPCONF2 = 2,
  38. EPCONF3 = 3
  39. } __epconf_types;
  40. typedef struct CSBitStream
  41. {
  42. void (*ByteAlign) (struct CSBitStream *self);
  43. void (*PushBack) (struct CSBitStream *self, INT32 n);
  44. INT32 (*Get) (struct CSBitStream *self, INT32 elemID, INT32 n);
  45. void (*SetPositionMarker) (struct CSBitStream *self, INT32 id);
  46. void (*SetCRCPositionMarker) (struct CSBitStream *self, CSBitStream_MarkerPosition position) ;
  47. INT32 (*GetBitCount) (struct CSBitStream *self);
  48. INT32 (*GetValidBits) (struct CSBitStream *self);
  49. INT32 (*GetValidBitsEp1) (struct CSBitStream *self, INT32 err_sens_class);
  50. UINT8* (*GetDataPointer) (struct CSBitStream *self);
  51. UINT32 m_BitsInCache;
  52. UINT32 m_CacheWord;
  53. INT32 m_erFlag;
  54. } CSBitStream, *CSBitStreamPtr;
  55. INT32 __getBits (CSBitStreamPtr self, INT32 elemID, INT32 nBits);
  56. void __pushBack (CSBitStreamPtr self, INT32 nBits);
  57. void __byteAlign (CSBitStreamPtr self);
  58. void __setPositionMarker (CSBitStreamPtr self, INT32 id);
  59. void __setCRCPositionMarker (CSBitStreamPtr self, CSBitStream_MarkerPosition position) ;
  60. INT32 __getBitCount (CSBitStreamPtr self);
  61. INT32 __getValidBits (CSBitStreamPtr self);
  62. INT32 __getValidBits_ep1 (CSBitStreamPtr self, INT32 err_sens_class);
  63. UINT8* __getDataPointer (CSBitStreamPtr self);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif