Commit a2c547ff authored by Clément Bœsch's avatar Clément Bœsch

lavfi: add spp filter.

parent 129edcb5
......@@ -67,6 +67,7 @@ version <next>:
- ffprobe -show_chapters option
- WavPack encoding through libwavpack
- rotate filter
- spp filter ported from libmpcodecs
version 1.2:
......
......@@ -42,6 +42,7 @@ Specifically, the GPL parts of FFmpeg are
- vf_pp.c
- vf_sab.c
- vf_smartblur.c
- vf_spp.c
- vf_stereo3d.c
- vf_super2xsai.c
- vf_tinterlace.c
......
......@@ -2175,6 +2175,7 @@ sab_filter_deps="gpl swscale"
scale_filter_deps="swscale"
smartblur_filter_deps="gpl swscale"
showspectrum_filter_deps="avcodec rdft"
spp_filter_deps="gpl avcodec fft"
stereo3d_filter_deps="gpl"
subtitles_filter_deps="avformat avcodec libass"
super2xsai_filter_deps="gpl"
......
......@@ -6476,6 +6476,42 @@ stereo3d=abl:sbsr
@end example
@end itemize
@section spp
Apply a simple postprocessing filter that compresses and decompresses the image
at several (or - in the case of @option{quality} level @code{6} - all) shifts
and average the results.
The filter accepts the following options:
@table @option
@item quality
Set quality. This option defines the number of levels for averaging. It accepts
an integer in the range 0-6. If set to @code{0}, the filter will have no
effect. A value of @code{6} means the higher quality. For each increment of
that value the speed drops by a factor of approximately 2. Default value is
@code{3}.
@item qp
Force a constant quantization parameter. If not set, the filter will use the QP
from the video stream (if available).
@item mode
Set thresholding mode. Available modes are:
@table @samp
@item hard
Set hard thresholding (default).
@item soft
Set soft thresholding (better de-ringing effect, but likely blurrier).
@end table
@item use_bframe_qp
Enable the use of the QP from the B-Frames if set to @code{1}. Using this
option may cause flicker since the B-Frames have often larger QP. Default is
@code{0} (not enabled).
@end table
@anchor{subtitles}
@section subtitles
......
......@@ -182,6 +182,7 @@ OBJS-$(CONFIG_SETTB_FILTER) += f_settb.o
OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o
OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o
OBJS-$(CONFIG_SPLIT_FILTER) += split.o
OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o
OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o
OBJS-$(CONFIG_SUBTITLES_FILTER) += vf_subtitles.o
OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
......
......@@ -177,6 +177,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SHOWINFO, showinfo, vf);
REGISTER_FILTER(SMARTBLUR, smartblur, vf);
REGISTER_FILTER(SPLIT, split, vf);
REGISTER_FILTER(SPP, spp, vf);
REGISTER_FILTER(STEREO3D, stereo3d, vf);
REGISTER_FILTER(SUBTITLES, subtitles, vf);
REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
......
......@@ -30,8 +30,8 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 76
#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_MINOR 77
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
......
This diff is collapsed.
/*
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2013 Clément Bœsch
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef AVFILTER_SPP_H
#define AVFILTER_SPP_H
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
#include "avfilter.h"
#define MAX_LEVEL 6 /* quality levels */
typedef struct {
const AVClass *av_class;
int log2_count;
int qp;
int mode;
int qscale_type;
int temp_linesize;
uint8_t *src;
int16_t *temp;
AVCodecContext *avctx;
DSPContext dsp;
int8_t *non_b_qp_table;
int non_b_qp_alloc_size;
int use_bframe_qp;
int hsub, vsub;
void (*store_slice)(uint8_t *dst, const int16_t *src,
int dst_stride, int src_stride,
int width, int height, int log2_scale,
const uint8_t dither[8][8]);
void (*requantize)(int16_t dst[64], const int16_t src[64],
int qp, const uint8_t *permutation);
} SPPContext;
void ff_spp_init_x86(SPPContext *s);
#endif /* AVFILTER_SPP_H */
OBJS-$(CONFIG_GRADFUN_FILTER) += x86/vf_gradfun.o
OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d_init.o
OBJS-$(CONFIG_SPP_FILTER) += x86/vf_spp.o
OBJS-$(CONFIG_VOLUME_FILTER) += x86/af_volume_init.o
OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif_init.o
......
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