Curve fitting enhancement

This commit is contained in:
korenkonder
2023-04-11 22:09:53 +03:00
parent d195d10c23
commit 5e79b91fab
4 changed files with 84 additions and 33 deletions
+17
View File
@@ -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 });