During transforming an image, a matrix multiplication per pixel was done.
The matrix in itself is always linear so it could be replaced by two additions.
Before
After
Differential D11533
Sequencer: Performance image crop transform. Authored by Jeroen Bakker (jbakker) on Jun 8 2021, 2:51 PM.
Details
During transforming an image, a matrix multiplication per pixel was done. Before After
Diff Detail
Event TimelineComment Actions Wow, I went from 20fps in the debug build to ~300fps. The next bottle neck seems to be in nearest_interpolation_color. I think you could remove the if (x1 < 0 || y1 < 0) { check on line 266 as that has already been done on line 255. However from looking at the perf data the slow part in that function seems to be the array index lookup (unsigned char *)in->rect + ((size_t)in->x) * y1 * 4 + 4 * x1; However the current code looks good and because of the huge performance uplift, I think it can be committed as is. |