diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/splines_gbench.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/splines_gbench.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/splines_gbench.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/splines_gbench.cc b/third_party/jpeg-xl/lib/jxl/splines_gbench.cc index 78ff6d41c0..903c5b6328 100644 --- a/third_party/jpeg-xl/lib/jxl/splines_gbench.cc +++ b/third_party/jpeg-xl/lib/jxl/splines_gbench.cc @@ -3,7 +3,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +#include <array> + #include "benchmark/benchmark.h" +#include "lib/jxl/image_ops.h" #include "lib/jxl/splines.h" namespace jxl { @@ -17,12 +20,14 @@ const float kYToB = cmap->YtoBRatio(0); void BM_Splines(benchmark::State& state) { const size_t n = state.range(); - std::vector<Spline> spline_data = { - {/*control_points=*/{ - {9, 54}, {118, 159}, {97, 3}, {10, 40}, {150, 25}, {120, 300}}, - /*color_dct=*/ - {{0.03125f, 0.00625f, 0.003125f}, {1.f, 0.321875f}, {1.f, 0.24375f}}, - /*sigma_dct=*/{0.3125f, 0.f, 0.f, 0.0625f}}}; + Spline spline1{ + /*control_points=*/{ + {9, 54}, {118, 159}, {97, 3}, {10, 40}, {150, 25}, {120, 300}}, + /*color_dct=*/ + {Dct32{0.03125f, 0.00625f, 0.003125f}, Dct32{1.f, 0.321875f}, + Dct32{1.f, 0.24375f}}, + /*sigma_dct=*/{0.3125f, 0.f, 0.f, 0.0625f}}; + std::vector<Spline> spline_data = {spline1}; std::vector<QuantizedSpline> quantized_splines; std::vector<Spline::Point> starting_points; for (const Spline& spline : spline_data) { @@ -33,7 +38,7 @@ void BM_Splines(benchmark::State& state) { Splines splines(kQuantizationAdjustment, std::move(quantized_splines), std::move(starting_points)); - Image3F drawing_area(320, 320); + JXL_ASSIGN_OR_DIE(Image3F drawing_area, Image3F::Create(320, 320)); ZeroFillImage(&drawing_area); for (auto _ : state) { for (size_t i = 0; i < n; ++i) { |