FFmpeg
|
#include <float.h>
#include <libavutil/lfg.h>
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/fifo.h"
#include "libavutil/common.h"
#include "libavutil/avassert.h"
#include "libavutil/pixfmt.h"
#include "avfilter.h"
#include "framequeue.h"
#include "filters.h"
#include "transform.h"
#include "formats.h"
#include "internal.h"
#include "opencl.h"
#include "opencl_source.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | PointPair |
struct | MotionVector |
struct | DebugMatches |
struct | AbsoluteFrameMotion |
struct | FrameDelta |
struct | SimilarityMatrix |
struct | CropInfo |
struct | IterIndices |
struct | DeshakeOpenCLContext |
Macros | |
#define | BREIFN 512 |
#define | BRIEF_PATCH_SIZE 31 |
#define | BRIEF_PATCH_SIZE_HALF (BRIEF_PATCH_SIZE / 2) |
#define | MATCHES_CONTIG_SIZE 2000 |
#define | ROUNDED_UP_DIV(a, b) ((a + (b - 1)) / b) |
#define | OFFSET(x) offsetof(DeshakeOpenCLContext, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Enumerations | |
enum | RingbufferIndices { RingbufX, RingbufY, RingbufRot, RingbufScaleX, RingbufScaleY, RingbufCount } |
Functions | |
static void | free_debug_matches (AbsoluteFrameMotion *afm) |
static int | rand_in (int low, int high, AVLFG *alfg) |
static double | averaged_event_time_ms (unsigned long long total_time, int num_frames) |
static void | run_estimate_kernel (const MotionVector *point_pairs, double *model) |
static int | points_not_collinear (const cl_float2 **points) |
static int | check_subset (const MotionVector *pairs_subset) |
static int | get_subset (AVLFG *alfg, const MotionVector *point_pairs, const int num_point_pairs, MotionVector *pairs_subset, int max_attempts) |
static void | compute_error (const MotionVector *point_pairs, const int num_point_pairs, const double *model, float *err) |
static int | find_inliers (MotionVector *point_pairs, const int num_point_pairs, const double *model, float *err, double thresh) |
static int | ransac_update_num_iters (double confidence, double num_outliers, int max_iters) |
static int | estimate_affine_2d (DeshakeOpenCLContext *deshake_ctx, MotionVector *point_pairs, DebugMatches *debug_matches, const int num_point_pairs, double *model_out, const double threshold, const int max_iters, const double confidence) |
static void | optimize_model (DeshakeOpenCLContext *deshake_ctx, MotionVector *best_pairs, MotionVector *inliers, const int num_inliers, float best_err, double *model_out) |
static int | minimize_error (DeshakeOpenCLContext *deshake_ctx, MotionVector *inliers, DebugMatches *debug_matches, const int num_inliers, double *model_out, const int max_iters) |
static FrameDelta | decompose_transform (double *model) |
static int | make_vectors_contig (DeshakeOpenCLContext *deshake_ctx, int size_y, int size_x) |
static float | gaussian_for (int x, float sigma) |
static void | make_gauss_kernel (float *gauss_kernel, float length, float sigma) |
static IterIndices | start_end_for (DeshakeOpenCLContext *deshake_ctx, int length) |
static void | ringbuf_float_at (DeshakeOpenCLContext *deshake_ctx, AVFifoBuffer *values, float *val, int offset) |
static float | smooth (DeshakeOpenCLContext *deshake_ctx, float *gauss_kernel, int length, float max_val, AVFifoBuffer *values) |
static cl_float2 | transformed_point (float x, float y, float *transform) |
static void | transform_center_scale (float x_shift, float y_shift, float angle, float scale_x, float scale_y, float center_w, float center_h, float *matrix) |
static void | update_needed_crop (CropInfo *crop, float *transform, float frame_width, float frame_height) |
static av_cold void | deshake_opencl_uninit (AVFilterContext *avctx) |
static int | deshake_opencl_init (AVFilterContext *avctx) |
static void | transform_debug (AVFilterContext *avctx, float *new_vals, float *old_vals, int curr_frame) |
static int | filter_frame (AVFilterLink *link, AVFrame *input_frame) |
static int | queue_frame (AVFilterLink *link, AVFrame *input_frame) |
static int | activate (AVFilterContext *ctx) |
AVFILTER_DEFINE_CLASS (deshake_opencl) | |
Variables | |
static const AVFilterPad | deshake_opencl_inputs [] |
static const AVFilterPad | deshake_opencl_outputs [] |
static const AVOption | deshake_opencl_options [] |
const AVFilter | ff_vf_deshake_opencl |
#define BREIFN 512 |
Definition at line 87 of file vf_deshake_opencl.c.
#define BRIEF_PATCH_SIZE 31 |
Definition at line 90 of file vf_deshake_opencl.c.
#define BRIEF_PATCH_SIZE_HALF (BRIEF_PATCH_SIZE / 2) |
Definition at line 91 of file vf_deshake_opencl.c.
#define MATCHES_CONTIG_SIZE 2000 |
Definition at line 93 of file vf_deshake_opencl.c.
Definition at line 95 of file vf_deshake_opencl.c.
#define OFFSET | ( | x | ) | offsetof(DeshakeOpenCLContext, x) |
Definition at line 2154 of file vf_deshake_opencl.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 2155 of file vf_deshake_opencl.c.
enum RingbufferIndices |
Enumerator | |
---|---|
RingbufX | |
RingbufY | |
RingbufRot | |
RingbufScaleX | |
RingbufScaleY | |
RingbufCount |
Definition at line 111 of file vf_deshake_opencl.c.
|
static |
Definition at line 152 of file vf_deshake_opencl.c.
Referenced by deshake_opencl_uninit().
Definition at line 313 of file vf_deshake_opencl.c.
Referenced by deshake_opencl_init(), and get_subset().
|
static |
Definition at line 319 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 329 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d(), minimize_error(), and optimize_model().
|
static |
Definition at line 359 of file vf_deshake_opencl.c.
Referenced by check_subset().
|
static |
Definition at line 385 of file vf_deshake_opencl.c.
Referenced by get_subset().
|
static |
Definition at line 403 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d(), and minimize_error().
|
static |
Definition at line 445 of file vf_deshake_opencl.c.
Referenced by find_inliers(), minimize_error(), and optimize_model().
|
static |
Definition at line 469 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d().
Definition at line 505 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d().
|
static |
Definition at line 527 of file vf_deshake_opencl.c.
|
static |
Definition at line 610 of file vf_deshake_opencl.c.
Referenced by minimize_error().
|
static |
Definition at line 683 of file vf_deshake_opencl.c.
|
static |
Definition at line 747 of file vf_deshake_opencl.c.
|
static |
Definition at line 787 of file vf_deshake_opencl.c.
|
static |
Definition at line 813 of file vf_deshake_opencl.c.
Referenced by make_gauss_kernel().
|
static |
Definition at line 819 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 843 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 854 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 903 of file vf_deshake_opencl.c.
Referenced by decode_lspf(), filter_channel(), filter_frame(), smooth_end_frame_filter(), and smooth_init().
|
static |
Definition at line 957 of file vf_deshake_opencl.c.
Referenced by transform_center_scale(), and update_needed_crop().
|
static |
Definition at line 967 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 1005 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 1066 of file vf_deshake_opencl.c.
|
static |
Definition at line 1125 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 1357 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 1385 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 1749 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 2039 of file vf_deshake_opencl.c.
AVFILTER_DEFINE_CLASS | ( | deshake_opencl | ) |
|
static |
Definition at line 2138 of file vf_deshake_opencl.c.
|
static |
Definition at line 2146 of file vf_deshake_opencl.c.
|
static |
Definition at line 2157 of file vf_deshake_opencl.c.
const AVFilter ff_vf_deshake_opencl |
Definition at line 2188 of file vf_deshake_opencl.c.