[gvar] Optimize unpack_deltas

This commit is contained in:
Behdad Esfahbod 2022-06-27 15:38:42 -06:00
parent 573e77280b
commit e9af9062c0
1 changed files with 4 additions and 3 deletions

View File

@ -608,9 +608,10 @@ struct gvar
for (unsigned int i = 0; i < num_deltas; i++) for (unsigned int i = 0; i < num_deltas; i++)
{ {
unsigned int pt_index = apply_to_all ? i : indices[i]; unsigned int pt_index = apply_to_all ? i : indices[i];
deltas[pt_index].flag = 1; /* this point is referenced, i.e., explicit deltas specified */ if (unlikely (pt_index >= deltas.length)) continue;
deltas[pt_index].x += x_deltas.arrayZ[i] * scalar; deltas.arrayZ[pt_index].flag = 1; /* this point is referenced, i.e., explicit deltas specified */
deltas[pt_index].y += y_deltas.arrayZ[i] * scalar; deltas.arrayZ[pt_index].x += x_deltas.arrayZ[i] * scalar;
deltas.arrayZ[pt_index].y += y_deltas.arrayZ[i] * scalar;
} }
/* infer deltas for unreferenced points */ /* infer deltas for unreferenced points */