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

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

Issue 1538743002: Switch to standard integer types in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEPS roll too Created 4 years, 12 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/audio_clock.cc ('k') | net/cert/ct_log_verifier_util.cc » ('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 5
6 /* 6 /*
7 * Copyright (c) 2010, The WebM Project authors. All rights reserved. 7 * Copyright (c) 2010, The WebM Project authors. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 22 matching lines...) Expand all
33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */ 37 */
38 38
39 // This file is modified from the dboolhuff.{c,h} from the WebM's libvpx 39 // This file is modified from the dboolhuff.{c,h} from the WebM's libvpx
40 // project. (http://www.webmproject.org/code) 40 // project. (http://www.webmproject.org/code)
41 // It is used to decode bits from a vp8 stream. 41 // It is used to decode bits from a vp8 stream.
42 42
43 #include <limits.h>
44
43 #include <algorithm> 45 #include <algorithm>
44 46
45 #include "base/numerics/safe_conversions.h" 47 #include "base/numerics/safe_conversions.h"
46 #include "media/filters/vp8_bool_decoder.h" 48 #include "media/filters/vp8_bool_decoder.h"
47 49
48 namespace media { 50 namespace media {
49 51
50 #define VP8_BD_VALUE_BIT \ 52 #define VP8_BD_VALUE_BIT \
51 static_cast<int>(sizeof(Vp8BoolDecoder::value_) * CHAR_BIT) 53 static_cast<int>(sizeof(Vp8BoolDecoder::value_) * CHAR_BIT)
52 54
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // occupied, 8 for the algorithm and 8 in the buffer. 199 // occupied, 8 for the algorithm and 8 in the buffer.
198 // 200 //
199 // When reading a byte from the user's buffer, |count_| is filled with 8 and 201 // When reading a byte from the user's buffer, |count_| is filled with 8 and
200 // one byte is filled into the |value_| buffer. When we reach the end of the 202 // one byte is filled into the |value_| buffer. When we reach the end of the
201 // data, |count_| is additionally filled with VP8_LOTS_OF_BITS. So when 203 // data, |count_| is additionally filled with VP8_LOTS_OF_BITS. So when
202 // |count_| == VP8_LOTS_OF_BITS - 1, the user's data has been exhausted. 204 // |count_| == VP8_LOTS_OF_BITS - 1, the user's data has been exhausted.
203 return (count_ > VP8_BD_VALUE_BIT) && (count_ < VP8_LOTS_OF_BITS); 205 return (count_ > VP8_BD_VALUE_BIT) && (count_ < VP8_LOTS_OF_BITS);
204 } 206 }
205 207
206 } // namespace media 208 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/audio_clock.cc ('k') | net/cert/ct_log_verifier_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698