Add SVE2 optimizations of PGM/PPM image savers - #910
Merged
Conversation
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
marked this pull request as ready for review
August 24, 2026 14:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds SVE2 implementations of the PGM/PPM image saver classes used by
ImageSaveToMemory:Sve2::ImagePgmTxtSaverSve2::ImagePgmBinSaverSve2::ImagePpmTxtSaverSve2::ImagePpmBinSaverThese 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::ImageSaveToMemoryis wired intoSimdImageSaveToMemory/SimdImageSaveToFile(preferred over NEON). PNG/JPEG/BMP saves still use the NEON savers until those formats have SVE2 implementations.Test plan
g++,SIMD_SHARED=ON):./Test "-r=.." -fi=ImageSaveToMemory -tt=1 -ts=1— ALL TESTS ARE FINISHED SUCCESSFULLY (82.1 s).-DSIMD_SVE2=ON:SimdSve2ImageSave.cpp,SimdLib.cpp, andTestImageIO.cppcompiled successfully. Object symbols includeSve2::ImageSaveToMemoryand the four saver constructors.Notes
src/Simd/SimdSve2ImageSave.cppprj/vs2022/Sve2.vcxprojandSve2.vcxproj.filtersdocs/2026.html(7.2.165)