Bug 1906728 - Update to libjxl v0.10.3 r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D216168
This commit is contained in:
Kagami Sascha Rosylight 2024-07-10 14:15:55 +00:00
parent 9a2053b08c
commit 746380e89f
8 changed files with 40 additions and 26 deletions

View File

@ -10,9 +10,9 @@ origin:
url: https://github.com/libjxl/libjxl
release: e1489592a770b989303b0edc5cc1dc447bbe0515 (2024-03-08T08:10:58Z).
release: v0.10.3 (2024-06-27T14:10:08+02:00).
revision: e1489592a770b989303b0edc5cc1dc447bbe0515
revision: v0.10.3
license: Apache-2.0

View File

@ -5,6 +5,11 @@ 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
### Fixed
- fix decoding of some special images (#3662)
## [0.10.2] - 2024-03-08
### Fixed

View File

@ -1,5 +1,5 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
workspace(name = "libjxl")

View File

@ -1,4 +1,10 @@
jpeg-xl (0.10.2) UNRELEASED; urgency=medium
jpeg-xl (0.10.3) UNRELEASED; urgency=medium
* Bump JPEG XL version to 0.10.3.
-- JPEG XL Maintainers <jpegxl@google.com> Thu, 27 Jun 2024 12:23:45 +0200
jpeg-xl (0.10.2) unstable; urgency=medium
* Bump JPEG XL version to 0.10.2.

View File

@ -3,6 +3,9 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
# Load sources/headers/tests lists.
load(
"jxl_lists.bzl",
@ -56,8 +59,6 @@ load(
"libjxl_test_shards",
"libjxl_test_timeouts",
)
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
DEFAULT_VISIBILITY = ["//:__subpackages__"]

View File

@ -5,7 +5,7 @@
set(JPEGXL_MAJOR_VERSION 0)
set(JPEGXL_MINOR_VERSION 10)
set(JPEGXL_PATCH_VERSION 2)
set(JPEGXL_PATCH_VERSION 3)
set(JPEGXL_LIBRARY_VERSION
"${JPEGXL_MAJOR_VERSION}.${JPEGXL_MINOR_VERSION}.${JPEGXL_PATCH_VERSION}")

View File

@ -138,8 +138,8 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
const Tree &global_tree,
const weighted::Header &wp_header,
pixel_type chan, size_t group_id,
TreeLut<uint8_t, true> &tree_lut,
Image *image) {
TreeLut<uint8_t, true> &tree_lut, Image *image,
uint32_t &fl_run, uint32_t &fl_v) {
Channel &channel = image->channel[chan];
std::array<pixel_type, kNumStaticProperties> static_props = {
@ -222,20 +222,19 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
} else if (uses_lz77 && predictor == Predictor::Gradient && offset == 0 &&
multiplier == 1 && reader->HuffRleOnly()) {
JXL_DEBUG_V(8, "Gradient RLE (fjxl) very fast track.");
uint32_t run = 0;
uint32_t v = 0;
pixel_type_w sv = 0;
pixel_type_w sv = UnpackSigned(fl_v);
for (size_t y = 0; y < channel.h; y++) {
pixel_type *JXL_RESTRICT r = channel.Row(y);
const pixel_type *JXL_RESTRICT rtop = (y ? channel.Row(y - 1) : r - 1);
const pixel_type *JXL_RESTRICT rtopleft =
(y ? channel.Row(y - 1) - 1 : r - 1);
pixel_type_w guess = (y ? rtop[0] : 0);
if (run == 0) {
reader->ReadHybridUintClusteredHuffRleOnly(ctx_id, br, &v, &run);
sv = UnpackSigned(v);
if (fl_run == 0) {
reader->ReadHybridUintClusteredHuffRleOnly(ctx_id, br, &fl_v,
&fl_run);
sv = UnpackSigned(fl_v);
} else {
run--;
fl_run--;
}
r[0] = sv + guess;
for (size_t x = 1; x < channel.w; x++) {
@ -243,11 +242,12 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
pixel_type top = rtop[x];
pixel_type topleft = rtopleft[x];
pixel_type_w guess = ClampedGradient(top, left, topleft);
if (!run) {
reader->ReadHybridUintClusteredHuffRleOnly(ctx_id, br, &v, &run);
sv = UnpackSigned(v);
if (!fl_run) {
reader->ReadHybridUintClusteredHuffRleOnly(ctx_id, br, &fl_v,
&fl_run);
sv = UnpackSigned(fl_v);
} else {
run--;
fl_run--;
}
r[x] = sv + guess;
}
@ -484,16 +484,16 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
const Tree &global_tree,
const weighted::Header &wp_header,
pixel_type chan, size_t group_id,
TreeLut<uint8_t, true> &tree_lut,
Image *image) {
TreeLut<uint8_t, true> &tree_lut, Image *image,
uint32_t &fl_run, uint32_t &fl_v) {
if (reader->UsesLZ77()) {
return detail::DecodeModularChannelMAANS</*uses_lz77=*/true>(
br, reader, context_map, global_tree, wp_header, chan, group_id,
tree_lut, image);
tree_lut, image, fl_run, fl_v);
} else {
return detail::DecodeModularChannelMAANS</*uses_lz77=*/false>(
br, reader, context_map, global_tree, wp_header, chan, group_id,
tree_lut, image);
tree_lut, image, fl_run, fl_v);
}
}
@ -619,6 +619,8 @@ Status ModularDecode(BitReader *br, Image &image, GroupHeader &header,
// Read channels
ANSSymbolReader reader(code, br, distance_multiplier);
auto tree_lut = jxl::make_unique<TreeLut<uint8_t, true>>();
uint32_t fl_run = 0;
uint32_t fl_v = 0;
for (; next_channel < nb_channels; next_channel++) {
Channel &channel = image.channel[next_channel];
if (!channel.w || !channel.h) {
@ -631,7 +633,7 @@ Status ModularDecode(BitReader *br, Image &image, GroupHeader &header,
}
JXL_RETURN_IF_ERROR(DecodeModularChannelMAANS(
br, &reader, *context_map, *tree, header.wp_header, next_channel,
group_id, *tree_lut, &image));
group_id, *tree_lut, &image, fl_run, fl_v));
// Truncated group.
if (!br->AllReadsWithinBounds()) {

View File

@ -551,7 +551,7 @@ libjxl_major_version = 0
libjxl_minor_version = 10
libjxl_patch_version = 2
libjxl_patch_version = 3
libjxl_public_headers = [
"include/jxl/cms.h",