Skip to content
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

Cherry-pick #72

Merged
merged 31 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b300b3c
Expose a wrapper function instead of Allotment (#3770)
sboukortt Aug 27, 2024
536328c
Avoid direct use of .value_() (#3771)
sboukortt Aug 27, 2024
3ef0141
Update software_support.md (#3769)
0fbcb238c0 Aug 27, 2024
ce0ab73
tools/file_io.h: set binary mode for stdin and stdout on Windows (#3750)
Traneptora Aug 27, 2024
fbfe540
add way to signal Rec2100 PQ/HLG in jxl_from_tree (#3728)
jonsneyers Aug 27, 2024
6c4fb6a
add unknown and optional extra channels in PAM (#3611)
jonsneyers Aug 27, 2024
09c4e1a
adding Status to functions of PaddedBytes (#3762)
mo271 Aug 28, 2024
fc4d21c
Fix/homogenise the disabling of spline tests (#3774)
sboukortt Aug 29, 2024
e3869fb
If InitializePPF fails in cjxl, return EXIT_FAILURE rather than “fal…
sboukortt Aug 29, 2024
19928a2
stop loading uninitialized memory from MaskingPtr1x1 (#3778)
mo271 Aug 29, 2024
8f9ce8a
Reduce compute and increase density of e11 (#3779)
monad0 Aug 29, 2024
99d2625
Improve error messages (#3781)
sboukortt Aug 29, 2024
03f1679
Fix e11 iterations (#3782)
monad0 Aug 29, 2024
177a428
ClangTidy fixes (#3783)
mo271 Aug 30, 2024
dbe8fb0
more ClangTidy fixes (#3784)
mo271 Aug 30, 2024
bdbabaf
even more ClangTidy fixes (#3785)
mo271 Aug 30, 2024
4efb89f
encoding changes for more precise epf (#3786)
jyrkialakuijala Aug 30, 2024
4dc04da
Bump github/codeql-action from 3.26.2 to 3.26.6 (#3790)
dependabot[bot] Sep 3, 2024
28d9fc8
Bump actions/upload-artifact from 4.3.6 to 4.4.0 (#3791)
dependabot[bot] Sep 3, 2024
19f9d72
exclude test_jpegli_jni_wrapper (#3797)
mo271 Sep 5, 2024
d9d9dab
fix tests from #3786 (#3796)
mo271 Sep 5, 2024
4fde3b7
In static builds, also link the MSVC runtime statically (#3803)
sboukortt Sep 5, 2024
23f76ba
check realloc in basicinfo (#3798)
mo271 Sep 5, 2024
11f585a
disable test_jpegli_jni_wrapper in converage test (#3802)
mo271 Sep 5, 2024
679f0e4
tools/benchmark_codec_avif.cc: restore compatability with libavif < 1…
Traneptora Sep 9, 2024
d47998d
Add a couple of missing HWY_ATTR (#3810)
sboukortt Sep 10, 2024
76f9903
Fix build with old gcc (#3811)
sboukortt Sep 10, 2024
2c78a81
Faster PNG compression (#3819)
jonnyawsom3 Sep 13, 2024
7e09380
clarify release instructions (#3820)
mo271 Sep 13, 2024
9665281
re-activate streaming fuzzer for higher effors (#3822)
mo271 Sep 13, 2024
81e958a
bump version to 0.12.0 (#3817)
mo271 Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
- name: coverage
env_test_stack_size: 2048
skip_install: true
# TODO: understand why this does not work
ctest_args: -E 'test_jpegli_jni_wrapper'
# Build with support for decoding to JPEG bytes disabled. Produces a
# smaller build if only decoding to pixels is needed.
- name: release-nojpeg
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_test_cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
mkdir -p ./build/Testing/Temporary
unzip ./tools/scripts/test_cost-${{ matrix.identifier }}.zip -d ./build/Testing/Temporary

- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: env.WILL_RUN_TESTS == 'true'
with:
name: cross_binary-${{ matrix.identifier }}
Expand Down Expand Up @@ -293,9 +293,9 @@ jobs:
chmod +x `cat executable.lst`
./ci.sh test \
-I ${{ matrix.shard_number }},,${{ env.LAST_SHARD }} \
-E '(bash_test|conformance_tooling_test|test_jxl_jni_wrapper)'
-E '(bash_test|conformance_tooling_test|test_jxl_jni_wrapper|test_jpegli_jni_wrapper)'

- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
name: Upload test cost
if: (env.UPLOAD_TEST_COST == 'true') && (matrix.shard_number == 0) && (env.WILL_RUN_TESTS == 'true')
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
language: c++
fuzz-seconds: 600
- name: Upload Crash
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
${{ runner.workspace }}/jpegli-linux-x86_64-static-${{ github.event.release.tag_name }}.tar.gz

- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: jpegli-linux-x86_64-static
path: ${{ runner.workspace }}/release_file.tar.gz
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
./ci.sh debian_stats

- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ steps.env.outputs.artifact_name }}
path: |
Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
BUILD_CONFIG=Release/ BENCHMARK_NUM_THREADS=2 STORE_IMAGES=0 ./ci.sh fast_benchmark

- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: jpegli-${{matrix.triplet}}
path: |
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ 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 Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ 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.
Expand Down
10 changes: 8 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
jpeg-xl (0.11.0) UNRELEASED; urgency=medium
jpeg-xl (0.12.0) UNRELEASED; urgency=medium

* Bump JPEG XL version to 0.12.0.

-- JPEG XL Maintainers <[email protected]> Fri, 13 Sep 2024 09:19:23 +0200

jpeg-xl (0.11.0) unstable; urgency=medium

* Bump JPEG XL version to 0.11.0.

-- JPEG XL Maintainers <[email protected]> Tue, 06 Aug 2024 14:35:34 +0200
-- JPEG XL Maintainers <[email protected]> Fri, 13 Sep 2024 09:19:23 +0200

jpeg-xl (0.10.2) unstable; urgency=medium

Expand Down
25 changes: 23 additions & 2 deletions doc/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ branches](https://docs.github.com/en/github/administering-a-repository/defining-
in our repository, however you can push to a protected branch when *creating* it
but you can't directly push to it after it is created. To include more changes
in the release branch see the "Cherry-picking fixes to a release" section below.
Remember to tag the first commit in the `main` branch after the branch of point
with the suffix `-snapshot`, so for instances, if you just made the
branch `v0.5.x`, run
```
git checkout [hash of first commit after the branch off point]
git tag v0.5-snapshot
git push [email protected]:libjxl/libjxl.git v0.5-snapshot
```


## Creating a merge label

Expand Down Expand Up @@ -274,17 +283,29 @@ instructions:
the release itself that are not included in the CHANGELOG.md, although prefer
to include those in the CHANGELOG.md file. You can switch to the Preview tab
to see the results.
* Copy-paste the following note:
```markdown
**Note:** This release is for evaluation purposes and may contain bugs, including security bugs, that may not be individually documented when fixed. See the [SECURITY.md](SECURITY.md) file for details. Always prefer to use the latest release.

Please provide feedback and report bugs [here](https://github.com/libjxl/libjxl/issues).
```


* Finally click "Publish release" and go celebrate with the team. 🎉

* The branch v0.7.x will be pushed to gitlab automatically, but make sure to
manually push the *tag* of the release also to
https://gitlab.com/wg1/jpeg-xl, by doing
https://gitlab.com/wg1/jpeg-xl, by doing configuring `gitlab` to be the remote `[email protected]:wg1/jpeg-xl.git` and then running:

```bash
git push gitlab v0.7.1
```
where `gitlab` is the remote `[email protected]:wg1/jpeg-xl.git`.
and possibly also push the tag for the snapshot to gitlab, if it wasn't done yet:
```bash
git push gitlab v0.7-snapshot
```



### How to build downstream projects

Expand Down
4 changes: 2 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://developers.google.com/open-source/licenses/bsd

set(JPEGXL_MAJOR_VERSION 0)
set(JPEGXL_MINOR_VERSION 11)
set(JPEGXL_MINOR_VERSION 12)
set(JPEGXL_PATCH_VERSION 0)
set(JPEGXL_LIBRARY_VERSION
"${JPEGXL_MAJOR_VERSION}.${JPEGXL_MINOR_VERSION}.${JPEGXL_PATCH_VERSION}")
Expand All @@ -16,7 +16,7 @@ set(JPEGXL_LIBRARY_VERSION
# It is important to update this value when making incompatible API/ABI changes
# so that programs that depend on libjxl can update their dependencies. Semantic
# versioning allows 0.y.z to have incompatible changes in minor versions.
set(JPEGXL_SO_MINOR_VERSION 11)
set(JPEGXL_SO_MINOR_VERSION 12)
if (JPEGXL_MAJOR_VERSION EQUAL 0)
set(JPEGXL_LIBRARY_SOVERSION
"${JPEGXL_MAJOR_VERSION}.${JPEGXL_SO_MINOR_VERSION}")
Expand Down
6 changes: 2 additions & 4 deletions lib/extras/convolve-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ class ConvolveT {
const Weights& weights,
ThreadPool* pool, ImageF* out) {
const int64_t stride = in.PixelsPerRow();
const auto process_row = [&](const uint32_t y,
size_t /*thread*/) -> Status {
const auto process_row = [&](const uint32_t y, size_t /*thread*/) HWY_ATTR {
RunRow<kSizeModN>(rect.ConstRow(in, y), rect.xsize(), stride,
WrapRowUnchanged(), weights, out->Row(y));
return true;
Expand All @@ -263,8 +262,7 @@ class ConvolveT {
const Weights& weights,
ThreadPool* pool, Image3F* out) {
const int64_t stride = in.PixelsPerRow();
const auto process_row = [&](const uint32_t y,
size_t /*thread*/) -> Status {
const auto process_row = [&](const uint32_t y, size_t /*thread*/) HWY_ATTR {
for (size_t c = 0; c < 3; ++c) {
RunRow<kSizeModN>(rect.ConstPlaneRow(in, c, y), rect.xsize(), stride,
WrapRowUnchanged(), weights, out->PlaneRow(c, y));
Expand Down
4 changes: 4 additions & 0 deletions lib/extras/dec/pnm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ class Parser {
header->ec_types.push_back(JXL_CHANNEL_CFA);
} else if (MatchString("Thermal")) {
header->ec_types.push_back(JXL_CHANNEL_THERMAL);
} else if (MatchString("Unknown")) {
header->ec_types.push_back(JXL_CHANNEL_UNKNOWN);
} else if (MatchString("Optional")) {
header->ec_types.push_back(JXL_CHANNEL_OPTIONAL);
} else {
return JXL_FAILURE("PAM: unknown TUPLTYPE");
}
Expand Down
4 changes: 4 additions & 0 deletions lib/extras/enc/pnm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ class PAMEncoder : public BasePNMEncoder {
return std::string("CFA");
case JXL_CHANNEL_THERMAL:
return std::string("Thermal");
case JXL_CHANNEL_UNKNOWN:
return std::string("Unknown");
case JXL_CHANNEL_OPTIONAL:
return std::string("Optional");
default:
return std::string("UNKNOWN");
}
Expand Down
1 change: 1 addition & 0 deletions lib/extras/memory_manager_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <cstddef>
#include <memory>
#include <utility>

#include "lib/base/compiler_specific.h"
#include "lib/base/memory_manager.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/jxl_lists.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ libjxl_jpegli_wrapper_sources = [

libjxl_major_version = 0

libjxl_minor_version = 11
libjxl_minor_version = 12

libjxl_patch_version = 0

Expand Down
2 changes: 1 addition & 1 deletion lib/lib.gni
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ libjxl_jpegli_wrapper_sources = [

libjxl_major_version = 0

libjxl_minor_version = 11
libjxl_minor_version = 12

libjxl_patch_version = 0

Expand Down
1 change: 1 addition & 0 deletions third_party/apngdis/enc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ Status APNGEncoder::EncodePackedPixelFileToAPNG(

info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr) return JXL_FAILURE("Could not init png info struct");
png_set_compression_level(png_ptr, 1);

png_set_write_fn(png_ptr, bytes, PngWrite, nullptr);
png_set_flush(png_ptr, 0);
Expand Down
4 changes: 2 additions & 2 deletions tools/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class CommandLineParser {
return (*parser_.parser_with_arg_)(arg, storage_);
} else {
fprintf(stderr, "--%s didn't expect any argument passed to it.\n",
argv[*i]);
long_name_);
return false;
}
}
Expand All @@ -280,7 +280,7 @@ class CommandLineParser {
(*i)++;
if (metavar_) {
if (argc <= *i) {
fprintf(stderr, "--%s expected an argument but none passed.\n",
fprintf(stderr, "%s expected an argument but none passed.\n",
argv[*i - 1]);
return false;
}
Expand Down
12 changes: 10 additions & 2 deletions tools/file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

#include "lib/base/compiler_specific.h"

#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#endif

namespace jpegxl {
namespace tools {

Expand All @@ -35,11 +40,14 @@ class FileWrapper {
close_on_delete_(pathname != "-") {
#ifdef _WIN32
struct __stat64 s = {};
const int err = _stat64(pathname.c_str(), &s);
int err = _stat64(pathname.c_str(), &s);
const bool is_file = (s.st_mode & S_IFREG) != 0;
if (pathname == "-") {
err |= _setmode(_fileno(file_), _O_BINARY);
}
#else
struct stat s = {};
const int err = stat(pathname.c_str(), &s);
int err = stat(pathname.c_str(), &s);
const bool is_file = S_ISREG(s.st_mode);
#endif
if (err == 0 && is_file) {
Expand Down
2 changes: 1 addition & 1 deletion tools/fuzzer_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void ProcessInput(const char* filename) {
std::vector<char> contents((std::istreambuf_iterator<char>(ifs)),
std::istreambuf_iterator<char>());
ifs.close();
std::cout << "Processing " << filename << "\n" << std::flush;
std::cout << "Processing " << filename << "\n";
LLVMFuzzerTestOneInput(reinterpret_cast<uint8_t*>(contents.data()),
contents.size());
}
Expand Down
12 changes: 5 additions & 7 deletions tools/jpegli_dec_fuzzer_corpus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ bool GenerateFile(const char* output_dir, const ImageSpec& spec,

if (!quiet) {
std::unique_lock<std::mutex> lock(stderr_mutex);
std::cerr << "Generating " << spec << " as " << hash_str << "\n"
<< std::flush;
std::cerr << "Generating " << spec << " as " << hash_str << "\n";
}

uint8_t hash[16];
Expand All @@ -248,8 +247,7 @@ bool GenerateFile(const char* output_dir, const ImageSpec& spec,
if (!quiet) {
std::unique_lock<std::mutex> lock(stderr_mutex);
std::cerr << "Stored " << output_fn << " size: " << compressed.size()
<< "\n"
<< std::flush;
<< "\n";
}

return true;
Expand Down Expand Up @@ -342,7 +340,7 @@ int main(int argc, const char** argv) {
spec.seed = mt() % 777777;
if (!spec.Validate()) {
if (!quiet) {
std::cerr << "Skipping " << spec << "\n" << std::flush;
std::cerr << "Skipping " << spec << "\n";
}
} else {
specs.push_back(spec);
Expand All @@ -365,9 +363,9 @@ int main(int argc, const char** argv) {
};
if (!RunOnPool(pool.get(), 0, specs.size(), jxl::ThreadPool::NoInit, generate,
"FuzzerCorpus")) {
std::cerr << "Error generating fuzzer corpus\n" << std::flush;
std::cerr << "Error generating fuzzer corpus\n";
return EXIT_FAILURE;
}
std::cerr << "Finished generating fuzzer corpus\n" << std::flush;
std::cerr << "Finished generating fuzzer corpus\n";
return EXIT_SUCCESS;
}
Loading
Loading