summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/dct_util.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /third_party/jpeg-xl/lib/jxl/dct_util.h
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/dct_util.h')
-rw-r--r--third_party/jpeg-xl/lib/jxl/dct_util.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/dct_util.h b/third_party/jpeg-xl/lib/jxl/dct_util.h
index 2f29449677..90a02658af 100644
--- a/third_party/jpeg-xl/lib/jxl/dct_util.h
+++ b/third_party/jpeg-xl/lib/jxl/dct_util.h
@@ -8,8 +8,9 @@
#include <stddef.h>
-#include "lib/jxl/base/compiler_specific.h"
-#include "lib/jxl/base/data_parallel.h"
+#include <memory>
+
+#include "lib/jxl/base/common.h"
#include "lib/jxl/base/status.h"
#include "lib/jxl/image.h"
#include "lib/jxl/image_ops.h"
@@ -50,12 +51,16 @@ template <typename T>
class ACImageT final : public ACImage {
public:
ACImageT() = default;
- ACImageT(size_t xsize, size_t ysize) {
+
+ static StatusOr<std::unique_ptr<ACImageT>> Make(size_t xsize, size_t ysize) {
static_assert(
std::is_same<T, int16_t>::value || std::is_same<T, int32_t>::value,
"ACImage must be either 32- or 16- bit");
- img_ = Image3<T>(xsize, ysize);
+ std::unique_ptr<ACImageT> result = jxl::make_unique<ACImageT>();
+ JXL_ASSIGN_OR_RETURN(result->img_, Image3<T>::Create(xsize, ysize));
+ return result;
}
+
ACType Type() const override {
return sizeof(T) == 2 ? ACType::k16 : ACType::k32;
}