mirror of
https://github.com/korenkonder/ReDIVA.git
synced 2026-10-07 14:18:30 +03:00
Curve fitting enhancement
This commit is contained in:
@@ -103,6 +103,23 @@ int32_t interpolate_chs_reverse_sequence(std::vector<float_t>& values_src, std::
|
||||
int32_t prev_frame = 0;
|
||||
float_t t2_old = 0.0f;
|
||||
while (left_count > 0) {
|
||||
int32_t i_const = -1;
|
||||
for (size_t i = 1; i < left_count; i++)
|
||||
if (!memcmp(&a[0], &a[i], sizeof(float_t)))
|
||||
i_const = (int32_t)i;
|
||||
else
|
||||
break;
|
||||
|
||||
if (i_const != -1) {
|
||||
values.push_back({ (float_t)frame, a[0], t2_old, 0.0f });
|
||||
t2_old = 0.0f;
|
||||
prev_frame = frame;
|
||||
frame += i_const;
|
||||
a += i_const;
|
||||
left_count -= i_const;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (left_count < reverse_min_count) {
|
||||
if (left_count > 1) {
|
||||
values.push_back({ (float_t)frame, a[0], t2_old, 0.0f });
|
||||
|
||||
Reference in New Issue
Block a user