Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
литература / Digital_Video_and_HD_Second_Edition_Algorithms_and_Interfaces.pdf
Скачиваний:
0
Добавлен:
13.05.2026
Размер:
38.02 Mб
Скачать

Nonlinear red, green, blue (R’G’B’)

Video originates with approximations of linear-light (tristimulus) RGB primary components, usually represented in abstract terms in the range 0 (black) to

+1 (white). In order to meaningfully determine a colour from an RGB triple, the colorimetric properties of the primaries and the reference white – such as their

CIE [x, y] chromaticity coordinates – must be known. Colorimetric properties of RGB components were discussed in Colour science for video, on page 287. In the absence of any specific information, use the BT.709 primaries and the CIE D65 white point.

In Gamma, on page 315, I described how lightness information is coded nonlinearly, in order to achieve good perceptual performance from a limited number of bits. In a colour system, the nonlinear transfer function described in that chapter is applied individually to each of the three RGB tristimulus components: From the set of RGB tristimulus (linear-light) values, three gammacorrected primary signals are computed; each is approximately proportional to the square-root of the corresponding scene tristimulus value.

See page 320. BT.709 standardizes an EOCF that ostensibly should be imposed at the camera. For tristimulus values greater than a few percent, the encoding is this:

R'

= 1.099R0.45 − 0.099

 

709

 

 

G'

= 1.099G0.45 − 0.099

Eq 28.3

709

 

 

B'

= 1.099B0.45 − 0.099

 

709

 

 

However, what is important in “BT.709” coding is that encoded image data produces the intended picture appearance on the standard display device. BT.1886 standardizes the reference EOCF for HD. Encoding should be specified in terms of the inverse EOCF.

R

= R1/2.4

 

709

= G1/2.4

 

G

Eq 28.4

709

= B1/2.4

 

B

 

709

 

 

To encode sRGB is similar, but using a power of 1/2.2 instead of 1/2.4.

CHAPTER 28

LUMA AND COLOUR DIFFERENCES

345

The BT.601 luma coefficients were computed using the technique that I explained in Luminance coefficients, on page 306, using the historical NTSC primaries and white point of 1953; see Table 3.2, on page 25 of Composite NTSC and PAL: Legacy Video Systems.

The mismatch between the primaries and the luma coefficients of SD has little practical significance; however, the mismatch of luma coefficients between SD and HD has great practical significance!

BT.601 luma

The following luma equation is standardized in BT.601 for SD, and also applies to JPEG/JFIF (in computing) and Exif (in digital still photography):

601Y'= 0.299 R'+ 0.587 G'+ 0.114 B'

Eq 28.5

As mentioned a moment ago, the E and prime symbols originally used for video signals have been elided over the course of time, and this has led to ambiguity of the Y symbol between colour science and television.

The coefficients in the luma equation are based upon the sensitivity of human vision to each of the RGB primaries standardized for the coding. The low value of the blue coefficient is a consequence of saturated blue colours having low lightness. The luma coefficients are also a function of the white point, or more properly, the chromaticity of reference white.

In principle, luma coefficients should be derived from the primary and white chromaticities. The BT.601 luma coefficients of Equation 28.5 are the same as those established in 1953 by the NTSC from the primaries and white point then in use. Primaries actually used in consumer displays changed a few years after the adoption of NTSC. The primaries in use for 480i SD today are approximately those specified in SMPTE RP 145; the primaries in use for 576i SD are approximately those specified in EBU Tech. 3213. (These primary sets are slightly different; both sets very nearly match the primaries of BT.709.) Despite the change in primaries, the luma coefficients for SD video – both 480i and 576i – have remained unchanged from the values that were established in 1953. As a consequence of the change in primaries, the luma coefficients in SD no longer theoretically match the primaries. The mismatch has little practical significance.

BT.709 luma

International agreement on BT.709 was achieved in 1990 on the basis of “theoretically correct” luma coefficients derived from the BT.709 primaries:

709Y′ = 0.2126 R′ + 0.7152G′ + 0.0722B

Eq 28.6

346

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

Chroma subsampling, revisited

The purpose of colour difference coding is to enable subsampling. In analog video, the colour difference components are subject to bandwidth reduction through the use of analog lowpass filters; horizontal colour detail is removed. In digital video, the chroma components are subsampled, or decimated, by filtering followed by the discarding of samples. Figure 12.3, Chroma subsampling, on page 124, sketches several digital subsampling schemes. In 4:2:2 subsampling, after filtering, alternate colour difference samples are discarded at the encoder. In 4:2:0, vertical chroma detail is removed as well. At the decoder, the missing samples are approximated by interpolation.

In analog chroma bandlimiting, and in digital subsampling, some colour detail is lost. However, owing to the poor colour acuity of vision, the loss cannot be detected by a viewer at normal viewing distance.

Some low-end digital video systems simply drop chroma pixels at the encoder without filtering, and replicate chroma pixels at the decoder. Discarding samples can be viewed as point sampling; that operation runs the risk of introducing aliases. Proper decimation and interpolation filters should be used; these should be designed according to the principles explained in Filtering and sampling, on page 191.

Luma/colour difference summary

When luma and colour difference coding is used for image interchange, it is important for the characteristics of red, green, and blue to be maintained from the input of the encoder to the output of the decoder. The chromaticities of the primaries were detailed in Colour science for video, on page 287, and mentioned in this chapter as they pertain to the encoding and decoding of luma. I have assumed that the characteristics of the primaries match across the whole system. The primaries upon which luma and colour difference coding are based are known as the interchange (or transmission) primaries.

In practice, a camera sensor may produce RGB components whose chromaticities do not match the interchange primaries. To achieve accurate colour reproduction in such a camera, it is necessary to insert

CHAPTER 28

LUMA AND COLOUR DIFFERENCES

347

TRISTIMULUS 3× 3

OECF

NONLINEAR

CHROMA

(“LINEAR MATRIX”)

 

3× 3

SUBSAMPLING

 

 

 

[T1-1]

 

 

γE

≈0.5

 

[P ]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XYZ

 

RGB

 

 

R’G’B’

Y’CBCR

 

 

 

Y’CBCR

or RsGsBs

 

 

 

 

 

 

 

 

 

 

 

 

 

e.g., 4:2:2

Figure 28.8 A luma/colour difference encoder involves the four stages summarized in this block diagram. First, linear-light (tristimulus) input signals are transformed through the “linear” matrix T1-1 to produce RGB coded to the interchange primaries. Gamma correction is then applied. The matrix P then produces luma and two colour differences. The colour difference (chroma) signals are then subsampled; luma undergoes a compensating delay.

I use T1-1 to denote the encoding “linear matrix,” to conform to the notation of Luminance coefficients, on page 306.

Interchange primaries are also called transmission primaries.

a 3× 3 matrix that transforms tristimulus signals from the image capture primaries to the interchange primaries. (This is the “linear matrix” built into the camera.) Similarly, a decoder may be required to drive a display whose primaries are different from the interchange primaries; at the output of the decoder, it may be necessary to insert a 3× 3 matrix that transforms from the interchange primaries to the image display primaries. (See page 309.)

Figure 28.8 above summarizes luma/colour difference encoding. If image data originated in linear XYZ components, a 3× 3 matrix transform (T1-1) would be applied to obtain linear RGB having chromaticities and white reference of the interchange primaries. For BT.709 interchange primaries standard for SD and HD, the matrix would be that of Equation 26.9, on

page 308. More typically, image data originates in some device-dependent space that I denote R1G1B1, and the 3× 3 “linear matrix” transform (T1-1) is determined by the camera designer. See the sequence of Figures 26.3 through 26.8, starting on page 300, and the accompanying text and captions, to gain an appreciation for how such a matrix might be crafted. Practical cameras do not have spectral sensitivities that are linear combinations of the CIE colour matching functions, so they are not properly characterized by chromaticities. Nonetheless, once a linear matrix to a set of interchange primaries has been chosen, Equation 26.10 can be used to derive equivalent sensor primaries (the “taking primaries”).

348

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

 

CHROMA

 

 

NONLINEAR

 

 

EOCF

 

TRISTIMULUS

 

INTERPOLATION

3× 3

 

 

 

 

3× 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[P-1]

 

γD=2.4

 

 

[T2 ]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XYZ

 

 

 

 

 

 

 

 

 

 

 

 

 

Y’CBCR

Y’CBCR

R’G’B’

RGB

 

 

 

e.g., 4:2:2

 

 

 

 

 

 

 

 

 

or RdGdBd

Figure 28.9 A luma/colour difference decoder involves the inverse of the four stages of Figure 28.8 in opposite order. First, subsampled colour difference (chroma) signals are interpo-

lated; luma undergoes a compensating delay. The matrix P-1 then recovers R’G’B’ from luma and two colour differences. A transfer function having an exponent of about 2.4 is then applied, which produces linear-light (tristimulus) signals RGB. If the display’s primaries differ from the interchange primaries, RGB are transformed through the matrix T2 to produce appropriate RdGdBd.

Figures 28.8 and 28.9 show 3× 3 matrix transforms being used for two distinctly different tasks.

When someone hands you a 3× 3, you have to ascertain

whether it is linearly or nonlinearly related to light power.

Once the linear matrix has been applied, each of the components is subject to a nonlinear transfer function (gamma correction) that produces nonlinear R’G’B’.

These components are transformed through a 3× 3 matrix (P), to obtain luma and colour difference components Y’CBCR or Y’PBPR. (This matrix depends upon the luma coefficients in use, and upon colour difference scale factors.) Then, if necessary, a chroma subsampling filter is applied to obtain subsampled colour difference components; luma is subject to a compensating delay.

A decoder uses the inverse operations of the encoder, in the opposite order, as sketched in

Figure 28.9. In a digital decoder, the chroma interpolation filter reconstructs missing chroma samples; in an analog decoder, no explicit operation is needed. The 3× 3 colour difference matrix (P-1) reconstructs nonlinear red, green, and blue primary components. The transfer functions restore the primary components to their linear-light tristimulus values. Finally, the tristimulus 3× 3 matrix (T2) transforms from the primaries of the interchange standard to the primaries implemented in the display device.

When a decoder is intimately associated with a CRT display, the decoder’s transfer function is performed by the nonlinear voltage-to-luminance relationship intrinsic to the CRT: No explicit operations are required for this step. However, to exploit this transfer function,

CHAPTER 28

LUMA AND COLOUR DIFFERENCES

349

Соседние файлы в папке литература