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

Calculate VMAF Motion score. More...

#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "vmaf_motion.h"

Go to the source code of this file.

Data Structures

struct  VMAFMotionContext
 

Macros

#define BIT_SHIFT   15
 
#define OFFSET(x)   offsetof(VMAFMotionContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define conv_y_fn(type, bits)
 

Functions

 AVFILTER_DEFINE_CLASS (vmafmotion)
 
static uint64_t image_sad (const uint16_t *img1, const uint16_t *img2, int w, int h, ptrdiff_t _img1_stride, ptrdiff_t _img2_stride)
 
static void convolution_x (const uint16_t *filter, int filt_w, const uint16_t *src, uint16_t *dst, int w, int h, ptrdiff_t _src_stride, ptrdiff_t _dst_stride)
 
 conv_y_fn (uint8_t, 8)
 
 conv_y_fn (uint16_t, 10)
 
static void vmafmotiondsp_init (VMAFMotionDSPContext *dsp, int bpp)
 
double ff_vmafmotion_process (VMAFMotionData *s, AVFrame *ref)
 
static void set_meta (AVDictionary **metadata, const char *key, float d)
 
static void do_vmafmotion (AVFilterContext *ctx, AVFrame *ref)
 
int ff_vmafmotion_init (VMAFMotionData *s, int w, int h, enum AVPixelFormat fmt)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input_ref (AVFilterLink *inlink)
 
double ff_vmafmotion_uninit (VMAFMotionData *s)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *ref)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const float FILTER_5 [5]
 
static const AVOption vmafmotion_options []
 
static const AVFilterPad vmafmotion_inputs []
 
static const AVFilterPad vmafmotion_outputs []
 
AVFilter ff_vf_vmafmotion
 

Detailed Description

Calculate VMAF Motion score.

Definition in file vf_vmafmotion.c.

Macro Definition Documentation

#define BIT_SHIFT   15

Definition at line 35 of file vf_vmafmotion.c.

Referenced by convolution_x(), ff_vmafmotion_init(), and ff_vmafmotion_process().

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

Definition at line 52 of file vf_vmafmotion.c.

Definition at line 53 of file vf_vmafmotion.c.

#define conv_y_fn (   type,
  bits 
)

Definition at line 128 of file vf_vmafmotion.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( vmafmotion  )
static uint64_t image_sad ( const uint16_t *  img1,
const uint16_t *  img2,
int  w,
int  h,
ptrdiff_t  _img1_stride,
ptrdiff_t  _img2_stride 
)
static

Definition at line 62 of file vf_vmafmotion.c.

Referenced by vmafmotiondsp_init().

static void convolution_x ( const uint16_t *  filter,
int  filt_w,
const uint16_t *  src,
uint16_t *  dst,
int  w,
int  h,
ptrdiff_t  _src_stride,
ptrdiff_t  _dst_stride 
)
static

Definition at line 81 of file vf_vmafmotion.c.

Referenced by vmafmotiondsp_init().

conv_y_fn ( uint8_t  ,
 
)
conv_y_fn ( uint16_t  ,
10   
)
static void vmafmotiondsp_init ( VMAFMotionDSPContext dsp,
int  bpp 
)
static

Definition at line 183 of file vf_vmafmotion.c.

Referenced by ff_vmafmotion_init().

double ff_vmafmotion_process ( VMAFMotionData s,
AVFrame ref 
)

Definition at line 189 of file vf_vmafmotion.c.

Referenced by do_vmafmotion().

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

Definition at line 214 of file vf_vmafmotion.c.

Referenced by do_vmafmotion().

static void do_vmafmotion ( AVFilterContext ctx,
AVFrame ref 
)
static

Definition at line 221 of file vf_vmafmotion.c.

Referenced by filter_frame().

int ff_vmafmotion_init ( VMAFMotionData s,
int  w,
int  h,
enum AVPixelFormat  fmt 
)

Definition at line 235 of file vf_vmafmotion.c.

Referenced by config_input_ref().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 262 of file vf_vmafmotion.c.

static int config_input_ref ( AVFilterLink inlink)
static

Definition at line 280 of file vf_vmafmotion.c.

double ff_vmafmotion_uninit ( VMAFMotionData s)

Definition at line 289 of file vf_vmafmotion.c.

Referenced by uninit().

static int filter_frame ( AVFilterLink inlink,
AVFrame ref 
)
static

Definition at line 298 of file vf_vmafmotion.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 305 of file vf_vmafmotion.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 328 of file vf_vmafmotion.c.

Variable Documentation

const float FILTER_5[5]
static
Initial value:
= {
0.054488685,
0.244201342,
0.402619947,
0.244201342,
0.054488685
}

Definition at line 37 of file vf_vmafmotion.c.

Referenced by ff_vmafmotion_init().

const AVOption vmafmotion_options[]
static
Initial value:
= {
{"stats_file", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_vmafmotion.c:52
#define FLAGS
Definition: vf_vmafmotion.c:53

Definition at line 55 of file vf_vmafmotion.c.

const AVFilterPad vmafmotion_inputs[]
static
Initial value:
= {
{
.name = "reference",
.filter_frame = filter_frame,
.config_props = config_input_ref,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *ref)
static int config_input_ref(AVFilterLink *inlink)

Definition at line 341 of file vf_vmafmotion.c.

const AVFilterPad vmafmotion_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 351 of file vf_vmafmotion.c.

AVFilter ff_vf_vmafmotion
Initial value:
= {
.name = "vmafmotion",
.description = NULL_IF_CONFIG_SMALL("Calculate the VMAF Motion score."),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(VMAFMotionContext),
.priv_class = &vmafmotion_class,
}
static const AVFilterPad vmafmotion_inputs[]
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad vmafmotion_outputs[]
static int query_formats(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int init(AVFilterContext *ctx)
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203

Definition at line 359 of file vf_vmafmotion.c.