blob: 5bfc54d73f92befd3d61411e9640db01da4ec6a8
1 | /* ***** BEGIN LICENSE BLOCK ***** |
2 | * Source last modified: $Id: bitstream.h,v 1.1.2.1 2005/02/26 02:05:12 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 | /************************************************************************************** |
39 | * Fixed-point HE-AAC decoder |
40 | * Jon Recker (jrecker@real.com) |
41 | * February 2005 |
42 | * |
43 | * bitstream.h - definitions of bitstream handling functions |
44 | **************************************************************************************/ |
45 | |
46 | #ifndef _BITSTREAM_H |
47 | #define _BITSTREAM_H |
48 | |
49 | #include "aaccommon.h" |
50 | |
51 | /* additional external symbols to name-mangle for static linking */ |
52 | #define SetBitstreamPointer STATNAME(SetBitstreamPointer) |
53 | #define GetBits STATNAME(GetBits) |
54 | #define GetBitsNoAdvance STATNAME(GetBitsNoAdvance) |
55 | #define AdvanceBitstream STATNAME(AdvanceBitstream) |
56 | #define CalcBitsUsed STATNAME(CalcBitsUsed) |
57 | #define ByteAlignBitstream STATNAME(ByteAlignBitstream) |
58 | |
59 | typedef struct _BitStreamInfo { |
60 | unsigned char *bytePtr; |
61 | unsigned int iCache; |
62 | int cachedBits; |
63 | int nBytes; |
64 | } BitStreamInfo; |
65 | |
66 | /* bitstream.c */ |
67 | void SetBitstreamPointer(BitStreamInfo *bsi, int nBytes, unsigned char *buf); |
68 | unsigned int GetBits(BitStreamInfo *bsi, int nBits); |
69 | unsigned int GetBitsNoAdvance(BitStreamInfo *bsi, int nBits); |
70 | void AdvanceBitstream(BitStreamInfo *bsi, int nBits); |
71 | int CalcBitsUsed(BitStreamInfo *bsi, unsigned char *startBuf, int startOffset); |
72 | void ByteAlignBitstream(BitStreamInfo *bsi); |
73 | |
74 | #endif /* _BITSTREAM_H */ |
75 |