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
58 cl_command_queue command_queue;
67 int out_plane_size[8];
72 size_t cl_outbuf_size;
73 } DeshakeOpenclContext;
79 AVFrame *ref; ///< Previous frame
80 int rx; ///< Maximum horizontal shift
81 int ry; ///< Maximum vertical shift
82 int edge; ///< Edge fill method
83 int blocksize; ///< Size of blocks to compare
84 int contrast; ///< Contrast threshold
85 int search; ///< Motion search method
86 AVCodecContext *avctx;
87 DSPContext c; ///< Context providing optimized SAD methods
88 Transform last; ///< Transform from last frame
89 int refcount; ///< Number of reference frames (defines averaging window)
92 int cw; ///< Crop motion search to this box
96 char *filename; ///< Motion search detailed log filename
99 DeshakeOpenclContext opencl_ctx;
101 int (* transform)(AVFilterContext *ctx, int width, int height, int cw, int ch,
102 const float *matrix_y, const float *matrix_uv, enum InterpolateMethod interpolate,
103 enum FillMethod fill, AVFrame *in, AVFrame *out);
106 #endif /* AVFILTER_DESHAKE_H */