mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
95354f044c
core: ARM64 loop unrolling in kmeans to improve Weighted Filter performance #27596 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - This PR improves the performance of the Weighted Filter function from the ximgproc module on Windows on ARM64. - The optimization is achieved by unrolling two performance-critical loops in the generateCentersPP function in modules/core/src/kmeans.cpp, which is internally used by the Weighted Filter function. - The unrolling is enabled only for ARM64 builds using #if defined(_M_ARM64) guards to preserve compatibility and maintain performance on other architectures. **Performance Improvements:** - Improves execution time for Weighted Filter performance tests on ARM64 without affecting other platforms. <img width="772" height="558" alt="image" src="https://github.com/user-attachments/assets/ae28c0af-97d3-460b-ad5a-207d3fc6936f" />