bitbuffer_c.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /***************************************************************************\
  2. *
  3. * (C) copyright Fraunhofer - IIS (1998)
  4. * All Rights Reserved
  5. *
  6. * filename: bitbuffer_c.h
  7. * project : MPEG-4 Audio Decoder
  8. * author : Stefan Gewinner [email protected]
  9. * contents/description: memory input class with transport format
  10. *
  11. * This software and/or program is protected by copyright law and
  12. * international treaties. Any reproduction or distribution of this
  13. * software and/or program, or any portion of it, may result in severe
  14. * civil and criminal penalties, and will be prosecuted to the maximum
  15. * extent possible under law.
  16. *
  17. * $Header: /cvs/root/winamp/aacdec/incs/bitbuffer_c.h,v 1.3 2012/05/08 20:16:49 audiodsp Exp $
  18. *
  19. \***************************************************************************/
  20. #ifndef __BITBUFFER_C_H__
  21. #define __BITBUFFER_C_H__
  22. #include "mp4dec_helpers/machine.h"
  23. #include "mp4dec_helpers/bitstream_c.h"
  24. struct CSStreamInfo;
  25. enum
  26. {
  27. CSBitBuffer_BufferSize = 8192,
  28. CSBitBuffer_BufferBits = CSBitBuffer_BufferSize*8,
  29. /* CBitBuffer_InvalidCrcValue = 0xFFFFFFFF, */
  30. CBitBuffer_MaximumMarkers = 25*4
  31. /* , CAverageNumber_MaximumSize = 16 */
  32. };
  33. typedef struct
  34. {
  35. CSBitStream_MarkerPosition what ;
  36. UINT32 m_elementBits ;
  37. UINT32 m_ValidBits;
  38. UINT32 m_BitCnt;
  39. UINT32 m_BitNdx;
  40. } CMarker, *CMarkerPtr ;
  41. typedef struct CSBitBuffer
  42. {
  43. CSBitStream base ;
  44. UINT32 m_ValidBits;
  45. UINT32 m_ReadOffset;
  46. UINT32 m_BitCnt;
  47. UINT32 m_BitNdx;
  48. UINT32 m_FramesLeftInPacket ;
  49. UINT32 m_FrameCrcValue ;
  50. INT32 m_isEOF ;
  51. UINT8 m_Buffer [CSBitBuffer_BufferSize] ;
  52. /* CAverageNumber m_ActualBitrate ; */
  53. UINT32 m_LastBufferFullness ;
  54. UINT32 m_LastFrameLength ;
  55. CMarker m_MarkerList [CBitBuffer_MaximumMarkers] ;
  56. UINT32 m_Markers ;
  57. } CSBitBuffer, *CSBitBufferPtr ;
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61. void CSBitBuffer_Initialize(CSBitBufferPtr self);
  62. void CSBitBuffer_Feed(CSBitBufferPtr self, const UINT8 pBuf[], const UINT32 cbSize, UINT32 *cbValid);
  63. INT32 CSBitBuffer_IsDecodableFrame(CSBitBufferPtr self, struct CSStreamInfo *info);
  64. INT32 CSBitBuffer_IsCrcConsistent(CSBitBufferPtr self) ;
  65. void CSBitBuffer_SetEOF(CSBitBufferPtr self) ;
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif