FFmpeg
Macros | Enumerations | Functions | Variables
vf_pp7.c File Reference
#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"

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 query_formats (AVFilterContext *ctx)
 
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 const AVFilterPad pp7_inputs []
 
static const AVFilterPad pp7_outputs []
 
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 44 of file vf_pp7.c.

◆ FLAGS

Definition at line 45 of file vf_pp7.c.

◆ N0

#define N0   4

Definition at line 68 of file vf_pp7.c.

◆ N1

#define N1   5

Definition at line 69 of file vf_pp7.c.

◆ N2

#define N2   10

Definition at line 70 of file vf_pp7.c.

◆ SN0

#define SN0   2

Definition at line 71 of file vf_pp7.c.

◆ SN1

#define SN1   2.2360679775

Definition at line 72 of file vf_pp7.c.

◆ SN2

#define SN2   3.16227766017

Definition at line 73 of file vf_pp7.c.

◆ N

#define N   (1 << 16)

Definition at line 74 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 38 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 83 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 95 of file vf_pp7.c.

Referenced by filter().

◆ dctB_c()

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

Definition at line 118 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 141 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 157 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 181 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 201 of file vf_pp7.c.

Referenced by filter_frame().

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 267 of file vf_pp7.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 285 of file vf_pp7.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 318 of file vf_pp7.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 380 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, "mode" },
{ "hard", "hard thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_HARD}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "soft", "soft thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_SOFT}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "medium", "medium thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_MEDIUM}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ NULL }
}

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

Referenced by filter().

◆ factor

const int factor[16]
static

◆ pp7_inputs

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

Definition at line 386 of file vf_pp7.c.

◆ pp7_outputs

const AVFilterPad pp7_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

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

OFFSET
#define OFFSET(x)
Definition: vf_pp7.c:44
N2
#define N2
Definition: vf_pp7.c:70
MODE_HARD
@ MODE_HARD
Definition: vf_pp7.c:39
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_pp7.c:267
FLAGS
#define FLAGS
Definition: vf_pp7.c:45
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_pp7.c:380
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
N
#define N
Definition: vf_pp7.c:74
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:116
N0
#define N0
Definition: vf_pp7.c:68
pp7_outputs
static const AVFilterPad pp7_outputs[]
Definition: vf_pp7.c:396
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_pp7.c:318
MODE_SOFT
@ MODE_SOFT
Definition: vf_pp7.c:40
pp7_inputs
static const AVFilterPad pp7_inputs[]
Definition: vf_pp7.c:386
N1
#define N1
Definition: vf_pp7.c:69
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
MODE_MEDIUM
@ MODE_MEDIUM
Definition: vf_pp7.c:41
PP7Context
Definition: vf_pp7.h:27
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:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_pp7.c:285
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233