FFmpeg
Macros | Functions | Variables
vf_deshake.c File Reference

fast deshake / depan video filter More...

#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/qsort.h"
#include "deshake.h"

Macros

#define OFFSET(x)   offsetof(DeshakeContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CMP(i, j)
 

Functions

 AVFILTER_DEFINE_CLASS (deshake)
 

Variables

AVFilter ff_vf_deshake
 

Detailed Description

fast deshake / depan video filter

SAD block-matching motion compensation to fix small changes in horizontal and/or vertical shift. This filter helps remove camera shake from hand-holding a camera, bumping a tripod, moving on a vehicle, etc.

Algorithm:

TODO:

Dark Shikari links to http://wiki.videolan.org/SoC_x264_2010#GPU_Motion_Estimation_2 for an algorithm similar to what could be used here to get the gmv It requires only a couple diamond searches + fast downscaling

Special thanks to Jason Kotenko for his help with the algorithm and my inability to see simple errors in C code.

Macro Definition Documentation

§ CMP

#define CMP (   i,
 
)
Value:
deshake->sad(src1 + cy * stride + cx, stride,\
src2 + (j) * stride + (i), stride)

Variable Documentation

§ ff_vf_deshake

AVFilter ff_vf_deshake
Initial value:
= {
.name = "deshake",
.description = NULL_IF_CONFIG_SMALL("Stabilize shaky video."),
.priv_size = sizeof(DeshakeContext),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.inputs = deshake_inputs,
.outputs = deshake_outputs,
.priv_class = &deshake_class,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
Definition: deshake.h:55