Jarek Samic
5b5746b1e0
lavfi: modify avfilter_get_matrix to support separate scale factors
2019-08-22 23:11:27 +01:00
Jun Zhao
5a3ce4a92b
lavfi/deshake: fix deshake crash issue.
...
Fixes ticket #7441 .
for block contrast calculate, the block is like this:
|<---------------- stride-----------------------|
+-----------------------------------------------> X
|
| w = 16
| (cx,cy)+------+
| | |
|h=blocksize| |
| | |
| +------+
V
Y
so we calc the block contrast use:
(cy + y) * stride + (cx + x)
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-10-06 21:30:18 +08:00
Carl Eugen Hoyos
cbbefc05b1
lavfi/deshake: Check alignment before calling asm init function.
...
Do this for every frame to make sure dynamic filters do not
cause crashes.
Fixes ticket #7078 .
2018-03-20 01:09:23 +01:00
Mark Thompson
3650cb2dfa
lavu,lavfi,ffmpeg: Remove experimental OpenCL API
...
This was added in early 2013 and abandoned several months later; as far as
I can tell, there are no external users. Future OpenCL use will be via
hwcontext, which requires neither special OpenCL-only API nor global state
in libavutil.
All internal users are also deleted - this is just the unsharp filter
(replaced by unsharp_opencl, which is more flexible) and the deshake filter
(no replacement).
2017-11-22 23:20:39 +00:00
Michael Niedermayer
15b2c37d5e
avfilter/vf_deshake: Free out AVFrame on error
...
Fixes memleak
Fixes part of CID1197065
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-03 21:52:22 +01:00
Derek Buitenhuis
21f9468402
avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
...
Libav, for some reason, merged this as a public API function. This will
aid in future merges.
A define is left for backwards compat, just in case some person
used it, since it is in a public header.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Clément Bœsch
90cd02059b
lavfi/deshake: use FF_CEIL_RSHIFT()
2016-01-07 22:27:54 +01:00
Ganesh Ajjanagadde
92e483f8ed
all: use FFDIFFSIGN to resolve possible undefined behavior in comparators
...
FFDIFFSIGN was created explicitly for this purpose, since the common
return a - b idiom is unsafe regarding overflow on signed integers. It
optimizes to branchless code on common compilers.
FFDIFFSIGN also has the subjective benefit of being easier to read due
to lack of ternary operators.
Tested with FATE.
Things not covered by this are unsigned integers, for which overflows
are well defined, and also places where overflow is clearly impossible,
e.g an instance where the a - b was being done on 24 bit values.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-03 16:28:30 -05:00
Ganesh Ajjanagadde
7910a2c269
avfilter/vf_deshake: replace qsort with AV_QSORT
...
qsort is called indirectly in filter_frame, suggesting its performance
criticality. AV_QSORT is substantially faster due to the inlining of the
comparison callback. Thus, the increase in performance should be worth
the increase in binary size.
This optimization is just a low hanging fruit. The trac ticket 1430 is
a request for an improved deshake filter.
Sample benchmark (x86-64, Haswell, GNU/Linux):
File: original from https://trac.ffmpeg.org/ticket/1430
command: ffmpeg -stream_loop 8 -i file.webm -vf deshake=rx=64:ry=64 -f null -
Timer truncated at 1024 runs.
new:
28260 decicycles in qsort, 1 runs, 0 skips
35570 decicycles in qsort, 2 runs, 0 skips
39010 decicycles in qsort, 4 runs, 0 skips
46897 decicycles in qsort, 8 runs, 0 skips
40442 decicycles in qsort, 16 runs, 0 skips
41611 decicycles in qsort, 32 runs, 0 skips
40345 decicycles in qsort, 64 runs, 0 skips
38967 decicycles in qsort, 128 runs, 0 skips
38647 decicycles in qsort, 256 runs, 0 skips
40238 decicycles in qsort, 512 runs, 0 skips
39676 decicycles in qsort, 1024 runs, 0 skips
old:
1740280 decicycles in qsort, 1 runs, 0 skips
923560 decicycles in qsort, 2 runs, 0 skips
511330 decicycles in qsort, 4 runs, 0 skips
309720 decicycles in qsort, 8 runs, 0 skips
194900 decicycles in qsort, 16 runs, 0 skips
142686 decicycles in qsort, 32 runs, 0 skips
112516 decicycles in qsort, 64 runs, 0 skips
98166 decicycles in qsort, 128 runs, 0 skips
88147 decicycles in qsort, 256 runs, 0 skips
88706 decicycles in qsort, 512 runs, 0 skips
86783 decicycles in qsort, 1024 runs, 0 skips
Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-31 10:25:00 -04:00
Ganesh Ajjanagadde
2ee51ef259
avfilter/vf_deshake: use a void * comparator for consistency
...
For generality, qsort uses a comparator whose elements are void *. This
makes the comparator have such a form, and thus makes the void * cast of
the comparator pointer useless. Furthermore, this makes the code more
consistent with other usages of qsort across the codebase.
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-24 20:35:31 -04:00
Clément Bœsch
97692ef1ba
avfilter/deshake: use AV_OPT_TYPE_BOOL for opencl option
2015-09-08 23:50:25 +02:00
Clément Bœsch
fd682b1892
avfilter: handle error in query_formats() of a bunch of random video filters
2015-03-16 23:43:12 +01:00
Andreas Cadhalpun
739f179dd6
vf_deshake: rename Transform.vector to Transform.vec to avoid compiler confusion
...
The token 'vector' is a keyword in the Vector/SIMD Multimedia Extension data types and thus should not be used as a variable name.
This fixes building on powerpc/ppc64el.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-18 00:48:15 +02:00
Reimar Döffinger
098af26067
vf_deshake: Avoid doing a malloc+free for every single frame.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-09-02 19:20:28 +02:00
Reimar Döffinger
4ea8406e38
vf_deshake: reduce stack usage.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-09-02 19:20:28 +02:00
Clément Bœsch
def03d3439
avfilter/deshake: remove avcodec dependency
2014-08-05 21:05:52 +02:00
Michael Niedermayer
c0a586d9d5
reintroduce avpriv_dsputil_init() to maintain ABI until next soname bump
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 13:21:07 +02:00
Michael Niedermayer
3a2d1465c8
Merge commit '2d60444331fca1910510038dd3817bea885c2367'
...
* commit '2d60444331fca1910510038dd3817bea885c2367':
dsputil: Split motion estimation compare bits off into their own context
Conflicts:
configure
libavcodec/Makefile
libavcodec/arm/Makefile
libavcodec/dvenc.c
libavcodec/error_resilience.c
libavcodec/h264.h
libavcodec/h264_slice.c
libavcodec/me_cmp.c
libavcodec/me_cmp.h
libavcodec/motion_est.c
libavcodec/motion_est_template.c
libavcodec/mpeg4videoenc.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo_enc.c
libavcodec/x86/Makefile
libavcodec/x86/me_cmp_init.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-17 23:27:40 +02:00
Michael Niedermayer
be55518fdb
avfilter/vf_deshake: Use av_malloc_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-11 15:30:41 +02:00
Michael Niedermayer
f364101144
avfilter/vf_deshake: fix macro ()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-24 21:43:40 +02:00
Michael Niedermayer
6b79ef00fd
avfilter/vf_deshake: dont pass the wrong context into the SAD functions
...
This fixes pointer type warnings
The context should have been unused so this should not fix any real bug
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-03 22:52:17 +02:00
Michael Niedermayer
73734282e0
avfilter/vf_deshake: fix loss of precission with odd resolutions
...
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-16 03:44:57 +02:00
Michael Niedermayer
325f6e0a97
Merge remote-tracking branch 'qatar/master'
...
* qatar/master:
lavfi: do not export the filters from shared objects
Conflicts:
libavfilter/af_amix.c
libavfilter/af_anull.c
libavfilter/asrc_anullsrc.c
libavfilter/f_select.c
libavfilter/f_settb.c
libavfilter/split.c
libavfilter/src_movie.c
libavfilter/vf_aspect.c
libavfilter/vf_blackframe.c
libavfilter/vf_colorbalance.c
libavfilter/vf_copy.c
libavfilter/vf_crop.c
libavfilter/vf_cropdetect.c
libavfilter/vf_drawbox.c
libavfilter/vf_format.c
libavfilter/vf_framestep.c
libavfilter/vf_frei0r.c
libavfilter/vf_hflip.c
libavfilter/vf_libopencv.c
libavfilter/vf_lut.c
libavfilter/vf_null.c
libavfilter/vf_overlay.c
libavfilter/vf_scale.c
libavfilter/vf_transpose.c
libavfilter/vf_unsharp.c
libavfilter/vf_vflip.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-29 11:58:11 +01:00
Michael Niedermayer
728bb910ec
avfilter/vf_deshake: fix block_contrast() lower brightness value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-07 22:05:14 +02:00
Lenny Wang
2779b7b30a
avfilter/deshake
...
The old row index looks weird and wrong to me
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-07 21:39:16 +02:00
Michael Niedermayer
9f88db5df1
avfilter/vf_deshake: check rx
...
Fixes crash on SSE2
Fixes Ticket2443
Note, its possible to restructure the code to avoid the 16pixel limitation,
and such change is welcome!
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-18 18:28:59 +02:00
Michael Niedermayer
aba678ab9d
deshake: fix off by 2 error
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 16:23:28 +02:00
Michael Niedermayer
3d8afb23bc
vf_deshake: Fix crash with r*=64
...
Replace literal numbers by named R_MAX and correct their value
Fixes half of Ticket2443
Based on patch by: João Bernardo <jbvsmo@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 14:28:19 +02:00
Clément Bœsch
1e3104cd3c
Add avpriv_dsputil_init() and use it in lavfi where relevant.
...
dsputil_init() is deprecated and not meant to be exported.
ff_dsputil_init() is internal to libavcodec and thus can not be used.
avpriv_dsputil_init() is the version shared between libraries.
This commit fixes 3 unjustified libavfilter deprecated warnings.
2013-04-14 20:15:54 +02:00
Michael Niedermayer
fd6228e657
lavfi: remove now unused args parameter from AVFilter.init and init_opaque
...
This is mostly automated global search and replace
The deprecated aconvert filter is disabled, if it still has users
it should be updated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-12 11:54:39 +02:00
Clément Bœsch
9ceb7bdf6f
lavfi/deshake: switch to an AVOptions-based system.
2013-04-11 11:51:48 +02:00
Carl Eugen Hoyos
6e90d9e206
vf_deshake: Reorder constant arguments in an if() statement.
...
Fixes compilation with clang on netbsd with --disable-optimizations.
Tested-by: Paul B Mahol
2013-04-03 12:52:38 +02:00
highgod0401
9079359141
deshake opencl based on comments on 20130402 3rd
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-02 15:57:44 +02:00
Clément Bœsch
7edda1a935
lavfi/deshake: use standard options parsing.
2013-03-24 12:26:24 +01:00
Clément Bœsch
96e4b00d62
lavfi: remove remaining forgotten min/rej perms.
2013-03-10 02:38:21 +01:00
Michael Niedermayer
a05a44e205
Merge commit '7e350379f87e7f74420b4813170fe808e2313911'
...
* commit '7e350379f87e7f74420b4813170fe808e2313911':
lavfi: switch to AVFrame.
Conflicts:
doc/filters.texi
libavfilter/af_ashowinfo.c
libavfilter/audio.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersink.c
libavfilter/buffersrc.c
libavfilter/buffersrc.h
libavfilter/f_select.c
libavfilter/f_setpts.c
libavfilter/fifo.c
libavfilter/split.c
libavfilter/src_movie.c
libavfilter/version.h
libavfilter/vf_aspect.c
libavfilter/vf_bbox.c
libavfilter/vf_blackframe.c
libavfilter/vf_delogo.c
libavfilter/vf_drawbox.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_fieldorder.c
libavfilter/vf_fps.c
libavfilter/vf_frei0r.c
libavfilter/vf_gradfun.c
libavfilter/vf_hqdn3d.c
libavfilter/vf_lut.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_scale.c
libavfilter/vf_showinfo.c
libavfilter/vf_transpose.c
libavfilter/vf_vflip.c
libavfilter/vf_yadif.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavfilter/yadif.h
Following are notes about the merge authorship and various technical details.
Michael Niedermayer:
* Main merge operation, notably avfilter.c and video.c
* Switch to AVFrame:
- afade
- anullsrc
- apad
- aresample
- blackframe
- deshake
- idet
- il
- mandelbrot
- mptestsrc
- noise
- setfield
- smartblur
- tinterlace
* various merge changes and fixes in:
- ashowinfo
- blackdetect
- field
- fps
- select
- testsrc
- yadif
Nicolas George:
* Switch to AVFrame:
- make rawdec work with refcounted frames. Adapted from commit
759001c534
by Anton Khirnov.
Also, fix the use of || instead of | in a flags check.
- make buffer sink and src, audio and video work all together
Clément Bœsch:
* Switch to AVFrame:
- aevalsrc
- alphaextract
- blend
- cellauto
- colormatrix
- concat
- earwax
- ebur128
- edgedetect
- geq
- histeq
- histogram
- hue
- kerndeint
- life
- movie
- mp (with the help of Michael)
- overlay
- pad
- pan
- pp
- pp
- removelogo
- sendcmd
- showspectrum
- showwaves
- silencedetect
- stereo3d
- subtitles
- super2xsai
- swapuv
- thumbnail
- tile
Hendrik Leppkes:
* Switch to AVFrame:
- aconvert
- amerge
- asetnsamples
- atempo
- biquads
Matthieu Bouron:
* Switch to AVFrame
- alphamerge
- decimate
- volumedetect
Stefano Sabatini:
* Switch to AVFrame:
- astreamsync
- flite
- framestep
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-10 01:40:35 +01:00
Clément Bœsch
34d0ea5247
lavfi/deshake: support named options.
2013-03-05 21:16:54 +01:00
Michael Niedermayer
3cd137bfea
vf_deshake: fix strict aliassing errors
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-29 20:00:48 +01:00
Clément Bœsch
a612e86ea6
lavfi/deshake: remove usage of link->cur_buf.
2012-12-26 21:30:45 +01:00
Paul B Mahol
185d1f3bfc
lavfi: declare arrays that never change as static const
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-12-21 22:38:59 +00:00
Clément Bœsch
eaa47e7454
lavfi/deshake: small align prettifying.
2012-12-06 16:20:31 +01:00
Clément Bœsch
03778575b9
lavfi/deshake: switch inverted comments.
2012-12-06 16:20:31 +01:00
Clément Bœsch
0678641b7c
lavfi/deshake: remove unecessary check before unref.
2012-12-06 16:20:31 +01:00
Clément Bœsch
e7b0e83e96
lavfi/deshake: switch to filter_frame.
2012-12-06 16:20:31 +01:00
Clément Bœsch
2d9d444051
lavfi: convert remaining input/output list compound literals to named objects.
...
This is following 568c70e79e
.
2012-11-28 23:19:20 +01:00
Hendrik Leppkes
79393a8363
Replace usage of the deprecated av_pix_fmt_descriptors array with av_pix_fmt_desc_get
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 18:00:13 +02:00
Michael Niedermayer
ac627b3d38
Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
...
* commit '716d413c13981da15323c7a3821860536eefdbbb':
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Conflicts:
doc/examples/muxing.c
ffmpeg.h
ffmpeg_filter.c
ffmpeg_opt.c
ffplay.c
ffprobe.c
libavcodec/8bps.c
libavcodec/aasc.c
libavcodec/aura.c
libavcodec/avcodec.h
libavcodec/avs.c
libavcodec/bfi.c
libavcodec/bmp.c
libavcodec/bmpenc.c
libavcodec/c93.c
libavcodec/cscd.c
libavcodec/cyuv.c
libavcodec/dpx.c
libavcodec/dpxenc.c
libavcodec/eatgv.c
libavcodec/escape124.c
libavcodec/ffv1.c
libavcodec/flashsv.c
libavcodec/fraps.c
libavcodec/h264.c
libavcodec/huffyuv.c
libavcodec/iff.c
libavcodec/imgconvert.c
libavcodec/indeo3.c
libavcodec/kmvc.c
libavcodec/libopenjpegdec.c
libavcodec/libopenjpegenc.c
libavcodec/libx264.c
libavcodec/ljpegenc.c
libavcodec/mjpegdec.c
libavcodec/mjpegenc.c
libavcodec/motionpixels.c
libavcodec/mpeg12.c
libavcodec/mpeg12enc.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo_enc.c
libavcodec/pamenc.c
libavcodec/pcxenc.c
libavcodec/pgssubdec.c
libavcodec/pngdec.c
libavcodec/pngenc.c
libavcodec/pnm.c
libavcodec/pnmdec.c
libavcodec/pnmenc.c
libavcodec/ptx.c
libavcodec/qdrw.c
libavcodec/qpeg.c
libavcodec/qtrleenc.c
libavcodec/raw.c
libavcodec/rawdec.c
libavcodec/rl2.c
libavcodec/sgidec.c
libavcodec/sgienc.c
libavcodec/snowdec.c
libavcodec/snowenc.c
libavcodec/sunrast.c
libavcodec/targa.c
libavcodec/targaenc.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/tmv.c
libavcodec/truemotion2.c
libavcodec/utils.c
libavcodec/vb.c
libavcodec/vp3.c
libavcodec/wnv1.c
libavcodec/xl.c
libavcodec/xwddec.c
libavcodec/xwdenc.c
libavcodec/yop.c
libavdevice/v4l2.c
libavdevice/x11grab.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersrc.c
libavfilter/drawutils.c
libavfilter/formats.c
libavfilter/src_movie.c
libavfilter/vf_ass.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_format.c
libavfilter/vf_hflip.c
libavfilter/vf_lut.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_scale.c
libavfilter/vf_transpose.c
libavfilter/vf_yadif.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavformat/movenc.c
libavformat/mxf.h
libavformat/utils.c
libavformat/yuv4mpeg.c
libavutil/imgutils.c
libavutil/pixdesc.c
libswscale/input.c
libswscale/output.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
libswscale/x86/swscale_template.c
libswscale/x86/yuv2rgb.c
libswscale/x86/yuv2rgb_template.c
libswscale/yuv2rgb.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:06:57 +02:00
Nicolas George
84923555bb
vf_deshake: fix permissions.
2012-08-17 18:26:40 +02:00
Nicolas George
ddcb99bb51
vf_deshake: set cur_buf to NULL.
...
Fix a segfault.
2012-07-23 22:44:25 +02:00
Michael Niedermayer
88beb2df98
Merge remote-tracking branch 'qatar/master'
...
* qatar/master:
FATE: fix the asyncts test
build: Drop gcc-specific warning flag from header compilation rule
FATE: add a test for the asyncts audio filter.
matroskadec: return more correct error code on read error.
buffersrc: check ff_get_audio_buffer() for errors.
lavfi: check all ff_get_video_buffer() calls for errors.
lavfi: check all avfilter_ref_buffer() calls for errors.
vf_select: avoid an unnecessary avfilter_ref_buffer().
buffersrc: avoid creating unnecessary buffer reference
lavfi: use avfilter_unref_bufferp() where appropriate.
vf_fps: add more error checks.
vf_fps: fix a memleak on malloc failure.
lavfi: check all ff_start_frame/draw_slice/end_frame calls for errors
lavfi: add error handling to end_frame().
lavfi: add error handling to draw_slice().
lavfi: add error handling to start_frame().
Conflicts:
Makefile
ffplay.c
libavfilter/buffersrc.c
libavfilter/vf_boxblur.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_frei0r.c
libavfilter/vf_hflip.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_scale.c
libavfilter/video.c
libavfilter/vsrc_color.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-22 23:56:21 +02:00