diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2024-12-11 13:58:30 +0100 |
---|---|---|
committer | Barnabás Pőcze <pobrn@protonmail.com> | 2025-01-06 10:18:44 +0100 |
commit | 4f9d8a63017d5217fcae1c55da3d4c9d1a04c469 (patch) | |
tree | 5eb1aa46e4ec5e46cfaa9ad42a62fc7ac2a165d4 /src/android/data | |
parent | fe33e727f278123e91ce5ebe75af08dec514cc5a (diff) |
After the initial generation, when a frame is requested,
the test pattern generator rotates the image left by 1 column.
The current approach has two shortcomings:
(1) it allocates a temporary buffer to hold one column;
(2) it swaps two columns at a time.
The test patterns are simple ARGB images, in row-major order,
so doing (2) works against memory prefetching. This can be
addressed by doing the rotation one row at a time as that way
the image is addressed in a purely linear fashion. Doing so also
eliminates the need for a dynamically allocated temporary buffer,
as the required buffer now only needs to hold one sample,
which is 4 bytes in this case.
In an optimized build, this results in about a 2x increase in the
number of frames per second as reported by `cam`. In an unoptimized,
ASAN and UBSAN intrumented build, the difference is even bigger,
which is useful for running lc-compliance in CI in a reasonable time.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/android/data')
0 files changed, 0 insertions, 0 deletions