]> git.sesse.net Git - ffmpeg/blobdiff - doc/eval.texi
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / doc / eval.texi
index b325b37dff6599879c1502ee79685e0068595151..92fdc6d0a66712ed25a901c7508f8a2f852525c9 100644 (file)
@@ -98,6 +98,14 @@ point (@var{x}, @var{y}) from the origin.
 @item gcd(x, y)
 Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
 @var{y} are 0 or either or both are less than zero then behavior is undefined.
+
+@item if(x, y)
+Evaluate @var{x}, and if the result is non-zero return the result of
+the evaluation of @var{y}, return 0 otherwise.
+
+@item ifnot(x, y)
+Evaluate @var{x}, and if the result is zero return the result of the
+evaluation of @var{y}, return 0 otherwise.
 @end table
 
 The following constants are available:
@@ -110,19 +118,20 @@ exp(1) (Euler's number), approximately 2.718
 golden ratio (1+sqrt(5))/2, approximately 1.618
 @end table
 
-Note that:
+Assuming that an expression is considered "true" if it has a non-zero
+value, note that:
 
 @code{*} works like AND
 
 @code{+} works like OR
 
-thus
+and the construct:
 @example
 if A then B else C
 @end example
 is equivalent to
 @example
-A*B + not(A)*C
+if(A,B) + ifnot(A,C)
 @end example
 
 In your C code, you can extend the list of unary and binary functions,