BUG= R=mflodman@webrtc.org, tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1760006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4293 4adac7df-926f-26a2-2b94-8c16560cd09d
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
/*
|
|
* 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_
|
|
|
|
#include "webrtc/typedefs.h"
|
|
|
|
namespace webrtc {
|
|
class BitstreamParser
|
|
{
|
|
public:
|
|
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();
|
|
|
|
// Exp-Golomb codes
|
|
uint32_t GetUE();
|
|
|
|
private:
|
|
const uint8_t* _data;
|
|
const uint32_t _dataLength;
|
|
|
|
uint32_t _byteOffset;
|
|
uint8_t _bitOffset;
|
|
};
|
|
} // namespace webrtc
|
|
|
|
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_BITSTREAM_PARSER_H_
|