Skip to content

Commit

Permalink
Bug 1918647 - Update libjxl to v0.11.0 r=saschanaz
Browse files Browse the repository at this point in the history
  • Loading branch information
updatebot-ci authored and MrAlex94 committed Nov 8, 2024
1 parent 3ca8f9e commit 33aa91d
Show file tree
Hide file tree
Showing 479 changed files with 16,837 additions and 23,160 deletions.
2 changes: 1 addition & 1 deletion media/libjxl/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ SOURCES += [
"/third_party/jpeg-xl/lib/jxl/alpha.cc",
"/third_party/jpeg-xl/lib/jxl/ans_common.cc",
"/third_party/jpeg-xl/lib/jxl/blending.cc",
"/third_party/jpeg-xl/lib/jxl/cache_aligned.cc",
"/third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc",
"/third_party/jpeg-xl/lib/jxl/coeff_order.cc",
"/third_party/jpeg-xl/lib/jxl/color_encoding_internal.cc",
Expand Down Expand Up @@ -85,6 +84,7 @@ SOURCES += [
"/third_party/jpeg-xl/lib/jxl/render_pipeline/stage_ycbcr.cc",
"/third_party/jpeg-xl/lib/jxl/simd_util.cc",
"/third_party/jpeg-xl/lib/jxl/splines.cc",
"/third_party/jpeg-xl/lib/jxl/test_memory_manager.cc",
"/third_party/jpeg-xl/lib/jxl/toc.cc",
]

Expand Down
4 changes: 2 additions & 2 deletions media/libjxl/moz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ origin:

url: https://github.com/libjxl/libjxl

release: v0.10.3 (2024-06-27T14:10:08+02:00).
release: v0.11.0 (2024-09-13T07:31:05+02:00).

revision: v0.10.3
revision: v0.11.0

license: Apache-2.0

Expand Down
5 changes: 4 additions & 1 deletion third_party/jpeg-xl/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ Checks: >-
modernize-*,
performance-*,
readability-*,
-bugprone-narrowing-conversions,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-infinite-loop,
-bugprone-narrowing-conversions,
-bugprone-unused-local-non-trivial-variable,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-deprecated-headers,
-modernize-return-braced-init-list,
-modernize-type-traits,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-modernize-use-using,
-performance-enum-size,
Expand Down
5 changes: 5 additions & 0 deletions third_party/jpeg-xl/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ Alistair Barrow
Andrius Lukas Narbutas <[email protected]>
Aous Naman <[email protected]>
Artem Selishchev
Aryan Pingle <[email protected]>
Biswapriyo Nath <[email protected]>
CanadianBaconBoi <[email protected]>
Damiano Albani <[email protected]>
Damon Townsend
Daniel Novomeský <[email protected]>
David Burnett <[email protected]>
dependabot[bot]
Expand All @@ -53,17 +55,20 @@ Dong Xu <[email protected]>
estrogently <[email protected]>
Even Rouault <[email protected]>
Fred Brennan <[email protected]>
Gerhard Huber <[email protected]>
gi-man
Gilles Devillers (GilDev) <[email protected]>
Heiko Becker <[email protected]>
Ivan Kokorev
Jim Robinson <[email protected]>
John Platts <[email protected]>
Jonathan Brown (Jonnyawsom3) <[email protected]>
Joshua Root <[email protected]>
Kai Hollberg <[email protected]>
Kerry Su <[email protected]>
Kleis Auke Wolthuizen <[email protected]>
L. E. Segovia
ledoge
Leo Izen <[email protected]>
Lovell Fuller
Maarten DB <[email protected]>
Expand Down
5 changes: 5 additions & 0 deletions third_party/jpeg-xl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

package(default_visibility = ["//:__subpackages__"])

filegroup(
Expand Down
19 changes: 16 additions & 3 deletions third_party/jpeg-xl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.3] - 2024-06-27
## [0.11.0] - 2024-09-13

### Fixed
- fix decoding of some special images (#3662)
### Added
- Gain Map API (#3552 and #3628): `JxlGainMapBundle` struct and API functions
to read and write gain map bundles`JxlGainMapWriteBundle` and
`JxlGainMapReadBundle` as well as handling compressed ICC profiles:
`JxlICCProfileEncode` and `JxlICCProfileDecode`.
- decoder API: added `JXL_DEC_BOX_COMPLETE` event to signal that the output
buffer for the current box has received all contents. Previously, this was
to be determined from the fact that the decoder had moved on either to
`JXL_DEC_SUCCESS` or to another subsequent `JXL_DEC_BOX`. This change is
made backward-compatible by the fact that the new event must be explicitly
subscribed to, and that `JXL_DEC_SUCCESS` / `JXL_DEC_BOX` still occur
afterwards and still imply that the previous box must be complete.

### Changed / clarified
- avoiding abort in release build (#3631 and #3639)

## [0.10.2] - 2024-03-08

Expand Down
51 changes: 40 additions & 11 deletions third_party/jpeg-xl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project(LIBJXL LANGUAGES C CXX)

# TODO(sboukortt): remove once oss-fuzz passes -DBUILD_SHARED_LIBS=OFF
if(JPEGXL_ENABLE_FUZZERS)
message(INFO "Fuzzer build detected, building static libs")
message(STATUS "Fuzzer build detected, building static libs")
set(BUILD_SHARED_LIBS OFF)
endif()

Expand All @@ -21,6 +21,10 @@ check_cxx_compiler_flag("-fsanitize=fuzzer-no-link" CXX_FUZZERS_SUPPORTED)
check_cxx_compiler_flag("-fmacro-prefix-map=OLD=NEW" CXX_MACRO_PREFIX_MAP)
check_cxx_compiler_flag("-fno-rtti" CXX_NO_RTTI_SUPPORTED)

# Add "DebugOpt" CMake build type. Unlike builtin DEBUG it is optimized.
string(REGEX REPLACE "-DNDEBUG " "" CMAKE_CXX_FLAGS_DEBUGOPT "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG" )
string(REGEX REPLACE "-DNDEBUG " "" CMAKE_C_FLAGS_DEBUGOPT "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDEBUG" )

# Enabled PIE binaries by default if supported.
include(CheckPIESupported OPTIONAL RESULT_VARIABLE CHECK_PIE_SUPPORTED)
if(CHECK_PIE_SUPPORTED)
Expand Down Expand Up @@ -86,6 +90,16 @@ if(EXISTS "${PROJECT_SOURCE_DIR}/third_party/libjpeg-turbo/jconfig.h.in")
set(ENABLE_JPEGLI_DEFAULT YES)
else()
set(ENABLE_JPEGLI_DEFAULT NO)
message(STATUS "libjpeg-turbo submodule is absent; not enabling jpegli")
endif()

include(TestBigEndian)
test_big_endian(ARCH_IS_BIG_ENDIAN)
if(ARCH_IS_BIG_ENDIAN)
set(ENABLE_SKCMS_DEFAULT NO)
message(STATUS "Big-endian architecture detected; defaulting to lcms2 instead of skcms")
else()
set(ENABLE_SKCMS_DEFAULT YES)
endif()

# Standard cmake naming for building shared libraries.
Expand Down Expand Up @@ -124,7 +138,7 @@ set(JPEGXL_ENABLE_SJPEG true CACHE BOOL
"Build JPEGXL with support for encoding with sjpeg.")
set(JPEGXL_ENABLE_OPENEXR true CACHE BOOL
"Build JPEGXL with support for OpenEXR if available.")
set(JPEGXL_ENABLE_SKCMS true CACHE BOOL
set(JPEGXL_ENABLE_SKCMS ${ENABLE_SKCMS_DEFAULT} CACHE BOOL
"Build with skcms instead of lcms2.")
set(JPEGXL_ENABLE_VIEWERS false CACHE BOOL
"Build JPEGXL viewer tools for evaluation.")
Expand Down Expand Up @@ -160,14 +174,14 @@ set(JPEGXL_ENABLE_AVX512_SPR false CACHE BOOL
"Build with AVX-512FP16 support (faster on CPUs that support it, but larger binary size).")
set(JPEGXL_ENABLE_AVX512_ZEN4 false CACHE BOOL
"Build with Zen4-optimized AVX512 support (faster on CPUs that support it, but larger binary size).")
set(JPEGXL_ENABLE_WASM_TRHEADS true CACHE BOOL
set(JPEGXL_ENABLE_WASM_THREADS true CACHE BOOL
"Builds WASM modules with threads support")

# Force system dependencies.
set(JPEGXL_FORCE_SYSTEM_BROTLI false CACHE BOOL
"Force using system installed brotli instead of third_party/brotli source.")
set(JPEGXL_FORCE_SYSTEM_GTEST false CACHE BOOL
"Force using system installed googletest (gtest/gmock) instead of third_party/googletest source.")
"Force using system installed googletest (gtest) instead of third_party/googletest source.")
set(JPEGXL_FORCE_SYSTEM_LCMS2 false CACHE BOOL
"Force using system installed lcms2 instead of third_party/lcms source.")
set(JPEGXL_FORCE_SYSTEM_HWY false CACHE BOOL
Expand Down Expand Up @@ -208,13 +222,20 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(JPEGXL_STATIC)
set(BUILD_SHARED_LIBS 0)

# https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170
# https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)

# Clang developers say that in case to use "static" we have to build stdlib
# ourselves; for real use case we don't care about stdlib, as it is "granted",
# so just linking all other libraries is fine.
if (NOT MSVC AND NOT APPLE)
if (NOT MSVC)
string(APPEND CMAKE_EXE_LINKER_FLAGS " -static")
endif()
if ((NOT WIN32 AND NOT APPLE) OR CYGWIN OR MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -static-libgcc -static-libstdc++")
endif()
endif() # JPEGXL_STATIC

Expand All @@ -224,7 +245,16 @@ find_package(Threads REQUIRED)

# These settings are important to drive check_cxx_source_compiles
# See CMP0067 (min cmake version is 3.10 anyway)
set(CMAKE_CXX_STANDARD 11)

if ("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 17)
else()
if ("cxx_std_14" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 14)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endif()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED YES)

Expand Down Expand Up @@ -265,7 +295,7 @@ if(JPEGXL_STATIC)
endif()
endif() # JPEGXL_STATIC

if (EMSCRIPTEN AND JPEGXL_ENABLE_WASM_TRHEADS)
if (EMSCRIPTEN AND JPEGXL_ENABLE_WASM_THREADS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
Expand Down Expand Up @@ -343,7 +373,6 @@ else ()
if(JPEGXL_ENABLE_COVERAGE)
set(JPEGXL_COVERAGE_FLAGS
-g -O0 -fprofile-arcs -ftest-coverage
-DJXL_ENABLE_ASSERT=0 -DJXL_ENABLE_CHECK=0
)
set(JPEGXL_COVERAGE_LINK_FLAGS
--coverage
Expand Down Expand Up @@ -431,7 +460,7 @@ if(JPEGXL_ENABLE_MANPAGES)
find_program(ASCIIDOC a2x)
if(ASCIIDOC)
file(STRINGS "${ASCIIDOC}" ASCIIDOC_SHEBANG LIMIT_COUNT 1)
if(ASCIIDOC_SHEBANG MATCHES "/sh|/bash" OR MINGW)
if(ASCIIDOC_SHEBANG MATCHES "sh$" OR MINGW)
set(ASCIIDOC_PY_FOUND ON)
# Run the program directly and set ASCIIDOC as empty.
set(ASCIIDOC_PY "${ASCIIDOC}")
Expand Down
12 changes: 10 additions & 2 deletions third_party/jpeg-xl/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
bazel_dep(name = "bazel_skylib", version = "1.5.0")
# Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "giflib", version = "5.2.1")
bazel_dep(name = "googletest", version = "1.14.0")
bazel_dep(name = "openexr", version = "3.2.1")
bazel_dep(name = "libjpeg_turbo", version = "2.1.91")
bazel_dep(name = "libpng", version = "1.6.40")
bazel_dep(name = "libwebp", version = "1.3.2")
bazel_dep(name = "openexr", version = "3.2.1")
Loading

0 comments on commit 33aa91d

Please sign in to comment.