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
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