You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Zlib-ng is zlib replacement with optimizations for "next generation" systems. Its optimization may benifits image library decode and encode speed such as libpng. In our tests, if using zlib-ng and libpng combination on a x86_64 machine with AVX2, the time of imdecode amd imencode will drop 20% approximately. This patch enables zlib-ng's optimization if CV_DISABLE_OPTIMIZATION is OFF. Since Zlib-ng can dispatch intrinsics on the fly, port work is much easier.
Zlib-ng is zlib replacement with optimizations for "next generation" systems. Its optimization may benifits image library decode and encode speed such as libpng. In our tests, if using zlib-ng and libpng combination on a x86_64 machine with AVX2, the time of `imdecode` amd `imencode` will drop 20% approximately. This patch enables zlib-ng's optimization if `CV_DISABLE_OPTIMIZATION` is OFF. Since Zlib-ng can dispatch intrinsics on the fly, port work is much easier.
Related discussion: opencv#22573
I apologize for the delay. Zlib is used py OpenCV itself, libpng, QT and other our 3rdparties. I'm looking on different options for OpenCV-Python package to re-use the same implementation and exclude conflicts.
Thanks for testing. For Armv7 build failure, opencv's zlib-ng build option is -DZLIB_COMPAT=ON -DZLIB_ENABLE_TESTS=OFF -DWITH_GTEST=OFF . We should test whther zlib-ng 2.1.6 can be built with those options on Armv7. Since I dont't have an Armv7 environment, it'll take some time to investigate the build failure. I'll have a try with qemu-system.
Sorry for late response. I encountered some difficulties using qemu-system. So, I tested my patch on raspberry pi 2b which is the latest armv7 device AFAIK. I cannot reproduce the build failure.
OS: raspberry pi OS based on debian 11, GCC 10.2.1-6+rpi1, CMake: cmake -GNinja -DCPU_BASELINE=NEON -DWITH_ZLIB_NG=ON -DBUILD_PNG=ON ..
I stuck a bit with the NEON issue in some configurations. I'll try to fix it and propose a solution this week. The PR is definitely useful and will be merged.
The compilation issue is compiler dependent. I see the same errors with GCC 5.4 in Ubuntu 16.04, GCC 7.5 and 8.4, but not with GCC 10.2 on Raspberry Pi.
Discussed the PR on the OpenCV Core team meeting. Decided to merge the PR as is. WITH_ZLIB_NG option is disabled by default. NEON issue with old compilers will be fixed later with another patch.
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.
Zlib-ng is zlib replacement with optimizations for "next generation" systems. Its optimization may benifits image library decode and encode speed such as libpng. In our tests, if using zlib-ng and libpng combination on a x86_64 machine with AVX2, the time of
imdecode
amdimencode
will drop 20% approximately. This patch enables zlib-ng's optimization ifCV_DISABLE_OPTIMIZATION
is OFF. Since Zlib-ng can dispatch intrinsics on the fly, port work is much easier.Related discussion: #22573
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.