FFmpeg
Macros | Enumerations | Functions | Variables
vf_pp7.c File Reference
#include "libavutil/emms.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
#include "qp_table.h"
#include "vf_pp7.h"
#include "video.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(PP7Context, 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 {
  FF_EBUR128_MODE_M = (1 << 0), FF_EBUR128_MODE_S = (1 << 1) | FF_EBUR128_MODE_M, FF_EBUR128_MODE_I = (1 << 2) | FF_EBUR128_MODE_M, FF_EBUR128_MODE_LRA = (1 << 3) | FF_EBUR128_MODE_S,
  FF_EBUR128_MODE_SAMPLE_PEAK = (1 << 4) | FF_EBUR128_MODE_M, MODE_NONE, MODE_RO, MODE_RW,
  MODE_TOGGLE, MODE_RANDOM, NB_MODES, MODE_COVER,
  MODE_BLUR, NB_MODES, MODE_HARD, MODE_SOFT,
  MODE_MEDIUM, MODE_HARD, MODE_SOFT, NB_MODES
}
 

Functions

 AVFILTER_DEFINE_CLASS (pp7)
 
static void init_thres2 (PP7Context *p)
 
static void dctA_c (int16_t *dst, uint8_t *src, int stride)
 
static void dctB_c (int16_t *dst, int16_t *src)
 
static int hardthresh_c (PP7Context *p, int16_t *src, int qp)
 
static int mediumthresh_c (PP7Context *p, int16_t *src, int qp)
 
static int softthresh_c (PP7Context *p, int16_t *src, int qp)
 
static void filter (PP7Context *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, 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 AVFilter 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)    offsetof(PP7Context, x)

Definition at line 46 of file vf_pp7.c.

◆ FLAGS

Definition at line 47 of file vf_pp7.c.

◆ N0

#define N0   4

Definition at line 70 of file vf_pp7.c.

◆ N1

#define N1   5

Definition at line 71 of file vf_pp7.c.

◆ N2

#define N2   10

Definition at line 72 of file vf_pp7.c.

◆ SN0

#define SN0   2

Definition at line 73 of file vf_pp7.c.

◆ SN1

#define SN1   2.2360679775

Definition at line 74 of file vf_pp7.c.

◆ SN2

#define SN2   3.16227766017

Definition at line 75 of file vf_pp7.c.

◆ N

#define N   (1 << 16)

Definition at line 76 of file vf_pp7.c.

Enumeration Type Documentation

◆ mode

enum mode
Enumerator
FF_EBUR128_MODE_M 

can resurrrect and call ff_ebur128_loudness_momentary

FF_EBUR128_MODE_S 

can call ff_ebur128_loudness_shortterm

FF_EBUR128_MODE_I 

can call ff_ebur128_loudness_global_* and ff_ebur128_relative_threshold

FF_EBUR128_MODE_LRA 

can call ff_ebur128_loudness_range

FF_EBUR128_MODE_SAMPLE_PEAK 

can call ff_ebur128_sample_peak

MODE_NONE 
MODE_RO 
MODE_RW 
MODE_TOGGLE 
MODE_RANDOM 
NB_MODES 
MODE_COVER 
MODE_BLUR 
NB_MODES 
MODE_HARD 
MODE_SOFT 
MODE_MEDIUM 
MODE_HARD 
MODE_SOFT 
NB_MODES 

Definition at line 40 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 85 of file vf_pp7.c.

Referenced by config_input().

◆ dctA_c()

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

Definition at line 97 of file vf_pp7.c.

Referenced by filter().

◆ dctB_c()

static void dctB_c ( int16_t *  dst,
int16_t *  src 
)
static

Definition at line 120 of file vf_pp7.c.

Referenced by config_input().

◆ hardthresh_c()

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

Definition at line 143 of file vf_pp7.c.

Referenced by config_input().

◆ mediumthresh_c()

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

Definition at line 159 of file vf_pp7.c.

Referenced by config_input().

◆ softthresh_c()

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

Definition at line 183 of file vf_pp7.c.

Referenced by config_input().

◆ filter()

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

Definition at line 203 of file vf_pp7.c.

Referenced by filter_frame().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 279 of file vf_pp7.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 313 of file vf_pp7.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 375 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 }
}

Definition at line 48 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 59 of file vf_pp7.c.

Referenced by filter().

◆ factor

const int factor[16]
static

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ pp7_inputs

const AVFilterPad pp7_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
}

Definition at line 381 of file vf_pp7.c.

◆ ff_vf_pp7

const AVFilter ff_vf_pp7
Initial value:
= {
.name = "pp7",
.description = NULL_IF_CONFIG_SMALL("Apply Postprocessing 7 filter."),
.priv_size = sizeof(PP7Context),
.priv_class = &pp7_class,
}

Definition at line 390 of file vf_pp7.c.

OFFSET
#define OFFSET(x)
Definition: vf_pp7.c:46
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:162
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
N2
#define N2
Definition: vf_pp7.c:72
MODE_HARD
@ MODE_HARD
Definition: vf_pp7.c:41
FLAGS
#define FLAGS
Definition: vf_pp7.c:47
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_pp7.c:375
ff_video_default_filterpad
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
AV_PIX_FMT_YUVJ422P
@ 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_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
AV_PIX_FMT_YUVJ444P
@ 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
NULL
#define NULL
Definition: coverity.c:32
N
#define N
Definition: vf_pp7.c:76
AV_PIX_FMT_YUVJ420P
@ 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
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
N0
#define N0
Definition: vf_pp7.c:70
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_pp7.c:313
AV_PIX_FMT_YUVJ440P
@ 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
MODE_SOFT
@ MODE_SOFT
Definition: vf_pp7.c:42
pp7_inputs
static const AVFilterPad pp7_inputs[]
Definition: vf_pp7.c:381
N1
#define N1
Definition: vf_pp7.c:71
mode
mode
Definition: ebur128.h:83
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_PIX_FMT_YUV444P
@ 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_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:165
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
MODE_MEDIUM
@ MODE_MEDIUM
Definition: vf_pp7.c:43
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
PP7Context
Definition: vf_pp7.h:28
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#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:155
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:79
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_pp7.c:269
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_pp7.c:279
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244