@chapter Expression Evaluation
@c man begin EXPRESSION EVALUATION
-When evaluating an arithemetic expression, FFmpeg uses an internal
+When evaluating an arithmetic expression, Libav uses an internal
formula evaluator, implemented through the @file{libavutil/eval.h}
interface.
@item abs(x)
@item squish(x)
@item gauss(x)
+@item isinf(x)
+Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
+@item isnan(x)
+Return 1.0 if @var{x} is NAN, 0.0 otherwise.
+
@item mod(x, y)
@item max(x, y)
@item min(x, y)
@item ld(var)
Allow to load the value of the internal variable with number
-@var{var}, which was previosly stored with st(@var{var}, @var{expr}).
+@var{var}, which was previously stored with st(@var{var}, @var{expr}).
The function returns the loaded value.
@item while(cond, expr)
Evaluate expression @var{expr} while the expression @var{cond} is
non-zero, and returns the value of the last @var{expr} evaluation, or
NAN if @var{cond} was always false.
+
+@item ceil(expr)
+Round the value of expression @var{expr} upwards to the nearest
+integer. For example, "ceil(1.5)" is "2.0".
+
+@item floor(expr)
+Round the value of expression @var{expr} downwards to the nearest
+integer. For example, "floor(-1.5)" is "-2.0".
+
+@item trunc(expr)
+Round the value of expression @var{expr} towards zero to the nearest
+integer. For example, "trunc(-1.5)" is "-1.0".
+
+@item sqrt(expr)
+Compute the square root of @var{expr}. This is equivalent to
+"(@var{expr})^.5".
+
+@item not(expr)
+Return 1.0 if @var{expr} is zero, 0.0 otherwise.
@end table
Note that:
A*B + not(A)*C
@end example
-When A evaluates to either 1 or 0, that is the same as
-@example
-A*B + eq(A,0)*C
-@end example
-
In your C code, you can extend the list of unary and binary functions,
and define recognized constants, so that they are available for your
expressions.