Quote:
Originally Posted by jorel
12=function ConvertToYUY2(clip c){ return isYV12(c) ? c : convertToYV12(c) }
|
Okay, that's simple.
First, the idea of this line is to overide the "ConvertToYUY2" that is done by D2S. With thie line, that is not the "real" convertoYUY2 that is called, but the one provided by this line 12.
How it works ?
This function receive a clip in parameter. By default, avisynth always give the last clip produced in the script. There we have only one clip : the one produced by the line "avisource". So, c = source. That's what we want.
The content of the function can be written in an easier way by this :
if c is in YV12 then return c without doing nothing else, convert c to YV12 and return the result of the convertion.
In few word : this function do a "ConvertToYV12" only if we need it, and fo nothing else.
By this way we are sure to :
- work always in YV12 (and not YuY2 as D2S wants) because avs2.52 is much more efficient in YV12
- do the convert only if the codec used for reading the avi doesn't already provide YV12 video.