Don't abbreviate to 'mono' and use 'monotonic' instead.
-_interpolate_cubic_mono_update_cache (GstTimedValueControlSource * self)
+_interpolate_cubic_monotonic_update_cache (GstTimedValueControlSource * self)
{
gint i, n = self->nvalues;
gdouble *dxs = g_new0 (gdouble, n);
{
gint i, n = self->nvalues;
gdouble *dxs = g_new0 (gdouble, n);
inv_dx = 1.0 / dxs[i];
common = c1 + c1s[i + 1] - m - m;
inv_dx = 1.0 / dxs[i];
common = c1 + c1s[i + 1] - m - m;
- cp->cache.cubic_mono.c1s = c1;
- cp->cache.cubic_mono.c2s = (m - c1 - common) * inv_dx;
- cp->cache.cubic_mono.c3s = common * inv_dx * inv_dx;
+ cp->cache.cubic_monotonic.c1s = c1;
+ cp->cache.cubic_monotonic.c2s = (m - c1 - common) * inv_dx;
+ cp->cache.cubic_monotonic.c3s = common * inv_dx * inv_dx;
iter = g_sequence_iter_next (iter);
}
iter = g_sequence_iter_next (iter);
}
-_interpolate_cubic_mono (GstTimedValueControlSource * self,
+_interpolate_cubic_monotonic (GstTimedValueControlSource * self,
GstControlPoint * cp1, gdouble value1, GstControlPoint * cp2,
gdouble value2, GstClockTime timestamp)
{
if (!self->valid_cache) {
GstControlPoint * cp1, gdouble value1, GstControlPoint * cp2,
gdouble value2, GstClockTime timestamp)
{
if (!self->valid_cache) {
- _interpolate_cubic_mono_update_cache (self);
+ _interpolate_cubic_monotonic_update_cache (self);
self->valid_cache = TRUE;
}
self->valid_cache = TRUE;
}
gdouble diff2 = diff * diff;
gdouble out;
gdouble diff2 = diff * diff;
gdouble out;
- out = value1 + cp1->cache.cubic_mono.c1s * diff;
- out += cp1->cache.cubic_mono.c2s * diff2;
- out += cp1->cache.cubic_mono.c3s * diff * diff2;
+ out = value1 + cp1->cache.cubic_monotonic.c1s * diff;
+ out += cp1->cache.cubic_monotonic.c2s * diff2;
+ out += cp1->cache.cubic_monotonic.c3s * diff * diff2;
return out;
} else {
return value1;
return out;
} else {
return value1;
-interpolate_cubic_mono_get (GstTimedValueControlSource * self,
+interpolate_cubic_monotonic_get (GstTimedValueControlSource * self,
GstClockTime timestamp, gdouble * value)
{
gboolean ret = FALSE;
GstClockTime timestamp, gdouble * value)
{
gboolean ret = FALSE;
g_mutex_lock (&self->lock);
if (_get_nearest_control_points (self, timestamp, &cp1, &cp2)) {
g_mutex_lock (&self->lock);
if (_get_nearest_control_points (self, timestamp, &cp1, &cp2)) {
- *value = _interpolate_cubic_mono (self, cp1, cp1->value, cp2,
+ *value = _interpolate_cubic_monotonic (self, cp1, cp1->value, cp2,
(cp2 ? cp2->value : 0.0), timestamp);
ret = TRUE;
}
(cp2 ? cp2->value : 0.0), timestamp);
ret = TRUE;
}
-interpolate_cubic_mono_get_value_array (GstTimedValueControlSource * self,
+interpolate_cubic_monotonic_get_value_array (GstTimedValueControlSource * self,
GstClockTime timestamp, GstClockTime interval, guint n_values,
gdouble * values)
{
GstClockTime timestamp, GstClockTime interval, guint n_values,
gdouble * values)
{
_get_nearest_control_points2 (self, ts, &cp1, &cp2, &next_ts);
}
if (cp1) {
_get_nearest_control_points2 (self, ts, &cp1, &cp2, &next_ts);
}
if (cp1) {
- *values = _interpolate_cubic_mono (self, cp1, cp1->value, cp2,
+ *values = _interpolate_cubic_monotonic (self, cp1, cp1->value, cp2,
(cp2 ? cp2->value : 0.0), ts);
ret = TRUE;
GST_LOG ("values[%3d]=%lf", i, *values);
(cp2 ? cp2->value : 0.0), ts);
ret = TRUE;
GST_LOG ("values[%3d]=%lf", i, *values);
(GstControlSourceGetValueArray) interpolate_linear_get_value_array}, {
(GstControlSourceGetValue) interpolate_cubic_get,
(GstControlSourceGetValueArray) interpolate_cubic_get_value_array}, {
(GstControlSourceGetValueArray) interpolate_linear_get_value_array}, {
(GstControlSourceGetValue) interpolate_cubic_get,
(GstControlSourceGetValueArray) interpolate_cubic_get_value_array}, {
- (GstControlSourceGetValue) interpolate_cubic_mono_get,
+ (GstControlSourceGetValue) interpolate_cubic_monotonic_get,
(GstControlSourceGetValueArray)
(GstControlSourceGetValueArray)
-interpolate_cubic_mono_get_value_array}};
+interpolate_cubic_monotonic_get_value_array}};
static const guint num_interpolation_modes = G_N_ELEMENTS (interpolation_modes);
static const guint num_interpolation_modes = G_N_ELEMENTS (interpolation_modes);
{GST_INTERPOLATION_MODE_NONE, "GST_INTERPOLATION_MODE_NONE", "none"},
{GST_INTERPOLATION_MODE_LINEAR, "GST_INTERPOLATION_MODE_LINEAR", "linear"},
{GST_INTERPOLATION_MODE_CUBIC, "GST_INTERPOLATION_MODE_CUBIC", "cubic"},
{GST_INTERPOLATION_MODE_NONE, "GST_INTERPOLATION_MODE_NONE", "none"},
{GST_INTERPOLATION_MODE_LINEAR, "GST_INTERPOLATION_MODE_LINEAR", "linear"},
{GST_INTERPOLATION_MODE_CUBIC, "GST_INTERPOLATION_MODE_CUBIC", "cubic"},
- {GST_INTERPOLATION_MODE_CUBIC_MONO, "GST_INTERPOLATION_MODE_CUBIC_MONO",
- "cubic-mono"},
+ {GST_INTERPOLATION_MODE_CUBIC_MONOTONIC,
+ "GST_INTERPOLATION_MODE_CUBIC_MONOTONIC", "cubic-monotonic"},
* @GST_INTERPOLATION_MODE_LINEAR: linear interpolation
* @GST_INTERPOLATION_MODE_CUBIC: cubic interpolation (natural), may overshoot
* the min or max values set by the control point, but is more 'curvy'
* @GST_INTERPOLATION_MODE_LINEAR: linear interpolation
* @GST_INTERPOLATION_MODE_CUBIC: cubic interpolation (natural), may overshoot
* the min or max values set by the control point, but is more 'curvy'
- * @GST_INTERPOLATION_MODE_CUBIC_MONO: monotonic cubic interpolation, will not
+ * @GST_INTERPOLATION_MODE_CUBIC_MONOTONIC: monotonic cubic interpolation, will not
* produce any values outside of the min-max range set by the control points
* (Since 1.8)
*
* produce any values outside of the min-max range set by the control points
* (Since 1.8)
*
GST_INTERPOLATION_MODE_NONE,
GST_INTERPOLATION_MODE_LINEAR,
GST_INTERPOLATION_MODE_CUBIC,
GST_INTERPOLATION_MODE_NONE,
GST_INTERPOLATION_MODE_LINEAR,
GST_INTERPOLATION_MODE_CUBIC,
- GST_INTERPOLATION_MODE_CUBIC_MONO,
+ GST_INTERPOLATION_MODE_CUBIC_MONOTONIC,
} GstInterpolationMode;
/**
} GstInterpolationMode;
/**
} cubic;
struct { /* 24 bytes */
gdouble c1s, c2s, c3s;
} cubic;
struct { /* 24 bytes */
gdouble c1s, c2s, c3s;
guint8 _gst_reserved[64];
} cache;
};
guint8 _gst_reserved[64];
} cache;
};
/* Functions */
GSequenceIter * gst_timed_value_control_source_find_control_point_iter (
/* Functions */
GSequenceIter * gst_timed_value_control_source_find_control_point_iter (
- GstTimedValueControlSource * self,
+ GstTimedValueControlSource * self,
GstClockTime timestamp);
gboolean gst_timed_value_control_source_set (GstTimedValueControlSource * self,
GstClockTime timestamp);
gboolean gst_timed_value_control_source_set (GstTimedValueControlSource * self,