163 return default_value;
274 return marker - track->
markers;
288 if (i < end &&
markers[i].framenr < *next_higher) {
290 *next_higher =
markers[i].framenr;
303 if (0 <= i &&
markers[i].framenr > *next_lower) {
305 *next_lower =
markers[i].framenr;
340 if ((next_higher - ref_frame) < (ref_frame - next_lower)) {
407 float result_offset[2])
452 const float pivot[2],
490 const float pivot[2],
491 float result_translation[2])
493 const float origin[2] = {0.5f * aspect *
size, 0.5f *
size};
494 float intended_pivot[2], rotated_pivot[2];
495 float rotation_mat[2][2];
504 add_v2_v2(result_translation, intended_pivot);
505 sub_v2_v2(result_translation, rotated_pivot);
523 float r_translation[2],
536 *r_scale_step = 0.0f;
555 weight_sum += weight;
557 r_translation[0] += weight * offset[0];
558 r_translation[1] += weight * offset[1];
559 ref_pos[0] += weight * marker->
pos[0];
560 ref_pos[1] += weight * marker->
pos[1];
569 ref_pos[0] /= weight_sum;
570 ref_pos[1] /= weight_sum;
571 r_translation[0] /= weight_sum;
572 r_translation[1] /= weight_sum;
592 float rotation, scale, quality;
594 stabilization_base, marker, aspect, r_pivot, &rotation, &scale);
595 const float quality_weight = weight * quality;
596 weight_sum += quality_weight;
597 *r_angle += rotation * quality_weight;
599 *r_scale_step +=
logf(scale) * quality_weight;
612 *r_scale_step /= weight_sum;
613 *r_angle /= weight_sum;
619 *r_scale_step = 0.0f;
645 weight_sum += weight;
646 r_ref_pos[0] += weight * marker->
pos[0];
647 r_ref_pos[1] += weight * marker->
pos[1];
653 r_ref_pos[0] /= weight_sum;
654 r_ref_pos[1] /= weight_sum;
699 float r_translation[2],
705 float trans_a[2], trans_b[2];
706 float angle_a, angle_b;
707 float scale_a, scale_b;
708 float pivot_a[2], pivot_b[2];
709 bool success =
false;
715 t = ((
float)framenr - frame_a) / (frame_b - frame_a);
719 ctx, frame_a, aspect, trans_a, pivot_a, &angle_a, &scale_a);
724 ctx, frame_b, aspect, trans_b, pivot_b, &angle_b, &scale_b);
731 *r_scale_step = s * scale_a +
t * scale_b;
732 *r_angle = s * angle_a +
t * angle_b;
759 order[tracknr].data = track;
829 const float average_translation[2],
830 const float pivot[2],
831 const float average_angle,
832 const float average_scale_step)
862 size_t track_len = 0;
871 float average_angle = 0, average_scale_step = 0;
872 float average_translation[2], average_pos[2], pivot[2];
881 "2D stabilization per track baseline data");
900 if (track_len == 0) {
908 for (
int i = 0; i < track_len; i++) {
910 if (reference_frame !=
order[i].reference_frame) {
911 reference_frame =
order[i].reference_frame;
918 &average_scale_step);
949 float r_translation[2],
954 bool success =
false;
959 *r_scale_step = 0.0f;
965 ctx, framenr, aspect, r_translation, r_pivot, r_angle, r_scale_step);
991 ctx, next_higher, aspect, r_translation, r_pivot, r_angle, r_scale_step);
996 ctx, next_lower, aspect, r_translation, r_pivot, r_angle, r_scale_step);
1020 float r_translation[2],
1025 float target_pos[2], target_scale;
1029 *r_scale =
expf(scale_step * scaleinf);
1046 if (target_scale != 0.0f) {
1047 *r_scale /= target_scale;
1052 r_translation[0] *= (
float)
size * aspect;
1060 if (do_compensate) {
1063 if (*r_scale != 0.0f) {
1064 *r_scale = 1.0f / *r_scale;
1070 const float pivot[2],
1071 const float translation[2],
1076 float translation_mat[4][4], rotation_mat[4][4], scale_mat[4][4], pivot_mat[4][4],
1077 inv_pivot_mat[4][4], aspect_mat[4][4], inv_aspect_mat[4][4];
1078 const float scale_vector[3] = {scale, scale, 1.0f};
1088 aspect_mat[0][0] /= pixel_aspect;
1095 add_v2_v2(translation_mat[3], translation);
1123 int sfra = INT_MAX, efra = INT_MIN;
1124 float scale = 1.0f, scale_step = 0.0f;
1130 int first_frame = track->markers[0].framenr;
1131 int last_frame = track->markers[track->markersnr - 1].framenr;
1132 sfra =
min_ii(sfra, first_frame);
1133 efra =
max_ii(efra, last_frame);
1138 for (
int cfra = sfra; cfra <= efra; cfra++) {
1139 float translation[2], pivot[2],
angle, tmp_scale;
1142 const bool do_compensate =
true;
1145 ctx, cfra, aspect, translation, pivot, &
angle, &scale_step);
1165 for (
int edge_index = 0; edge_index < 4; edge_index++) {
1170 float stable_edge_p1[3], stable_edge_p2[3];
1171 copy_v2_v2(stable_edge_p1, points[edge_index]);
1172 copy_v2_v2(stable_edge_p2, points[(edge_index + 1) % 4]);
1173 stable_edge_p1[2] = stable_edge_p2[2] = 0.0f;
1180 for (
int point_index = 0; point_index < 4; point_index++) {
1181 const float point[3] = {points[point_index][0], points[point_index][1], 0.0f};
1185 float stable_edge_vec[3];
1186 sub_v3_v3v3(stable_edge_vec, stable_edge_p2, stable_edge_p1);
1190 float point_to_edge_start_vec[3];
1191 sub_v3_v3v3(point_to_edge_start_vec, point, stable_edge_p1);
1197 if (
cross_v2v2(stable_edge_vec, point_to_edge_start_vec) >= 0.0f) {
1199 float scale_pivot[2];
1215 float real_dist =
dist_to_line_v2(scale_pivot, stable_edge_p1, stable_edge_p2);
1217 const float S = required_dist / real_dist;
1218 scale =
max_ff(scale, S);
1277 float translation[2],
1285 bool do_compensate =
true;
1286 float scale_step = 0.0f;
1297 ctx, framenr, aspect, translation, pivot,
angle, &scale_step)) {
1299 ctx, framenr,
size, aspect, do_compensate, scale_step, translation, pivot, scale,
angle);
1330 for (
int i = 0; i < tmpibuf->
x; i++) {
1331 float vec[3] = {i, j, 0.0f};
1335 interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j);
1346 MovieClip *clip,
int framenr,
ImBuf *ibuf,
float translation[2],
float *scale,
float *
angle)
1348 float tloc[2], tscale, tangle;
1399 ibuf->
x, ibuf->
y, pixel_aspect, tloc, tscale, tangle, mat);
1424 .interpolation = interpolation,
1465 float translation[2],
1482 pivot[0] = 0.5f * pixel_aspect * buffer_width;
1483 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_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
void * BLI_ghash_lookup(GHash *gh, const void *key) 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], const char axis, const float angle)
void angle_to_mat2(float R[2][2], const float angle)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], const float t)
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)
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(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
@ TRACKING_FILTER_BICUBIC
@ TRACKING_FILTER_NEAREST
@ TRACKING_FILTER_BILINEAR
@ TRACKING_STABILIZE_SCALE
@ TRACKING_STABILIZE_ROTATION
@ TRACKING_2D_STABILIZATION
_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 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 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(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.
StructRNA RNA_MovieTrackingStabilization
StructRNA RNA_MovieTrackingTrack
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.
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
const vector< Marker > & markers
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)
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])
void(* interpolation_func)(struct ImBuf *, struct ImBuf *, float, float, int, int)
struct StabContext StabContext
__forceinline const avxi abs(const avxi &a)