Ganesh Ajjanagadde
0e9fe3e3c9
lavu/eval: replace pow(10,x) by ff_exp10(x)
...
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
Ganesh Ajjanagadde
4fa6f09c2c
lavu/eval: remove pow and exp2 for postfixes
...
These postfixes can be computed statically, and there is no need to
waste runtime resources.
Tested with FATE.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
Ganesh Ajjanagadde
401c93ddb7
avutil/eval: change sqrt to hypot
...
This improves the mathematical behavior of hypotenuse computation.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
Andreas Cadhalpun
107e54c5bf
avutil: add ff_reverse as av_reverse replacement
...
The table is used in libavutil/eval.c.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
9 years ago
Michael Niedermayer
c49e7924a8
avutil/eval: check for av_malloc failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
61123634dd
avutil/eval: factor av_expr_free() calls out
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
10 years ago
Michael Niedermayer
88efc013b1
avutil: move QP2LAMBDA constant to eval
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Stefano Sabatini
f3e886c7df
lavu/eval: add clip function
10 years ago
Janne Grunau
fb0c9d41d6
avutil: remove timer.h include from internal.h
...
Added libavutil/timer.h include to all files with {START,STOP}_TIMER.
11 years ago
Diego Biurrun
5b097399ba
eval: Explicitly ignore return value of strtod() in parse_db()
...
The return value is not needed. This fixes the warning:
libavutil/eval.c:353:15: warning: ignoring return value of ‘strtod’
11 years ago
Carl Eugen Hoyos
0915b531bc
Rename "AVClass class" as "AVClass component_class".
...
The aix header math.h defines "extern int class()" for C.
12 years ago
Stefano Sabatini
8afcaaeb75
lavu/eval: rename "new_eval_expr()" to "make_eval_expr()"
...
The new name is more semantically and stilistically consistent.
12 years ago
Clément Bœsch
77f60f0011
lavu/eval: add between() function.
12 years ago
Stefano Sabatini
b2098d2417
lavu/eval: add bitor and bitand functions
...
Warning note suggested by Reimar.
12 years ago
Reimar Döffinger
efa7f42020
Use the avstring.h locale-independent character type functions
...
Make sure the behavior does not change with the locale.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Stefano Sabatini
ad48556135
lavu/eval: add native support to lte and lt functions
12 years ago
Reimar Döffinger
88d55b827d
Remove incorrect use of ctype.h functions.
...
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Michael Niedermayer
29c8619a49
fate: add print() to the tests of eval
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
09ece9fa6c
eval: print() support
...
This allows printing values via av_log from expressions.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
3cd9849d9c
eval: fix 'warning: ignoring return value of strtod, declared with attribute warn_unused_result'
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Stefano Sabatini
2ed0803c6c
lavu/eval: extend if/ifnot functions to accept a third parameter
...
Add support to an if/else construct, simplify logic in expressions.
12 years ago
Michael Niedermayer
31cd1e20bb
eval: add function to access the current "wallclock" time.
...
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
49a78e6b8c
lavu/eval: handle div by zero in mod().
...
Similarly to 03f5043f5
, we use the FTRAPV config setting.
12 years ago
Justin Ruggles
5312268b34
eval: treat dB as decibels instead of decibytes
12 years ago
Anton Khirnov
cb45553f57
Remove pointless #undefs of previously forbidden functions.
12 years ago
Stefano Sabatini
1c6962dc20
lavu: remove disabled FF_API_OLD_EVAL_NAMES code
12 years ago
Michael Niedermayer
25a21c587c
eval-test: add some otherwise untested functions.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mans Rullgard
74c39bc682
eval-test: make table static const
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Michael Niedermayer
03f5043f5d
eval: Fix eval test with ftrapv
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Ronald S. Bultje
02ac28229a
eval: fix printing of NaN in eval fate test.
...
This fixes "make fate-eval" on MSVC builds. Without this, the test outputs
"-1.#NaN" instead of "nan" on MSVS 2010.
12 years ago
Janne Grunau
2d497c141d
eval: add gt(), gte(), lt() and lte() fate tests
13 years ago
Max Lazarov
caac3ab6ef
eval: fix swapping of lt() and lte()
...
CC: libav-stable@libav.org
13 years ago
Martin Storsjö
143f1e9203
eval: Add the isinf() function and tests for it
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Martin Storsjö
3893feeccd
opt/eval: Include mathematics.h for NAN/INFINITY
...
These files use NAN/INFINITY but didn't include mathematics.h to get
the fallback definitions if the system lacks the macros.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
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