Dialogs: Video color depth


VirtualDub help - Dialogs: Video color depth

Selects the desired image formats for video decompression and video compression.

Decompression format

Selects a color format to target when decompressing the input video.

For a compressed source, this format is requested directly from the video codec. "Autoselect" will choose a common, safe RGB format, such as 24-bit, 32-bit, or 15-bit RGB.

For an uncompressed source (or Avisynth script), the desired format is produced through image conversion if it is not the same as the source. YCbCr-to-YCbCr conversions do not round-trip through RGB. "Autoselect" chooses the source format so that no conversion is necessary.

If the video codec cannot produce the format you have selected, VirtualDub will automatically attempt to degrade the video format to a similar format that is supported. For instance, if 16-bit RGB fails, 24-bit RGB will be tried. The fallback code avoids color space conversions if possible; if a YCbCr format fails, other YCbCr formats will be tested before resorting to RGB.

Output format

Selects a color format for output. During preview, this is the format sent to the display panes. When video compression is active, this selects the format received by the video compressor.

The output format is produced by conversion from the input format. When video filters are in use, the input format is converted to 32-bit RGB, processed, and the result converted to the output format. If video filters are not being used, the input format is converted directly to the output format.

Note As is standard in GDI bitmaps, the 32-bit format has a dummy alpha channel, used only for padding. VirtualDub cannot currently target a 32-bit format with meaningful alpha.
Note The size of the output format doesn't necessarily relate to how well the output compresses through a video codec. For instance, converting from 24-bit RGB to 16-bit RGB can hinder compression, because it increases quantization noise (banding) in the image.

Format descriptions

16-bit RGB (555)
This is a format with five bits per channel (32 levels) for each of red, green, and blue. It is a relatively low-precision format that is prone to some banding artifacts but is common on older video display hardware, as it is faster and consumes less memory than 24-bit RGB. This format is sometimes known as HiColor.
16-bit RGB (565)
This is a slightly improved version of 16-bit RGB (555), as it uses the unused bit to improve precision in green.
24-bit RGB (888)
This is a format with eight bits per channel (256 levels) for each of red, green, and blue. It is common for photographic images and is often known as TrueColor. This is the safest and most reliable format to use for video interchange.
32-bit RGB (8888) (dummy alpha channel)
This is similar to 24-bit RGB, except that it has an additional unused eight bits per pixel. Picture quality is identical to 24-bit, but the additional padding makes the pixels a more convenient size for computation. This format is sometimes slightly faster than 24-bit for processing, but should be avoided for storage as it wastes one-third more space.
4:2:2 YCbCr (UYVY)
This is a format which uses the YCbCr color space (luma, chroma-blue, chroma-red), which is closer to the way color images are perceived by the human brain. It averages only 16 bits per pixel with similar perceptual quality to 24-bit RGB by only storing color information at half horizontal resolution, producing slight color bleeding but only taking two-thirds as much space.

This format, as do all other YCbCr formats listed below, encodes luminance (Y) with a range of [16, 235] and chroma (Cb/Cr, or U/V), with a range of [16, 240].

UYVY is accepted directly by many video codecs. Since many video codecs internally use color spaces similar to YCbCr, using this format with video codecs can speed up rendering.

4:2:2 YCbCr (YUY2)
This is the same as 4:2:2 YCbCr (UYVY), except for a shuffling of data bytes. It has the same quality and performance advantages as UYVY.
4:2:0 planar YCbCr (YV12)
This is a YCbCr format with an average of 12 bits per pixel and half resolution both horizontally and vertically in color information. It thus takes 25% less space than UYVY or YUY2, but with some vertical bleeding. "Planar" refers to the organization of data in the format, where luma, chroma-blue, and chroma-red are stored separately.

Some codecs accept this format directly for further increases in performance over the 4:2:2 formats. However, it should be avoided for interlaced video, where the loss of vertical color resolution can cause motion artifacts between fields.

Note Although 4:2:0 YCbCr formats exist that accommodate interlacing, the YV12 four-character code (FOURCC) denotes a specific 4:2:0 encoding that is non-interlaced.
4:2:2 planar YCbCr (YV16)
This is a YCbCr format with an average of 16 bits per pixel and half horizontal resolution in color information.

The YV16 format is rare and not well supported by video codecs and playback applications, but is supported here for completeness.

4:1:0 planar YCbCr (YVU9)
This is a YCbCr format with an average of 9 bits per pixel and quarter resolution both horizontally and vertically in color information. YVU9 thus takes 43% less space than UYVY/YUY2 and 62% less space than 24-bit RGB, but at the cost of significant color bleeding.
Luminance only (Y8)
Y8 is a monochrome format, and thus selecting it will cause video to be converted to grayscale. However, it only requires half of the space of UYVY or YUY2 at 8 bits per pixel.

Y8 uses the same luma scale as YCbCr, 16-240, so there is a very slight loss of luma precision compared to 24-bit RGB. However, conversion between Y8 and YCbCr formats is lossless in luma and extremely fast.