Quantcast DVD2SVCD: Function ConvertToYUY2(Clipc) - digitalFAQ.com Forums [Archives]
  #1  
09-07-2003, 05:04 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
09-07-2003, 06:07 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #3  
09-07-2003, 07:15 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts

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!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: SmoothDeinterlace and ConvertToYUY2? shgr Avisynth Scripting 35 11-05-2004 07:38 AM
TO use Use ConvertToYuY2() Or Not? Major Video Encoding and Conversion 18 09-20-2004 01:42 PM
Avisynth: Converttoyuy2() jorel Avisynth Scripting 49 03-15-2004 01:40 PM
Avishynht 2.54 y converttoyuy2().... generador Convertir y Codificar Video (Español) 3 01-27-2004 10:48 AM
ConvertToYUY2() CaLaFaT Convertir y Codificar Video (Español) 5 07-14-2003 12:48 AM

Thread Tools



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