diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-13 02:09:18 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-13 02:09:18 +0000 |
commit | ae80a63c97121a6f2694bd64a08455bd59341a11 (patch) | |
tree | 60324b0070732424d0b477344c5bc0038ec4ae1b /DOCS/tech/colorspaces.txt | |
parent | 3962480f56fd954ecfe2bf806628c25395d0726e (diff) | |
download | mpv-ae80a63c97121a6f2694bd64a08455bd59341a11.tar.bz2 mpv-ae80a63c97121a6f2694bd64a08455bd59341a11.tar.xz |
updated
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5587 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'DOCS/tech/colorspaces.txt')
-rw-r--r-- | DOCS/tech/colorspaces.txt | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/DOCS/tech/colorspaces.txt b/DOCS/tech/colorspaces.txt index 4a68a43ad2..4fb8875098 100644 --- a/DOCS/tech/colorspaces.txt +++ b/DOCS/tech/colorspaces.txt @@ -1,9 +1,27 @@ -Huh. The planar YUV modes. -========================== +In general +========== -The most missunderstood thingie... +There are planar and packed modes. +- Planar mode means: you have 3 separated image, one for each component, +each image 8 bites/pixel. To get the real colored pixel, you have to +mix the components from all planes. The resolution of planes may differ! +- Packed mode means: you have all components mixed/interleaved together, +so you have small "packs" of components in a single, big image. -Let's see: (some cut'n'paste from www and maillist) +There are RGB and YUV colorspaces. +- RGB: Read, Green and Blue components. Used by analog VGA monitors. +- YUV: Luminance (Y) and Chrominance (U,V) components. Used by some + video systems, like PAL. Also most m(j)peg/dct based codecs use this. + +With YUV, they used to reduce the resolution of U,V planes: +The most common YUV formats: +fourcc: bpp: IEEE: plane sizes: (w=width h=height of original image) +? 24 YUV 4:4:4 Y: w * h U,V: w * h +YUY2,UYVY 16 YUV 4:2:2 Y: w * h U,V: (w/2) * h +YV12,I420 12 YUV 4:2:0 Y: w * h U,V: (w/2) * (h/2) +YVU9 9 YUV 4:1:1 Y: w * h U,V: (w/4) * (h/4) + +conversion: (some cut'n'paste from www and maillist) RGB to YUV Conversion: Y = (0.257 * R) + (0.504 * G) + (0.098 * B) + 16 @@ -35,10 +53,14 @@ Y = luminance, the weighted average of R G B components. (0=black 255=white) U = Cb = blue component (0=green 128=grey 255=blue) V = Cr = red component (0=green 128=grey 255=red) -MPlayer side: -============= + +Huh. The planar YUV modes. +========================== + +The most missunderstood thingie... + In MPlayer, we usually have 3 pointers to the Y, U and V planes, so it -doesn't matter what is they order in memory: +doesn't matter what is the order of the planes in the memory: for mp_image_t and libvo's draw_slice(): planes[0] = Y = luminance planes[1] = U = Cb = blue |