release: v1.10.0 - modular refactoring, WebP support, and CI/CD improvements#9
Merged
Conversation
- Add libwebp as a vendor submodule and update build system (CMake/Makefile) - Implement zero-copy WebP decoding in loader and core API - Add WebP support to test suite and benchmarks - Improve WebP loading performance by ~27x compared to external dwebp - Update README and THIRD-PARTY-NOTICES with licensing info
… algorithms - aHash/dHash/pHash: Remove incorrect Laplacian filter to restore standard algorithmic compliance and fix grayscale caching loop. - wHash: Fix downscaling matrix logic and cascaded Haar DWT in the fast variant to extract the correct LL-band (low frequency). - ColorHash & ColorMoments: Correct bitwise string packing to generate true 64-bit entropy and prevent out-of-bounds reads on grayscale images. - Radial: Resolve internal scratchpad memory overlap on Gaussian blur and handle valid black pixels correctly in Radon projections. - mHash: Enforce 18x18 input block scaling (step=2) to extract exactly 64-bit entropy instead of producing truncated 49-bit hashes. - BMH: Fix unsafe integer cast causing max digest size clamping failures on large image blocks. - Core: Implement correct grayscale cache invalidation on color weight changes.
Full refactoring of the C engine for better maintainability and safety: - Organized source tree: created src/image/ and src/loaders/ subdirectories. - Unified image loading with a backend-registry dispatcher (loader.c). - Decentralized image.c into specialized modules (resize, color, filters). - Implemented a linear arena allocator in ph_context_t for scratchpad memory. - Grouped context fields into 'image', 'config', and 'arena' sub-structures. - All changes verified with the full test suite (all tests passed).
- Extracted math helpers for mHash, pHash, wHash, Radial, and Color hashes. - Added unit tests for new helpers and expanded e2e coverage. - Verified memory safety with AddressSanitizer.
Performance Benchmark |
- Added AVX2 and SSE4.1 SIMD paths for pHash (DCT) and Hamming distance. - Implemented 32-byte aligned memory allocation in Arena for SIMD efficiency. - Added `madvise(MADV_SEQUENTIAL)` to optimize `mmap` image loading on Linux. - Updated CMake with LTO support, AVX2 detection, and `-ffast-math` for hashes.
- Removed global `-mavx2` compiler flag that caused auto-vectorization overhead in simple hash algorithms on x86_64 processors. - Disabled LTO (Link Time Optimization) by default for the static library to prevent inline heuristic regressions. - Reverted manual AVX2 intrinsics in `phash.c`. - Restricted explicitly `-mavx2` instruction set compilation to `common.c` for Hamming distance optimizations only.
- Converted Radial Hash interpolation to `float` (6% faster). - Added separate wHash (Fast/Full) tests to benchmark. - Updated internal headers and unit tests for float compatibility.
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.
Features & Core Enhancements
Architecture & Infrastructure
Miscellaneous