Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_BASE_HDR_METADATA_H_ | |
| 6 #define MEDIA_BASE_HDR_METADATA_H_ | |
| 7 | |
| 8 #include <cstdint> | |
| 9 #include "media/base/media_export.h" | |
| 10 | |
| 11 namespace media { | |
| 12 | |
| 13 // The definitions below are copied from the current libwebm top-of-tree. | |
| 14 // Chromium's third_party/libwebm doesn't have these yet. We can probably just | |
| 15 // include libwebm header directly in the future. | |
| 16 // ---- Begin copy/paste from libwebm/webm_parser/include/webm/dom_types.h ---- | |
| 17 | |
| 18 /** | |
| 19 A parsed \WebMID{MatrixCoefficients} element. | |
| 20 | |
| 21 Matroska/WebM adopted these values from Table 4 of ISO/IEC 23001-8:2013/DCOR1. | |
| 22 See that document for further details. | |
| 23 */ | |
| 24 enum class MatrixCoefficients : std::uint64_t { | |
|
hubbe
2016/09/14 17:34:16
Plase use gfx::ColorSpace
servolk
2016/09/14 22:34:35
Ah, ok, thank for the pointer I didn't know about
hubbe
2016/09/14 22:41:25
We made the range an enum specifically so that we
| |
| 25 /** | |
| 26 The identity matrix. | |
| 27 | |
| 28 Typically used for GBR (often referred to as RGB); however, may also be used | |
| 29 for YZX (often referred to as XYZ). | |
| 30 */ | |
| 31 kRgb = 0, | |
| 32 | |
| 33 /** | |
| 34 Rec. ITU-R BT.709-5. | |
| 35 */ | |
| 36 kBt709 = 1, | |
| 37 | |
| 38 /** | |
| 39 Image characteristics are unknown or are determined by the application. | |
| 40 */ | |
| 41 kUnspecified = 2, | |
| 42 | |
| 43 /** | |
| 44 United States Federal Communications Commission Title 47 Code of Federal | |
| 45 Regulations (2003) 73.682 (a) (20). | |
| 46 */ | |
| 47 kFcc = 4, | |
| 48 | |
| 49 /** | |
| 50 Rec. ITU-R BT.470‑6 System B, G (historical). | |
| 51 */ | |
| 52 kBt470Bg = 5, | |
| 53 | |
| 54 /** | |
| 55 Society of Motion Picture and Television Engineers 170M (2004). | |
| 56 */ | |
| 57 kSmpte170M = 6, | |
| 58 | |
| 59 /** | |
| 60 Society of Motion Picture and Television Engineers 240M (1999). | |
| 61 */ | |
| 62 kSmpte240M = 7, | |
| 63 | |
| 64 /** | |
| 65 YCgCo. | |
| 66 */ | |
| 67 kYCgCo = 8, | |
| 68 | |
| 69 /** | |
| 70 Rec. ITU-R BT.2020 (non-constant luminance). | |
| 71 */ | |
| 72 kBt2020NonconstantLuminance = 9, | |
| 73 | |
| 74 /** | |
| 75 Rec. ITU-R BT.2020 (constant luminance). | |
| 76 */ | |
| 77 kBt2020ConstantLuminance = 10, | |
| 78 }; | |
| 79 | |
| 80 /** | |
| 81 A parsed \WebMID{Range} element. | |
| 82 */ | |
| 83 enum class Range : std::uint64_t { | |
| 84 /** | |
| 85 Unspecified. | |
| 86 */ | |
| 87 kUnspecified = 0, | |
| 88 | |
| 89 /** | |
| 90 Broadcast range. | |
| 91 */ | |
| 92 kBroadcast = 1, | |
| 93 | |
| 94 /** | |
| 95 Full range (no clipping). | |
| 96 */ | |
| 97 kFull = 2, | |
| 98 | |
| 99 /** | |
| 100 Defined by MatrixCoefficients/TransferCharacteristics. | |
| 101 */ | |
| 102 kDerived = 3, | |
| 103 }; | |
| 104 | |
| 105 /** | |
| 106 A parsed \WebMID{TransferCharacteristics} element. | |
| 107 | |
| 108 Matroska/WebM adopted these values from Table 3 of ISO/IEC 23001-8:2013/DCOR1. | |
| 109 See that document for further details. | |
| 110 */ | |
| 111 enum class TransferCharacteristics : std::uint64_t { | |
| 112 /** | |
| 113 Rec. ITU-R BT.709-6. | |
| 114 */ | |
| 115 kBt709 = 1, | |
| 116 | |
| 117 /** | |
| 118 Image characteristics are unknown or are determined by the application. | |
| 119 */ | |
| 120 kUnspecified = 2, | |
| 121 | |
| 122 /** | |
| 123 Rec. ITU‑R BT.470‑6 System M (historical) with assumed display gamma 2.2. | |
| 124 */ | |
| 125 kGamma22curve = 4, | |
| 126 | |
| 127 /** | |
| 128 Rec. ITU‑R BT.470-6 System B, G (historical) with assumed display gamma 2.8. | |
| 129 */ | |
| 130 kGamma28curve = 5, | |
| 131 | |
| 132 /** | |
| 133 Society of Motion Picture and Television Engineers 170M (2004). | |
| 134 */ | |
| 135 kSmpte170M = 6, | |
| 136 | |
| 137 /** | |
| 138 Society of Motion Picture and Television Engineers 240M (1999). | |
| 139 */ | |
| 140 kSmpte240M = 7, | |
| 141 | |
| 142 /** | |
| 143 Linear transfer characteristics. | |
| 144 */ | |
| 145 kLinear = 8, | |
| 146 | |
| 147 /** | |
| 148 Logarithmic transfer characteristic (100:1 range). | |
| 149 */ | |
| 150 kLog = 9, | |
| 151 | |
| 152 /** | |
| 153 Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range). | |
| 154 */ | |
| 155 kLogSqrt = 10, | |
| 156 | |
| 157 /** | |
| 158 IEC 61966-2-4. | |
| 159 */ | |
| 160 kIec6196624 = 11, | |
| 161 | |
| 162 /** | |
| 163 Rec. ITU‑R BT.1361-0 extended colour gamut system (historical). | |
| 164 */ | |
| 165 kBt1361ExtendedColourGamut = 12, | |
| 166 | |
| 167 /** | |
| 168 IEC 61966-2-1 sRGB or sYCC. | |
| 169 */ | |
| 170 kIec6196621 = 13, | |
| 171 | |
| 172 /** | |
| 173 Rec. ITU-R BT.2020-2 (10-bit system). | |
| 174 */ | |
| 175 k10BitBt2020 = 14, | |
| 176 | |
| 177 /** | |
| 178 Rec. ITU-R BT.2020-2 (12-bit system). | |
| 179 */ | |
| 180 k12BitBt2020 = 15, | |
| 181 | |
| 182 /** | |
| 183 Society of Motion Picture and Television Engineers ST 2084. | |
| 184 */ | |
| 185 kSmpteSt2084 = 16, | |
| 186 | |
| 187 /** | |
| 188 Society of Motion Picture and Television Engineers ST 428-1. | |
| 189 */ | |
| 190 kSmpteSt4281 = 17, | |
| 191 | |
| 192 /** | |
| 193 Association of Radio Industries and Businesses (ARIB) STD-B67. | |
| 194 */ | |
| 195 kAribStdB67Hlg = 18, | |
| 196 }; | |
| 197 | |
| 198 /** | |
| 199 A parsed \WebMID{Primaries} element. | |
| 200 | |
| 201 Matroska/WebM adopted these values from Table 2 of ISO/IEC 23001-8:2013/DCOR1. | |
| 202 See that document for further details. | |
| 203 */ | |
| 204 enum class Primaries : std::uint64_t { | |
| 205 /** | |
| 206 Rec. ITU‑R BT.709-6. | |
| 207 */ | |
| 208 kBt709 = 1, | |
| 209 | |
| 210 /** | |
| 211 Image characteristics are unknown or are determined by the application. | |
| 212 */ | |
| 213 kUnspecified = 2, | |
| 214 | |
| 215 /** | |
| 216 Rec. ITU‑R BT.470‑6 System M (historical). | |
| 217 */ | |
| 218 kBt470M = 4, | |
| 219 | |
| 220 /** | |
| 221 Rec. ITU‑R BT.470‑6 System B, G (historical). | |
| 222 */ | |
| 223 kBt470Bg = 5, | |
| 224 | |
| 225 /** | |
| 226 Society of Motion Picture and Television Engineers 170M (2004). | |
| 227 */ | |
| 228 kSmpte170M = 6, | |
| 229 | |
| 230 /** | |
| 231 Society of Motion Picture and Television Engineers 240M (1999). | |
| 232 */ | |
| 233 kSmpte240M = 7, | |
| 234 | |
| 235 /** | |
| 236 Generic film. | |
| 237 */ | |
| 238 kFilm = 8, | |
| 239 | |
| 240 /** | |
| 241 Rec. ITU-R BT.2020-2. | |
| 242 */ | |
| 243 kBt2020 = 9, | |
| 244 | |
| 245 /** | |
| 246 Society of Motion Picture and Television Engineers ST 428-1. | |
| 247 */ | |
| 248 kSmpteSt4281 = 10, | |
| 249 | |
| 250 /** | |
| 251 JEDEC P22 phosphors/EBU Tech. 3213-E (1975). | |
| 252 */ | |
| 253 kJedecP22Phosphors = 22, | |
| 254 }; | |
| 255 | |
| 256 // ---- End copy/paste from libwebm/webm_parser/include/webm/dom_types.h ---- | |
| 257 | |
| 258 // SMPTE ST 2086 mastering metadata. | |
| 259 struct MEDIA_EXPORT MasteringMetadata { | |
| 260 float PrimaryRChromaticityX = 0; | |
|
halliwell
2016/09/14 18:58:40
nit: here and below, not following standard for me
servolk
2016/09/15 01:50:03
Done.
| |
| 261 float PrimaryRChromaticityY = 0; | |
| 262 float PrimaryGChromaticityX = 0; | |
| 263 float PrimaryGChromaticityY = 0; | |
| 264 float PrimaryBChromaticityX = 0; | |
| 265 float PrimaryBChromaticityY = 0; | |
| 266 float WhitePointChromaticityX = 0; | |
| 267 float WhitePointChromaticityY = 0; | |
| 268 float LuminanceMax = 0; | |
| 269 float LuminanceMin = 0; | |
| 270 | |
| 271 MasteringMetadata(); | |
| 272 MasteringMetadata(const MasteringMetadata& rhs); | |
| 273 }; | |
| 274 | |
| 275 // HDR metadata common for HDR10 and WebM/VP9-based HDR formats. | |
| 276 struct MEDIA_EXPORT HDRMetadata { | |
| 277 MasteringMetadata mastering_metadata; | |
| 278 unsigned MaxCLL = 0; | |
| 279 unsigned MaxFALL = 0; | |
| 280 | |
| 281 HDRMetadata(); | |
| 282 HDRMetadata(const HDRMetadata& rhs); | |
| 283 }; | |
| 284 | |
| 285 // WebM color information, containing HDR metadata: | |
| 286 // http://www.webmproject.org/docs/container/#Colour | |
| 287 struct MEDIA_EXPORT ColorMetadata { | |
|
halliwell
2016/09/14 18:58:40
nit, shouldn't the file be called color_metadata?
servolk
2016/09/14 22:34:35
I'm actually not sure about it yes, since this Col
| |
| 288 MatrixCoefficients matrix_coefficients = MatrixCoefficients::kUnspecified; | |
| 289 unsigned BitsPerChannel = 0; | |
| 290 unsigned ChromaSubsamplingHorz = 0; | |
| 291 unsigned ChromaSubsamplingVert = 0; | |
| 292 unsigned CbSubsamplingHorz = 0; | |
| 293 unsigned CbSubsamplingVert = 0; | |
| 294 unsigned ChromaSitingHorz = 0; | |
| 295 unsigned ChromaSitingVert = 0; | |
| 296 Range range = Range::kUnspecified; | |
| 297 TransferCharacteristics transfer_characteristics = | |
| 298 TransferCharacteristics::kUnspecified; | |
| 299 Primaries primaries = Primaries::kUnspecified; | |
| 300 | |
| 301 HDRMetadata hdr_metadata; | |
| 302 | |
| 303 ColorMetadata(); | |
| 304 ColorMetadata(const ColorMetadata& rhs); | |
| 305 }; | |
| 306 | |
| 307 } // namespace media | |
| 308 | |
| 309 #endif // MEDIA_BASE_HDR_METADATA_H_ | |
| OLD | NEW |