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/render_pipeline/test_render_pipeline_stages.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.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/render_pipeline/test_render_pipeline_stages.h')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/render_pipeline/test_render_pipeline_stages.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/render_pipeline/test_render_pipeline_stages.h b/third_party/jpeg-xl/lib/jxl/render_pipeline/test_render_pipeline_stages.h index 789a52f8b2..c2c25c46c3 100644 --- a/third_party/jpeg-xl/lib/jxl/render_pipeline/test_render_pipeline_stages.h +++ b/third_party/jpeg-xl/lib/jxl/render_pipeline/test_render_pipeline_stages.h @@ -7,10 +7,7 @@ #include <stdint.h> #include <stdio.h> -#include <algorithm> -#include <utility> -#include <vector> - +#include "lib/jxl/base/status.h" #include "lib/jxl/render_pipeline/render_pipeline_stage.h" namespace jxl { @@ -20,13 +17,13 @@ class UpsampleXSlowStage : public RenderPipelineStage { UpsampleXSlowStage() : RenderPipelineStage(RenderPipelineStage::Settings::ShiftX(1, 1)) {} - void ProcessRow(const RowInfo& input_rows, const RowInfo& output_rows, - size_t xextra, size_t xsize, size_t xpos, size_t ypos, - size_t thread_id) const final { + Status ProcessRow(const RowInfo& input_rows, const RowInfo& output_rows, + size_t xextra, size_t xsize, size_t xpos, size_t ypos, + size_t thread_id) const final { for (size_t c = 0; c < input_rows.size(); c++) { const float* row = GetInputRow(input_rows, c, 0); float* row_out = GetOutputRow(output_rows, c, 0); - for (int64_t x = -xextra; x < (int64_t)(xsize + xextra); x++) { + for (int64_t x = -xextra; x < static_cast<int64_t>(xsize + xextra); x++) { float xp = *(row + x - 1); float xc = *(row + x); float xn = *(row + x + 1); @@ -36,6 +33,7 @@ class UpsampleXSlowStage : public RenderPipelineStage { *(row_out + 2 * x + 1) = xout1; } } + return true; } const char* GetName() const override { return "TEST::UpsampleXSlowStage"; } @@ -50,16 +48,16 @@ class UpsampleYSlowStage : public RenderPipelineStage { UpsampleYSlowStage() : RenderPipelineStage(RenderPipelineStage::Settings::ShiftY(1, 1)) {} - void ProcessRow(const RowInfo& input_rows, const RowInfo& output_rows, - size_t xextra, size_t xsize, size_t xpos, size_t ypos, - size_t thread_id) const final { + Status ProcessRow(const RowInfo& input_rows, const RowInfo& output_rows, + size_t xextra, size_t xsize, size_t xpos, size_t ypos, + size_t thread_id) const final { for (size_t c = 0; c < input_rows.size(); c++) { const float* rowp = GetInputRow(input_rows, c, -1); const float* rowc = GetInputRow(input_rows, c, 0); const float* rown = GetInputRow(input_rows, c, 1); float* row_out0 = GetOutputRow(output_rows, c, 0); float* row_out1 = GetOutputRow(output_rows, c, 1); - for (int64_t x = -xextra; x < (int64_t)(xsize + xextra); x++) { + for (int64_t x = -xextra; x < static_cast<int64_t>(xsize + xextra); x++) { float xp = *(rowp + x); float xc = *(rowc + x); float xn = *(rown + x); @@ -69,6 +67,7 @@ class UpsampleYSlowStage : public RenderPipelineStage { *(row_out1 + x) = yout1; } } + return true; } RenderPipelineChannelMode GetChannelMode(size_t c) const final { @@ -82,14 +81,15 @@ class Check0FinalStage : public RenderPipelineStage { public: Check0FinalStage() : RenderPipelineStage(RenderPipelineStage::Settings()) {} - void ProcessRow(const RowInfo& input_rows, const RowInfo& output_rows, - size_t xextra, size_t xsize, size_t xpos, size_t ypos, - size_t thread_id) const final { + Status ProcessRow(const RowInfo& input_rows, const RowInfo& output_rows, + size_t xextra, size_t xsize, size_t xpos, size_t ypos, + size_t thread_id) const final { for (size_t c = 0; c < input_rows.size(); c++) { for (size_t x = 0; x < xsize; x++) { JXL_CHECK(fabsf(GetInputRow(input_rows, c, 0)[x]) < 1e-8); } } + return true; } RenderPipelineChannelMode GetChannelMode(size_t c) const final { |