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

Unified Diff: content/common/gpu/media/h264_parser.cc

Issue 10939010: Cleanup: avoid foo ? true : false, part 1. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 3 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 | « chrome/renderer/chrome_render_view_observer.cc ('k') | content/public/test/mock_render_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/h264_parser.cc
===================================================================
--- content/common/gpu/media/h264_parser.cc (revision 159076)
+++ content/common/gpu/media/h264_parser.cc (working copy)
@@ -120,7 +120,7 @@
void H264Parser::SetStream(const uint8* stream, off_t stream_size) {
DCHECK(stream);
- DCHECK(stream_size > 0);
+ DCHECK_GT(stream_size, 0);
stream_ = stream;
bytes_left_ = stream_size;
@@ -281,9 +281,10 @@
READ_BITS_OR_RETURN(2, &nalu->nal_ref_idc);
READ_BITS_OR_RETURN(5, &nalu->nal_unit_type);
- DVLOG(4) << "NALU type: " << (int)nalu->nal_unit_type
- << " at: " << (void*)nalu->data << " size: " << nalu->size
- << " ref: " << (int)nalu->nal_ref_idc;
+ DVLOG(4) << "NALU type: " << static_cast<int>(nalu->nal_unit_type)
+ << " at: " << reinterpret_cast<const void*>(nalu->data)
+ << " size: " << nalu->size
+ << " ref: " << static_cast<int>(nalu->nal_ref_idc);
return kOk;
}
@@ -310,7 +311,7 @@
static inline void DefaultScalingList4x4(
int i,
int scaling_list4x4[][kH264ScalingList4x4Length]) {
- DCHECK(i < 6);
+ DCHECK_LT(i, 6);
if (i < 3)
memcpy(scaling_list4x4[i], kDefault4x4Intra, sizeof(kDefault4x4Intra));
@@ -321,7 +322,7 @@
static inline void DefaultScalingList8x8(
int i,
int scaling_list8x8[][kH264ScalingList8x8Length]) {
- DCHECK(i < 6);
+ DCHECK_LT(i, 6);
if (i % 2 == 0)
memcpy(scaling_list8x8[i], kDefault8x8Intra, sizeof(kDefault8x8Intra));
@@ -564,7 +565,6 @@
for (int i = 0; i < 6; ++i)
for (int j = 0; j < kH264ScalingList8x8Length; ++j)
sps->scaling_list8x8[i][j] = 16;
-
}
H264Parser::Result H264Parser::ParseSPS(int* sps_id) {
@@ -951,7 +951,7 @@
memset(shdr, 0, sizeof(*shdr));
- shdr->idr_pic_flag = ((nalu.nal_unit_type == 5) ? true : false);
+ shdr->idr_pic_flag = (nalu.nal_unit_type == 5);
shdr->nal_ref_idc = nalu.nal_ref_idc;
shdr->nalu_data = nalu.data;
shdr->nalu_size = nalu.size;
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | content/public/test/mock_render_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698