Video with Linux

Sampling Chroma in DV

NTSC DV employs a 4:1:1 color space with a luma resolution of 720x480 and a chroma resolution of 180x480. Blue screen chroma key techniques require accurate color information to obtain satisfactory results. We compare the chroma upsampling in Sony Vegas 9 to Cinelerra and to a simple inpainting technique that uses the luma plane to increase chroma resolution.

Comparison of Vegas and Cinelerra

Screen captures of DV encoded video displayed by Vegas and Cinelerra are magnified 4x. The sample aspect ratio was set to 3:2 to avoid additional scaling in the display routines.

Vertical banding in the red colors near the blue background is evident in both programs.

Interpolation and Inpainting

The following describes linear interpolation and a simple inpainting technique to upsample the chroma planes in DV video. It is presented as a image to allow for the mathematical typesetting.

In a practical implementation it may happen that ni,4 is zero. The solution I adopted in my code was to replace ni,k by ni,k+ck where c is a non-zero bias factor and switch to linear interpolation when ni,4+ck is smaller than a certain threshold. Given the 8 bit color depth of DV video a threshold of 4 or a bias factor of 1 is reasonable.

Cinelerra Plugin

I have written a Cinelerra plugin called yuv411 that performs interpolation and inpainting for DV source. This plugin yields improved chroma upsampling results.

Note that the red vertical banding is gone from the upsampled images.

The plugin has an additional setting called offset. This setting shifts the chroma planes to the right by one or two pixels. For DV source downloaded from a camcorder the offset should be 0. For a DV file encoded by ffmpeg, the offset should be 1.

This plugin is designed to work with the YUV-8 Bit or YUVA-8 Bit color models in Cinelerra. It will not work with any of the RGB color models.

Conclusions

The inpainting algorithm is simple and obtains better chroma key results than any of the other algorithms. Vegas may use different upsampling algorithms for chroma keying and encoding than it does for displaying video. Improved upsampling of the chroma planes helps with the 4:1:1 to 4:2:0 color space conversion needed to create DVD compliant mpeg2 video streams. However, if the project is being rendered back to DV format, better quality will be obtained without chroma upsampling.
Page written and maintained by Eric Olson
ejolsonYYYrenomath.unr (replace YYY with an @ sign)
Last Updated: Fri Aug 28 00:15:26 PDT 2009