annotate ffmpeg/libavfilter/deshake.h @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 /*
yading@10 2 * Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
yading@10 3 *
yading@10 4 * This file is part of FFmpeg.
yading@10 5 *
yading@10 6 * FFmpeg is free software; you can redistribute it and/or
yading@10 7 * modify it under the terms of the GNU Lesser General Public
yading@10 8 * License as published by the Free Software Foundation; either
yading@10 9 * version 2.1 of the License, or (at your option) any later version.
yading@10 10 *
yading@10 11 * FFmpeg is distributed in the hope that it will be useful,
yading@10 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
yading@10 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
yading@10 14 * Lesser General Public License for more details.
yading@10 15 *
yading@10 16 * You should have received a copy of the GNU Lesser General Public
yading@10 17 * License along with FFmpeg; if not, write to the Free Software
yading@10 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yading@10 19 */
yading@10 20
yading@10 21 #ifndef AVFILTER_DESHAKE_H
yading@10 22 #define AVFILTER_DESHAKE_H
yading@10 23
yading@10 24 #include "config.h"
yading@10 25 #include "avfilter.h"
yading@10 26 #include "libavcodec/dsputil.h"
yading@10 27 #include "transform.h"
yading@10 28 #if CONFIG_OPENCL
yading@10 29 #include "libavutil/opencl.h"
yading@10 30 #endif
yading@10 31
yading@10 32
yading@10 33 enum SearchMethod {
yading@10 34 EXHAUSTIVE, ///< Search all possible positions
yading@10 35 SMART_EXHAUSTIVE, ///< Search most possible positions (faster)
yading@10 36 SEARCH_COUNT
yading@10 37 };
yading@10 38
yading@10 39 typedef struct {
yading@10 40 int x; ///< Horizontal shift
yading@10 41 int y; ///< Vertical shift
yading@10 42 } IntMotionVector;
yading@10 43
yading@10 44 typedef struct {
yading@10 45 double x; ///< Horizontal shift
yading@10 46 double y; ///< Vertical shift
yading@10 47 } MotionVector;
yading@10 48
yading@10 49 typedef struct {
yading@10 50 MotionVector vector; ///< Motion vector
yading@10 51 double angle; ///< Angle of rotation
yading@10 52 double zoom; ///< Zoom percentage
yading@10 53 } Transform;
yading@10 54
yading@10 55 #if CONFIG_OPENCL
yading@10 56
yading@10 57 typedef struct {
yading@10 58 size_t matrix_size;
yading@10 59 float matrix_y[9];
yading@10 60 float matrix_uv[9];
yading@10 61 cl_mem cl_matrix_y;
yading@10 62 cl_mem cl_matrix_uv;
yading@10 63 int in_plane_size[8];
yading@10 64 int out_plane_size[8];
yading@10 65 int plane_num;
yading@10 66 cl_mem cl_inbuf;
yading@10 67 size_t cl_inbuf_size;
yading@10 68 cl_mem cl_outbuf;
yading@10 69 size_t cl_outbuf_size;
yading@10 70 AVOpenCLKernelEnv kernel_env;
yading@10 71 } DeshakeOpenclContext;
yading@10 72
yading@10 73 #endif
yading@10 74
yading@10 75 typedef struct {
yading@10 76 const AVClass *class;
yading@10 77 AVFrame *ref; ///< Previous frame
yading@10 78 int rx; ///< Maximum horizontal shift
yading@10 79 int ry; ///< Maximum vertical shift
yading@10 80 int edge; ///< Edge fill method
yading@10 81 int blocksize; ///< Size of blocks to compare
yading@10 82 int contrast; ///< Contrast threshold
yading@10 83 int search; ///< Motion search method
yading@10 84 AVCodecContext *avctx;
yading@10 85 DSPContext c; ///< Context providing optimized SAD methods
yading@10 86 Transform last; ///< Transform from last frame
yading@10 87 int refcount; ///< Number of reference frames (defines averaging window)
yading@10 88 FILE *fp;
yading@10 89 Transform avg;
yading@10 90 int cw; ///< Crop motion search to this box
yading@10 91 int ch;
yading@10 92 int cx;
yading@10 93 int cy;
yading@10 94 char *filename; ///< Motion search detailed log filename
yading@10 95 int opencl;
yading@10 96 #if CONFIG_OPENCL
yading@10 97 DeshakeOpenclContext opencl_ctx;
yading@10 98 #endif
yading@10 99 int (* transform)(AVFilterContext *ctx, int width, int height, int cw, int ch,
yading@10 100 const float *matrix_y, const float *matrix_uv, enum InterpolateMethod interpolate,
yading@10 101 enum FillMethod fill, AVFrame *in, AVFrame *out);
yading@10 102 } DeshakeContext;
yading@10 103
yading@10 104 #endif /* AVFILTER_DESHAKE_H */