Skip to content

Add SVE2 optimizations of PGM/PPM image savers - #910

Merged
ermig1979 merged 1 commit into
devfrom
cursor/sve2-image-save-ppm-81f4
Aug 24, 2026
Merged

Add SVE2 optimizations of PGM/PPM image savers#910
ermig1979 merged 1 commit into
devfrom
cursor/sve2-image-save-ppm-81f4

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

Adds SVE2 implementations of the PGM/PPM image saver classes used by ImageSaveToMemory:

  • Sve2::ImagePgmTxtSaver
  • Sve2::ImagePgmBinSaver
  • Sve2::ImagePpmTxtSaver
  • Sve2::ImagePpmBinSaver

These follow the existing NEON/SSE/AVX pattern: the SVE2 savers inherit from the NEON classes and replace color-conversion callbacks with SVE2 kernels (BgrToGray, BgraToGray, RgbToGray, RgbaToGray, GrayToBgr, BgrToRgb, BgraToRgb, BgraToBgr) when width is at least one SVE vector.

Sve2::ImageSaveToMemory is wired into SimdImageSaveToMemory / SimdImageSaveToFile (preferred over NEON). PNG/JPEG/BMP saves still use the NEON savers until those formats have SVE2 implementations.

Test plan

  • Native x86_64 Release build (g++, SIMD_SHARED=ON): ./Test "-r=.." -fi=ImageSaveToMemory -tt=1 -ts=1ALL TESTS ARE FINISHED SUCCESSFULLY (82.1 s).
  • aarch64 cross-compile with -DSIMD_SVE2=ON: SimdSve2ImageSave.cpp, SimdLib.cpp, and TestImageIO.cpp compiled successfully. Object symbols include Sve2::ImageSaveToMemory and the four saver constructors.

Notes

  • New file: src/Simd/SimdSve2ImageSave.cpp
  • VS2022: prj/vs2022/Sve2.vcxproj and Sve2.vcxproj.filters
  • Release notes: docs/2026.html (7.2.165)
  • Runtime SVE2 vs Base comparison needs an ARM host with SVE2; this environment is x86_64.
Open in Web Open in Cursor 

Wire Sve2::ImagePgmTxtSaver, ImagePgmBinSaver, ImagePpmTxtSaver and
ImagePpmBinSaver into ImageSaveToMemory, tests, VS2022 project files
and release notes for 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 14:51
@ermig1979
ermig1979 merged commit cf11a80 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