maxlazarov
7a3df014b9
The lt and lte functions were swapped.
13 years ago
Michael Niedermayer
d2101bffa0
eval: fix infinite loop on opensolaris x86.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
59affed23c
eval: add root() to solve f(x)=0
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
8c5ee45d13
eval: Check that single parameter functions dont get a second param.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
923092697a
eval: Allow specifying the variable id.
...
Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
094673ff1b
eval: support 3 parameter functions.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
43b1943a55
eval: Add taylor series evaluation support.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Alex Converse
b0f29db5c2
Mark mutable static data const where appropriate.
13 years ago
Stefano Sabatini
999495734b
lavu/eval: add if() and ifnot() eval functions
...
They allow to implement the if/then/else logic, which cannot be
implemented otherwise.
For example the expression:
A*B + not(A)*C
always evaluates to NaN if B is NaN, even in the case where A is 0.
13 years ago
Reimar Döffinger
d086c1203c
Add coverage exclusions for test code.
...
For some of the code e.g. doing timing measurements there is no
real point in running regression testing on it, thus it should
not be counted against coverage.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Nicolas George
40963ea9e9
eval: add mathematical constants (PI, E, PHI).
...
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
085ea85c2e
eval: fix () bug in not.
...
Found-by: Oded Shimon
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
1339702540
eval: add gcd()
...
example: -vf 'scale=256:256,mp=geq=gcd(X\,Y)-2:128:128'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
9e5e086b7e
eval:add hypot()
...
useage example: -vf 'scale=256:256,mp=geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
ac7cda9e14
eval: add random()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
8fd56f7b12
eval: make variables persistent so they can be used between evaluations.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
775af761a0
eval: test isnan(sqrt(-1)) instead of just sqrt(-1)
...
sqrt(-1) returns "some NaN", it's not specified which exactly.
13 years ago
Stefano Sabatini
8cee38a298
eval: implement not() expression
13 years ago
Stefano Sabatini
9bc393908a
eval: add sqrt function for computing the square root
13 years ago
Ronald S. Bultje
dfd8116986
eval: add missing comma to tests.
14 years ago
Ronald S. Bultje
fe277b16f0
eval: fix memleak.
14 years ago
Michael Niedermayer
16a565d0cb
eval/fate: try to fix nan printing format failures.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Mans Rullgard
94350ab986
eval: clear Parser instances before using
...
This prevents random values from the stack being used as
"variables" in expressions.
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Mans Rullgard
6da812e4ee
eval: make timing optional in test program
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Mans Rullgard
abc78a5a7c
Do not include log.h in avutil.h
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Michael Niedermayer
940a55ccf4
eval: Fix 32bit unsigned parsing
...
Fixes ticket264
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Diego Biurrun
dc25d79f49
Drop unnecessary directory prefixes from #include directives.
14 years ago
Stefano Sabatini
d58ed64a89
eval: add support for pow() function
...
It is a more search-friendly alternative to the ^ operator.
14 years ago
Stefano Sabatini
3c2c52baec
eval: implement not() expression
14 years ago
Michael Niedermayer
9132f2ad0c
eval: opensolaris strtod() cannot handle 0x1234
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Stefano Sabatini
e5272e729e
eval: add sqrt function for computing the square root
14 years ago
Anton Khirnov
516fb5e40c
lavu: remove FF_API_OLD_EVAL_NAMES cruft
14 years ago
Stefano Sabatini
5ae4251c3b
eval: add support for trunc, ceil, and floor functions
...
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14 years ago
Stefano Sabatini
25601bc564
eval: add support for trunc, ceil, and floor functions
...
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Stefano Sabatini
d2af7205a1
Use hierarchic names convention (prefix them with av_expr) for the
...
eval API.
More grep-friendly and more consistent with the rest of the FFmpeg
API.
Originally committed as revision 25708 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
20fcd0797e
Implement isnan() function evaluation.
...
Originally committed as revision 25666 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
4cabef0a9d
Make strmatch() return 1 only if the string compared against the
...
prefix does not contain other characters which may belong to an
identifier.
This allows to distinguish for example to have different constants
with the same prefix (e.g. "foo" and "foobar").
Originally committed as revision 25626 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
2b59fbe9b1
Add st, ld, while examples/tests.
...
Originally committed as revision 25625 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
8bb12e71af
Add examples of unary operators.
...
Originally committed as revision 25624 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
63b1630356
Fix evaluation of expressions of the form: E1;E2.
...
The pointer to the char ';' has to be increased before to evaluate
";E2".
Originally committed as revision 25623 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
eb928286de
Add more tests to eval, help detecting some of the more apparent
...
errors, far from being a complete test system.
Originally committed as revision 23635 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
7ec9b9beca
Make av_parse_expr() fail if there are trailing chars at the end of
...
the provided expression.
Allow detection of mistyped expressions.
Originally committed as revision 23629 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
2f62224bc0
Improve av_parse_eval() error reporting.
...
Originally committed as revision 23627 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
0b99215c0e
Move eval.c and eval.h from libavcodec to libavutil, and make the eval
...
API public.
Originally committed as revision 23485 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
79513857ba
Fix eval-test compilation.
...
Originally committed as revision 23406 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
b851dd9e9b
Cosmetics: reindent and break some overly long line.
...
Originally committed as revision 23405 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
0cd28d9494
Cosmetics: consistently apply K&R style.
...
Make me and Diego happy.
Originally committed as revision 23404 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
9711439b44
Cosmetics: rename ff_parse_expr() and ff_parse_and_eval_expr() parameters:
...
const_name -> const_names
const_value -> const_values
func[12]_name -> func[12]_names
func[12] -> funcs[12]
All these parameters contain a list of values, using plural names for
them help understanding a little.
Originally committed as revision 23403 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
9ace13b416
Make ff_parse_expr() and ff_parse_and_eval_expr() return an int
...
containing an error code.
Allow these functions to convey the reason of the failure to the
calling function, failure which is not always due to a parsing error
but it may depend for example on a memory problem.
Also fix several potential memleaks.
Originally committed as revision 23402 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago