Current version

v1.10.4 (stable)

Navigation

Main page
Archived news
Downloads
Documentation
   Capture
   Compiling
   Processing
   Crashes
Features
Filters
Plugin SDK
Knowledge base
Contact info
 
Other projects
   Altirra

Archives

Blog Archive

Does VirtualDub do a color conversion when converting I420 to YV12?

No, current versions of VirtualDub do lossless conversions between I420 and YV12.

I420 and YV12 are FOURCCs for uncompressed video formats that use the YCbCr color space with 4:2:0 sampling and with the images stored as back-to-back, non-interleaved planes. The only difference between them is that the Cb and Cr planes are swapped in the encoding order. Parts of VirtualDub's video processing pipeline were made YCbCr-aware starting in 1.6.0, and this was extended over later versions up to 1.8.0, which makes the video filter pipeline YCbCr-capable as well. The video pipeline will still do format conversions as necessary, but when converting between YCbCr formats it is capable of simply reinterleaving the data or resampling the chroma planes without touching the luma plane. In the specific case of I420 and YV12, the two video formats map to the same internal format (YUV420_Planar), but with the two secondary plane entries swapped. Conversion between the two simply involves swapping the planes or doing three plane copies.

Sharp users will notice that the Video Color Depth dialog only allows you to choose YV12 and not I420. Well, that was a mistake on my part. When I originally reworked the video pipeline to allow YCbCr formats, I made the mistake of exposing the internal format as the setting in the pipeline configuration. As a result, when you select YV12 in that dialog, you're actually selecting the internal 4:2:0 planar format, and this later gets mapped in the back end to YUV420_Planar variant 0, which is YV12. I420 is variant 1, which you can't get to because the pipeline hardcodes variant 0. The same goes for Y800 vs. Y8. I suppose it wouldn't be too hard to push out the variant setting and add compatibility code in the script layer, but I haven't heard many requests for it (read: zero).

Comments

This blog was originally open for comments when this entry was first posted, but was later closed and then removed due to spam and after a migration away from the original blog software. Unfortunately, it would have been a lot of work to reformat the comments to republish them. The author thanks everyone who posted comments and added to the discussion.