Commit 316afee7 authored by Jérémy Tran's avatar Jérémy Tran Committed by Stefano Sabatini

lavfi: add smartblur filter

This is a port of the MPlayer smartblur filter (libmpcodecs/vf_smartblur.c)
by Michael Niedermayer.
Signed-off-by: 's avatarStefano Sabatini <stefasab@gmail.com>
parent 18217bb0
...@@ -54,6 +54,7 @@ version next: ...@@ -54,6 +54,7 @@ version next:
- Ut Video encoder - Ut Video encoder
- Matroska demuxer now identifies SRT subtitles as AV_CODEC_ID_SUBRIP - Matroska demuxer now identifies SRT subtitles as AV_CODEC_ID_SUBRIP
instead of AV_CODEC_ID_TEXT instead of AV_CODEC_ID_TEXT
- smartblur filter ported from MPlayer
version 0.11: version 0.11:
......
...@@ -1867,6 +1867,7 @@ ocv_filter_deps="libopencv" ...@@ -1867,6 +1867,7 @@ ocv_filter_deps="libopencv"
pan_filter_deps="swresample" pan_filter_deps="swresample"
removelogo_filter_deps="avcodec avformat swscale" removelogo_filter_deps="avcodec avformat swscale"
scale_filter_deps="swscale" scale_filter_deps="swscale"
smartblur_filter_deps="gpl swscale"
select_filter_deps="avcodec" select_filter_deps="avcodec"
showspectrum_filter_deps="avcodec" showspectrum_filter_deps="avcodec"
super2xsai_filter_deps="gpl" super2xsai_filter_deps="gpl"
......
...@@ -3253,6 +3253,35 @@ not specified it will use the default value of 16. ...@@ -3253,6 +3253,35 @@ not specified it will use the default value of 16.
Adding this in the beginning of filter chains should make filtering Adding this in the beginning of filter chains should make filtering
faster due to better use of the memory cache. faster due to better use of the memory cache.
@section smartblur
Blur the input video without impacting the outlines.
The filter accepts the following parameters:
@var{luma_radius}:@var{luma_strength}:@var{luma_threshold}[:@var{chroma_radius}:@var{chroma_strength}:@var{chroma_threshold}]
Parameters prefixed by @var{luma} indicate that they work on the
luminance of the pixels whereas parameters prefixed by @var{chroma}
refer to the chrominance of the pixels.
If the chroma parameters are not set, the luma parameters are used for
either the luminance and the chrominance of the pixels.
@var{luma_radius} or @var{chroma_radius} must be a float number in the
range [0.1,5.0] that specifies the variance of the gaussian filter
used to blur the image (slower if larger).
@var{luma_strength} or @var{chroma_strength} must be a float number in
the range [-1.0,1.0] that configures the blurring. A value included in
[0.0,1.0] will blur the image whereas a value included in [-1.0,0.0]
will sharpen the image.
@var{luma_threshold} or @var{chroma_threshold} must be an integer in
the range [-30,30] that is used as a coefficient to determine whether
a pixel should be blurred or not. A value of 0 will filter all the
image, a value included in [0,30] will filter flat areas and a value
included in [-30,0] will filter edges.
@section split @section split
Split input video into several identical outputs. Split input video into several identical outputs.
......
...@@ -14,6 +14,7 @@ FFLIBS-$(CONFIG_MOVIE_FILTER) += avformat avcodec ...@@ -14,6 +14,7 @@ FFLIBS-$(CONFIG_MOVIE_FILTER) += avformat avcodec
FFLIBS-$(CONFIG_PAN_FILTER) += swresample FFLIBS-$(CONFIG_PAN_FILTER) += swresample
FFLIBS-$(CONFIG_REMOVELOGO_FILTER) += avformat avcodec FFLIBS-$(CONFIG_REMOVELOGO_FILTER) += avformat avcodec
FFLIBS-$(CONFIG_MP_FILTER) += avcodec postproc FFLIBS-$(CONFIG_MP_FILTER) += avcodec postproc
FFLIBS-$(CONFIG_SMARTBLUR_FILTER) += swscale
HEADERS = asrc_abuffer.h \ HEADERS = asrc_abuffer.h \
avcodec.h \ avcodec.h \
...@@ -125,6 +126,7 @@ OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o ...@@ -125,6 +126,7 @@ OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o
OBJS-$(CONFIG_SETTB_FILTER) += f_settb.o OBJS-$(CONFIG_SETTB_FILTER) += f_settb.o
OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o
OBJS-$(CONFIG_SLICIFY_FILTER) += vf_slicify.o OBJS-$(CONFIG_SLICIFY_FILTER) += vf_slicify.o
OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o
OBJS-$(CONFIG_SPLIT_FILTER) += split.o OBJS-$(CONFIG_SPLIT_FILTER) += split.o
OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o
......
...@@ -116,6 +116,7 @@ void avfilter_register_all(void) ...@@ -116,6 +116,7 @@ void avfilter_register_all(void)
REGISTER_FILTER (SETTB, settb, vf); REGISTER_FILTER (SETTB, settb, vf);
REGISTER_FILTER (SHOWINFO, showinfo, vf); REGISTER_FILTER (SHOWINFO, showinfo, vf);
REGISTER_FILTER (SLICIFY, slicify, vf); REGISTER_FILTER (SLICIFY, slicify, vf);
REGISTER_FILTER (SMARTBLUR, smartblur, vf);
REGISTER_FILTER (SPLIT, split, vf); REGISTER_FILTER (SPLIT, split, vf);
REGISTER_FILTER (SUPER2XSAI, super2xsai, vf); REGISTER_FILTER (SUPER2XSAI, super2xsai, vf);
REGISTER_FILTER (SWAPUV, swapuv, vf); REGISTER_FILTER (SWAPUV, swapuv, vf);
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3 #define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 13 #define LIBAVFILTER_VERSION_MINOR 14
#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \ LIBAVFILTER_VERSION_MINOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment