Skip to content

Libjpeg-turbo update to version 3.0.3#25623

Merged
asmorkalov merged 10 commits intoopencv:4.xfrom
asmorkalov:as/jpegturbo_3.0.3
May 25, 2024
Merged

Libjpeg-turbo update to version 3.0.3#25623
asmorkalov merged 10 commits intoopencv:4.xfrom
asmorkalov:as/jpegturbo_3.0.3

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented May 22, 2024

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov added this to the 4.10.0 milestone May 22, 2024
@asmorkalov
Copy link
Copy Markdown
Contributor Author

Performance result for 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz

Geometric mean (ms)

Name of Test 4.x-1  patched-1 patched-1 
                                  vs    
                                4.x-1   
                              (x-factor)
Decode::JPEG 34.697  34.245      1.01   
Encode::JPEG 27.822  28.298      0.98   
decode::PNG  22.550  22.609      1.00   
encode::PNG  48.699  49.358      0.99 

@opencv-alalek
Copy link
Copy Markdown
Contributor

opencv-alalek commented May 24, 2024

Something is wrong in CMake reports on CI (x86):

--     JPEG:                        build-libjpeg-turbo (ver 3.0.3-62)
--       SIMD Support Request:      YES
--       SIMD Support:              NO

Update: NASM is missing in build environment.

@asmorkalov asmorkalov requested a review from mshabunin May 24, 2024 06:47
@opencv-alalek
Copy link
Copy Markdown
Contributor

ARM64 reports of partial NEON support:

-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Use partial Neon SIMD intrinsics implementation (NEON_INTRINSICS = OFF)
-- CMAKE_ASM_FLAGS =    -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -Wno-unused-parameter -Wno-sign-compare -Wno-implicit-fallthrough  -O3 -DNDEBUG
-- SIMD extensions: arm64 (WITH_SIMD = 1)

@asmorkalov
Copy link
Copy Markdown
Contributor Author

libjpeg-turbo uses confusing names for some options, including NEON. See https://github.com/libjpeg-turbo/libjpeg-turbo/blob/9ddcae4a8f4aaa096ccdcddec36afc52fbc01481/ChangeLog.md?plain=1#L657 for details. Not all NEON intrinsics are available in old GCC. The flag means that NEON supported partially (some simd and no assebler).

@asmorkalov asmorkalov merged commit d97df26 into opencv:4.x May 25, 2024
@Kumataro
Copy link
Copy Markdown
Contributor

It seems that OpenCV4.x CI for Win64 and doc are failed after merging this patch.

Before merging

https://pullrequest.opencv.org/buildbot/builders/precommit_windows64/builds/105626/steps/cmake/logs/stdio

-- libjpeg-turbo: VERSION = 2.1.3, BUILD = opencv-4.10.0-pre-libjpeg-turbo
-- Check size of size_t
-- Check size of size_t - done
-- Check size of unsigned long
-- Check size of unsigned long - done
-- Looking for include file intrin.h
-- Looking for include file intrin.h - found
-- Looking for a ASM_NASM compiler
-- Looking for a ASM_NASM compiler - NOTFOUND
-- libjpeg-turbo(SIMD): SIMD extensions disabled: could not find NASM compiler.  Performance will suffer.
-- Looking for assert.h
-- Looking for assert.h - found

After merging

https://pullrequest.opencv.org/buildbot/builders/precommit_windows64/builds/105632/steps/cmake/logs/stdio

-- libjpeg-turbo: VERSION = 3.0.3, BUILD = opencv-4.10.0-pre-libjpeg-turbo
-- Check size of size_t
-- Check size of size_t - done
-- Check size of unsigned long
-- Check size of unsigned long - done
-- Looking for include file intrin.h
-- Looking for include file intrin.h - found
-- Looking for a ASM_NASM compiler
-- Looking for a ASM_NASM compiler - NOTFOUND
-- Looking for assert.h
CMake Warning at 3rdparty/libjpeg-turbo/src/simd/CMakeLists.txt:5 (message):
  SIMD extensions disabled: could not find NASM compiler.  Performance will
  suffer.
Call Stack (most recent call first):
  3rdparty/libjpeg-turbo/src/simd/CMakeLists.txt:48 (simd_fail)


-- Looking for assert.h - found
-- Looking for fcntl.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants