16 #include "RNA_prototypes.h"
128 &RNA_MovieTrackingStabilization,
148 return default_value;
259 return marker - track->
markers;
273 if (i < end &&
markers[i].framenr < *next_higher) {
275 *next_higher =
markers[i].framenr;
288 if (0 <= i &&
markers[i].framenr > *next_lower) {
290 *next_lower =
markers[i].framenr;
325 if ((next_higher - ref_frame) < (ref_frame - next_lower)) {
392 float result_offset[2])
437 const float pivot[2],
475 const float pivot[2],
476 float result_translation[2])
478 const float origin[2] = {0.5f * aspect *
size, 0.5f *
size};
479 float intended_pivot[2], rotated_pivot[2];
480 float rotation_mat[2][2];
489 add_v2_v2(result_translation, intended_pivot);
490 sub_v2_v2(result_translation, rotated_pivot);
508 float r_translation[2],
521 *r_scale_step = 0.0f;
540 weight_sum += weight;
542 r_translation[0] += weight *
offset[0];
543 r_translation[1] += weight *
offset[1];
544 ref_pos[0] += weight * marker->
pos[0];
545 ref_pos[1] += weight * marker->
pos[1];
554 ref_pos[0] /= weight_sum;
555 ref_pos[1] /= weight_sum;
556 r_translation[0] /= weight_sum;
557 r_translation[1] /= weight_sum;
577 float rotation, scale, quality;
579 stabilization_base, marker, aspect, r_pivot, &rotation, &scale);
580 const float quality_weight = weight * quality;
581 weight_sum += quality_weight;
582 *r_angle += rotation * quality_weight;
584 *r_scale_step +=
logf(scale) * quality_weight;
597 *r_scale_step /= weight_sum;
598 *r_angle /= weight_sum;
604 *r_scale_step = 0.0f;
630 weight_sum += weight;
631 r_ref_pos[0] += weight * marker->
pos[0];
632 r_ref_pos[1] += weight * marker->
pos[1];
638 r_ref_pos[0] /= weight_sum;
639 r_ref_pos[1] /= weight_sum;
684 float r_translation[2],
690 float trans_a[2], trans_b[2];
691 float angle_a, angle_b;
692 float scale_a, scale_b;
693 float pivot_a[2], pivot_b[2];
694 bool success =
false;
700 t = ((
float)framenr - frame_a) / (frame_b - frame_a);
704 ctx, frame_a, aspect, trans_a, pivot_a, &angle_a, &scale_a);
709 ctx, frame_b, aspect, trans_b, pivot_b, &angle_b, &scale_b);
716 *r_scale_step = s * scale_a +
t * scale_b;
717 *r_angle = s * angle_a +
t * angle_b;
744 order[tracknr].data = track;
814 const float average_translation[2],
815 const float pivot[2],
816 const float average_angle,
817 const float average_scale_step)
847 size_t track_len = 0;
856 float average_angle = 0, average_scale_step = 0;
857 float average_translation[2], average_pos[2], pivot[2];
866 "2D stabilization per track baseline data");
885 if (track_len == 0) {
893 for (
int i = 0; i < track_len; i++) {
895 if (reference_frame !=
order[i].reference_frame) {
896 reference_frame =
order[i].reference_frame;
903 &average_scale_step);
934 float r_translation[2],
939 bool success =
false;
944 *r_scale_step = 0.0f;
950 ctx, framenr, aspect, r_translation, r_pivot, r_angle, r_scale_step);
976 ctx, next_higher, aspect, r_translation, r_pivot, r_angle, r_scale_step);
981 ctx, next_lower, aspect, r_translation, r_pivot, r_angle, r_scale_step);
1005 float r_translation[2],
1010 float target_pos[2], target_scale;
1014 *r_scale =
expf(scale_step * scaleinf);
1031 if (target_scale != 0.0f) {
1032 *r_scale /= target_scale;
1037 r_translation[0] *= (
float)
size * aspect;
1045 if (do_compensate) {
1048 if (*r_scale != 0.0f) {
1049 *r_scale = 1.0f / *r_scale;
1055 const float pivot[2],
1056 const float translation[2],
1061 float translation_mat[4][4], rotation_mat[4][4], scale_mat[4][4], pivot_mat[4][4],
1062 inv_pivot_mat[4][4], aspect_mat[4][4], inv_aspect_mat[4][4];
1063 const float scale_vector[3] = {scale, scale, 1.0f};
1073 aspect_mat[0][0] /= pixel_aspect;
1080 add_v2_v2(translation_mat[3], translation);
1108 int sfra = INT_MAX, efra = INT_MIN;
1109 float scale = 1.0f, scale_step = 0.0f;
1115 int first_frame = track->markers[0].framenr;
1116 int last_frame = track->markers[track->markersnr - 1].framenr;
1117 sfra =
min_ii(sfra, first_frame);
1118 efra =
max_ii(efra, last_frame);
1123 for (
int cfra = sfra; cfra <= efra; cfra++) {
1124 float translation[2], pivot[2],
angle, tmp_scale;
1127 const bool do_compensate =
true;
1130 ctx, cfra, aspect, translation, pivot, &
angle, &scale_step);
1150 for (
int edge_index = 0; edge_index < 4; edge_index++) {
1155 float stable_edge_p1[3], stable_edge_p2[3];
1156 copy_v2_v2(stable_edge_p1, points[edge_index]);
1157 copy_v2_v2(stable_edge_p2, points[(edge_index + 1) % 4]);
1158 stable_edge_p1[2] = stable_edge_p2[2] = 0.0f;
1170 float stable_edge_vec[3];
1171 sub_v3_v3v3(stable_edge_vec, stable_edge_p2, stable_edge_p1);
1175 float point_to_edge_start_vec[3];
1182 if (
cross_v2v2(stable_edge_vec, point_to_edge_start_vec) >= 0.0f) {
1184 float scale_pivot[2];
1200 float real_dist =
dist_to_line_v2(scale_pivot, stable_edge_p1, stable_edge_p2);
1202 const float S = required_dist / real_dist;
1203 scale =
max_ff(scale, S);
1244 float translation[2],
1252 bool do_compensate =
true;
1253 float scale_step = 0.0f;
1264 ctx, framenr, aspect, translation, pivot,
angle, &scale_step)) {
1266 ctx, framenr,
size, aspect, do_compensate, scale_step, translation, pivot, scale,
angle);
1297 for (
int i = 0; i < tmpibuf->
x; i++) {
1298 float vec[3] = {i, j, 0.0f};
1302 interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j);
1307 MovieClip *clip,
int framenr,
ImBuf *ibuf,
float translation[2],
float *scale,
float *
angle)
1309 float tloc[2], tscale, tangle;
1360 ibuf->
x, ibuf->
y, pixel_aspect, tloc, tscale, tangle, mat);
1385 .interpolation = interpolation,
1416 float translation[2],
1433 pivot[0] = 0.5f * pixel_aspect * buffer_width;
1434 pivot[1] = 0.5f * buffer_height;
typedef float(TangentPoint)[2]
float evaluate_fcurve(struct FCurve *fcu, float evaltime)
struct FCurve * id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven)
float BKE_movieclip_remap_clip_to_scene_frame(const struct MovieClip *clip, float framenr)
struct MovieTrackingMarker * BKE_tracking_marker_get_exact(struct MovieTrackingTrack *track, int framenr)
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2])
bool invert_m4(float R[4][4])
void unit_m4(float m[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void size_to_mat4(float R[4][4], const float size[3])
void mul_m4_v3(const float M[4][4], float r[3])
#define mul_m4_series(...)
void mul_m2_v2(const float M[2][2], float v[2])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void rotate_m4(float mat[4][4], char axis, float angle)
void angle_to_mat2(float R[2][2], float angle)
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v2_fl(float r[2], float f)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v2(float r[2])
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
int BLI_sortutil_cmp_int(const void *a_, const void *b_)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
@ TRACKING_STABILIZE_SCALE
@ TRACKING_STABILIZE_ROTATION
@ TRACKING_2D_STABILIZATION
@ TRACKING_FILTER_BICUBIC
@ TRACKING_FILTER_NEAREST
@ TRACKING_FILTER_BILINEAR
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint order
void IMB_colormanagegent_copy_settings(struct ImBuf *ibuf_src, struct ImBuf *ibuf_dst)
void nearest_interpolation(const struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout)
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
SyclQueue void void size_t num_bytes void
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
const vector< Marker > & markers
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const float *float_buffer, unsigned char *byte_output, float *float_output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y)
BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, const float *float_buffer, unsigned char *byte_output, float *float_output, int width, int height, int components, float u, float v)
struct MovieTracking tracking
MovieTrackingMarker * markers
MovieTrackingStabilization stabilization
MovieTrackingCamera camera
MovieTrackingStabilization * stab
GHash * private_track_data
MovieTrackingTrack * data
FCurve * track_weight_curve
float stabilization_offset_base[2]
bool is_init_for_stabilization
float stabilization_scale_base
float stabilization_rotation_base[2][2]
interpolation_func interpolation
void BKE_tracking_stabilization_data_to_mat4(int buffer_width, int buffer_height, float pixel_aspect, float translation[2], float scale, float angle, float r_mat[4][4])
static void retrieve_next_lower_usable_frame(StabContext *ctx, MovieTrackingTrack *track, int i, int ref_frame, int *next_lower)
static void average_marker_positions(StabContext *ctx, int framenr, float r_ref_pos[2])
struct TrackingStabilizeFrameInterpolationData TrackingStabilizeFrameInterpolationData
static void discard_stabilization_baseline_data(void *val)
static int establish_track_initialization_order(StabContext *ctx, TrackInitOrder *order)
static float get_animated_target_scale(StabContext *ctx, int framenr)
static FCurve * retrieve_track_weight_animation(MovieClip *clip, MovieTrackingTrack *track)
void BKE_tracking_stabilization_data_get(MovieClip *clip, int framenr, int width, int height, float translation[2], float *scale, float *angle)
static float get_animated_target_rot(StabContext *ctx, int framenr)
ImBuf * BKE_tracking_stabilize_frame(MovieClip *clip, int framenr, ImBuf *ibuf, float translation[2], float *scale, float *angle)
static FCurve * retrieve_stab_animation(MovieClip *clip, const char *data_path, int idx)
static float get_animated_rotinf(StabContext *ctx, int framenr)
static bool average_track_contributions(StabContext *ctx, int framenr, float aspect, float r_translation[2], float r_pivot[2], float *r_angle, float *r_scale_step)
static MovieTrackingMarker * get_closest_marker(StabContext *ctx, MovieTrackingTrack *track, int ref_frame)
struct TrackStabilizationBase TrackStabilizationBase
static StabContext * init_stabilizer(MovieClip *clip, int size, float aspect)
static void stabilization_calculate_data(StabContext *ctx, int framenr, int size, float aspect, bool do_compensate, float scale_step, float r_translation[2], float r_pivot[2], float *r_scale, float *r_angle)
struct TrackInitOrder TrackInitOrder
static void tracking_stabilize_frame_interpolation_cb(void *__restrict userdata, const int j, const TaskParallelTLS *__restrict UNUSED(tls))
static bool stabilization_determine_offset_for_frame(StabContext *ctx, int framenr, float aspect, float r_translation[2], float r_pivot[2], float *r_angle, float *r_scale_step)
static bool is_init_for_stabilization(StabContext *ctx, MovieTrackingTrack *track)
static bool is_usable_for_stabilization(StabContext *ctx, MovieTrackingTrack *track)
static bool is_effectively_disabled(StabContext *ctx, MovieTrackingTrack *track, MovieTrackingMarker *marker)
static void use_values_from_fcurves(StabContext *ctx, bool toggle)
static bool interpolate_averaged_track_contributions(StabContext *ctx, int framenr, int frame_a, int frame_b, const float aspect, float r_translation[2], float r_pivot[2], float *r_angle, float *r_scale_step)
static void get_animated_target_pos(StabContext *ctx, int framenr, float target_pos[2])
static float get_animated_locinf(StabContext *ctx, int framenr)
static void init_all_tracks(StabContext *ctx, float aspect)
static float get_animated_scaleinf(StabContext *ctx, int framenr)
static float get_animated_weight(StabContext *ctx, MovieTrackingTrack *track, int framenr)
static float SCALE_ERROR_LIMIT_BIAS
static int search_closest_marker_index(MovieTrackingTrack *track, int ref_frame)
static void find_next_working_frames(StabContext *ctx, int framenr, int *next_lower, int *next_higher)
static void attach_stabilization_baseline_data(StabContext *ctx, MovieTrackingTrack *track, TrackStabilizationBase *private_data)
static void setup_pivot(const float ref_pos[2], float r_pivot[2])
static float calculate_autoscale_factor(StabContext *ctx, int size, float aspect)
static float EPSILON_WEIGHT
static void stabilization_data_to_mat4(float pixel_aspect, const float pivot[2], const float translation[2], float scale, float angle, float r_mat[4][4])
static float fetch_from_fcurve(FCurve *animationCurve, int framenr, StabContext *ctx, float default_value)
void(* interpolation_func)(const struct ImBuf *, struct ImBuf *, float, float, int, int)
static StabContext * init_stabilization_working_context(MovieClip *clip)
static void retrieve_next_higher_usable_frame(StabContext *ctx, MovieTrackingTrack *track, int i, int ref_frame, int *next_higher)
static float rotation_contribution(TrackStabilizationBase *track_ref, MovieTrackingMarker *marker, const float aspect, const float pivot[2], float *result_angle, float *result_scale)
static void compensate_rotation_center(const int size, float aspect, const float angle, const float scale, const float pivot[2], float result_translation[2])
static MovieTrackingMarker * get_tracking_data_point(StabContext *ctx, MovieTrackingTrack *track, int framenr, float *r_weight)
static void discard_stabilization_working_context(StabContext *ctx)
static void init_track_for_stabilization(StabContext *ctx, MovieTrackingTrack *track, int reference_frame, float aspect, const float average_translation[2], const float pivot[2], const float average_angle, const float average_scale_step)
static TrackStabilizationBase * access_stabilization_baseline_data(StabContext *ctx, MovieTrackingTrack *track)
static void translation_contribution(TrackStabilizationBase *track_ref, MovieTrackingMarker *marker, float result_offset[2])
struct StabContext StabContext