2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_BITSTREAM_PARSER_H_
|
|
|
|
|
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_BITSTREAM_PARSER_H_
|
|
|
|
|
|
2013-05-29 14:27:38 +00:00
|
|
|
#include "webrtc/typedefs.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
class BitstreamParser
|
|
|
|
|
{
|
|
|
|
|
public:
|
2013-04-08 11:08:41 +00:00
|
|
|
BitstreamParser(const uint8_t* data, const uint32_t dataLength);
|
|
|
|
|
|
|
|
|
|
uint8_t Get1Bit();
|
|
|
|
|
uint8_t Get2Bits();
|
|
|
|
|
uint8_t Get3Bits();
|
|
|
|
|
uint8_t Get4Bits();
|
|
|
|
|
uint8_t Get5Bits();
|
|
|
|
|
uint8_t Get6Bits();
|
|
|
|
|
uint8_t Get7Bits();
|
|
|
|
|
uint8_t Get8Bits();
|
|
|
|
|
uint16_t Get16Bits();
|
|
|
|
|
uint32_t Get24Bits();
|
|
|
|
|
uint32_t Get32Bits();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// Exp-Golomb codes
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t GetUE();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
private:
|
2013-04-08 11:08:41 +00:00
|
|
|
const uint8_t* _data;
|
|
|
|
|
const uint32_t _dataLength;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
uint32_t _byteOffset;
|
|
|
|
|
uint8_t _bitOffset;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_BITSTREAM_PARSER_H_
|