summaryrefslogtreecommitdiff
path: root/libavutil/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* libavutil/eval: Remove CONFIG_TRAPV special handlingMichael Niedermayer2021-02-201-1/+1
| | | | | | | | | | Fixes: division by zero Fixes: 29555/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-5149951447400448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8574fcbfc7784173347418e09035ff8121574571) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()Michael Niedermayer2019-12-281-8/+20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/eval: add function to track variable useGyan Doshi2019-11-171-0/+16
| | | | | | | | | | | | | | | | | | | | | 1)Some filters allow cross-referenced expressions e.g. x=y+10. In such cases, filters evaluate expressions multiple times for successful evaluation of all expressions. If the expression for one or more variables contains a RNG, the result may vary across evaluation leading to inconsistent values across the cross-referenced expressions. 2)A related case is circular expressions e.g. x=y+10 and y=x+10 which cannot be succesfully resolved. 3)Certain filter variables may only be applicable in specific eval modes and lead to a failure of evaluation in other modes e.g. pts is only relevant for frame eval mode. At present, there is no reliable means to identify these occurrences and thus the error messages provided are broad or inaccurate. The helper function introduced - av_expr_count_vars - allows developers to identify the use and count of variables in expressions and thus tailor the error message, allow for a graceful fallback and/or decide evaluation order.
* avutil/eval: add sgn()Paul B Mahol2019-10-121-0/+4
|
* Merge commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24'James Almer2017-11-011-1/+8
|\ | | | | | | | | | | | | * commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24': Convert all AVClass struct declarations to designated initializers. Merged-by: James Almer <jamrial@gmail.com>
| * Convert all AVClass struct declarations to designated initializers.Diego Biurrun2017-06-121-1/+8
| |
* | avutil/eval: add linear interpolation helperPaul B Mahol2017-08-191-1/+9
| |
* | libavutil/eval: Add round function to expression parserKevin Mark2017-06-061-1/+4
| | | | | | | | | | | | | | We have floor, ceil, and trunc. Let's add round. Signed-off-by: Kevin Mark <kmark937@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/eval: add atan2 functionPaul B Mahol2017-01-301-1/+3
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avutil/reverse: move the ff_reverse declaration to a separate headerJames Almer2017-01-121-0/+1
| | | | | | | | | | | | | | | | Fixes compilation with hardcoded tables after eaff1aa09e90e2711207c9463db8bf8e8dec8178 and e71b8119e7db675dd2dac3f7fb069b0df2943c38 Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-111-153/+0
|\ \ | |/ | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * build: Split test programs off into separate filesDiego Biurrun2016-04-071-124/+0
| | | | | | | | | | This avoids spurious library rebuilds when only the test program code is changed and simplifies the build system.
* | all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.hGanesh Ajjanagadde2016-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | The idea is to use ffmath.h for internal implementations of math functions. Currently, it is used for variants of libm functions, but is by no means limited to such things. Note that this is not exported; use lavu/mathematics for such purposes. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
* | lavu/eval: replace pow(10,x) by ff_exp10(x)Ganesh Ajjanagadde2015-12-251-1/+1
| | | | | | | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/eval: remove pow and exp2 for postfixesGanesh Ajjanagadde2015-12-161-24/+28
| | | | | | | | | | | | | | | | | | | | 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>
* | avutil/eval: change sqrt to hypotGanesh Ajjanagadde2015-11-211-1/+1
| | | | | | | | | | | | | | This improves the mathematical behavior of hypotenuse computation. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avutil: add ff_reverse as av_reverse replacementAndreas Cadhalpun2015-08-121-1/+2
| | | | | | | | | | | | | | The table is used in libavutil/eval.c. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avutil/eval: check for av_malloc failureMichael Niedermayer2015-04-011-0/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/eval: factor av_expr_free() calls outMichael Niedermayer2015-04-011-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-151-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-151-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avutil: move QP2LAMBDA constant to evalMichael Niedermayer2014-07-211-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/eval: add clip functionStefano Sabatini2014-07-171-1/+13
| |
* | Merge commit 'fb0c9d41d685abb58575c5482ca33b8cd457c5ec'Michael Niedermayer2014-01-261-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'fb0c9d41d685abb58575c5482ca33b8cd457c5ec': avutil: remove timer.h include from internal.h Conflicts: libavcodec/ffv1dec.c libavutil/internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: remove timer.h include from internal.hJanne Grunau2014-01-251-0/+1
| | | | | | | | Added libavutil/timer.h include to all files with {START,STOP}_TIMER.
* | Merge commit '5b097399baa2e38cc513939cfab3a9b6fdbc33df'Michael Niedermayer2013-07-281-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '5b097399baa2e38cc513939cfab3a9b6fdbc33df': eval: Explicitly ignore return value of strtod() in parse_db() Conflicts: libavutil/eval.c See: 3cd9849d9c24b0808e6e55cd7568250acaae2b91 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * eval: Explicitly ignore return value of strtod() in parse_db()Diego Biurrun2013-07-271-1/+2
| | | | | | | | | | The return value is not needed. This fixes the warning: libavutil/eval.c:353:15: warning: ignoring return value of ‘strtod’
| * Use the avstring.h locale-independent character type functionsReimar Döffinger2013-03-071-1/+2
| | | | | | | | | | | | Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Rename "AVClass class" as "AVClass component_class".Carl Eugen Hoyos2013-06-301-2/+2
| | | | | | | | The aix header math.h defines "extern int class()" for C.
* | lavu/eval: rename "new_eval_expr()" to "make_eval_expr()"Stefano Sabatini2013-04-101-5/+5
| | | | | | | | The new name is more semantically and stilistically consistent.
* | lavu/eval: add between() function.Clément Bœsch2013-03-221-1/+14
| |
* | lavu/eval: add bitor and bitand functionsStefano Sabatini2013-03-171-1/+8
| | | | | | | | Warning note suggested by Reimar.
* | lavu/eval: add native support to lte and lt functionsStefano Sabatini2013-03-051-3/+5
| |
* | Remove incorrect use of ctype.h functions.Reimar Döffinger2013-03-031-1/+2
| | | | | | | | | | | | | | 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>
* | fate: add print() to the tests of evalMichael Niedermayer2013-02-171-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | eval: print() supportMichael Niedermayer2013-02-171-1/+11
| | | | | | | | | | | | This allows printing values via av_log from expressions. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | eval: fix 'warning: ignoring return value of strtod, declared with attribute ↵Michael Niedermayer2013-01-291-1/+1
| | | | | | | | | | | | warn_unused_result' Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/eval: extend if/ifnot functions to accept a third parameterStefano Sabatini2013-01-241-2/+10
| | | | | | | | Add support to an if/else construct, simplify logic in expressions.
* | eval: add function to access the current "wallclock" time.Michael Niedermayer2013-01-231-0/+7
| | | | | | | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/eval: handle div by zero in mod().Clément Bœsch2013-01-021-1/+1
| | | | | | | | Similarly to 03f5043f5, we use the FTRAPV config setting.
* | Merge commit '9d5c62ba5b586c80af508b5914934b1c439f6652'Michael Niedermayer2012-12-061-3/+24
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit '9d5c62ba5b586c80af508b5914934b1c439f6652': lavu/opt: do not filter out the initial sign character except for flags eval: treat dB as decibels instead of decibytes float_dsp: add vector_dmul_scalar() to multiply a vector of doubles Conflicts: libavutil/eval.c tests/ref/fate/eval Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * eval: treat dB as decibels instead of decibytesJustin Ruggles2012-12-051-3/+24
| |
* | Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'Michael Niedermayer2012-12-051-3/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967': Remove pointless #undefs of previously forbidden functions. fate: Add dependencies for bmp, cdxl, dfa, mp3 Conflicts: doc/examples/muxing.c libavfilter/filtfmts.c libavutil/des.c libavutil/eval.c libavutil/log.c libavutil/parseutils.c tests/fate/mp3.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove pointless #undefs of previously forbidden functions.Anton Khirnov2012-12-041-1/+0
| |
* | lavu: remove disabled FF_API_OLD_EVAL_NAMES codeStefano Sabatini2012-11-071-34/+0
| |
* | eval-test: add some otherwise untested functions.Michael Niedermayer2012-11-011-0/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b5198a2637b7b45b0049a1d4b386a06f016f2520'Michael Niedermayer2012-10-141-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit 'b5198a2637b7b45b0049a1d4b386a06f016f2520': configure: tms470: add mapping for -mfpu=vfpv3-d16 flag configure: recognise Minix as OS configure: work around bug in ash shell eval-test: make table static const lavr: handle clipping in the float to s32 conversion nut: support pcm codecs not mapped in avi Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * eval-test: make table static constMans Rullgard2012-10-131-1/+2
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* | eval: Fix eval test with ftrapvMichael Niedermayer2012-10-091-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-161-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix even more missing includes after the common.h removal build: Factor out rangecoder dependencies to CONFIG_RANGECODER build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE x86: avcodec: Consistently name all init files Add more missing includes after removing the implicit common.h Add some more missing includes after removing the implicit common.h Don't include common.h from avutil.h rtmp: Automatically compute the hash for SWFVerification Conflicts: configure doc/APIchanges doc/examples/decoding_encoding.c libavcodec/Makefile libavcodec/assdec.c libavcodec/audio_frame_queue.c libavcodec/avpacket.c libavcodec/dv_profile.c libavcodec/dwt.c libavcodec/libtheoraenc.c libavcodec/rawdec.c libavcodec/rv40dsp.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/v210dec.h libavcodec/vc1dsp.c libavcodec/x86/Makefile libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/buffer.c libavfilter/formats.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_select.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/version.h libavutil/audioconvert.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>