2 * $Id: GolombBuffer.h 2533 2010-09-12 12:45:26Z xhmikosr $
4 * (C) 2006-2010 see AUTHORS
6 * This file is part of mplayerc.
8 * Mplayerc is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * Mplayerc is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 CGolombBuffer(BYTE
* pBuffer
, int nSize
);
30 UINT64
BitRead(int nBits
, bool fPeek
= false);
31 UINT64
UExpGolombRead();
32 INT64
SExpGolombRead();
35 inline BYTE
ReadByte() {
36 return (BYTE
) BitRead ( 8);
38 inline SHORT
ReadShort() {
39 return (SHORT
)BitRead (16);
41 inline DWORD
ReadDword() {
42 return (DWORD
)BitRead (32);
44 void ReadBuffer(BYTE
* pDest
, int nSize
);
47 void Reset(BYTE
* pNewBuffer
, int nNewSize
);
49 void SetSize(int nValue
) {
55 int RemainingSize() const {
56 return m_nSize
- m_nBitPos
;
59 return m_nBitPos
>= m_nSize
;
62 BYTE
* GetBufferPos() {
63 return m_pBuffer
+ m_nBitPos
;
66 void SkipBytes(int nCount
);