Log in

View Full Version : Exactly when to use ReYV12() function and why?


Steve56
25th June 2006, 19:15
Hi folks,

I've had a longer absence of this forum, so this question might
not be up to the standard... :rolleyes:

I wonder when to use scharfis' ReYV12() function. Only if my
DV decoder outputs YUY2 and I need to have YV12 and want to
get the right (interlaced) color resampling?

So ReYV12() would not be needed if my decoder outputs the
video in DV native YV12 color space?

And if the source was YUY2 from the beginning, I would just use
ConvertToYV12() when needed, right?

Thanks

Steve56

actionman133
25th June 2006, 22:55
If you're DV decoder is giving you YV12, you don't need Scharfis' function. RYV12 () recovers the YV12 frame from a decoder providing YUY2 data. If you're already YV12, it's not necessary.

And ConvertToYV12 () should never be used on interlaced content. At the very least, it should be ConvertToYV12 (interlaced = true), However, this interpolates similarly to Bob () (I think... not certain on that tidbit). Scharfis' ReYV12 () appears to understand a method that doesn't require any interpolation (probably due to the decoder using a rough YV12-YUY2 conversion).

And about using ReYV12 () for a general, YUY2-YV12 converter: it *could* be used for such a thing, although I don't know if it *should*. Hopefully, someone else will answer that for you.

Steve56
26th June 2006, 11:56
Just to be sure this is the actual version of scharfis_brain's function:

# revert PAL-DV to YV12 for speed and quality reasons;
# needs yuy2 input (ie. canopus-dv-decoder)
# BFF Mandatory (hint: DV-AVIs commonly are BFF)
function reYV12(clip i)
{ isyuy2(i) ? i : i.converttoyuy2()
yx=i.converttoyv12()
x=i.separatefields().assumeframebased().separatefields().selectevery(4,0,2).weave()
ux=x.utoy().converttoyv12()
vx=x.vtoy().converttoyv12()
ytouv(ux,vx,yx)
}

(was posted here: http://forum.gleitz.info/showthread.php?t=25198&page=2&highlight=reyv12)

Steve56

actionman133
26th June 2006, 14:53
Yeah, that's the one I'm familiar with. As it says on the second line, it needs YUY2 input. If you're video is already decoding to YV12, then this function isn't necessary. As for content that was already interlaced YUY2, I still don't know whether this would be better than AVISynth's internal routines.

IF you have DV footage, AND it's given to you in YUY2, THEN use ReYV12 (). Under any other circumstances, then ReYV12 () is probably not the solution...