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

Unified Diff: media/filters/vp9_raw_bits_reader.cc

Issue 1258083004: Add a Vp9Parser implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ReadBool, fix compile warning Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/vp9_raw_bits_reader.h ('k') | media/filters/vp9_raw_bits_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vp9_raw_bits_reader.cc
diff --git a/media/filters/vp9_raw_bits_reader.cc b/media/filters/vp9_raw_bits_reader.cc
index 47014fde229a941c3aa8c2c56f141c42d9788f01..ccd21a9232b07ba922a0a86e17dde4970b7e5fdd 100644
--- a/media/filters/vp9_raw_bits_reader.cc
+++ b/media/filters/vp9_raw_bits_reader.cc
@@ -21,11 +21,11 @@ void Vp9RawBitsReader::Initialize(const uint8_t* data, size_t size) {
valid_ = true;
}
-int Vp9RawBitsReader::ReadBit() {
+bool Vp9RawBitsReader::ReadBool() {
DCHECK(reader_);
int value = 0;
valid_ = valid_ && reader_->ReadBits(1, &value);
- return value;
+ return value == 1;
}
int Vp9RawBitsReader::ReadLiteral(int bits) {
@@ -38,7 +38,7 @@ int Vp9RawBitsReader::ReadLiteral(int bits) {
int Vp9RawBitsReader::ReadSignedLiteral(int bits) {
int value = ReadLiteral(bits);
- return ReadBit() ? -value : value;
+ return ReadBool() ? -value : value;
}
size_t Vp9RawBitsReader::GetBytesRead() const {
« no previous file with comments | « media/filters/vp9_raw_bits_reader.h ('k') | media/filters/vp9_raw_bits_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698