summaryrefslogtreecommitdiff
path: root/lib/jxl/fast_dct-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jxl/fast_dct-inl.h')
-rw-r--r--lib/jxl/fast_dct-inl.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/jxl/fast_dct-inl.h b/lib/jxl/fast_dct-inl.h
index defdfcd..de1f845 100644
--- a/lib/jxl/fast_dct-inl.h
+++ b/lib/jxl/fast_dct-inl.h
@@ -10,6 +10,7 @@
#define LIB_JXL_FAST_DCT_INL_H_
#endif
+#include <cmath>
#include <hwy/aligned_allocator.h>
#include <hwy/highway.h>
@@ -157,7 +158,9 @@ HWY_NOINLINE void TestFastIDCT() {
auto idct_mem = hwy::AllocateAligned<int16_t>(N * M);
int16_t* idct = idct_mem.get();
- auto scratch_space_mem = hwy::AllocateAligned<float>(N * M * 2);
+ const HWY_FULL(float) df;
+ auto scratch_space_mem = hwy::AllocateAligned<float>(
+ N * M * 2 + 3 * std::max(N, M) * MaxLanes(df));
float* scratch_space = scratch_space_mem.get();
auto scratch_space_i_mem = hwy::AllocateAligned<int16_t>(N * M * 2);
int16_t* scratch_space_i = scratch_space_i_mem.get();
@@ -204,7 +207,7 @@ HWY_NOINLINE void TestFloatIDCT() {
auto dct_in_mem = hwy::AllocateAligned<float>(N * M);
float* dct_in = dct_mem.get();
- auto scratch_space_mem = hwy::AllocateAligned<float>(N * M * 2);
+ auto scratch_space_mem = hwy::AllocateAligned<float>(N * M * 5);
float* scratch_space = scratch_space_mem.get();
Rng rng(0);