Skip to content

Add SVE2 optimizations of ImageBmpSaver - #911

Merged
ermig1979 merged 1 commit into
devfrom
cursor/sve2-image-bmp-saver-b997
Aug 24, 2026
Merged

Add SVE2 optimizations of ImageBmpSaver#911
ermig1979 merged 1 commit into
devfrom
cursor/sve2-image-bmp-saver-b997

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Wire SVE2 ImageBmpSaver into ImageSaveToMemory so BMP encoding uses SVE2 color converters on ARM/ARM64.

Changes

  • Add Sve2::ImageBmpSaver (inherits Neon::ImageBmpSaver) in SimdImageSave.h.
  • Implement the constructor in SimdSve2ImageSave.cpp: Gray8 stays a memcpy path; Rgb24 uses Sve2::BgrToRgb; Rgba32 uses Sve2::BgraToRgba. This matches the Neon/SSE41/AVX2 BMP saver pattern.
  • Route SimdImageFileBmp through Sve2::ImageBmpSaver in CreateImageSaver.
  • Document the feature in docs/2026.html (release 7.2.165).

Test::ImageSaveToMemoryAutoTest already compares Simd::Sve2::ImageSaveToMemory with SimdImageSaveToMemory. SimdSve2ImageSave.cpp is already listed in prj/vs2022/Sve2.vcxproj and Sve2.vcxproj.filters.

Testing

  • x86_64 CMake Release build of the library and Test.
  • ./Test "-r=.." -fi=ImageSaveToMemory -tt=1 -ts=1 — all formats including BMP finished successfully (82.1 s).
  • Cross-compiled SimdSve2ImageSave.cpp with aarch64-linux-gnu-g++ -march=armv9-a+sve+sve2+i8mm+bf16. The constructor stores Sve2::BgrToRgb / Sve2::BgraToRgba into _convert.
Open in Web Open in Cursor 

Wire Sve2::ImageBmpSaver into ImageSaveToMemory using SVE2 BgrToRgb and
BgraToRgba converters, matching the Neon/SSE41 BMP saver pattern, and
note the change in release 7.2.165.

Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
@ermig1979
ermig1979 marked this pull request as ready for review August 24, 2026 15:08
@ermig1979
ermig1979 merged commit c0f2b74 into dev Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants