Log in

View Full Version : AddBorders and interlaced YV12 chroma?


ChiDragon
18th April 2007, 11:42
It took me a while to figure out what was messing up the chroma in one of my scripts...


MPEG2Source() #interlaced YV12 source

AddBorders(0,2,0,2) #broken chroma

AddBorders(0,4,0,4) #fine

AddBorders(0,6,0,2) #broken chroma

The AddBorders doc says "See colorspace conversion filters for constraints when using the different color formats" but that only states that height for interlaced YV12 needs to be a multiple of four, so I thought I was okay doing 2+2=4.

Maybe a note on the AddBorders page is in order, or am I misunderstanding what the ConvertToxxx page says?

scharfis_brain
18th April 2007, 11:59
interlaced YV12 needs mod4 in vertical like you discovered.

THis is cause by the further vertical subsampling in interlaced fields.

if you add 2 pixels of black on top and bottom, you'll end up with the chroma swapped between both fields.

it is like adding one pixel on top & bottom of a YUY2 image. you'll get both fields completely swapped (fieldorder reversed)