2 * Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVFILTER_DESHAKE_H
22 #define AVFILTER_DESHAKE_H
26 #include "libavcodec/dsputil.h"
27 #include "transform.h"
29 #include "libavutil/opencl.h"
34 EXHAUSTIVE, ///< Search all possible positions
35 SMART_EXHAUSTIVE, ///< Search most possible positions (faster)
40 int x; ///< Horizontal shift
41 int y; ///< Vertical shift
45 double x; ///< Horizontal shift
46 double y; ///< Vertical shift
50 MotionVector vector; ///< Motion vector
51 double angle; ///< Angle of rotation
52 double zoom; ///< Zoom percentage
64 int out_plane_size[8];
69 size_t cl_outbuf_size;
70 AVOpenCLKernelEnv kernel_env;
71 } DeshakeOpenclContext;
77 AVFrame *ref; ///< Previous frame
78 int rx; ///< Maximum horizontal shift
79 int ry; ///< Maximum vertical shift
80 int edge; ///< Edge fill method
81 int blocksize; ///< Size of blocks to compare
82 int contrast; ///< Contrast threshold
83 int search; ///< Motion search method
84 AVCodecContext *avctx;
85 DSPContext c; ///< Context providing optimized SAD methods
86 Transform last; ///< Transform from last frame
87 int refcount; ///< Number of reference frames (defines averaging window)
90 int cw; ///< Crop motion search to this box
94 char *filename; ///< Motion search detailed log filename
97 DeshakeOpenclContext opencl_ctx;
99 int (* transform)(AVFilterContext *ctx, int width, int height, int cw, int ch,
100 const float *matrix_y, const float *matrix_uv, enum InterpolateMethod interpolate,
101 enum FillMethod fill, AVFrame *in, AVFrame *out);
104 #endif /* AVFILTER_DESHAKE_H */