Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: webrtc/base/bitbuffer.h

Issue 1314473008: H264 bitstream parser. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove DCHECK_GT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/base/bitbuffer.cc » ('j') | webrtc/base/bitbuffer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // Reads the exponential golomb encoded value at the current offset. 54 // Reads the exponential golomb encoded value at the current offset.
55 // Exponential golomb values are encoded as: 55 // Exponential golomb values are encoded as:
56 // 1) x = source val + 1 56 // 1) x = source val + 1
57 // 2) In binary, write [countbits(x) - 1] 0s, then x 57 // 2) In binary, write [countbits(x) - 1] 0s, then x
58 // To decode, we count the number of leading 0 bits, read that many + 1 bits, 58 // To decode, we count the number of leading 0 bits, read that many + 1 bits,
59 // and increment the result by 1. 59 // and increment the result by 1.
60 // Returns false if there isn't enough data left for the specified type, or if 60 // Returns false if there isn't enough data left for the specified type, or if
61 // the value wouldn't fit in a uint32_t. 61 // the value wouldn't fit in a uint32_t.
62 bool ReadExponentialGolomb(uint32_t* val); 62 bool ReadExponentialGolomb(uint32_t* val);
63 bool ReadSignedExponentialGolomb(int32_t* val);
63 64
64 // Moves current position |byte_count| bytes forward. Returns false if 65 // Moves current position |byte_count| bytes forward. Returns false if
65 // there aren't enough bytes left in the buffer. 66 // there aren't enough bytes left in the buffer.
66 bool ConsumeBytes(size_t byte_count); 67 bool ConsumeBytes(size_t byte_count);
67 // Moves current position |bit_count| bits forward. Returns false if 68 // Moves current position |bit_count| bits forward. Returns false if
68 // there aren't enough bits left in the buffer. 69 // there aren't enough bits left in the buffer.
69 bool ConsumeBits(size_t bit_count); 70 bool ConsumeBits(size_t bit_count);
70 71
71 // Sets the current offset to the provied byte/bit offsets. The bit 72 // Sets the current offset to the provied byte/bit offsets. The bit
72 // offset is from the given byte, in the range [0,7]. 73 // offset is from the given byte, in the range [0,7].
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 private: 110 private:
110 // The buffer, as a writable array. 111 // The buffer, as a writable array.
111 uint8_t* const writable_bytes_; 112 uint8_t* const writable_bytes_;
112 113
113 DISALLOW_COPY_AND_ASSIGN(BitBufferWriter); 114 DISALLOW_COPY_AND_ASSIGN(BitBufferWriter);
114 }; 115 };
115 116
116 } // namespace rtc 117 } // namespace rtc
117 118
118 #endif // WEBRTC_BASE_BITBUFFER_H_ 119 #endif // WEBRTC_BASE_BITBUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/bitbuffer.cc » ('j') | webrtc/base/bitbuffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698