FFmpeg
Loading...
Searching...
No Matches
vf_pp7.c File Reference

Postprocessing filter - 7. More...

#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/video_enc_params.h"
#include "avfilter.h"
#include "filters.h"
#include "qp_table.h"
#include "vf_pp7dsp.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  PP7Context
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define N0   4
 
#define N1   5
 
#define N2   10
 
#define SN0   2
 
#define SN1   2.2360679775
 
#define SN2   3.16227766017
 
#define N   (1 << 16)
 

Enumerations

enum  mode { MODE_HARD , MODE_SOFT , MODE_MEDIUM }
 

Functions

 AVFILTER_DEFINE_CLASS (pp7)
 
static void init_thres2 (PP7Context *p)
 
static void dctA_c (int16_t *dst, const uint8_t *src, int stride)
 
static int hardthresh_c (const PP7Context *p, const int16_t *src, int qp)
 
static int mediumthresh_c (const PP7Context *p, const int16_t *src, int qp)
 
static int softthresh_c (const PP7Context *p, const int16_t *src, int qp)
 
static void filter (PP7Context *p, uint8_t *dst, const uint8_t *src, int dst_stride, int src_stride, int width, int height, const uint8_t *qp_store, int qp_stride, int is_luma)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption pp7_options []
 
static const uint8_t dither [8][8]
 
static const int factor [16]
 
static enum AVPixelFormat pix_fmts []
 
static const AVFilterPad pp7_inputs []
 
const FFFilter ff_vf_pp7
 

Detailed Description

Postprocessing filter - 7.

Originally written by Michael Niedermayer for the MPlayer project, and ported by Arwa Arif for FFmpeg.

Definition in file vf_pp7.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(PP7Context, x)

Definition at line 66 of file vf_pp7.c.

◆ FLAGS

Definition at line 67 of file vf_pp7.c.

◆ N0

◆ N1

#define N1   5

Definition at line 91 of file vf_pp7.c.

◆ N2

#define N2   10

Definition at line 92 of file vf_pp7.c.

Referenced by celt_compute_qn(), and qmf_synth().

◆ SN0

#define SN0   2

Definition at line 93 of file vf_pp7.c.

Referenced by init_thres2().

◆ SN1

#define SN1   2.2360679775

Definition at line 94 of file vf_pp7.c.

◆ SN2

#define SN2   3.16227766017

Definition at line 95 of file vf_pp7.c.

Referenced by init_thres2().

◆ N

#define N   (1 << 16)

Definition at line 96 of file vf_pp7.c.

Enumeration Type Documentation

◆ mode

enum mode
Enumerator
MODE_HARD 
MODE_SOFT 
MODE_MEDIUM 

Definition at line 43 of file vf_pp7.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( pp7 )

◆ init_thres2()

static void init_thres2 ( PP7Context * p)
static

Definition at line 105 of file vf_pp7.c.

Referenced by config_input().

◆ dctA_c()

static void dctA_c ( int16_t * dst,
const uint8_t * src,
int stride )
inlinestatic

Definition at line 117 of file vf_pp7.c.

Referenced by filter().

◆ hardthresh_c()

static int hardthresh_c ( const PP7Context * p,
const int16_t * src,
int qp )
static

Definition at line 140 of file vf_pp7.c.

Referenced by config_input(), and config_input().

◆ mediumthresh_c()

static int mediumthresh_c ( const PP7Context * p,
const int16_t * src,
int qp )
static

Definition at line 156 of file vf_pp7.c.

Referenced by config_input().

◆ softthresh_c()

static int softthresh_c ( const PP7Context * p,
const int16_t * src,
int qp )
static

Definition at line 180 of file vf_pp7.c.

Referenced by config_input(), and config_input().

◆ filter()

static void filter ( PP7Context * p,
uint8_t * dst,
const uint8_t * src,
int dst_stride,
int src_stride,
int width,
int height,
const uint8_t * qp_store,
int qp_stride,
int is_luma )
static

Definition at line 200 of file vf_pp7.c.

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 274 of file vf_pp7.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 304 of file vf_pp7.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 365 of file vf_pp7.c.

Variable Documentation

◆ pp7_options

const AVOption pp7_options[]
static
Initial value:
= {
{ "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 64, FLAGS },
{ "mode", "set thresholding mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_MEDIUM}, 0, 2, FLAGS, .unit = "mode" },
{ "hard", "hard thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_HARD}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
{ "soft", "soft thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_SOFT}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
{ "medium", "medium thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_MEDIUM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
mode
Use these values in ebur128_init (or'ed).
Definition ebur128.h:83
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ MODE_HARD
Definition vf_pp7.c:44
@ MODE_SOFT
Definition vf_pp7.c:45
@ MODE_MEDIUM
Definition vf_mcdeint.c:62

Definition at line 68 of file vf_pp7.c.

◆ dither

const uint8_t dither[8][8]
static
Initial value:
= {
{ 0, 48, 12, 60, 3, 51, 15, 63, },
{ 32, 16, 44, 28, 35, 19, 47, 31, },
{ 8, 56, 4, 52, 11, 59, 7, 55, },
{ 40, 24, 36, 20, 43, 27, 39, 23, },
{ 2, 50, 14, 62, 1, 49, 13, 61, },
{ 34, 18, 46, 30, 33, 17, 45, 29, },
{ 10, 58, 6, 54, 9, 57, 5, 53, },
{ 42, 26, 38, 22, 41, 25, 37, 21, },
}

Definition at line 79 of file vf_pp7.c.

◆ factor

const int factor[16]
static
Initial value:
= {
N / (N0 * N0), N / (N0 * N1), N / (N0 * N0), N / (N0 * N2),
N / (N1 * N0), N / (N1 * N1), N / (N1 * N0), N / (N1 * N2),
N / (N0 * N0), N / (N0 * N1), N / (N0 * N0), N / (N0 * N2),
N / (N2 * N0), N / (N2 * N1), N / (N2 * N0), N / (N2 * N2),
}
#define N
Definition af_mcompand.c:54
#define N0
Definition vf_pp7.c:90
#define N1
Definition vf_pp7.c:91
#define N2
Definition vf_pp7.c:92

Definition at line 98 of file vf_pp7.c.

Referenced by adaptive_quantization(), amplify_frame(), analyze_plane(), aptx_bin_search(), av_bessel_i0(), avpriv_solve_lls(), bitreduction(), blend_frame(), build_filter(), calculate_factors(), calculate_motion(), cfhd_decode(), check_cd_factors(), config_eq_output(), config_filter(), config_input(), config_input(), config_output(), config_output(), config_output(), config_output(), convert_full_range(), convolve_sobel(), create_default_qtables(), decode_block(), decode_log_area(), decompose_zp2biquads(), dequantize_coefficients(), do_despill_slice(), do_transform(), draw_gradients_slice(), draw_gradients_slice16(), draw_gradients_slice32_planar(), eq_interp(), ff_build_rac_states(), ff_jpegls_reset_coding_parameters(), ff_tx_fft_init_naive_small(), ff_tx_fft_naive(), filter_block2d(), filter_block3d1(), filter_block3d2(), filter_dbl(), filter_flt(), filter_frame(), filter_frame(), filter_frame(), gate(), get_lowpass(), get_qtable(), hardthresh_c(), is_expand_bit(), lfe_fir_float_c(), lfe_iir_c(), mediumthresh_c(), mip_upsampling_1d(), multiply(), normalize_coeffs(), osq_decode_block(), parse_keyframes_index(), process_bayer(), quantize_band(), resample_init(), softthresh_c(), try_push_frame(), unpack(), and vtenc_create_encoder().

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static
Initial value:
= {
}
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition pixfmt.h:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85

Definition at line 264 of file vf_pp7.c.

◆ pp7_inputs

const AVFilterPad pp7_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
}
static int config_input(AVFilterLink *inlink)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 371 of file vf_pp7.c.

◆ ff_vf_pp7

const FFFilter ff_vf_pp7
Initial value:
= {
.p.name = "pp7",
.p.description = NULL_IF_CONFIG_SMALL("Apply Postprocessing 7 filter."),
.p.priv_class = &pp7_class,
.priv_size = sizeof(PP7Context),
}
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition avfilter.h:204
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
static const AVFilterPad pp7_inputs[]
Definition vf_pp7.c:371
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37

Definition at line 380 of file vf_pp7.c.