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

Ultra Slow/Simple Post-processing filter. More...

#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
#include "libavcodec/avcodec.h"
#include "avfilter.h"

Go to the source code of this file.

Data Structures

struct  USPPContext
 

Macros

#define MAX_LEVEL   8 /* quality levels */
 
#define BLOCK   16
 
#define OFFSET(x)   offsetof(USPPContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define STORE(pos)
 

Functions

 AVFILTER_DEFINE_CLASS (uspp)
 
static void store_slice_c (uint8_t *dst, const uint16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
 
static int norm_qscale (int qscale, int type)
 
static void filter (USPPContext *p, uint8_t *dst[3], uint8_t *src[3], int dst_stride[3], int src_stride[3], int width, int height, uint8_t *qp_store, int qp_stride)
 
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 uspp_options []
 
static const uint8_t dither [8][8]
 
static const uint8_t offset [511][2]
 
static const AVFilterPad uspp_inputs []
 
static const AVFilterPad uspp_outputs []
 
AVFilter ff_vf_uspp
 

Detailed Description

Ultra Slow/Simple Post-processing filter.

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

Definition in file vf_uspp.c.

Macro Definition Documentation

#define MAX_LEVEL   8 /* quality levels */

Definition at line 38 of file vf_uspp.c.

#define BLOCK   16

Definition at line 39 of file vf_uspp.c.

Referenced by config_input(), and filter().

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

Definition at line 60 of file vf_uspp.c.

Definition at line 61 of file vf_uspp.c.

#define STORE (   pos)
Value:
do { \
temp = ((src[x + y * src_stride + pos] << log2_scale) + d[pos]) >> 8; \
if (temp & 0x100) temp = ~(temp >> 31); \
dst[x + y * dst_stride + pos] = temp; \
} while (0)

Function Documentation

AVFILTER_DEFINE_CLASS ( uspp  )
static void store_slice_c ( uint8_t dst,
const uint16_t *  src,
int  dst_stride,
int  src_stride,
int  width,
int  height,
int  log2_scale 
)
static

Definition at line 156 of file vf_uspp.c.

Referenced by filter().

static int norm_qscale ( int  qscale,
int  type 
)
inlinestatic

Definition at line 184 of file vf_uspp.c.

Referenced by filter().

static void filter ( USPPContext p,
uint8_t dst[3],
uint8_t src[3],
int  dst_stride[3],
int  src_stride[3],
int  width,
int  height,
uint8_t qp_store,
int  qp_stride 
)
static

Definition at line 196 of file vf_uspp.c.

Referenced by filter_frame().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 298 of file vf_uspp.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 313 of file vf_uspp.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 379 of file vf_uspp.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 460 of file vf_uspp.c.

Variable Documentation

const AVOption uspp_options[]
static
Initial value:
= {
{ "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 3}, 0, MAX_LEVEL, FLAGS },
{ "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, FLAGS },
{ "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
{ NULL }
}

Definition at line 62 of file vf_uspp.c.

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

Definition at line 71 of file vf_uspp.c.

Referenced by store_slice_c().

const uint8_t offset[511][2]
static

Definition at line 82 of file vf_uspp.c.

Referenced by filter().

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

Definition at line 480 of file vf_uspp.c.

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

Definition at line 490 of file vf_uspp.c.

AVFilter ff_vf_uspp
Initial value:
= {
.name = "uspp",
.description = NULL_IF_CONFIG_SMALL("Apply Ultra Simple / Slow Post-processing filter."),
.priv_size = sizeof(USPPContext),
.priv_class = &uspp_class,
}

Definition at line 498 of file vf_uspp.c.