FFmpeg
|
#include <float.h>
#include <libavutil/lfg.h>
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "libavutil/fifo.h"
#include "libavutil/common.h"
#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "avfilter.h"
#include "framequeue.h"
#include "filters.h"
#include "transform.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, AVFifo *values, float *val, int offset) |
static float | smooth (DeshakeOpenCLContext *deshake_ctx, float *gauss_kernel, int length, float max_val, AVFifo *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 86 of file vf_deshake_opencl.c.
#define BRIEF_PATCH_SIZE 31 |
Definition at line 89 of file vf_deshake_opencl.c.
#define BRIEF_PATCH_SIZE_HALF (BRIEF_PATCH_SIZE / 2) |
Definition at line 90 of file vf_deshake_opencl.c.
#define MATCHES_CONTIG_SIZE 2000 |
Definition at line 92 of file vf_deshake_opencl.c.
Definition at line 94 of file vf_deshake_opencl.c.
#define OFFSET | ( | x | ) | offsetof(DeshakeOpenCLContext, x) |
Definition at line 2119 of file vf_deshake_opencl.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 2120 of file vf_deshake_opencl.c.
enum RingbufferIndices |
Enumerator | |
---|---|
RingbufX | |
RingbufY | |
RingbufRot | |
RingbufScaleX | |
RingbufScaleY | |
RingbufCount |
Definition at line 110 of file vf_deshake_opencl.c.
|
static |
Definition at line 151 of file vf_deshake_opencl.c.
Referenced by deshake_opencl_uninit().
Definition at line 304 of file vf_deshake_opencl.c.
Referenced by deshake_opencl_init(), and get_subset().
Definition at line 310 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 320 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d(), minimize_error(), and optimize_model().
|
static |
Definition at line 350 of file vf_deshake_opencl.c.
Referenced by check_subset().
|
static |
Definition at line 376 of file vf_deshake_opencl.c.
Referenced by get_subset().
|
static |
Definition at line 394 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d(), and minimize_error().
|
static |
Definition at line 436 of file vf_deshake_opencl.c.
Referenced by find_inliers(), minimize_error(), and optimize_model().
|
static |
Definition at line 460 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d().
Definition at line 496 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d().
|
static |
Definition at line 518 of file vf_deshake_opencl.c.
|
static |
Definition at line 601 of file vf_deshake_opencl.c.
Referenced by minimize_error().
|
static |
Definition at line 674 of file vf_deshake_opencl.c.
|
static |
Definition at line 738 of file vf_deshake_opencl.c.
|
static |
Definition at line 778 of file vf_deshake_opencl.c.
Definition at line 804 of file vf_deshake_opencl.c.
Referenced by make_gauss_kernel().
Definition at line 810 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 834 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 845 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 888 of file vf_deshake_opencl.c.
Referenced by decode_lspf(), do_transform(), filter_channel(), filter_frame(), smooth_end_frame_filter(), and smooth_init().
Definition at line 942 of file vf_deshake_opencl.c.
Referenced by transform_center_scale(), and update_needed_crop().
|
static |
Definition at line 952 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 990 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 1051 of file vf_deshake_opencl.c.
|
static |
Definition at line 1110 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 1340 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 1368 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 1725 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 2004 of file vf_deshake_opencl.c.
AVFILTER_DEFINE_CLASS | ( | deshake_opencl | ) |
|
static |
Definition at line 2103 of file vf_deshake_opencl.c.
|
static |
Definition at line 2111 of file vf_deshake_opencl.c.
|
static |
Definition at line 2122 of file vf_deshake_opencl.c.
const AVFilter ff_vf_deshake_opencl |
Definition at line 2153 of file vf_deshake_opencl.c.