OLD | NEW |
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 #ifndef MEDIA_FILTERS_VP9_RAW_BITS_READER_H_ | 5 #ifndef MEDIA_FILTERS_VP9_RAW_BITS_READER_H_ |
6 #define MEDIA_FILTERS_VP9_RAW_BITS_READER_H_ | 6 #define MEDIA_FILTERS_VP9_RAW_BITS_READER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 bool ReadBool(); | 41 bool ReadBool(); |
42 | 42 |
43 // Reads a literal with |bits| bits. | 43 // Reads a literal with |bits| bits. |
44 // If the read goes beyond the end of buffer, the return value is undefined. | 44 // If the read goes beyond the end of buffer, the return value is undefined. |
45 int ReadLiteral(int bits); | 45 int ReadLiteral(int bits); |
46 | 46 |
47 // Reads a signed literal with |bits| bits (not including the sign bit). | 47 // Reads a signed literal with |bits| bits (not including the sign bit). |
48 // If the read goes beyond the end of buffer, the return value is undefined. | 48 // If the read goes beyond the end of buffer, the return value is undefined. |
49 int ReadSignedLiteral(int bits); | 49 int ReadSignedLiteral(int bits); |
50 | 50 |
| 51 // Consumes trailing bits up to next byte boundary. Returns true if no |
| 52 // trailing bits or they are all zero. |
| 53 bool ConsumeTrailingBits(); |
| 54 |
51 private: | 55 private: |
52 std::unique_ptr<BitReader> reader_; | 56 std::unique_ptr<BitReader> reader_; |
53 | 57 |
54 // Indicates if none of the reads since the last Initialize() call has gone | 58 // Indicates if none of the reads since the last Initialize() call has gone |
55 // beyond the end of available data. | 59 // beyond the end of available data. |
56 bool valid_; | 60 bool valid_; |
57 | 61 |
58 DISALLOW_COPY_AND_ASSIGN(Vp9RawBitsReader); | 62 DISALLOW_COPY_AND_ASSIGN(Vp9RawBitsReader); |
59 }; | 63 }; |
60 | 64 |
61 } // namespace media | 65 } // namespace media |
62 | 66 |
63 #endif // MEDIA_FILTERS_VP9_RAW_BITS_READER_H_ | 67 #endif // MEDIA_FILTERS_VP9_RAW_BITS_READER_H_ |
OLD | NEW |