summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteph@migrax <steph@migrax>2010-10-24 12:33:31 -0700
committersteph@migrax <steph@migrax>2010-10-24 12:33:31 -0700
commitdf0c9e557d09f81bc073907c3addaa0e629ab937 (patch)
tree29a6a0063db25558a0a899143aba002922bd7944
parent46dac421ff2d30f9047d90f8a00d54238be4e3cd (diff)
Changes...
-rw-r--r--linuxgraphicsdrivers.lyx395
1 files changed, 226 insertions, 169 deletions
diff --git a/linuxgraphicsdrivers.lyx b/linuxgraphicsdrivers.lyx
index 8d1ee01..a973b9b 100644
--- a/linuxgraphicsdrivers.lyx
+++ b/linuxgraphicsdrivers.lyx
@@ -6063,28 +6063,38 @@ Color Space Conversion
\begin_layout Standard
\lang english
-Color spaces
+A color space is the way color is represented.
\end_layout
\begin_layout Standard
\lang english
-Linear relation
+In order to save space, perception principles are applied to movie encoding.
+
+\lang american
+The color space conversion stage exploits the fact that the human eye is
+ more perceptive of the luminance than the chrominance, and separates the
+ color data into those two components.
+ Intuitively, the luminance is the amount of light in the color, and the
+ chrominance is the name of the color (red, green, yellow...) and its amount
+ of saturation.
\end_layout
\begin_layout Standard
-
-\lang english
-Conversion matrices
+The quality of the chrominance data can lowered to conserve space, for example
+ by downsampling it, and the missing chrominance data is interpolated at
+ playing time while minimally impacting the perceived video quality.
\end_layout
\begin_layout Standard
\lang english
-The YUV color space: 1 component luminance (Y) + 2 components chrominance
- (UV).
- Chrominance information is less relevant to the eye than chrominance, so
- usually chrominance is subsampled and luminance at the original resolution.
+This is how the YUV color space works: it separates the color information
+ into one luminance component (Y) and two chrominance components (U and
+ V).
+ The chrominance information is less relevant to the eye than the luminance,
+ so usually chrominance is subsampled and luminance is at the original resolutio
+n.
Therefore, the Y plane usually has a higher resolution than the U and V
planes.
\end_layout
@@ -6092,13 +6102,175 @@ The YUV color space: 1 component luminance (Y) + 2 components chrominance
\begin_layout Standard
\lang english
-Bandwidth gain (RGBA32 vs YV12)
+Bandwidth gain example (RGBA32 vs YV12)
\end_layout
\begin_layout Standard
\lang english
-YUV Planar and packed (interlaced) formats.
+The color conversion from the YUV to the RGB color space is a linear relation,
+ and can therefore be represented by a matrix/vector multipliy, the matrix
+ being the conversion formula.
+\end_layout
+
+\begin_layout Standard
+
+\lang english
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+
+\lang english
+\begin_inset Formula $\left[\begin{array}{c}
+R\\
+G\\
+B\end{array}\right]=\left[\begin{array}{ccc}
+1 & 0 & 1.13983\\
+1 & -0.39465 & -0.58060\\
+1 & 2.03211 & 0\end{array}\right]\left[\begin{array}{c}
+Y\\
+U\\
+V\end{array}\right]$
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\lang english
+filler verifier la formule
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+
+\lang english
+\begin_inset Caption
+
+\begin_layout Plain Layout
+
+\lang english
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:YUV-to-RGB"
+
+\end_inset
+
+YUV to RGB Conversion formula as per ITU-R RB recommendation 601.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\lang english
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+
+\lang english
+\begin_inset Formula $\left[\begin{array}{c}
+R\\
+G\\
+B\end{array}\right]=\left[\begin{array}{ccc}
+1 & 0 & 1.13983\\
+1 & -0.39465 & -0.58060\\
+1 & 2.03211 & 0\end{array}\right]\left[\begin{array}{c}
+Y\\
+U\\
+V\end{array}\right]$
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\lang english
+filler verifier la formule peut pas etre la meme que 601
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+
+\lang english
+\begin_inset Caption
+
+\begin_layout Plain Layout
+
+\lang english
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:YUV-to-RGB-1"
+
+\end_inset
+
+YUV to RGB Conversion formula as per ITU-R RB recommendation 709.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+Figure
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "fig:YUV-to-RGB"
+
+\end_inset
+
+ shows the conversion matrices from ITU-R BT Recommendation 601 (standard
+ content) and recommendation 709 (intended for HD content).
+ Notice that although these matrices are very similar, there are numerical
+ differences which will result in slight off-colored rendering if one is
+ used in place of the other.
+ This is indeed often the case that video decoders with YUV to RGB hardware
+ are used to playback high definition content but no attention is made to
+ the proper conversion matrix that should be used.
+ Since the colors are only slightly wrong, this problem is commonly overlooked,
+ whereas most hardware features at least a BT601/BT709 switch, or a fully
+ programmable conversion matrix.
+\end_layout
+
+\begin_layout Standard
+
+\lang english
+YUV Planar and packed (interlaced) formats on Figure
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "fig:YUV-layouts-in"
+
+\end_inset
+
+.
\end_layout
\begin_layout Standard
@@ -6251,7 +6423,6 @@ end{tikzpicture}
\begin_layout Plain Layout
\noindent
-\align left
\lang english
\begin_inset ERT
@@ -6368,7 +6539,6 @@ end{tikzpicture}
\begin_layout Plain Layout
\noindent
-\align left
\lang english
\begin_inset ERT
@@ -6441,6 +6611,13 @@ node at (6,0.5) { };
\begin_layout Plain Layout
+
+\backslash
+node at (14,4) { };
+\end_layout
+
+\begin_layout Plain Layout
+
}
\end_layout
@@ -6469,6 +6646,12 @@ end{tikzpicture}
\begin_layout Plain Layout
\lang english
+\begin_inset CommandInset label
+LatexCommand label
+name "fig:YUV-layouts-in"
+
+\end_inset
+
YUV layouts in memory: planar format example (YV12, top), partially interleaved
format example (NV12, middle), fully interleaved format example (YUY2,
bottom).
@@ -6522,153 +6705,6 @@ http://en.wikipedia.org/wiki/YUV
\begin_layout Standard
\lang english
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Plain Layout
-
-\lang english
-\begin_inset Formula $\left[\begin{array}{c}
-R\\
-G\\
-B\end{array}\right]=\left[\begin{array}{ccc}
-1 & 0 & 1.13983\\
-1 & -0.39465 & -0.58060\\
-1 & 2.03211 & 0\end{array}\right]\left[\begin{array}{c}
-Y\\
-U\\
-V\end{array}\right]$
-\end_inset
-
-
-\begin_inset Note Note
-status open
-
-\begin_layout Plain Layout
-
-\lang english
-filler verifier la formule
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Plain Layout
-
-\lang english
-\begin_inset Caption
-
-\begin_layout Plain Layout
-
-\lang english
-\begin_inset CommandInset label
-LatexCommand label
-name "fig:YUV-to-RGB"
-
-\end_inset
-
-YUV to RGB Conversion formula as per ITU-R RB recommendation 601.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-
-\lang english
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Plain Layout
-
-\lang english
-\begin_inset Formula $\left[\begin{array}{c}
-R\\
-G\\
-B\end{array}\right]=\left[\begin{array}{ccc}
-1 & 0 & 1.13983\\
-1 & -0.39465 & -0.58060\\
-1 & 2.03211 & 0\end{array}\right]\left[\begin{array}{c}
-Y\\
-U\\
-V\end{array}\right]$
-\end_inset
-
-
-\begin_inset Note Note
-status open
-
-\begin_layout Plain Layout
-
-\lang english
-filler verifier la formule peut pas etre la meme que 601
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Plain Layout
-
-\lang english
-\begin_inset Caption
-
-\begin_layout Plain Layout
-
-\lang english
-\begin_inset CommandInset label
-LatexCommand label
-name "fig:YUV-to-RGB-1"
-
-\end_inset
-
-YUV to RGB Conversion formula as per ITU-R RB recommendation 709.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-Figure
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "fig:YUV-to-RGB"
-
-\end_inset
-
- shows the conversion matrices from ITU-R BT Recommendation 601 (standard
- content) and recommendation 709 (intended for HD content).
- Notice that although these matrices are very similar, there are numerical
- differences which will result in slight off-colored rendering if one is
- used in place of the other.
- This is indeed often the case that video decoders with YUV to RGB hardware
- are used to playback high definition content but no attention is made to
- the proper conversion matrix that should be used.
- Since the colors are only slightly wrong, this problem is commonly overlooked,
- whereas most hardware features at least a BT601/BT709 switch, or a fully
- programmable conversion matrix.
-\end_layout
-
-\begin_layout Standard
-
-\lang english
http://www.fourcc.org/yuv.php
\end_layout
@@ -7000,15 +7036,14 @@ Common YUV color space formats
\end_layout
\begin_layout Standard
+The final stage of video decoding is video upscaling.
+ Video upscaling consists in upscaling the movie resolution to the screen
+ resolution.
+ It can be done by specialized hardware, the 3D engine, or the 2D blitter
+ if it has scaling capabilities.
\lang english
-Pixel scaling
-\end_layout
-
-\begin_layout Standard
-
-\lang english
-Since the conversion from YUV space to RGB space is linear, filtered scaling
+ Since the conversion from YUV space to RGB space is linear, filtered upscaling
can be done either in the YUV or RGB space, which conveniently allows using
texture filtering which is available on 3D hardware to sample the YUV data.
This allows a single pass color space conversion and scaling.
@@ -7027,8 +7062,18 @@ Since the conversion from YUV space to RGB space is linear, filtered scaling
\lang english
If the hardware cannot achieve color space conversion and scaling at the
same time (for example if you have a YUV->RGB blitter and a shader less
- 3D engine), again the linear color conversion allows you to do the scaling
- in RGB space, and this will produce the same results (baring gamma correction).
+ 3D engine), it is equivalent to first do color space conversion from YUV
+ to RGB and then scaling in RGB space.
+ Again this is only possible when the color conversion operation is a linear
+ operation, in particular that means gamma correction has to be ignored.
+\end_layout
+
+\begin_layout Standard
+gamma conversion
+\end_layout
+
+\begin_layout Standard
+using a conversion shader or a conversion texture lookup
\end_layout
\begin_layout Section
@@ -8071,6 +8116,18 @@ The winsys is in charge of talking to the OS/Platform of choice.
\begin_layout Section
\lang english
+Vertex submission
+\end_layout
+
+\begin_layout Standard
+
+\lang english
+The VBO interface
+\end_layout
+
+\begin_layout Section
+
+\lang english
Writing Gallium3D drivers
\end_layout