-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3rdparty: added libjpeg-turbo (with deprecation of libjpeg) #11497
Conversation
Just a curious question. All of the SIMD code in libjpeg-turbo are actually in the *.asm files in each folder. To build these assembly files, either NASM or YASM will be needed. If libjpeg-turbo is to be compiled on each user's computer, then either NASM or YASM will need to be accessible to CMake during configuration. Another approach is to invoke NASM or YASM using custom build actions defined for *.asm file type. In this approach, the Visual Studio solution projects need to contain a snippet that knows how to invoke NASM or YASM when the project is built. There is also the question of whether NASM or YASM should be installed into user's computer as part of the CMake preparation. However this might not be popular with some (experienced) people. But not doing this means some (novice) users will be annoyed when their first encounter with OpenCV CMake fails, and they have to manually install NASM or YASM. This is just a curious question; I'm sure you have decided how to solve it. I just want to know more about it. |
We would like to avoid such cases. Currently we put libjpeg-turbo without any SIMD |
cmake/OpenCVFindLibsGrfmt.cmake
Outdated
ocv_parse_header("${JPEG_INCLUDE_DIR}/jpeglib.h" JPEG_VERSION_LINES JPEG_LIB_VERSION) | ||
endif() | ||
if(NOT DEFINED JPEG_LIB_VERSION AND EXISTS "${JPEG_INCLUDE_DIR}/jconfig.h") # libjpeg-turbo stores version in a separate file | ||
ocv_parse_header("${JPEG_INCLUDE_DIR}/jpeglib.h" JPEG_VERSION_LINES JPEG_LIB_VERSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is jconfig.h
checked for existence but jpeglib.h
is parsed?
Maybe it is better to make it in a loop, something like:
foreach(jpeg_dir "${JPEG_INCLUDE_DIR};${${JPEG_LIBRARY}_BINARY_DIR}")
foreach(jpeg_hdr "jpeglib.h;jconfig.h;jconfig-64.h;...")
ocv_parse_header("${jpeg_dir}/${jpeg_hdr}" JPEG_VERSION_LINES JPEG_LIB_VERSION)
if (JPEG_LIB_VERSION)
break()
endif()
endforeach()
endforeach()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added macro to avoid copy-paste mistakes
Repo: https://github.com/libjpeg-turbo/libjpeg-turbo.git Tag: 1.5.3 excluded libjpeg-turbo files: - bmp.c - bmp.h - cderror.h - cdjpeg.c - cdjpeg.h - cjpeg.c - djpeg.c - example.c - jcstest.c - jdatadst-tj.c - jdatasrc-tj.c - jpegtran.c - rdbmp.c - rdcolmap.c - rdgif.c - rdjpgcom.c - rdppm.c - rdrle.c - rdswitch.c - rdtarga.c - tjbench.c - tjunittest.c - tjutil.c - tjutil.h - transupp.c - transupp.h - turbojpeg-jni.c - turbojpeg.c - turbojpeg.h - wrbmp.c - wrgif.c - wrjpgcom.c - wrppm.c - wrrle.c - wrtarga.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! 👍
* Including a custom libjpeg is no longer needed Since opencv/opencv#11497, OpenCV bundles its own * (dummy commit to trigger rebuild)
* Including a custom libjpeg is no longer needed Since opencv/opencv#11497, OpenCV bundles its own * (dummy commit to trigger rebuild)
Repo: https://github.com/libjpeg-turbo/libjpeg-turbo.git
Tag: 1.5.3
SIMD optimizations are disabled (removed) due build issues.
Enable
BUILD_JPEG_TURBO_DISABLE=ON
to use libjpeg.