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

Side by Side Diff: media/filters/vp9_raw_bits_reader.cc

Issue 2133993002: Parse VP9 compressed header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reset curr_frame_info_ when Reset Created 4 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 unified diff | Download patch
« no previous file with comments | « media/filters/vp9_raw_bits_reader.h ('k') | media/filters/vp9_uncompressed_header_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/vp9_raw_bits_reader.h" 5 #include "media/filters/vp9_raw_bits_reader.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/base/bit_reader.h" 10 #include "media/base/bit_reader.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 int Vp9RawBitsReader::ReadSignedLiteral(int bits) { 45 int Vp9RawBitsReader::ReadSignedLiteral(int bits) {
46 int value = ReadLiteral(bits); 46 int value = ReadLiteral(bits);
47 return ReadBool() ? -value : value; 47 return ReadBool() ? -value : value;
48 } 48 }
49 49
50 size_t Vp9RawBitsReader::GetBytesRead() const { 50 size_t Vp9RawBitsReader::GetBytesRead() const {
51 DCHECK(reader_); 51 DCHECK(reader_);
52 return (reader_->bits_read() + 7) / 8; 52 return (reader_->bits_read() + 7) / 8;
53 } 53 }
54 54
55 bool Vp9RawBitsReader::ConsumeTrailingBits() {
56 DCHECK(reader_);
57 int bits_left = GetBytesRead() * 8 - reader_->bits_read();
58 return ReadLiteral(bits_left) == 0;
59 }
60
55 } // namespace media 61 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/vp9_raw_bits_reader.h ('k') | media/filters/vp9_uncompressed_header_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698