digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   DVD2SVCD: function ConvertToYUY2(clipC) (http://www.digitalfaq.com/archives/encode/5442-dvd2svcd-function-converttoyuy2clipc.html)

jorel 09-07-2003 05:04 PM

DVD2SVCD: function ConvertToYUY2(clipC)
 
hy Phil,

please,
what means and for how reasons works this line in the
Latest optimal script for DVD2SVCD :

12=function ConvertToYUY2(clip c){ return isYV12(c) ? c : convertToYV12(c) }

i can't see a thing! :?

Dialhot 09-07-2003 06:07 PM

Re: Phil, how it work? - function ConvertToYUY2(clip c)...
 
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.

jorel 09-07-2003 07:15 PM

:wink:
after your explanations the horizon is wide open.

is cool (if c is in YV12 then return c without doing nothing else,
convert c to YV12 and return the result of the convertion.),

smart ( this function do a "ConvertToYV12" only if we need it,..),

wise ( work always in YV12 (and not YuY2 as D2S wants)
because avs2.52 is much more efficient in YV12 ),

great (do the convert only if the codec used for reading the avi
doesn't already provide YV12 video.),

and efficient (That's what we want.) !


thanks, is very clear!
:D


All times are GMT -5. The time now is 04:59 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.