X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=image_format.h;h=7ca334c36016e4324f0cc75fac9ab8fe87af5cb3;hp=90f60347807faa1aa80035e7e34a6c81f20d92bc;hb=9651a4eaae012cdc49c1aa38197861e04f62e91e;hpb=b10c546f579c7ccb5939161e61a71cd18a3f9bbd diff --git a/image_format.h b/image_format.h index 90f6034..7ca334c 100644 --- a/image_format.h +++ b/image_format.h @@ -1,5 +1,15 @@ -#ifndef _IMAGE_FORMAT_H -#define _IMAGE_FORMAT_H 1 +#ifndef _MOVIT_IMAGE_FORMAT_H +#define _MOVIT_IMAGE_FORMAT_H 1 + +// Note: Movit's internal processing formats do not have enough +// accuracy to support 12-bit input, so if you want to use Rec. 2020, +// you should probably stick to 10-bit, or accept somewhat reduced +// accuracy for 12-bit. Input depths above 8 bits are also generally +// less tested. +// +// 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 +28,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 +37,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 +52,4 @@ struct ImageFormat { GammaCurve gamma_curve; }; -#endif // !defined(_IMAGE_FORMAT_H) +#endif // !defined(_MOVIT_IMAGE_FORMAT_H)