bitstream.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Source last modified: $Id: bitstream.h,v 1.1 2005/02/26 01:47:34 jrecker Exp $
  3. *
  4. * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.
  5. *
  6. * The contents of this file, and the files included with this file,
  7. * are subject to the current version of the RealNetworks Public
  8. * Source License (the "RPSL") available at
  9. * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10. * the file under the current version of the RealNetworks Community
  11. * Source License (the "RCSL") available at
  12. * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13. * will apply. You may also obtain the license terms directly from
  14. * RealNetworks. You may not use this file except in compliance with
  15. * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16. * to this file, the RCSL. Please see the applicable RPSL or RCSL for
  17. * the rights, obligations and limitations governing use of the
  18. * contents of the file.
  19. *
  20. * This file is part of the Helix DNA Technology. RealNetworks is the
  21. * developer of the Original Code and owns the copyrights in the
  22. * portions it created.
  23. *
  24. * This file, and the files included with this file, is distributed
  25. * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  26. * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  27. * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  28. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  29. * ENJOYMENT OR NON-INFRINGEMENT.
  30. *
  31. * Technology Compatibility Kit Test Suite(s) Location:
  32. * http://www.helixcommunity.org/content/tck
  33. *
  34. * Contributor(s):
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. /**************************************************************************************
  38. * Fixed-point HE-AAC decoder
  39. * Jon Recker (jrecker@real.com)
  40. * February 2005
  41. *
  42. * bitstream.h - definitions of bitstream handling functions
  43. **************************************************************************************/
  44. #ifndef _BITSTREAM_H
  45. #define _BITSTREAM_H
  46. #include "aaccommon.h"
  47. /* additional external symbols to name-mangle for static linking */
  48. #define SetBitstreamPointer STATNAME(SetBitstreamPointer)
  49. #define GetBits STATNAME(GetBits)
  50. #define GetBitsNoAdvance STATNAME(GetBitsNoAdvance)
  51. #define AdvanceBitstream STATNAME(AdvanceBitstream)
  52. #define CalcBitsUsed STATNAME(CalcBitsUsed)
  53. #define ByteAlignBitstream STATNAME(ByteAlignBitstream)
  54. typedef struct _BitStreamInfo {
  55. unsigned char *bytePtr;
  56. unsigned int iCache;
  57. int cachedBits;
  58. int nBytes;
  59. } BitStreamInfo;
  60. /* bitstream.c */
  61. void SetBitstreamPointer(BitStreamInfo *bsi, int nBytes, unsigned char *buf);
  62. unsigned int GetBits(BitStreamInfo *bsi, int nBits);
  63. unsigned int GetBitsNoAdvance(BitStreamInfo *bsi, int nBits);
  64. void AdvanceBitstream(BitStreamInfo *bsi, int nBits);
  65. int CalcBitsUsed(BitStreamInfo *bsi, unsigned char *startBuf, int startOffset);
  66. void ByteAlignBitstream(BitStreamInfo *bsi);
  67. #endif /* _BITSTREAM_H */