YCoCg

Last updated

The YCoCg color model, also known as the YCgCo color model, is the color space formed from a simple transformation of an associated RGB color space into a luma 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, VVC, JPEG XR, and Dirac. [1] 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. The more complete definition with variable bit depths of Y and chrominance values is given in ITU-T H.273.

Contents

Original image above and representation of the individual components Y, chrominance green Cg and chrominance orange Co. Barns grand tetons YCgCo separation.jpg
Original image above and representation of the individual components Y, chrominance green Cg and chrominance orange Co.

History and naming

The earliest documents (circa 2003) referred to this color model as YCoCg. [2] [3] It was adopted in an international standard for the first time in H.264/AVC (in its second edition professional extensions project [4] ), which had primarily been designed to use the YCbCr 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 color model are simpler and faster computation, better decorrelation of the color planes to improve compression performance, and exactly lossless invertibility. [5] [6]

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: [2]

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. For example, pure red is expressed in the RGB system as (1, 0, 0) and in the YCoCg system as (1/4, 1/2, −1/4). [5] [6] 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), [7] can be implemented efficiently with a reduced bit depth. The scaled version uses a lifting scheme 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. [8]

Here, possible values for Y are still in [0, 1], while possible values for Co and Cg are now in [-1, 1].

The conversion from RGB to YCoCg-R is:

Co=R-B;tmp=B+Co/2;Cg=G-tmp;Y=tmp+Cg/2;

The conversion from YCoCg-R to RGB is then:

tmp=Y-Cg/2;G=Cg+tmp;B=tmp-Co/2;R=B+Co;

(All divisions are truncating, as in C. The forward transformation may be adapted to produce a similar implementation of YCoCg.)

It is also possible to pack all three elements in 3n bits using modulo arithmetic. [9] However, the resulting discontinuity at wraparound can confuse subsequent stages of compression. [10] [11]

Efficiency gains

The screen content coding (SCC) extensions of the HEVC (H.265) standard and the VVC (H.266) 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. Use of YCoCg color space to encode RGB video in HEVC-SCC found large (~20%) coding gains for lossy video, but minimal gains when using YCoCg-R to losslessly encode video. [12]

The reversible variant gives 4.21 dB of coding gain, compared to 3.54 dB for the BT.470 color matrix and 3.98 dB for the JPEG 2000 reversible color transform. [8] [2]

Literature

Related Research Articles

<span class="mw-page-title-main">JPEG</span> Lossy compression method for reducing the size of digital images

JPEG is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality. Since its introduction in 1992, JPEG has been the most widely used image compression standard in the world, and the most widely used digital image format, with several billion JPEG images produced every day as of 2015.

<span class="mw-page-title-main">Lossy compression</span> Data compression approach that reduces data size while discarding or changing some of it

In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size for storing, handling, and transmitting content. The different versions of the photo of the cat on this page show how higher degrees of approximation create coarser images as more details are removed. This is opposed to lossless data compression which does not degrade the data. The amount of data reduction possible using lossy compression is much higher than using lossless techniques.

<span class="mw-page-title-main">JPEG 2000</span> Image compression standard and coding system

JPEG 2000 (JP2) is an image compression standard and coding system. It was developed from 1997 to 2000 by a Joint Photographic Experts Group committee chaired by Touradj Ebrahimi, with the intention of superseding their original JPEG standard, which is based on a discrete cosine transform (DCT), with a newly designed, wavelet-based method. The standardized filename extension is .jp2 for ISO/IEC 15444-1 conforming files and .jpx for the extended part-2 specifications, published as ISO/IEC 15444-2. The registered MIME types are defined in RFC 3745. For ISO/IEC 15444-1 it is image/jp2.

Golomb coding is a lossless data compression method using a family of data compression codes invented by Solomon W. Golomb in the 1960s. Alphabets following a geometric distribution will have a Golomb code as an optimal prefix code, making Golomb coding highly suitable for situations in which the occurrence of small values in the input stream is significantly more likely than large values.

Color depth or colour depth, also known as bit depth, is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component of a single pixel. When referring to a pixel, the concept can be defined as bits per pixel (bpp). When referring to a color component, the concept can be defined as bits per component, bits per channel, bits per color, and also bits per pixel component, bits per color channel or bits per sample (bps). Modern standards tend to use bits per component, but historical lower-depth systems used bits per pixel more often.

In digital photography, computer-generated imagery, and colorimetry, a grayscale image is one in which the value of each pixel is a single sample representing only an amount of light; that is, it carries only intensity information. Grayscale images, a kind of black-and-white or gray monochrome, are composed exclusively of shades of gray. The contrast ranges from black at the weakest intensity to white at the strongest.

<span class="mw-page-title-main">YCbCr</span> Family of digital colour spaces

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-difference and red-difference chroma components. Y′ is distinguished from Y, which is luminance, meaning that light intensity is nonlinearly encoded based on gamma corrected RGB primaries.

sRGB Standard RGB color space

sRGB is a standard RGB color space that HP and Microsoft created cooperatively in 1996 to use on monitors, printers, and the World Wide Web. It was subsequently standardized by the International Electrotechnical Commission (IEC) as IEC 61966-2-1:1999. sRGB is the current defined standard colorspace for the web, and it is usually the assumed colorspace for images that are neither tagged for a colorspace nor have an embedded color profile.

<span class="mw-page-title-main">Adobe RGB color space</span> Color space developed by Adobe

The Adobe RGB (1998) color space or opRGB is a color space developed by Adobe Inc. in 1998. It was designed to encompass most of the colors achievable on CMYK color printers, but by using RGB primary colors on a device such as a computer display. The Adobe RGB (1998) color space encompasses roughly 50% of the visible colors specified by the CIELAB color space – improving upon the gamut of the sRGB color space, primarily in cyan-green hues. It was subsequently standardized by the IEC as IEC 61966-2-5:1999 with a name opRGB and is used in HDMI.

<span class="mw-page-title-main">CIE 1931 color space</span> Color space defined by the CIE in 1931

The CIE 1931 color spaces are the first defined quantitative links between distributions of wavelengths in the electromagnetic visible spectrum, and physiologically perceived colors in human color vision. The mathematical relationships that define these color spaces are essential tools for color management, important when dealing with color inks, illuminated displays, and recording devices such as digital cameras. The system was designed in 1931 by the "Commission Internationale de l'éclairage", known in English as the International Commission on Illumination.

<span class="mw-page-title-main">LMS color space</span> Color space represented by the response of the three types of cones of the human eye

LMS, is a color space which represents the response of the three types of cones of the human eye, named for their responsivity (sensitivity) peaks at long, medium, and short wavelengths.

JPEG XR is an image compression standard for continuous tone photographic images, based on the HD Photo specifications that Microsoft originally developed and patented. It supports both lossy and lossless compression, and is the preferred image format for Ecma-388 Open XML Paper Specification documents.

<span class="mw-page-title-main">Progressive Graphics File</span> File format

PGF is a wavelet-based bitmapped image format that employs lossless and lossy data compression. PGF was created to improve upon and replace the JPEG format. It was developed at the same time as JPEG 2000 but with a focus on speed over compression ratio.

<span class="mw-page-title-main">Rec. 2020</span> ITU-R recommendation

ITU-R Recommendation BT.2020, more commonly known by the abbreviations Rec. 2020 or BT.2020, defines various aspects of ultra-high-definition television (UHDTV) with standard dynamic range (SDR) and wide color gamut (WCG), including picture resolutions, frame rates with progressive scan, bit depths, color primaries, RGB and luma-chroma color representations, chroma subsamplings, and an opto-electronic transfer function. The first version of Rec. 2020 was posted on the International Telecommunication Union (ITU) website on August 23, 2012, and two further editions have been published since then.

Apple Video is a lossy video compression and decompression algorithm (codec) developed by Apple Inc. and first released as part of QuickTime 1.0 in 1991. The codec is also known as QuickTime Video, by its FourCC RPZA and the name Road Pizza. When used in the AVI container, the FourCC AZPR is also used.

Better Portable Graphics (BPG) is a file format for coding digital images, which was created by programmer Fabrice Bellard in 2014. He has proposed it as a replacement for the JPEG image format as the more compression-efficient alternative in terms of image quality or file size. It is based on the intra-frame encoding of the High Efficiency Video Coding (HEVC) video compression standard. Tests on photographic images in July 2014 found that BPG produced smaller files for a given quality than JPEG, JPEG XR and WebP.

<span class="mw-page-title-main">Free Lossless Image Format</span> Raster graphics format

Free Lossless Image Format (FLIF) is a lossless image format claiming to outperform PNG, lossless WebP, lossless BPG and lossless JPEG 2000 in terms of compression ratio on a variety of inputs.

Display Stream Compression (DSC) is a VESA-developed video compression algorithm designed to enable increased display resolutions and frame rates over existing physical interfaces, and make devices smaller and lighter, with longer battery life. It is a low-latency algorithm based on delta PCM coding and YCGCO-R color space.

<i>ICtCp</i>

ICTCP, ICtCp, or ITP is a color representation format specified in the Rec. ITU-R BT.2100 standard that is used as a part of the color image pipeline in video and digital photography systems for high dynamic range (HDR) and wide color gamut (WCG) imagery. It was developed by Dolby Laboratories from the IPT color space by Ebner and Fairchild. The format is derived from an associated RGB color space by a coordinate transformation that includes two matrix transformations and an intermediate nonlinear transfer function that is informally known as gamma pre-correction. The transformation produces three signals called I, CT, and CP. The ICTCP transformation can be used with RGB signals derived from either the perceptual quantizer (PQ) or hybrid log–gamma (HLG) nonlinearity functions, but is most commonly associated with the PQ function.

References

  1. "Dirac Specification" (PDF). BBC. p. 136. Archived from the original (pdf) on 2015-05-03. Retrieved 2010-05-04.
  2. 1 2 3 Henrique Malvar and Gary Sullivan, "Transform, Scaling & Color Space Impact of Professional Extensions". Moving Picture Experts Group and Video Coding Experts Group document JVT-H031, JVT 8th meeting, Geneva, May 2003.
  3. Shijun Sun, "Residual Color Transform Using YCoCg-R". Moving Picture Experts Group and Video Coding Experts Group document JVT-L014, 12th JVT meeting: Redmond, Washington, United States, July 2004.
  4. 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 document VCEG-Z16, 26th VCEG meeting: Busan, Korea, April 2005.
  5. 1 2 "YCoCg: A Color Space with RGB Reversibility" (ppt). University of Texas at Arlington. Retrieved 2010-05-02.
  6. 1 2 Yair Moshe. "H.264 Amendment: Fidelity Range Extensions" (PDF). Signal and Image processing Lab (SIPL), Technion Israel Institute of Technology. p. 15. Archived from the original (pdf) on 2014-10-06. Retrieved 2010-05-02.
  7. Henrique Malvar and Gary Sullivan, "YCoCg-R: A color space with RGB reversibility and low dynamic range". Moving Picture Experts Group and Video Coding Experts Group document JVT-I014, JVT PExt Ad Hoc Group Meeting: Trondheim, Norway, July 2003.
  8. 1 2 Malvar, Henrique S.; Sullivan, Gary J.; Srinivasan, Sridhar (28 August 2008). Lifting-based reversible color transformations for image compression (PDF). Optical Engineering + Applications, 2008. p. 707307. doi:10.1117/12.797091.
  9. Cary, David. "Lossless RGB to Y'CbCr transformation". Stack Overflow.
  10. 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.
  11. 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.
  12. Shan Liu; Xiaozhong Xu; Shawmin Lei; Kevin Jou (September 2015). "Overview of HEVC extensions on screen content coding". p. 8.