]> git.sesse.net Git - movit/blobdiff - image_format.h
Add partial Rec. 2020 support.
[movit] / image_format.h
index 90f60347807faa1aa80035e7e34a6c81f20d92bc..df6f48747cdc3e933dfa6cdaf6cec88f544b14a3 100644 (file)
@@ -1,5 +1,11 @@
-#ifndef _IMAGE_FORMAT_H
-#define _IMAGE_FORMAT_H 1
+#ifndef _MOVIT_IMAGE_FORMAT_H
+#define _MOVIT_IMAGE_FORMAT_H 1
+
+// Note: Input depths above 8 bits have not been tested, so Rec. 2020
+// support should be regarded as somewhat untested (it assumes 10-
+// or 12-bit input). We also only support “conventional non-constant
+// luminance” for Rec. 2020, where Y' is derived from R'G'B' instead of
+// RGB, since this is the same system as used in Rec. 601 and 709.
 
 enum MovitPixelFormat {
        FORMAT_RGB,
@@ -18,6 +24,7 @@ enum Colorspace {
        COLORSPACE_REC_601_525 = 1,
        COLORSPACE_REC_601_625 = 2,
        COLORSPACE_XYZ = 3,  // Mostly useful for testing and debugging.
+       COLORSPACE_REC_2020 = 4,
 };
 
 enum GammaCurve {
@@ -26,11 +33,14 @@ enum GammaCurve {
        GAMMA_sRGB = 1,
        GAMMA_REC_601 = 2,
        GAMMA_REC_709 = 2,  // Same as Rec. 601.
+       GAMMA_REC_2020_10_BIT = 2,  // Same as Rec. 601.
+       GAMMA_REC_2020_12_BIT = 3,
 };
 
 enum YCbCrLumaCoefficients {
        YCBCR_REC_601 = 0,
        YCBCR_REC_709 = 1,
+       YCBCR_REC_2020 = 2,
 };
 
 struct ImageFormat {
@@ -38,4 +48,4 @@ struct ImageFormat {
        GammaCurve gamma_curve;
 };
 
-#endif  // !defined(_IMAGE_FORMAT_H)
+#endif  // !defined(_MOVIT_IMAGE_FORMAT_H)