Log in

View Full Version : Interlaced 4:2:0 chroma to progressive?


`Orum
10th February 2016, 23:55
TL;DR version: Given two fields from a 3:2 telecined 4:2:0 source, how should the chroma be reassembled in memory for a progressive (IVTC'd) frame? For more info read below...

I'm trying to understand chroma subsampling in the context of interlaced (3:2 telecine) footage, and how to take the said chroma planes from two different fields and assemble them in memory appropriately. If I'm interpreting the wiki article (http://avisynth.nl/index.php/Sampling#YV12_color_format) correctly, it sounds like that to appropriately encode interlaced 4:2:0, the fields are split before chroma sampling was encoded, thus a chroma sample for luma pixel 0,0 would also be used for luma pixels 1,0; 0,2 and 1,2 in the final assembled frame. Thus, a chroma sample for interlaced 4:2:0 actually spans 3 rows of a frame, but it only valid for 2 of those 3 rows.

While this alone sounds like a very good reason not to ever combine vertical chroma subsampling with interlaced footage, that's exactly what was done with the DVD standard, and it seems to get even worse when you try to restore the footage to its original progressive state via IVTC. Progressive footage that is subsampled is supposed to have a single chroma sample cover 0,0; 1,0; 0,1; 1,1 in the luma plane. However, this requires chroma samples from two different fields, and when averaged all of a sudden instead of a single sample covering 2x2 in the luma plane, it's covering 2x4--yuck!

But when I look at IVTC'd footage (e.g. via LSMASH's optional internal pulldown, which doesn't seem to always work correctly in regard to field matching/decimation), I don't see this additional subsampling in the chroma plane, so I'm not entirely sure what is going on. While I can see how some analysis could produce better chroma than just a simple average, I'm not sure what the best method would be to produce quality results. Most importantly, I'm not sure how I'm supposed to assemble the chroma planes from two different fields once I've matched them for my filter. Any guidance or recommended reading material would be greatly appreciated.