The YCoCg color model, also known as the YCgCo color model, is the
color space
A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represent ...
formed from a simple transformation of an associated
RGB
The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three addi ...
color space into a ''
luma
Luma or LUMA may refer to:
Arts
* La Trobe University Museum of Art, Melbourne, Australia
* LUMA Projection Arts Festival, an annual event featuring building-scale projection mapping and light installations in Binghamton, NY
* LUMA Foundation, ...
'' value (denoted as Y) and two ''
chroma'' values called ''chrominance green'' (Cg) and ''chrominance orange'' (Co). It is supported in video and image compression designs such as
H.264/MPEG-4 AVC,
HEVC
High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard designed as part of the MPEG-H project as a successor to the widely used Advanced Video Coding (AVC, H.264, or MPEG-4 Part 10). In compari ...
,
VVC,
JPEG XR
JPEG XR (JPEG extended range) is an image compression standard for continuous tone photographic images, based on the HD Photo (formerly Windows Media Photo) specifications that Microsoft originally developed and patented. It supports both lossy a ...
, and
Dirac
Distributed Research using Advanced Computing (DiRAC) is an integrated supercomputing facility used for research in particle physics, astronomy and cosmology in the United Kingdom. DiRAC makes use of multi-core processors and provides a variety o ...
.
[ It is simple to compute, has good transform coding gain, and can be losslessly converted to and from RGB with fewer bits than are needed with other color models. A reversible scaled version with even lower bit depth, YCoCg-R, is also supported in most of these designs and is also used in ]Display Stream Compression
DisplayPort (DP) is a digital display interface developed by a consortium of PC and chip manufacturers and standardized by the Video Electronics Standards Association (VESA). It is primarily used to connect a video source to a display device su ...
. The more complete definition with variable bit depths of Y and chrominance values is given i
ITU-T H.273
![Barns grand tetons YCgCo separation](https://upload.wikimedia.org/wikipedia/commons/c/c8/Barns_grand_tetons_YCgCo_separation.jpg)
History and naming
The earliest documents (circa 2003) referred to this color model as YCoCg. It was adopted in an international standard for the first time in H.264/AVC (in its second edition professional extensions project), which had primarily been designed to use the YCbCr
YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in video and digital photography systems. Y′ is the luma component and CB and CR are the blue-diffe ...
color model. When it was adopted it was noted that the Co component carried the deviation toward red and was thus more similar to Cr than Cb, so the signal assignment and the naming was switched in the standard, resulting in the YCgCo alternative name (YCgCo is used in ITU-T H.273).
Properties
Advantages the YCoCg color model has over the YCbCr
YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in video and digital photography systems. Y′ is the luma component and CB and CR are the blue-diffe ...
color model are simpler and faster computation, better decorrelation
Decorrelation is a general term for any process that is used to reduce autocorrelation within a signal, or cross-correlation within a set of signals, while preserving other aspects of the signal. A frequently used method of decorrelation is the u ...
of the color planes to improve compression performance, and exactly lossless invertibility.[
]
Conversion with the RGB color model
The three values of the YCoCg color model are calculated as follows from the three color values of the RGB color model:
The values of Y are in the range from 0 to 1, while Co and Cg are in the range of −0.5 to 0.5, as is typical with "YCC" color models such as YCbCr
YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in video and digital photography systems. Y′ is the luma component and CB and CR are the blue-diffe ...
. For example, pure red is expressed in the RGB system as (1, 0, 0) and in the YCoCg system as (, , −).[ However, since the coefficients of the transformation matrix are simple binary fractions, it is easier to compute than other YCC transformations. For RGB signals with bit depth ''n'', either the resulting signals would then be rounded to ''n'' bits or would ordinarily be ''n''+2 bits when processing data in this form (although ''n''+1 bits would be sufficient for Co).
The inverse matrix converts from the YCoCg color model back to the RGB color model:
To perform the inverse conversion, only two additions and two subtractions are necessary, with integer-valued coefficients, by implementing it as:
tmp = Y - Cg;
R = tmp + Co;
G = Y + Cg;
B = tmp - Co;
]
The lifting-based YCoCg-R variation
A scaled version of the transformation, sometimes called YCoCg-R (where the "-R" refers to reversibility), can be implemented efficiently with a reduced bit depth. The scaled version uses a lifting scheme
The lifting scheme is a technique for both designing wavelets and performing the discrete wavelet transform (DWT). In an implementation, it is often worthwhile to merge these steps and design the wavelet filters ''while'' performing the wavelet tr ...
to make it exactly invertible while minimizing the bit depth of the three color components. For RGB signals with bit depth ''n'', the bit depth of the Y signal when using YCoCg-R will be ''n'' and the bit depth of Co and Cg will be ''n''+1, as contrasted with ordinary YCoCg which would need ''n''+2 bits for Y and Cg and ''n''+1 bits for Co.
Here, possible values for Y are still in , 1
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline (t ...
while possible values for Co and Cg are now in 1, 1
Onekama ( ) is a village in Manistee County in the U.S. state of Michigan. The population was 411 at the 2010 census. The village is located on the shores of Portage Lake and is surrounded by Onekama Township. The town's name is derived from "On ...
The conversion from RGB to YCoCg-R is:
The conversion from YCoCg-R to RGB is then:
(All divisions are truncating, as in C. The forward transformation may be adapted to produce a similar implementation of YCoCg.)
Efficiency gains
The screen content coding extensions of the HEVC
High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard designed as part of the MPEG-H project as a successor to the widely used Advanced Video Coding (AVC, H.264, or MPEG-4 Part 10). In compari ...
standard and the VVC standard include an adaptive color transform within the residual coding process that corresponds with switching the coding of RGB video into the YCoCg-R domain.
The use of YCoCg color space to encode RGB video in HEVC
High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard designed as part of the MPEG-H project as a successor to the widely used Advanced Video Coding (AVC, H.264, or MPEG-4 Part 10). In compari ...
screen content coding found large coding gains for lossy video, but minimal gains when using YCoCg-R to losslessly encode video.
Literature
* Henrique Malvar and Gary Sullivan,
Transform, Scaling & Color Space Impact of Professional Extensions
. Moving Picture Experts Group
The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by ISO and IEC that sets standards for media coding, including compression coding of audio, video, graphics, and genomic data; and transmission and f ...
and Video Coding Experts Group
The Video Coding Experts Group or Visual Coding Experts Group (VCEG, also known as Question 6) is a working group of the ITU Telecommunication Standardization Sector (ITU-T) concerned with standards for compression coding of video, images, audio, ...
document JVT-H031, JVT 8th meeting, Geneva, May 2003.
* Henrique Malvar and Gary Sullivan,
YCoCg-R: A color space with RGB reversibility and low dynamic range
. Moving Picture Experts Group
The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by ISO and IEC that sets standards for media coding, including compression coding of audio, video, graphics, and genomic data; and transmission and f ...
and Video Coding Experts Group
The Video Coding Experts Group or Visual Coding Experts Group (VCEG, also known as Question 6) is a working group of the ITU Telecommunication Standardization Sector (ITU-T) concerned with standards for compression coding of video, images, audio, ...
document JVT-I014, JVT PExt Ad Hoc Group Meeting: Trondheim, Norway, July 2003.
* Shijun Sun,
Residual Color Transform Using YCoCg-R
. Moving Picture Experts Group
The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by ISO and IEC that sets standards for media coding, including compression coding of audio, video, graphics, and genomic data; and transmission and f ...
and Video Coding Experts Group
The Video Coding Experts Group or Visual Coding Experts Group (VCEG, also known as Question 6) is a working group of the ITU Telecommunication Standardization Sector (ITU-T) concerned with standards for compression coding of video, images, audio, ...
document JVT-L014, 12th JVT meeting: Redmond, Washington, United States, July 2004.
* Woo-Shik Kim, Dmitry Birinov, and Dae-Sung Cho, Hyun Mun Kim (Multimedia Lab, Samsung AIT),
Enhancements to RGB coding in H.264/MPEG-4 AVC FRExt
. Video Coding Experts Group
The Video Coding Experts Group or Visual Coding Experts Group (VCEG, also known as Question 6) is a working group of the ITU Telecommunication Standardization Sector (ITU-T) concerned with standards for compression coding of video, images, audio, ...
document VCEG-Z16, 26th VCEG
The Video Coding Experts Group or Visual Coding Experts Group (VCEG, also known as Question 6) is a working group of the ITU Telecommunication Standardization Sector (ITU-T) concerned with standards for compression coding of video, images, audio, ...
meeting: Busan, Korea, April 2005.
* Henrique S. Malvar, Gary J. Sullivan, and Sridhar Srinivasan,
Lifting-based Reversible Color Transformations for Image Compression
, ''SPIE Applications of Digital Image Processing XXXI, Proc. SPIE
SPIE (formerly the Society of Photographic Instrumentation Engineers, later the Society of Photo-Optical Instrumentation Engineers) is an international not-for-profit professional society for optics and photonics technology, founded in 1955. It ...
'', San Diego, California, Vol. 7073, paper 7073-07, August 2008.
* P. Agawane and K. R. Rao (Multimedia Processing Lab, University of Texas at Arlington
The University of Texas at Arlington (UTA or UT Arlington) is a public research university in Arlington, Texas. The university was founded in 1895 and was in the Texas A&M University System for several decades until joining the University of Te ...
),
Implementation and evaluation of residual color transform for 4:4:4 lossless RGB coding
. International Conference on Recent Advances in Communication Engineering, Hyderabad, India, December, 2008.
* Tilo Strutz,
Multiplierless Reversible Colour Transforms and their Automatic Selection for Image Data Compression
" ''IEEE Transactions on Circuits and Systems for Video Technology'', Vol. 23, No. 7, pp. 1249–1259, July 2013.
* Tilo Strutz and Alexander Leipnitz,
Reversible Colour Spaces without Increased Bit Depth and Their Adaptive Selection
" ''IEEE Signal Processing Letters'', Vol. 22, No. 9, pp. 1269–1273, September 2015.
References
{{color space
YCgCo color space