[neon/backports-jammy/libjxl-jammy/Neon/release] debian/patches: Remove patch applied upstream

Scarlett Moore null at kde.org
Wed Sep 6 14:56:08 BST 2023


Git commit 78432d45eaa9cf9f9e53a16deb3b654cf8ed6a36 by Scarlett Moore.
Committed on 06/09/2023 at 15:54.
Pushed by scarlettmoore into branch 'Neon/release'.

Remove patch applied upstream

D  +0    -344  debian/patches/de08116d14db785431f3efb651dcf2af15bbb682.patch
M  +0    -1    debian/patches/series

https://invent.kde.org/neon/backports-jammy/libjxl-jammy/-/commit/78432d45eaa9cf9f9e53a16deb3b654cf8ed6a36

diff --git a/debian/patches/de08116d14db785431f3efb651dcf2af15bbb682.patch b/debian/patches/de08116d14db785431f3efb651dcf2af15bbb682.patch
deleted file mode 100644
index b0caeb8..0000000
--- a/debian/patches/de08116d14db785431f3efb651dcf2af15bbb682.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-From de08116d14db785431f3efb651dcf2af15bbb682 Mon Sep 17 00:00:00 2001
-From: Zoltan Szabadka <szabadka at google.com>
-Date: Mon, 22 Aug 2022 09:40:05 +0200
-Subject: [PATCH] Improve 'custom' codec in benchmark.
-
-Add options to prepare input of custom codec in arbitrary file
-format and colorspace.
-
-Add option to suppress custom codec stdin/stdout.
-
-Fix endianness of pfm headers and check correct endianness
-of ppf when encoding into ppm/pgm.
----
- lib/extras/codec.cc                       |  6 +-
- lib/extras/enc/pnm.cc                     | 10 ++-
- lib/jxl/base/file_io.h                    |  3 +-
- tools/benchmark/benchmark_args.cc         |  2 +
- tools/benchmark/benchmark_codec_custom.cc | 94 +++++++++++++++++++----
- tools/benchmark/benchmark_codec_custom.h  |  1 +
- tools/benchmark/benchmark_utils.cc        | 15 +++-
- tools/benchmark/benchmark_utils.h         |  3 +-
- 8 files changed, 103 insertions(+), 31 deletions(-)
-
-diff --git a/lib/extras/codec.cc b/lib/extras/codec.cc
-index 774b4ccb6e..b19a3dd721 100644
---- a/lib/extras/codec.cc
-+++ b/lib/extras/codec.cc
-@@ -105,11 +105,6 @@ Status Encode(const CodecInOut& io, const extras::Codec codec,
-         format.endianness = JXL_NATIVE_ENDIAN;
-         encoder = extras::GetPFMEncoder();
-       }
--      if (!c_desired.IsSRGB()) {
--        JXL_WARNING(
--            "PNM encoder cannot store custom ICC profile; decoder "
--            "will need hint key=color_space to get the same values");
--      }
-       break;
-     case extras::Codec::kPGX:
-       encoder = extras::GetPGXEncoder();
-@@ -135,6 +130,7 @@ Status Encode(const CodecInOut& io, const extras::Codec codec,
-   extras::PackedPixelFile ppf;
-   JXL_RETURN_IF_ERROR(
-       ConvertCodecInOutToPackedPixelFile(io, format, c_desired, pool, &ppf));
-+  ppf.info.bits_per_sample = bits_per_sample;
-   extras::EncodedImage encoded_image;
-   JXL_RETURN_IF_ERROR(encoder->Encode(ppf, &encoded_image, pool));
-   JXL_ASSERT(encoded_image.bitstreams.size() == 1);
-diff --git a/lib/extras/enc/pnm.cc b/lib/extras/enc/pnm.cc
-index 9b5f6cbc95..f5210052cd 100644
---- a/lib/extras/enc/pnm.cc
-+++ b/lib/extras/enc/pnm.cc
-@@ -71,8 +71,12 @@ Status EncodeHeader(const PackedImage& image, size_t bits_per_sample,
- 
- Status EncodeImagePNM(const PackedImage& image, size_t bits_per_sample,
-                       std::vector<uint8_t>* bytes) {
--  // Choose native for PFM; PGM/PPM require big-endian
--  bool is_little_endian = bits_per_sample > 16 && IsLittleEndian();
-+  if (bits_per_sample <= 16 && image.format.endianness != JXL_BIG_ENDIAN) {
-+    return JXL_FAILURE("PPM/PGM requires big-endian pixel format.");
-+  }
-+  bool is_little_endian =
-+      (image.format.endianness == JXL_LITTLE_ENDIAN ||
-+       (image.format.endianness == JXL_NATIVE_ENDIAN && IsLittleEndian()));
-   char header[kMaxHeaderSize];
-   int header_size = 0;
-   JXL_RETURN_IF_ERROR(EncodeHeader(image, bits_per_sample, is_little_endian,
-@@ -130,7 +134,7 @@ class PPMEncoder : public PNMEncoder {
-     std::vector<JxlPixelFormat> formats;
-     for (const uint32_t num_channels : {1, 2, 3, 4}) {
-       for (const JxlDataType data_type : {JXL_TYPE_UINT8, JXL_TYPE_UINT16}) {
--        for (JxlEndianness endianness : {JXL_BIG_ENDIAN, JXL_LITTLE_ENDIAN}) {
-+        for (JxlEndianness endianness : {JXL_BIG_ENDIAN}) {
-           formats.push_back(JxlPixelFormat{/*num_channels=*/num_channels,
-                                            /*data_type=*/data_type,
-                                            /*endianness=*/endianness,
-diff --git a/lib/jxl/base/file_io.h b/lib/jxl/base/file_io.h
-index 8c7777c945..64d5860915 100644
---- a/lib/jxl/base/file_io.h
-+++ b/lib/jxl/base/file_io.h
-@@ -133,7 +133,8 @@ template <typename ContainerType>
- static inline Status WriteFile(const ContainerType& bytes,
-                                const std::string& pathname) {
-   FileWrapper f(pathname, "wb");
--  if (f == nullptr) return JXL_FAILURE("Failed to open file for writing");
-+  if (f == nullptr)
-+    return JXL_FAILURE("Failed to open file for writing: %s", pathname.c_str());
- 
-   size_t pos = 0;
-   while (pos < bytes.size()) {
-diff --git a/tools/benchmark/benchmark_args.cc b/tools/benchmark/benchmark_args.cc
-index 2bd3eb8932..4a617b611a 100644
---- a/tools/benchmark/benchmark_args.cc
-+++ b/tools/benchmark/benchmark_args.cc
-@@ -17,6 +17,7 @@
- #include "lib/jxl/base/status.h"
- #include "lib/jxl/color_encoding_internal.h"
- #include "lib/jxl/color_management.h"
-+#include "tools/benchmark/benchmark_codec_custom.h"  // for AddCommand..
- #include "tools/benchmark/benchmark_codec_jpeg.h"  // for AddCommand..
- #include "tools/benchmark/benchmark_codec_jxl.h"
- #if JPEGXL_ENABLE_APNG
-@@ -210,6 +211,7 @@ Status BenchmarkArgs::AddCommandLineOptions() {
-       "Distance numbers and compression speeds shown in the table are invalid.",
-       false);
- 
-+  if (!AddCommandLineOptionsCustomCodec(this)) return false;
-   if (!AddCommandLineOptionsJxlCodec(this)) return false;
- #ifdef BENCHMARK_JPEG
-   if (!AddCommandLineOptionsJPEGCodec(this)) return false;
-diff --git a/tools/benchmark/benchmark_codec_custom.cc b/tools/benchmark/benchmark_codec_custom.cc
-index eefae6e65c..ef7d44b71a 100644
---- a/tools/benchmark/benchmark_codec_custom.cc
-+++ b/tools/benchmark/benchmark_codec_custom.cc
-@@ -13,6 +13,7 @@
- #include <fstream>
- 
- #include "lib/extras/codec.h"
-+#include "lib/extras/dec/color_description.h"
- #include "lib/extras/enc/apng.h"
- #include "lib/extras/time.h"
- #include "lib/jxl/base/file_io.h"
-@@ -22,6 +23,30 @@
- #include "tools/benchmark/benchmark_utils.h"
- 
- namespace jxl {
-+
-+struct CustomCodecArgs {
-+  std::string extension;
-+  std::string colorspace;
-+  bool quiet;
-+};
-+
-+static CustomCodecArgs* const custom_args = new CustomCodecArgs;
-+
-+Status AddCommandLineOptionsCustomCodec(BenchmarkArgs* args) {
-+  args->AddString(
-+      &custom_args->extension, "custom_codec_extension",
-+      "Converts input and output of codec to this file type (default: png).",
-+      "png");
-+  args->AddString(
-+      &custom_args->colorspace, "custom_codec_colorspace",
-+      "If not empty, converts input and output of codec to this colorspace.",
-+      "");
-+  args->AddFlag(&custom_args->quiet, "custom_codec_quiet",
-+                "Whether stdin and stdout of custom codec should be shown.",
-+                false);
-+  return true;
-+}
-+
- namespace {
- 
- std::string GetBaseName(std::string filename) {
-@@ -64,21 +89,40 @@ class CustomCodec : public ImageCodec {
-   explicit CustomCodec(const BenchmarkArgs& args) : ImageCodec(args) {}
- 
-   Status ParseParam(const std::string& param) override {
-+    if (param_index_ == 0) {
-+      description_ = "";
-+    }
-     switch (param_index_) {
-       case 0:
-         extension_ = param;
-+        description_ += param;
-         break;
--
-       case 1:
-         compress_command_ = param;
-+        description_ += std::string(":");
-+        if (param.find_last_of('/') < param.size()) {
-+          description_ += param.substr(param.find_last_of('/') + 1);
-+        } else {
-+          description_ += param;
-+        }
-         break;
--
-       case 2:
-         decompress_command_ = param;
-         break;
--
-       default:
-         compress_args_.push_back(param);
-+        if (param.size() > 2 && param[0] == '-' && param[1] == 'd') {
-+          // For setting ba_params_.hf_asymmetry
-+          JXL_RETURN_IF_ERROR(ImageCodec::ParseParam(param.substr(1)));
-+        }
-+        description_ += std::string(":");
-+        if (param.size() > 2 && param[0] == '-' && param[1] == '-') {
-+          description_ += param.substr(2);
-+        } else if (param.size() > 2 && param[0] == '-') {
-+          description_ += param.substr(1);
-+        } else {
-+          description_ += param;
-+        }
-         break;
-     }
-     ++param_index_;
-@@ -91,20 +135,30 @@ class CustomCodec : public ImageCodec {
-     JXL_RETURN_IF_ERROR(param_index_ > 2);
- 
-     const std::string basename = GetBaseName(filename);
--    TemporaryFile png_file(basename, "png"), encoded_file(basename, extension_);
--    std::string png_filename, encoded_filename;
--    JXL_RETURN_IF_ERROR(png_file.GetFileName(&png_filename));
-+    TemporaryFile in_file(basename, custom_args->extension);
-+    TemporaryFile encoded_file(basename, extension_);
-+    std::string in_filename, encoded_filename;
-+    JXL_RETURN_IF_ERROR(in_file.GetFileName(&in_filename));
-     JXL_RETURN_IF_ERROR(encoded_file.GetFileName(&encoded_filename));
-     saved_intensity_target_ = io->metadata.m.IntensityTarget();
- 
-     const size_t bits = io->metadata.m.bit_depth.bits_per_sample;
--    JXL_RETURN_IF_ERROR(
--        EncodeToFile(*io, io->Main().c_current(), bits, png_filename, pool));
-+    ColorEncoding c_enc = io->Main().c_current();
-+    if (!custom_args->colorspace.empty()) {
-+      JxlColorEncoding colorspace;
-+      JXL_RETURN_IF_ERROR(
-+          ParseDescription(custom_args->colorspace, &colorspace));
-+      JXL_RETURN_IF_ERROR(
-+          ConvertExternalToInternalColorEncoding(colorspace, &c_enc));
-+    }
-+    JXL_RETURN_IF_ERROR(EncodeToFile(*io, c_enc, bits, in_filename, pool));
-     std::vector<std::string> arguments = compress_args_;
--    arguments.push_back(png_filename);
-+    arguments.push_back(in_filename);
-     arguments.push_back(encoded_filename);
-     JXL_RETURN_IF_ERROR(ReportCodecRunningTime(
--        [&, this] { return RunCommand(compress_command_, arguments); },
-+        [&, this] {
-+          return RunCommand(compress_command_, arguments, custom_args->quiet);
-+        },
-         encoded_filename, speed_stats));
-     return ReadFile(encoded_filename, compressed);
-   }
-@@ -114,21 +168,26 @@ class CustomCodec : public ImageCodec {
-                     ThreadPoolInternal* pool, CodecInOut* io,
-                     jpegxl::tools::SpeedStats* speed_stats) override {
-     const std::string basename = GetBaseName(filename);
--    TemporaryFile encoded_file(basename, extension_), png_file(basename, "png");
--    std::string encoded_filename, png_filename;
-+    TemporaryFile encoded_file(basename, extension_);
-+    TemporaryFile out_file(basename, custom_args->extension);
-+    std::string encoded_filename, out_filename;
-     JXL_RETURN_IF_ERROR(encoded_file.GetFileName(&encoded_filename));
--    JXL_RETURN_IF_ERROR(png_file.GetFileName(&png_filename));
-+    JXL_RETURN_IF_ERROR(out_file.GetFileName(&out_filename));
- 
-     JXL_RETURN_IF_ERROR(WriteFile(compressed, encoded_filename));
-     JXL_RETURN_IF_ERROR(ReportCodecRunningTime(
-         [&, this] {
-           return RunCommand(
-               decompress_command_,
--              std::vector<std::string>{encoded_filename, png_filename});
-+              std::vector<std::string>{encoded_filename, out_filename},
-+              custom_args->quiet);
-         },
--        png_filename, speed_stats));
--    JXL_RETURN_IF_ERROR(
--        SetFromFile(png_filename, extras::ColorHints(), io, pool));
-+        out_filename, speed_stats));
-+    extras::ColorHints hints;
-+    if (!custom_args->colorspace.empty()) {
-+      hints.Add("color_space", custom_args->colorspace);
-+    }
-+    JXL_RETURN_IF_ERROR(SetFromFile(out_filename, hints, io, pool));
-     io->metadata.m.SetIntensityTarget(saved_intensity_target_);
-     return true;
-   }
-@@ -155,6 +214,7 @@ ImageCodec* CreateNewCustomCodec(const BenchmarkArgs& args) {
- namespace jxl {
- 
- ImageCodec* CreateNewCustomCodec(const BenchmarkArgs& args) { return nullptr; }
-+Status AddCommandLineOptionsCustomCodec(BenchmarkArgs* args) { return false; }
- 
- }  // namespace jxl
- 
-diff --git a/tools/benchmark/benchmark_codec_custom.h b/tools/benchmark/benchmark_codec_custom.h
-index b2711cd5cc..38351e7a12 100644
---- a/tools/benchmark/benchmark_codec_custom.h
-+++ b/tools/benchmark/benchmark_codec_custom.h
-@@ -40,6 +40,7 @@
- namespace jxl {
- 
- ImageCodec* CreateNewCustomCodec(const BenchmarkArgs& args);
-+Status AddCommandLineOptionsCustomCodec(BenchmarkArgs* args);
- 
- }  // namespace jxl
- 
-diff --git a/tools/benchmark/benchmark_utils.cc b/tools/benchmark/benchmark_utils.cc
-index 4b531317e6..58fe324caa 100644
---- a/tools/benchmark/benchmark_utils.cc
-+++ b/tools/benchmark/benchmark_utils.cc
-@@ -51,7 +51,7 @@ Status TemporaryFile::GetFileName(std::string* const output) const {
- }
- 
- Status RunCommand(const std::string& command,
--                  const std::vector<std::string>& arguments) {
-+                  const std::vector<std::string>& arguments, bool quiet) {
-   std::vector<char*> args;
-   args.reserve(arguments.size() + 2);
-   args.push_back(const_cast<char*>(command.c_str()));
-@@ -60,10 +60,17 @@ Status RunCommand(const std::string& command,
-   }
-   args.push_back(nullptr);
-   pid_t pid;
--  JXL_RETURN_IF_ERROR(posix_spawnp(&pid, command.c_str(), nullptr, nullptr,
--                                   args.data(), environ) == 0);
-+  posix_spawn_file_actions_t file_actions;
-+  posix_spawn_file_actions_init(&file_actions);
-+  if (quiet) {
-+    posix_spawn_file_actions_addclose(&file_actions, STDOUT_FILENO);
-+    posix_spawn_file_actions_addclose(&file_actions, STDERR_FILENO);
-+  }
-+  JXL_RETURN_IF_ERROR(posix_spawnp(&pid, command.c_str(), &file_actions,
-+                                   nullptr, args.data(), environ) == 0);
-   int wstatus;
-   waitpid(pid, &wstatus, 0);
-+  posix_spawn_file_actions_destroy(&file_actions);
-   return WIFEXITED(wstatus) && WEXITSTATUS(wstatus) == EXIT_SUCCESS;
- }
- 
-@@ -81,7 +88,7 @@ Status TemporaryFile::GetFileName(std::string* const output) const {
- }
- 
- Status RunCommand(const std::string& command,
--                  const std::vector<std::string>& arguments) {
-+                  const std::vector<std::string>& arguments, bool quiet) {
-   return JXL_FAILURE("Not supported on this build");
- }
- 
-diff --git a/tools/benchmark/benchmark_utils.h b/tools/benchmark/benchmark_utils.h
-index 027fa0868f..ba4128db8b 100644
---- a/tools/benchmark/benchmark_utils.h
-+++ b/tools/benchmark/benchmark_utils.h
-@@ -28,7 +28,8 @@ class TemporaryFile final {
- };
- 
- Status RunCommand(const std::string& command,
--                  const std::vector<std::string>& arguments);
-+                  const std::vector<std::string>& arguments,
-+                  bool quiet = false);
- 
- }  // namespace jxl
- 
diff --git a/debian/patches/series b/debian/patches/series
index a86e237..f91e3c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,6 @@
 do_not_force_cxx11.patch
 continuefinalnonessentialboxtest.patch
 #roundtriplargefast.patch
-de08116d14db785431f3efb651dcf2af15bbb682.patch
 1a36db0bf452a2232f0a15d7d8edb542e8196401.patch
 manpages.patch
 hwy.patch


More information about the Neon-commits mailing list