1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/libavfilter
Jean Delvare 16fd75ceec lavfi/delogo: use weighted interpolation
The original delogo algorithm interpolates both horizontally and
vertically and uses the average to compute the resulting sample. This
works reasonably well when the logo area is almost square. However
when the logo area is significantly larger than high or higher than
large, the result is largely suboptimal.

The issue can be clearly seen by testing the delogo filter with a fake
logo area that is 200 pixels large and 2 pixels high. Vertical
interpolation gives a very good result in that case, horizontal
interpolation gives a very bad result, and the overall result is poor,
because both are given the same weight.

Even when the logo is roughly square, the current algorithm gives poor
results on the borders of the logo area, because it always gives
horizontal and vertical interpolations an equal weight, and this is
suboptimal on borders. For example, in the middle of the left hand
side border of the logo, you want to trust the left known point much
more than the right known point (which the current algorithm already
does) but also much more than the top and bottom known points (which
the current algorithm doesn't do.)

By properly weighting each known point when computing the value of
each interpolated pixel, the visual result is much better, especially
on borders and/or for high or large logo areas.

The algorithm I implemented guarantees that the weight of each of the
4 known points directly depends on its distance to the interpolated
point. It is largely inspired from the original algorithm, the key
difference being that it computes the relative weights globally
instead of separating the vertical and horizontal interpolations and
combining them afterward.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-07-01 09:33:33 +02:00
..
libmpcodecs lavfi/mp: remove mp=spp. 2013-06-14 01:27:22 +02:00
x86 lavfi: add spp filter. 2013-06-14 01:27:22 +02:00
af_aconvert.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
af_afade.c lavfi/afade: add timeline support 2013-05-25 13:20:27 +00:00
af_aformat.c Merge commit 'c5ab6088ad7b0dac461fb6757b038f5260e638e5' 2013-05-18 12:22:25 +02:00
af_amerge.c lavfi: flag more dynamic i/o filters. 2013-04-13 19:43:17 +02:00
af_amix.c Merge commit '093804a93cc5da3f95f98265a5df116912443cec' 2013-05-05 11:42:18 +02:00
af_anull.c lavfi/anull: remove redundant lines 2013-05-10 15:08:12 +00:00
af_apad.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
af_aphaser.c lavfi/aphaser: silence uninitialized variable warnings. 2013-04-15 01:12:26 +02:00
af_aresample.c avfilter/aresample: use init_dict system and set child AVOption context correctly 2013-04-11 20:40:59 +02:00
af_asetnsamples.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
af_asetrate.c lavfi: add asetrate filter. 2013-04-21 15:20:50 +02:00
af_ashowinfo.c lavfi/(a)showinfo: use link frame counter instead of local counter. 2013-05-21 22:29:16 +02:00
af_astats.c avfilter/af_astats: rename stat() 2013-06-03 14:59:52 +02:00
af_astreamsync.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
af_asyncts.c Merge commit '16a4a18db089af8c432f1cdec62155000585b72c' 2013-05-10 23:03:50 +02:00
af_atempo.c libavfilter/af_atempo: Avoid round-off error build-up, ticket #2484 2013-04-21 10:46:52 +02:00
af_biquads.c Rename constant HZ in af_biquads.c as HERTZ. 2013-06-30 13:47:45 +02:00
af_channelmap.c lavfi/channelmap: make use of AVFILTER_DEFINE_CLASS 2013-05-27 11:31:52 +00:00
af_channelsplit.c Merge commit '093804a93cc5da3f95f98265a5df116912443cec' 2013-05-05 11:42:18 +02:00
af_earwax.c lavfi/earwax: remove pointless store 2013-04-16 21:32:26 +00:00
af_join.c lavfi/join: make use of AVFILTER_DEFINE_CLASS 2013-05-27 11:10:39 +00:00
af_pan.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
af_resample.c af_resample: switch to an AVOptions-based system. 2013-04-09 18:45:50 +02:00
af_silencedetect.c lavfi/silencedetect: switch to an AVOptions-based system. 2013-04-10 23:16:02 +02:00
af_volume.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
af_volume.h
af_volumedetect.c avfilter: add av_cold to uninit() 2013-05-06 16:55:06 +02:00
all_channel_layouts.inc
allfilters.c lavfi: add spp filter. 2013-06-14 01:27:22 +02:00
asink_anullsink.c Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
asrc_abuffer.h
asrc_aevalsrc.c avfilter: add av_cold to uninit() 2013-05-06 16:55:06 +02:00
asrc_anullsrc.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
asrc_flite.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
asrc_sine.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
audio.c Merge remote-tracking branch 'qatar/master' 2013-06-19 08:27:35 +02:00
audio.h Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
avcodec.c lavfi/avcodec: deprecate remainders of the avcodec glue code 2013-03-16 17:04:36 +01:00
avcodec.h lavfi/avcodec: deprecate remainders of the avcodec glue code 2013-03-16 17:04:36 +01:00
avf_avectorscope.c lavfi: avectorscope filter 2013-05-10 17:11:54 +00:00
avf_concat.c lavfi: flag more dynamic i/o filters. 2013-04-13 19:43:17 +02:00
avf_showspectrum.c lavfi/showspectrum: fix crash in case of negative linesize 2013-04-29 19:27:15 +00:00
avf_showwaves.c lavfi/showwaves: fix crash in case of negative linesize 2013-04-29 19:28:12 +00:00
avfilter.c avfilter/avfilter: Make avfilter_register() thread safe 2013-06-28 12:44:03 +02:00
avfilter.h Merge commit '8b7dffc2d6c6c19f8e0a1fedcd0e95dce7a273ff' 2013-06-05 12:05:41 +02:00
avfiltergraph.c Merge commit '129bb238430ec45a3b5f8f1d384df590ddf7b62f' 2013-05-24 14:07:00 +02:00
avfiltergraph.h Merge commit '38f0c0781a6e099f11c0acec07f9b8be742190c4' 2013-04-11 23:50:39 +02:00
bbox.c
bbox.h
buffer.c Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
bufferqueue.h Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
buffersink.c Merge commit '20c86571ccc71412781d4a4813e4693e0c42aec6' 2013-05-05 12:48:25 +02:00
buffersink.h lavfi/buffersink: fix header. 2013-03-17 12:31:25 +01:00
buffersrc.c lavfi: let gcc realign the stack on public graph driving functions 2013-05-04 23:40:13 +03:00
buffersrc.h lavfi/buffersrc: implement flags. 2013-03-10 13:56:17 +01:00
deshake_opencl_kernel.h lavfi: modify names of deshake_kernel.h and unsharp_kernel.h 2013-05-10 12:44:04 +02:00
deshake_opencl.c lavu: add FF_CEIL_RSHIFT and use it in various places. 2013-05-09 16:59:42 +02:00
deshake_opencl.h deshake opencl based on comments on 20130402 3rd 2013-04-02 15:57:44 +02:00
deshake.h deshake opencl based on comments on 20130402 3rd 2013-04-02 15:57:44 +02:00
drawutils.c lavfi/drawutils: attempt to fix subsampling. 2013-05-28 19:20:27 +02:00
drawutils.h
dualinput.c lavfi: add dual input helpers. 2013-05-27 20:32:28 +02:00
dualinput.h lavfi: add dual input helpers. 2013-05-27 20:32:28 +02:00
f_ebur128.c lavfi: flag more dynamic i/o filters. 2013-04-13 19:43:17 +02:00
f_interleave.c avfilter: add av_cold to uninit() 2013-05-06 16:55:06 +02:00
f_perms.c avfilter: Filter options that are used for both video and audio should have both flags 2013-04-12 15:45:28 +02:00
f_select.c lavfi/select: unbreak compatibility with older PICT_TYPE syntax 2013-05-12 10:52:26 +00:00
f_sendcmd.c make the ordering of the return type and av_cold consistent 2013-05-05 13:13:00 +02:00
f_settb.c lavfi/asettb: switch to an AVOptions-based system. 2013-04-11 11:53:53 +02:00
f_zmq.c lavfi: add zmq filters 2013-05-14 20:10:44 +02:00
fifo.c Merge commit '9bfc6e02bae9de354fb9ba09a8a140e83eeadf7d' 2013-04-22 13:02:29 +02:00
filtfmts.c Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0' 2013-05-18 11:46:09 +02:00
formats.c Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0' 2013-05-18 11:46:09 +02:00
formats.h Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0' 2013-05-18 11:46:09 +02:00
gradfun.h Merge commit '7ed833d78ea661d619124fd898547a900f6480bc' 2013-04-10 21:09:06 +02:00
graphdump.c Merge commit '42c7c61ab25809620b8c8809b3da73e25f5bbaaf' 2013-03-16 16:09:37 +01:00
graphparser.c Merge commit 'c22263d3e813d442df8fa5f5ba8993573fe775d8' 2013-05-01 10:16:31 +02:00
internal.h Merge commit '129bb238430ec45a3b5f8f1d384df590ddf7b62f' 2013-05-24 14:07:00 +02:00
lavfutils.c
lavfutils.h
libavfilter.v
lswsutils.c
lswsutils.h
Makefile lavfi/mp: remove mp=spp. 2013-06-14 01:27:22 +02:00
opencl_allkernels.c lavfi: modify names of deshake_kernel.h and unsharp_kernel.h 2013-05-10 12:44:04 +02:00
opencl_allkernels.h deshake opencl based on comments on 20130402 3rd 2013-04-02 15:57:44 +02:00
pthread.c Rename thread_init() in libavcodec and libavfilter as library_thread_init(). 2013-06-30 13:47:45 +02:00
setpts.c lavfi/setpts: make use of AVFILTER_DEFINE_CLASS 2013-05-27 11:14:43 +00:00
split.c Merge commit '093804a93cc5da3f95f98265a5df116912443cec' 2013-05-05 11:42:18 +02:00
src_movie.c avfilter/src_movie: Fix handling of packet size for video 2013-06-26 13:46:19 +02:00
thread.h Merge commit '129bb238430ec45a3b5f8f1d384df590ddf7b62f' 2013-05-24 14:07:00 +02:00
transform.c
transform.h
trim.c lavfi/trim: mark link closed on EOF. 2013-06-02 23:19:42 +02:00
unsharp_opencl_kernel.h lavfi: modify names of deshake_kernel.h and unsharp_kernel.h 2013-05-10 12:44:04 +02:00
unsharp_opencl.c lavfi/opencl: replace SHIFTUP with FF_CEIL_RSHIFT. 2013-05-09 16:59:43 +02:00
unsharp_opencl.h lavfi/unsharp: add opencl unsharp filter 2013-04-26 03:05:26 +02:00
unsharp.h lavfi/opencl: replace SHIFTUP with FF_CEIL_RSHIFT. 2013-05-09 16:59:43 +02:00
version.h lavfi/mp: remove mp=spp. 2013-06-14 01:27:22 +02:00
vf_alphamerge.c lavfi/alphamerge: raise filter_frame() error. 2013-03-13 19:00:09 +01:00
vf_aspect.c Merge commit '3fb29588a27a711132106b924e27b53789a58dcb' 2013-05-17 11:29:22 +02:00
vf_bbox.c lavfi/bbox: export bbox info to frame metadata 2013-05-26 14:00:10 +00:00
vf_blackdetect.c lavfi: add frame counter into AVFilterLink and use it in filters. 2013-04-23 01:02:27 +02:00
vf_blackframe.c Merge commit '7f83959598b6565baa0091e5739dd9091ab7a990' 2013-05-16 10:08:17 +02:00
vf_blend.c lavfi/blend: support slice threading 2013-05-24 21:41:28 +00:00
vf_boxblur.c Merge commit '7f83959598b6565baa0091e5739dd9091ab7a990' 2013-05-16 10:08:17 +02:00
vf_colorbalance.c lavfi: cosmetics: fix vertical alignment for pads in some filters 2013-05-14 15:31:56 +00:00
vf_colorchannelmixer.c lavfi: cosmetics: fix vertical alignment for pads in some filters 2013-05-14 15:31:56 +00:00
vf_colormatrix.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
vf_copy.c vf_copy: silence "incompatible pointer type" warning 2013-05-11 15:51:27 +02:00
vf_crop.c Merge commit '3fb29588a27a711132106b924e27b53789a58dcb' 2013-05-17 11:29:22 +02:00
vf_cropdetect.c Merge commit 'ba09675f44612fad9f7169f71b8276beb50a0dcd' 2013-05-16 10:14:00 +02:00
vf_curves.c lavfi: cosmetics: fix vertical alignment for pads in some filters 2013-05-14 15:31:56 +00:00
vf_dctdnoiz.c lavfi/dctdnoiz: move DC normalization out of loops. 2013-05-26 22:41:02 +02:00
vf_decimate.c lavfi: use ceil right shift for chroma width/height. 2013-05-10 17:20:06 +02:00
vf_delogo.c lavfi/delogo: use weighted interpolation 2013-07-01 09:33:33 +02:00
vf_deshake.c avfilter/vf_deshake: check rx 2013-05-18 18:28:59 +02:00
vf_drawbox.c vf_drawbox: give all v_log() a context 2013-06-26 00:54:08 +02:00
vf_drawtext.c add the start_number offset to var_values[VAR_N] directly, instead of adding it in func_frame_num 2013-06-18 17:38:17 -04:00
vf_edgedetect.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
vf_extractplanes.c Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0' 2013-05-18 11:46:09 +02:00
vf_fade.c vf_fade: remove unused function 2013-05-24 20:50:15 +02:00
vf_field.c lavfi/field, il, noise: use av_pix_fmt_count_planes() 2013-05-24 12:53:23 +00:00
vf_fieldmatch.c lavfi: use ceil right shift for chroma width/height. 2013-05-10 17:20:06 +02:00
vf_fieldorder.c Merge commit 'f6b6d6ac42c0ee427fcd3fae4c398b2103b491b8' 2013-05-16 15:21:31 +02:00
vf_format.c lavfi/format: make use of AVFILTER_DEFINE_CLASS 2013-05-27 11:17:34 +00:00
vf_fps.c Merge commit '4c205f42c86ccefa093c59434669af34ad14a52b' 2013-05-17 11:05:18 +02:00
vf_framestep.c lavfi/framestep: cosmetics: reindent AVFilter 2013-06-06 17:19:16 +00:00
vf_frei0r.c lavfi/frei0r: make use of AVFILTER_DEFINE_CLASS 2013-05-27 11:31:52 +00:00
vf_geq.c lavfi/geq: prefer symbolic constants 2013-05-21 21:15:08 +02:00
vf_gradfun.c Merge commit 'd371c3c2e2830d9783465ecfe1ab7d93351083b7' 2013-05-17 10:51:59 +02:00
vf_hflip.c Merge commit '4753f802c00853859b7b4b8fdb79c35e082cb7f8' 2013-05-16 16:45:43 +02:00
vf_histeq.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
vf_histogram.c lavfi/histogram: cache log2 of max_hval 2013-05-19 14:30:42 +00:00
vf_hqdn3d.c lavfi/hqdn3d: make use of AVFILTER_DEFINE_CLASS 2013-05-27 10:58:45 +00:00
vf_hqdn3d.h Merge commit '8c747d46f721cffa8ea51990805ad1d3a3a4fd0a' 2013-04-10 21:14:30 +02:00
vf_hue.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
vf_idet.c lavfi/idet: remove request_frame hack 2013-05-27 09:55:39 +00:00
vf_il.c lavfi/il: add timeline support 2013-06-06 17:44:54 +00:00
vf_interlace.c Merge remote-tracking branch 'qatar/master' 2013-06-18 09:31:05 +02:00
vf_kerndeint.c replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_* 2013-05-15 11:23:14 +02:00
vf_libopencv.c lavfi/ocv: make use of AVFILTER_DEFINE_CLASS 2013-05-27 11:31:52 +00:00
vf_lut3d.c lavfi/lut3d: add sanity checks. 2013-06-07 01:48:41 +02:00
vf_lut.c Merge commit 'd371c3c2e2830d9783465ecfe1ab7d93351083b7' 2013-05-17 10:51:59 +02:00
vf_mcdeint.c avfilter/vf_mcdeint: free frame on error 2013-06-03 15:41:29 +02:00
vf_mp.c avfilter/vf_mp: preserve pixel format when possible 2013-06-28 03:32:00 +02:00
vf_mpdecimate.c lavfi: use ceil right shift for chroma width/height. 2013-05-10 17:20:06 +02:00
vf_noise.c lavfi/noise: fix out of array access 2013-05-29 16:54:28 +00:00
vf_null.c lavfi/null: remove redudant lines 2013-05-08 12:48:05 +00:00
vf_overlay.c lavfi/overlay: remove do_blend forward declaration. 2013-05-27 20:42:46 +02:00
vf_owdenoise.c lavfi: port wavelet denoiser filter from libmpcodecs. 2013-05-16 00:45:45 +02:00
vf_pad.c lavfi/pad: switch to AV_OPT_TYPE_COLOR 2013-05-17 11:32:54 +00:00
vf_pixdesctest.c lavfi/pixdesctest: fix chroma subsampling with odd sizes. 2013-06-01 12:05:55 +02:00
vf_pp.c lavfi/pp: set out frame size. 2013-06-08 23:23:30 +02:00
vf_removelogo.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
vf_rotate.c lavfi/rotate: add angle command 2013-06-13 01:21:47 +02:00
vf_sab.c vf_sab: Fix memleak 2013-06-10 22:00:43 +02:00
vf_scale.c Merge remote-tracking branch 'qatar/master' 2013-05-15 11:10:09 +02:00
vf_separatefields.c lavfi: add frame counter into AVFilterLink and use it in filters. 2013-04-23 01:02:27 +02:00
vf_setfield.c lavfi/setfield: switch to an AVOptions-based system. 2013-04-11 11:53:53 +02:00
vf_showinfo.c lavfi/(a)showinfo: use link frame counter instead of local counter. 2013-05-21 22:29:16 +02:00
vf_smartblur.c lavfi: replace passthrough_filter_frame with a flag. 2013-05-12 13:07:47 +02:00
vf_spp.c lavfi/spp: fix description. 2013-06-14 06:53:52 +02:00
vf_spp.h lavfi: add spp filter. 2013-06-14 01:27:22 +02:00
vf_stereo3d.c lavfi/stereo3d: add support for alternating frames input & output format 2013-04-30 09:13:36 +00:00
vf_subtitles.c lavfi/subtitles: zero-init AVSubtitle. 2013-04-25 00:56:38 +02:00
vf_super2xsai.c Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
vf_swapuv.c replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_* 2013-05-15 11:23:14 +02:00
vf_telecine.c replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_* 2013-05-15 11:23:14 +02:00
vf_thumbnail.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
vf_tile.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
vf_tinterlace.c Merge remote-tracking branch 'qatar/master' 2013-06-18 09:31:05 +02:00
vf_transpose.c replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_* 2013-05-15 11:23:14 +02:00
vf_unsharp.c lavfi/unsharp: remove unused float.h include. 2013-05-16 13:38:26 +02:00
vf_vflip.c lavfi/vflip: use FF_CEIL_RSHIFT for chroma w/h rounding. 2013-05-12 12:59:00 +02:00
vf_vidstabdetect.c lavfi/vidstabdetect: fix direct path. 2013-04-24 18:30:43 +02:00
vf_vidstabtransform.c lavfi/vidstab: remove mention of defaults for consistency with other filters. 2013-04-24 18:30:43 +02:00
vf_vignette.c lavfi/vignette: remove extra semi-colon. 2013-05-31 10:22:03 +02:00
vf_yadif.c yadif: fix slice sizes 2013-05-24 17:46:57 +02:00
video.c Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
video.h Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
vidstabutils.c lavfi/vidstab: miscelenaous cosmetics and typo fixes. 2013-04-24 18:30:42 +02:00
vidstabutils.h lavfi: add video stabilization plugins using vid.stab library 2013-04-24 18:30:42 +02:00
vsink_nullsink.c Merge commit '7e350379f87e7f74420b4813170fe808e2313911' 2013-03-10 01:40:35 +01:00
vsrc_cellauto.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
vsrc_life.c lavfi/life: switch to AV_OPT_TYPE_COLOR 2013-05-17 11:32:54 +00:00
vsrc_mandelbrot.c lavfi: remove now unused args parameter from AVFilter.init and init_opaque 2013-04-12 11:54:39 +02:00
vsrc_mptestsrc.c lavfi/mptestsrc: fix chroma subsampling with odd sizes. 2013-06-01 12:05:55 +02:00
vsrc_testsrc.c avfilter/vsrc_testsrc: fix artifacts with odd height 2013-06-24 23:21:17 +02:00
yadif.h yadif: restore speed of the C filtering code 2013-05-14 09:23:55 +02:00