FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_deblock.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  DeblockContext
 

Macros

#define WEAK_HFILTER(name, type, ldiv)
 
#define WEAK_VFILTER(name, type, ldiv)
 
#define STRONG_HFILTER(name, type, ldiv)
 
#define STRONG_VFILTER(name, type, ldiv)
 
#define OFFSET(x)   offsetof(DeblockContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Enumerations

enum  FilterType {
  DC_TYPE, AC_TYPE, SQ_TYPE, PS_TYPE,
  NB_TYPES, BUTTERWORTH, CHEBYSHEV1, CHEBYSHEV2,
  NB_TYPES, biquad, equalizer, bass,
  treble, bandpass, bandreject, allpass,
  highpass, lowpass, lowshelf, highshelf,
  tiltshelf, WEAK, STRONG, NB_FILTER,
  LOWPASS, FLAT, AFLAT, CHROMA,
  COLOR, ACOLOR, XFLAT, YFLAT,
  NB_FILTERS
}
 

Functions

static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 AVFILTER_DEFINE_CLASS (deblock)
 

Variables

static enum AVPixelFormat pixel_fmts []
 
static const AVOption deblock_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_vf_deblock
 

Macro Definition Documentation

◆ WEAK_HFILTER

#define WEAK_HFILTER (   name,
  type,
  ldiv 
)

Definition at line 85 of file vf_deblock.c.

◆ WEAK_VFILTER

#define WEAK_VFILTER (   name,
  type,
  ldiv 
)

Definition at line 124 of file vf_deblock.c.

◆ STRONG_HFILTER

#define STRONG_HFILTER (   name,
  type,
  ldiv 
)

Definition at line 165 of file vf_deblock.c.

◆ STRONG_VFILTER

#define STRONG_VFILTER (   name,
  type,
  ldiv 
)

Definition at line 211 of file vf_deblock.c.

◆ OFFSET

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

Definition at line 380 of file vf_deblock.c.

◆ FLAGS

Definition at line 381 of file vf_deblock.c.

Enumeration Type Documentation

◆ FilterType

enum FilterType
Enumerator
DC_TYPE 
AC_TYPE 
SQ_TYPE 
PS_TYPE 
NB_TYPES 
BUTTERWORTH 
CHEBYSHEV1 
CHEBYSHEV2 
NB_TYPES 
biquad 
equalizer 
bass 
treble 
bandpass 
bandreject 
allpass 
highpass 
lowpass 
lowshelf 
highshelf 
tiltshelf 
WEAK 
STRONG 
NB_FILTER 
LOWPASS 
FLAT 
AFLAT 
CHROMA 
COLOR 
ACOLOR 
XFLAT 
YFLAT 
NB_FILTERS 

Definition at line 33 of file vf_deblock.c.

Function Documentation

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 259 of file vf_deblock.c.

Referenced by process_command().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 301 of file vf_deblock.c.

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 368 of file vf_deblock.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( deblock  )

Variable Documentation

◆ pixel_fmts

enum AVPixelFormat pixel_fmts[]
static

◆ deblock_options

const AVOption deblock_options[]
static
Initial value:
= {
{ "filter", "set type of filter", OFFSET(filter), AV_OPT_TYPE_INT, {.i64=STRONG},0, 1, FLAGS, "filter" },
{ "weak", 0, 0, AV_OPT_TYPE_CONST, {.i64=WEAK}, 0, 0, FLAGS, "filter" },
{ "strong", 0, 0, AV_OPT_TYPE_CONST, {.i64=STRONG},0, 0, FLAGS, "filter" },
{ "block", "set size of block", OFFSET(block), AV_OPT_TYPE_INT, {.i64=8}, 4, 512, FLAGS },
{ "alpha", "set 1st detection threshold", OFFSET(alpha), AV_OPT_TYPE_FLOAT, {.dbl=.098}, 0, 1, FLAGS },
{ "beta", "set 2nd detection threshold", OFFSET(beta), AV_OPT_TYPE_FLOAT, {.dbl=.05}, 0, 1, FLAGS },
{ "gamma", "set 3rd detection threshold", OFFSET(gamma), AV_OPT_TYPE_FLOAT, {.dbl=.05}, 0, 1, FLAGS },
{ "delta", "set 4th detection threshold", OFFSET(delta), AV_OPT_TYPE_FLOAT, {.dbl=.05}, 0, 1, FLAGS },
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, FLAGS },
{ NULL },
}

Definition at line 383 of file vf_deblock.c.

◆ inputs

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

Definition at line 396 of file vf_deblock.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}

Definition at line 404 of file vf_deblock.c.

◆ ff_vf_deblock

const AVFilter ff_vf_deblock
Initial value:
= {
.name = "deblock",
.description = NULL_IF_CONFIG_SMALL("Deblock video."),
.priv_size = sizeof(DeblockContext),
.priv_class = &deblock_class,
.process_command = process_command,
}

Definition at line 414 of file vf_deblock.c.

AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:512
AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:491
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:172
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:504
AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:511
outputs
static const AVFilterPad outputs[]
Definition: vf_deblock.c:404
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:506
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:468
inputs
static const AVFilterPad inputs[]
Definition: vf_deblock.c:396
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
filter
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
Definition: filter_design.txt:228
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:507
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:448
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:503
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:486
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:484
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:513
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:466
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:452
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_deblock.c:368
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:471
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:276
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:480
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:79
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:488
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:489
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:481
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:510
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:465
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:479
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:451
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:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
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:80
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:449
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:487
NULL
#define NULL
Definition: coverity.c:32
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_deblock.c:259
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:78
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_deblock.c:63
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:469
WEAK
@ WEAK
Definition: vf_deblock.c:33
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:483
DeblockContext
Definition: vf_deblock.c:35
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
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:473
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:475
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:508
STRONG
@ STRONG
Definition: vf_deblock.c:33
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:147
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
OFFSET
#define OFFSET(x)
Definition: vf_deblock.c:380
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:485
delta
float delta
Definition: vorbis_enc_data.h:430
planes
static const struct @363 planes[]
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:100
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:467
AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:505
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:472
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:477
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:509
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_deblock.c:301
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:71
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
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:70
alpha
static const int16_t alpha[]
Definition: ilbcdata.h:55
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
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:73
FLAGS
#define FLAGS
Definition: vf_deblock.c:381
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:72
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:474
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:478
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:450
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:476