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 "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 85 of file vf_deshake_opencl.c.
#define BRIEF_PATCH_SIZE 31 |
Definition at line 88 of file vf_deshake_opencl.c.
#define BRIEF_PATCH_SIZE_HALF (BRIEF_PATCH_SIZE / 2) |
Definition at line 89 of file vf_deshake_opencl.c.
#define MATCHES_CONTIG_SIZE 2000 |
Definition at line 91 of file vf_deshake_opencl.c.
Definition at line 93 of file vf_deshake_opencl.c.
#define OFFSET | ( | x | ) | offsetof(DeshakeOpenCLContext, x) |
Definition at line 2120 of file vf_deshake_opencl.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 2121 of file vf_deshake_opencl.c.
enum RingbufferIndices |
Enumerator | |
---|---|
RingbufX | |
RingbufY | |
RingbufRot | |
RingbufScaleX | |
RingbufScaleY | |
RingbufCount |
Definition at line 109 of file vf_deshake_opencl.c.
|
static |
Definition at line 150 of file vf_deshake_opencl.c.
Referenced by deshake_opencl_uninit().
|
static |
Definition at line 303 of file vf_deshake_opencl.c.
Referenced by deshake_opencl_init(), and get_subset().
|
static |
Definition at line 309 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 319 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d(), minimize_error(), and optimize_model().
|
static |
Definition at line 349 of file vf_deshake_opencl.c.
Referenced by check_subset().
|
static |
Definition at line 375 of file vf_deshake_opencl.c.
Referenced by get_subset().
|
static |
Definition at line 393 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d(), and minimize_error().
|
static |
Definition at line 435 of file vf_deshake_opencl.c.
Referenced by find_inliers(), minimize_error(), and optimize_model().
|
static |
Definition at line 459 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d().
Definition at line 495 of file vf_deshake_opencl.c.
Referenced by estimate_affine_2d().
|
static |
Definition at line 517 of file vf_deshake_opencl.c.
|
static |
Definition at line 600 of file vf_deshake_opencl.c.
Referenced by minimize_error().
|
static |
Definition at line 673 of file vf_deshake_opencl.c.
|
static |
Definition at line 737 of file vf_deshake_opencl.c.
|
static |
Definition at line 777 of file vf_deshake_opencl.c.
Definition at line 803 of file vf_deshake_opencl.c.
Referenced by make_gauss_kernel().
Definition at line 809 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 833 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 844 of file vf_deshake_opencl.c.
Referenced by smooth().
|
static |
Definition at line 887 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 941 of file vf_deshake_opencl.c.
Referenced by transform_center_scale(), and update_needed_crop().
|
static |
Definition at line 951 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 989 of file vf_deshake_opencl.c.
Referenced by filter_frame().
|
static |
Definition at line 1050 of file vf_deshake_opencl.c.
|
static |
Definition at line 1109 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 1726 of file vf_deshake_opencl.c.
Referenced by activate().
|
static |
Definition at line 2005 of file vf_deshake_opencl.c.
AVFILTER_DEFINE_CLASS | ( | deshake_opencl | ) |
|
static |
Definition at line 2104 of file vf_deshake_opencl.c.
|
static |
Definition at line 2112 of file vf_deshake_opencl.c.
|
static |
Definition at line 2123 of file vf_deshake_opencl.c.
const AVFilter ff_vf_deshake_opencl |
Definition at line 2154 of file vf_deshake_opencl.c.