FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
vf_pp7.c File Reference

Postprocessing filter - 7. More...

#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.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 {
  MODE_NONE, MODE_RO, MODE_RW, MODE_TOGGLE,
  MODE_RANDOM, 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 int thres [16]
 
static const AVFilterPad pp7_inputs []
 
static const AVFilterPad pp7_outputs []
 
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

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

Definition at line 43 of file vf_pp7.c.

Definition at line 44 of file vf_pp7.c.

#define N0   4
#define N1   5

Definition at line 68 of file vf_pp7.c.

#define N2   10

Definition at line 69 of file vf_pp7.c.

Referenced by celt_compute_qn().

#define SN0   2

Definition at line 70 of file vf_pp7.c.

Referenced by init_thres2().

#define SN1   2.2360679775

Definition at line 71 of file vf_pp7.c.

#define SN2   3.16227766017

Definition at line 72 of file vf_pp7.c.

Referenced by init_thres2().

#define N   (1 << 16)

Enumeration Type Documentation

enum mode
Enumerator:
MODE_NONE 
MODE_RO 
MODE_RW 
MODE_TOGGLE 
MODE_RANDOM 
NB_MODES 
MODE_HARD 
MODE_SOFT 
MODE_MEDIUM 
MODE_HARD 
MODE_SOFT 
NB_MODES 

Definition at line 37 of file vf_pp7.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( pp7  )
static void init_thres2 ( PP7Context p)
static

Definition at line 89 of file vf_pp7.c.

Referenced by config_input().

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

Definition at line 101 of file vf_pp7.c.

Referenced by filter().

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

Definition at line 124 of file vf_pp7.c.

Referenced by config_input().

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

Definition at line 147 of file vf_pp7.c.

Referenced by config_input().

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

Definition at line 163 of file vf_pp7.c.

Referenced by config_input().

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

Definition at line 187 of file vf_pp7.c.

Referenced by config_input().

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 207 of file vf_pp7.c.

Referenced by filter_frame().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 273 of file vf_pp7.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 288 of file vf_pp7.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 321 of file vf_pp7.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 376 of file vf_pp7.c.

Variable Documentation

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 45 of file vf_pp7.c.

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 56 of file vf_pp7.c.

Referenced by filter().

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),
}

Definition at line 75 of file vf_pp7.c.

Referenced by adaptive_quantization(), av_resample_init(), avpriv_solve_lls(), build_filter(), create_default_qtables(), ff_audio_resample_init(), ff_jpegls_reset_coding_parameters(), ffserver_set_float_param(), ffserver_set_int_param(), hardthresh_c(), mediumthresh_c(), resample_init(), and softthresh_c().

const int thres[16]
static
Initial value:
= {
N / (SN0 * SN0), N / (SN0 * SN2), N / (SN0 * SN0), N / (SN0 * SN2),
N / (SN2 * SN0), N / (SN2 * SN2), N / (SN2 * SN0), N / (SN2 * SN2),
N / (SN0 * SN0), N / (SN0 * SN2), N / (SN0 * SN0), N / (SN0 * SN2),
N / (SN2 * SN0), N / (SN2 * SN2), N / (SN2 * SN0), N / (SN2 * SN2),
}

Definition at line 82 of file vf_pp7.c.

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

Definition at line 382 of file vf_pp7.c.

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

Definition at line 392 of file vf_pp7.c.

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 400 of file vf_pp7.c.