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

Unified Diff: media/base/bit_reader.cc

Issue 14495010: Add UMA stats for audio/video containers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
Index: media/base/bit_reader.cc
diff --git a/media/base/bit_reader.cc b/media/base/bit_reader.cc
index ed3dc6050f1f11383db82d6784c37ff82e9d124b..c51cde274ddde21f413a340c68afd34339e1ac1e 100644
--- a/media/base/bit_reader.cc
+++ b/media/base/bit_reader.cc
@@ -15,6 +15,20 @@ BitReader::BitReader(const uint8* data, off_t size)
BitReader::~BitReader() {}
+bool BitReader::SkipBits(int num_bits) {
xhwang 2013/05/20 23:24:24 This seems mostly duplicate of ReadBitsInternal. H
jrummell 2013/05/22 18:27:39 Implemented Aaron's suggestion instead.
+ while (num_remaining_bits_in_curr_byte_ != 0 && num_bits != 0) {
acolwell GONE FROM CHROMIUM 2013/05/18 01:22:09 You might want to take a stab at implementing this
jrummell 2013/05/22 18:27:39 Done.
+ int bits_to_take = std::min(num_remaining_bits_in_curr_byte_, num_bits);
+ num_bits -= bits_to_take;
+ num_remaining_bits_in_curr_byte_ -= bits_to_take;
+ curr_byte_ &= (1 << num_remaining_bits_in_curr_byte_) - 1;
+
+ if (num_remaining_bits_in_curr_byte_ == 0)
+ UpdateCurrByte();
+ }
+
+ return num_bits == 0;
+}
+
int BitReader::bits_available() const {
return 8 * bytes_left_ + num_remaining_bits_in_curr_byte_;
}

Powered by Google App Engine
This is Rietveld 408576698