PDA

View Full Version : Interlaced YV12 -> YUY2 Conversion Question


Incast
7th May 2009, 00:54
I'm very confused with results I am getting from re-encoding MPEG2 recordings I've made.

When I crop I see the following colour distortion emerge in each interlaced field:
http://i3.photobucket.com/albums/y76/incast/AVIsynth.png

My AVIsynth script is as follows:

MPEG2Source("D:\1.d2v")
Crop(0,0,-6,-2)
AddBorders(0,2,2,0)
Lanczos4resize(720,576)
ConverttoYUY2(interlaced=true)

This mystifies me as I always crop by an even number to preserve the interlacing, and the same behaviour occurs with or without the resolution change.

This issue can be resolved by moving the colourspace conversion to the start, but I always believed the golden rule to be to perform the colourspace conversion last to best preserve quality.

Clearly I haven't correctly understood the documentation on this point, so if anyone could offer me some clarity I'd greatly appreciate it.

Gavino
7th May 2009, 01:04
This mystifies me as I always crop by an even number to preserve the interlacing ...
For YV12, you need to crop vertically by a multiple of four to preserve chroma pixel allocation to the correct field.

Incast
7th May 2009, 01:13
For YV12, you need to crop vertically by a multiple of four to preserve chroma pixel allocation to the correct field.

Thanks for clarifying. For future reference, does the same apply for cropping horizontally i.e. it needs to be a multiple of four there too?

Gavino
7th May 2009, 01:20
For horizontal cropping of YV12, a multiple of two is sufficient.
Not because of interlacing (which only affects the vertical axis), but because of the 2x chroma subsampling. In this respect it's the same as YUY2.

Incast
7th May 2009, 01:22
For horizontal cropping of YV12, a multiple of two is sufficient.
Not because of interlacing (which only affects the vertical axis), but because of the 2x chroma subsampling. In this respect it's the same as YUY2.

Ah, I follow you now. Thanks for explaining that so clearly - you saved me a lot of effort going through the reference material! :thanks: