summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/dct_util.h
diff options
context:
space:
mode:
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;
}