Skip to content

Keep scalar PNG Avg/Paeth unfilters for 1-byte pixels - #950

Merged
ermig1979 merged 1 commit into
devfrom
cursor/png-decode-line-gray8-fallback-b4b5
Sep 9, 2026
Merged

Keep scalar PNG Avg/Paeth unfilters for 1-byte pixels#950
ermig1979 merged 1 commit into
devfrom
cursor/png-decode-line-gray8-fallback-b4b5

Conversation

@ermig1979

Copy link
Copy Markdown
Owner

Follow-up to #949.

Whole-vector Avg/Paeth unfilters are serial for srcN == 1, so the SIMD path was slower than Base on Gray8 (~7.5 ms vs ~4.3 ms in ImageLoadFromMemoryAutoTest).

This drops the n=1 Avg/Paeth/AvgFirst cases so grayscale uses the scalar fallback. Vector paths for n>=2 (RGB/RGBA and 16-bit) stay as in #949.

After this change, AutoTest Gray8 is 4.182 ms (Sse41) vs 4.278 ms (Base). Color-format speedups from #949 are unchanged.

Open in Web Open in Cursor 

Whole-vector Avg/Paeth is serial for n=1, so the SIMD path was slower
than Base on Gray8. Leave grayscale Avg/Paeth/AvgFirst on the scalar
fallback and keep vector paths for n>=2.

Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
@ermig1979
ermig1979 marked this pull request as ready for review September 8, 2026 15:19
@ermig1979
ermig1979 merged commit 5b0910b into dev Sep 9, 2026
2 checks 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