Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ configure to activate them. In this case, FFmpeg's license changes to GPL v2+.

Specifically, the GPL parts of FFmpeg are:

- libpostproc
- optional x86 optimization in the files
- `libavcodec/x86/flac_dsp_gpl.asm`
- `libavcodec/x86/idct_mmx.c`
Expand Down Expand Up @@ -44,6 +45,7 @@ Specifically, the GPL parts of FFmpeg are:
- `vf_owdenoise.c`
- `vf_perspective.c`
- `vf_phase.c`
- `vf_pp.c`
- `vf_pp7.c`
- `vf_pullup.c`
- `vf_repeatfields.c`
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ Generic Parts:
ratecontrol.c [2] Michael Niedermayer
simple IDCT:
simple_idct.c, simple_idct.h [2] Michael Niedermayer
postprocessing:
libpostproc/* [2] Michael Niedermayer
table generation:
tableprint.c, tableprint.h Reimar Doeffinger
fixed point FFT:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ALLFFLIBS = \
avfilter \
avformat \
avutil \
postproc \
swscale \
swresample \

Expand All @@ -33,6 +34,7 @@ FFLIBS-$(CONFIG_AVDEVICE) += avdevice
FFLIBS-$(CONFIG_AVFILTER) += avfilter
FFLIBS-$(CONFIG_AVFORMAT) += avformat
FFLIBS-$(CONFIG_AVCODEC) += avcodec
FFLIBS-$(CONFIG_POSTPROC) += postproc
FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
FFLIBS-$(CONFIG_SWSCALE) += swscale

Expand Down
13 changes: 12 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Component options:
--disable-avformat disable libavformat build
--disable-swresample disable libswresample build
--disable-swscale disable libswscale build
--disable-postproc disable libpostproc build
--disable-avfilter disable libavfilter build
--disable-pthreads disable pthreads [autodetect]
--disable-w32threads disable Win32 threads [autodetect]
Expand Down Expand Up @@ -2076,6 +2077,7 @@ LIBRARY_LIST="
avdevice
avfilter
swscale
postproc
avformat
avcodec
swresample
Expand Down Expand Up @@ -4011,6 +4013,7 @@ pan_filter_deps="swresample"
perspective_filter_deps="gpl"
phase_filter_deps="gpl"
pp7_filter_deps="gpl"
pp_filter_deps="gpl postproc"
prewitt_opencl_filter_deps="opencl"
procamp_vaapi_filter_deps="vaapi"
program_opencl_filter_deps="opencl"
Expand Down Expand Up @@ -4129,6 +4132,8 @@ avfilter_suggest="libm stdatomic spirv_compiler"
avformat_deps="avcodec avutil"
avformat_suggest="libm network zlib stdatomic"
avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
postproc_deps="avutil gpl"
postproc_suggest="libm stdatomic"
swresample_deps="avutil"
swresample_suggest="libm libsoxr stdatomic"
swscale_deps="avutil"
Expand Down Expand Up @@ -7634,7 +7639,7 @@ void (^block)(void);
EOF

# add some linker flags
check_ldflags -Wl,-rpath-link=:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic

Expand Down Expand Up @@ -8017,6 +8022,7 @@ enabled fsync_filter && prepend avfilter_deps "avformat"
enabled mcdeint_filter && prepend avfilter_deps "avcodec"
enabled movie_filter && prepend avfilter_deps "avformat avcodec"
enabled pan_filter && prepend avfilter_deps "swresample"
enabled pp_filter && prepend avfilter_deps "postproc"
enabled qrencode_filter && prepend avfilter_deps "swscale"
enabled qrencodesrc_filter && prepend avfilter_deps "swscale"
enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
Expand Down Expand Up @@ -8068,6 +8074,9 @@ expand_deps(){
reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
}

#we have to remove gpl from the deps here as some code assumes all lib deps are libs
postproc_deps="$(filter_out 'gpl' $postproc_deps)"

map 'expand_deps $v' $LIBRARY_LIST

if test "$quiet" != "yes"; then
Expand Down Expand Up @@ -8158,6 +8167,7 @@ echo "optimize for size ${small-no}"
echo "optimizations ${optimizations-no}"
echo "static ${static-no}"
echo "shared ${shared-no}"
echo "postprocessing support ${postproc-no}"
echo "network support ${network-no}"
echo "threading support ${thread_type-no}"
echo "safe bitstream reader ${safe_bitstream_reader-no}"
Expand Down Expand Up @@ -8534,6 +8544,7 @@ extralibs_avcodec="$avcodec_extralibs"
extralibs_avformat="$avformat_extralibs"
extralibs_avdevice="$avdevice_extralibs"
extralibs_avfilter="$avfilter_extralibs"
extralibs_postproc="$postproc_extralibs"
extralibs_swscale="$swscale_extralibs"
extralibs_swresample="$swresample_extralibs"
EOF
Expand Down
175 changes: 175 additions & 0 deletions doc/filters.texi
Original file line number Diff line number Diff line change
Expand Up @@ -19583,6 +19583,181 @@ Set window Y position, relative offset on Y axis.

This filter supports same @ref{commands} as options.

@section pp

Enable the specified chain of postprocessing subfilters using libpostproc. This
library should be automatically selected with a GPL build (@code{--enable-gpl}).
Subfilters must be separated by '/' and can be disabled by prepending a '-'.
Each subfilter and some options have a short and a long name that can be used
interchangeably, i.e. dr/dering are the same.

The filters accept the following options:

@table @option
@item subfilters
Set postprocessing subfilters string.
@end table

All subfilters share common options to determine their scope:

@table @option
@item a/autoq
Honor the quality commands for this subfilter.

@item c/chrom
Do chrominance filtering, too (default).

@item y/nochrom
Do luma filtering only (no chrominance).

@item n/noluma
Do chrominance filtering only (no luma).
@end table

These options can be appended after the subfilter name, separated by a '|'.

Available subfilters are:

@table @option
@item hb/hdeblock[|difference[|flatness]]
Horizontal deblocking filter
@table @option
@item difference
Difference factor where higher values mean more deblocking (default: @code{32}).
@item flatness
Flatness threshold where lower values mean more deblocking (default: @code{39}).
@end table

@item vb/vdeblock[|difference[|flatness]]
Vertical deblocking filter
@table @option
@item difference
Difference factor where higher values mean more deblocking (default: @code{32}).
@item flatness
Flatness threshold where lower values mean more deblocking (default: @code{39}).
@end table

@item ha/hadeblock[|difference[|flatness]]
Accurate horizontal deblocking filter
@table @option
@item difference
Difference factor where higher values mean more deblocking (default: @code{32}).
@item flatness
Flatness threshold where lower values mean more deblocking (default: @code{39}).
@end table

@item va/vadeblock[|difference[|flatness]]
Accurate vertical deblocking filter
@table @option
@item difference
Difference factor where higher values mean more deblocking (default: @code{32}).
@item flatness
Flatness threshold where lower values mean more deblocking (default: @code{39}).
@end table
@end table

The horizontal and vertical deblocking filters share the difference and
flatness values so you cannot set different horizontal and vertical
thresholds.

@table @option
@item h1/x1hdeblock
Experimental horizontal deblocking filter

@item v1/x1vdeblock
Experimental vertical deblocking filter

@item dr/dering
Deringing filter

@item tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
@table @option
@item threshold1
larger -> stronger filtering
@item threshold2
larger -> stronger filtering
@item threshold3
larger -> stronger filtering
@end table

@item al/autolevels[:f/fullyrange], automatic brightness / contrast correction
@table @option
@item f/fullyrange
Stretch luma to @code{0-255}.
@end table

@item lb/linblenddeint
Linear blend deinterlacing filter that deinterlaces the given block by
filtering all lines with a @code{(1 2 1)} filter.

@item li/linipoldeint
Linear interpolating deinterlacing filter that deinterlaces the given block by
linearly interpolating every second line.

@item ci/cubicipoldeint
Cubic interpolating deinterlacing filter deinterlaces the given block by
cubically interpolating every second line.

@item md/mediandeint
Median deinterlacing filter that deinterlaces the given block by applying a
median filter to every second line.

@item fd/ffmpegdeint
FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
second line with a @code{(-1 4 2 4 -1)} filter.

@item l5/lowpass5
Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
block by filtering all lines with a @code{(-1 2 6 2 -1)} filter.

@item fq/forceQuant[|quantizer]
Overrides the quantizer table from the input with the constant quantizer you
specify.
@table @option
@item quantizer
Quantizer to use
@end table

@item de/default
Default pp filter combination (@code{hb|a,vb|a,dr|a})

@item fa/fast
Fast pp filter combination (@code{h1|a,v1|a,dr|a})

@item ac
High quality pp filter combination (@code{ha|a|128|7,va|a,dr|a})
@end table

@subsection Examples

@itemize
@item
Apply horizontal and vertical deblocking, deringing and automatic
brightness/contrast:
@example
pp=hb/vb/dr/al
@end example

@item
Apply default filters without brightness/contrast correction:
@example
pp=de/-al
@end example

@item
Apply default filters and temporal denoiser:
@example
pp=default/tmpnoise|1|2|3
@end example

@item
Apply deblocking on luma only, and switch vertical deblocking on or off
automatically depending on available CPU time:
@example
pp=hb|y/vb|a
@end example
@end itemize

@section pp7
Apply Postprocessing filter 7. It is variant of the @ref{spp} filter,
similar to spp = 6 with 7 point DCT, where only the center sample is
Expand Down
3 changes: 3 additions & 0 deletions fftools/ffprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
#include "libswscale/version.h"
#include "libswresample/swresample.h"
#include "libswresample/version.h"
#include "libpostproc/postprocess.h"
#include "libpostproc/version.h"
#include "libavfilter/version.h"
#include "textformat/avtextformat.h"
#include "cmdutils.h"
Expand Down Expand Up @@ -2562,6 +2564,7 @@ static void ffprobe_show_library_versions(AVTextFormatContext *tfc)
SHOW_LIB_VERSION(avfilter, AVFILTER);
SHOW_LIB_VERSION(swscale, SWSCALE);
SHOW_LIB_VERSION(swresample, SWRESAMPLE);
SHOW_LIB_VERSION(postproc, POSTPROC);
avtext_print_section_footer(tfc);
}

Expand Down
3 changes: 3 additions & 0 deletions fftools/opt_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
#include "libswresample/swresample.h"
#include "libswresample/version.h"

#include "libpostproc/postprocess.h"
#include "libpostproc/version.h"

enum show_muxdemuxers {
SHOW_DEFAULT,
Expand Down Expand Up @@ -189,6 +191,7 @@ static void print_all_libs_info(int flags, int level)
PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level);
PRINT_LIB_INFO(postproc, POSTPROC, flags, level);
}

static void print_program_info(int flags, int level)
Expand Down
Loading