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

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

Issue 2697863003: color: Clarify default behaviors (Closed)
Patch Set: color: Remove redundant PrimaryID/TransferID/MatrixID values Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/h264_parser.h" 5 #include "media/filters/h264_parser.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return gfx::Rect(crop_left, crop_top, 119 return gfx::Rect(crop_left, crop_top,
120 coded_size->width() - crop_left - crop_right, 120 coded_size->width() - crop_left - crop_right,
121 coded_size->height() - crop_top - crop_bottom); 121 coded_size->height() - crop_top - crop_bottom);
122 } 122 }
123 123
124 // Based on T-REC-H.264 E.2.1, "VUI parameters semantics", 124 // Based on T-REC-H.264 E.2.1, "VUI parameters semantics",
125 // available from http://www.itu.int/rec/T-REC-H.264. 125 // available from http://www.itu.int/rec/T-REC-H.264.
126 gfx::ColorSpace H264SPS::GetColorSpace() const { 126 gfx::ColorSpace H264SPS::GetColorSpace() const {
127 if (colour_description_present_flag) { 127 if (colour_description_present_flag) {
128 return gfx::ColorSpace( 128 return gfx::ColorSpace(
129 colour_primaries, transfer_characteristics, matrix_coefficients, 129 gfx::ColorSpace::PrimaryIDFromH264(colour_primaries),
130 gfx::ColorSpace::TransferIDFromH264(transfer_characteristics),
131 gfx::ColorSpace::MatrixIDFromH264(matrix_coefficients),
130 video_full_range_flag ? gfx::ColorSpace::RangeID::FULL 132 video_full_range_flag ? gfx::ColorSpace::RangeID::FULL
131 : gfx::ColorSpace::RangeID::LIMITED); 133 : gfx::ColorSpace::RangeID::LIMITED);
132 } else { 134 } else {
133 return gfx::ColorSpace(gfx::ColorSpace::PrimaryID::UNSPECIFIED, 135 return gfx::ColorSpace(
134 gfx::ColorSpace::TransferID::UNSPECIFIED, 136 gfx::ColorSpace::PrimaryID::BT709, gfx::ColorSpace::TransferID::BT709,
135 gfx::ColorSpace::MatrixID::UNSPECIFIED, 137 gfx::ColorSpace::MatrixID::BT709,
136 video_full_range_flag 138 video_full_range_flag ? gfx::ColorSpace::RangeID::FULL
137 ? gfx::ColorSpace::RangeID::FULL 139 : gfx::ColorSpace::RangeID::LIMITED);
138 : gfx::ColorSpace::RangeID::LIMITED);
139 } 140 }
140 } 141 }
141 142
142 H264PPS::H264PPS() { 143 H264PPS::H264PPS() {
143 memset(this, 0, sizeof(*this)); 144 memset(this, 0, sizeof(*this));
144 } 145 }
145 146
146 H264SliceHeader::H264SliceHeader() { 147 H264SliceHeader::H264SliceHeader() {
147 memset(this, 0, sizeof(*this)); 148 memset(this, 0, sizeof(*this));
148 } 149 }
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 1476
1476 default: 1477 default:
1477 DVLOG(4) << "Unsupported SEI message"; 1478 DVLOG(4) << "Unsupported SEI message";
1478 break; 1479 break;
1479 } 1480 }
1480 1481
1481 return kOk; 1482 return kOk;
1482 } 1483 }
1483 1484
1484 } // namespace media 1485 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698