feat(simd): split imgproc SIMD helpers and add performance docs#26
Merged
feat(simd): split imgproc SIMD helpers and add performance docs#26
Conversation
Move 5 imgproc-specific SIMD functions (simd_rgb_to_gray_u8, simd_bgr_to_gray_u8, simd_rgba_to_gray_u8, simd_bgra_to_gray_u8, simd_deriv_3x3_row_f32) from src/core/simd.rs to a new src/imgproc/simd.rs module for better separation of concerns. Adds unit tests for bgr, rgba, bgra color conversion and deriv_3x3 SIMD kernels that were previously untested directly. Closes #17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add # Performance doc comments to all SIMD-accelerated public APIs: cvt_color_rgb/bgr/rgba/bgra_to_gray, sobel, scharr, threshold, SimdElement trait, and internal SIMD kernels. Each documents measured speedups from benchmark results (e.g. 22x for sobel_3x3_f32). Update CHANGELOG.md with refactor and documentation entries. Refs #14 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each top-level module (core/, imgproc/, features2d/, etc.) must contain its own tests.rs and simd.rs with domain-specific SIMD kernels co-located in the module that uses them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
simd_rgb_to_gray_u8,simd_bgr_to_gray_u8,simd_rgba_to_gray_u8,simd_bgra_to_gray_u8,simd_deriv_3x3_row_f32) fromsrc/core/simd.rsto a newsrc/imgproc/simd.rsmodule, improving separation of concerns.# Performancedoc comments to all SIMD-accelerated public APIs with measured speedups (e.g. 22× forsobel_3x3_f32). Updated CHANGELOG.bgr_to_gray,rgba_to_gray,bgra_to_gray,deriv_3x3_row_f32).Closes #17
Refs #14
Test plan
cargo test— all 207 tests passcargo test --features simd— passcargo test --features "parallel,simd"— passcargo fmt --check— cleancargo doc --no-deps— docs generate correctly🤖 Generated with Claude Code