FFmpeg
Loading...
Searching...
No Matches
vf_blockdetect.c File Reference

No-reference blockdetect filter. More...

#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  BLKContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (blockdetect)
 
static int blockdetect_config_input (AVFilterLink *inlink)
 
static float calculate_blockiness (BLKContext *s, int w, int h, float *grad, int grad_linesize, uint8_t *src, int src_linesize)
 
static void set_meta (AVDictionary **metadata, const char *key, float d)
 
static int blockdetect_filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void blockdetect_uninit (AVFilterContext *ctx)
 

Variables

static const AVOption blockdetect_options []
 
static enum AVPixelFormat pix_fmts []
 
static const AVFilterPad blockdetect_inputs []
 
const FFFilter ff_vf_blockdetect
 

Detailed Description

No-reference blockdetect filter.

Implementing: Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. IEEE, 2005. http://www.eurasip.org/Proceedings/Eusipco/Eusipco2005/defevent/papers/cr1042.pdf

Author
Thilo Borgmann <thilo.borgmann at mail.de>

Definition in file vf_blockdetect.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(BLKContext, x)

Definition at line 55 of file vf_blockdetect.c.

◆ FLAGS

Definition at line 56 of file vf_blockdetect.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( blockdetect )

◆ blockdetect_config_input()

static int blockdetect_config_input ( AVFilterLink * inlink)
static

Definition at line 66 of file vf_blockdetect.c.

◆ calculate_blockiness()

static float calculate_blockiness ( BLKContext * s,
int w,
int h,
float * grad,
int grad_linesize,
uint8_t * src,
int src_linesize )
static

Definition at line 86 of file vf_blockdetect.c.

Referenced by blockdetect_filter_frame().

◆ set_meta()

static void set_meta ( AVDictionary ** metadata,
const char * key,
float d )
static

Definition at line 193 of file vf_blockdetect.c.

Referenced by blockdetect_filter_frame().

◆ blockdetect_filter_frame()

static int blockdetect_filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 200 of file vf_blockdetect.c.

◆ blockdetect_uninit()

static av_cold void blockdetect_uninit ( AVFilterContext * ctx)
static

Definition at line 246 of file vf_blockdetect.c.

Variable Documentation

◆ blockdetect_options

const AVOption blockdetect_options[]
static
Initial value:
= {
{ "period_min", "Minimum period to search for", OFFSET(period_min), AV_OPT_TYPE_INT, {.i64=3}, 2, 32, FLAGS},
{ "period_max", "Maximum period to search for", OFFSET(period_max), AV_OPT_TYPE_INT, {.i64=24}, 2, 64, FLAGS},
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=1}, 0, 15, FLAGS },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
static const struct @257111027162314367033347246032313251342043035002 planes[]

Definition at line 57 of file vf_blockdetect.c.

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static
Initial value:
= {
}
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ 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
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ 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_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ 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:283
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ 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_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ 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
@ 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

Definition at line 258 of file vf_blockdetect.c.

◆ blockdetect_inputs

const AVFilterPad blockdetect_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = blockdetect_config_input,
.filter_frame = blockdetect_filter_frame,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int blockdetect_config_input(AVFilterLink *inlink)
static int blockdetect_filter_frame(AVFilterLink *inlink, AVFrame *in)

Definition at line 270 of file vf_blockdetect.c.

◆ ff_vf_blockdetect

const FFFilter ff_vf_blockdetect
Initial value:
= {
.p.name = "blockdetect",
.p.description = NULL_IF_CONFIG_SMALL("Blockdetect filter."),
.p.priv_class = &blockdetect_class,
.priv_size = sizeof(BLKContext),
}
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition avfilter.h:182
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
static av_cold void blockdetect_uninit(AVFilterContext *ctx)
static const AVFilterPad blockdetect_inputs[]
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

Definition at line 279 of file vf_blockdetect.c.