View Single Post
Old 19th February 2008, 07:59   #6  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Quote:
Originally Posted by Corran View Post
but as far as I've noticed in testing, the videos have not been adversely affected by the way I've used it.
Only because it happens that the videos you've tested it with haven't required replacing frames near the beginning and end, but can you guarantee that you'll never need to replace those?

Maybe you can make that guarantee. I haven't looked at your script carefully enough to tell. Personally I'd rather use my safer versions of Trim() and not have to bother thinking about that stuff.

But if you can make that guarantee, you should enforce it with Assert(). A hard failure at the beginning is much better than allowing people to waste hours encoding videos that they later realize don't contain the correct frames.
Quote:
As for the boolean, is it really not fast to do it this way than repeating the mathematical expression in multiple conditions?

I did it mostly to cut down on the number of times calculations had to be repeated. Otherwise, the script would become much more complex to read and calcuations that I needed to reference multiple times would have to be computed several times before the script was fully completed.
That's not what I'm talking about at all.

If you want to save a boolean expression into a variable, that's perfectly fine. The "? true : false" part is completely useless.
Code:
foo = booleanExpression
foo = booleanExpression ? true : false
foo = (booleanExpression ? true : false) ? true : false
foo = ((booleanExpression ? true : false) ? true : false) ? true : false
Are all equivalent.

Last edited by stickboy; 19th February 2008 at 08:05.
stickboy is offline   Reply With Quote