PDA

View Full Version : squeeze the most possible detail out of interlaced YV12!(the motion adptive approach)


scharfis_brain
1st March 2005, 17:23
Some time ago I told, I would make a motion adaptive interlaced yuy2 <-> yv12 conversion.

after some little experiments, I was surprised, how easy that is:

#interlaced yuy2 to yv12
function yuy2toyv12_laced(clip i, int "th", bool "matchfields")
{ th=default(th,8)
matchfields=default(matchfields,false)
i.converttoyv12().mergechroma(
\ i.tdeint(mode=1,type=1,link=0,mthreshc=th,tryweave=matchfields,full=(matchfields==false)).converttoyv12().separatefields().selectevery(4,0,3).weave()
\)
}

#interlaced yv12 to yuy2
function yv12toyuy2_laced(clip i, int "th", bool "matchfields")
{ th=default(th,8)
matchfields=default(matchfields,false)
i.converttoyuy2().mergechroma(
\ i.tdeint(mode=1,type=1,mthreshc=th,tryweave=matchfields,full=(matchfields==false)).converttoyuy2().separatefields().selectevery(4,0,3).weave()
\)
}

yv12toyuy2_interlaced() does what its name says.
but it is better than a simple converttoyuy2(interlaced=true) in more than one reason:
- it produces better chroma detail in static areas (progressive chroma sampling!)
- it makes a ELA-based chroma-interlpolation for moving areas (the old method only does weighting)
- it produces much lesser chroma-flickering, when doing some sort of bob() afterwards.

Richard Berg
1st March 2005, 17:34
Would you recommend using yuy2toyv12_laced() before MvBob() when deinterlacing YUY2 captures, or is that redundant?

scharfis_brain
1st March 2005, 17:39
mvbob() is able to handle yuy2 as well as yv12.

so I do not see a reason to convert the colorspace before mvbob().

Richard Berg
1st March 2005, 19:12
Thanks, didn't realize that.

North2Polaris
8th March 2005, 04:47
@scharfis_brain

Based on what I have read in other threads, YUY2 is YUV 4:2:2, NTSC DV is YUV 4:1:1 (every fourth luma sample has a colour sample), and PAL DV is YUV 4:2:0 (half-luma sampling rate in both, horizontal and vertical directions).

In the case of NTSC DV to DVD (using QuEnc, for example, and keeping everything in YV12), any potential benefit to using your script following ReInterpolate411, rather than ConvertToYV12(interlaced=true)?

ReInterpolate411 “corrects the improper 4:1:1 => 4:2:2 conversion that seems to occur with some DV/4:1:1 codes when used with Avisynth".

Thanks.

North