diff --git a/intrinsiccv/include/types.h b/intrinsiccv/include/types.h index f6703c73891341c45fecd920d039a8d44c19ed21..a21bba91967ce7f98db3772be85b8bf36b0ff533 100644 --- a/intrinsiccv/include/types.h +++ b/intrinsiccv/include/types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -541,13 +541,14 @@ template void zip_parallel_rows(OperationType &operation, Rectangle rect, RowTypes... rows) INTRINSICCV_STREAMING_COMPATIBLE { for (size_t row_index = 0; row_index < rect.height(); row_index += 2) { - operation.process_row(rect.width(), rows.as_columns()...); - // Call pre-increment operator on all elements in the parameter pack. - ((++rows), ...); // Handle the last odd row in a special way. if (INTRINSICCV_UNLIKELY(row_index == (rect.height() - 1))) { ((rows.make_single_row(), ...)); } + + operation.process_row(rect.width(), rows.as_columns()...); + // Call pre-increment operator on all elements in the parameter pack. + ((++rows), ...); } } diff --git a/test/api/test_yuv_to_rgb.cpp b/test/api/test_yuv_to_rgb.cpp index 876e4dce59171780a48e65a24cdcf33d9ff06934..931695a9ab9e1be8c8230fcee9c9d9669f9a459e 100644 --- a/test/api/test_yuv_to_rgb.cpp +++ b/test/api/test_yuv_to_rgb.cpp @@ -16,34 +16,44 @@ class YuvTest final { template void execute_scalar_test(F impl, bool is_nv21) { size_t scalar_path_width = 5; - execute_test(impl, scalar_path_width, is_nv21); + execute_test(impl, scalar_path_width, is_nv21, 0); + // Padding version + execute_test(impl, scalar_path_width, is_nv21, + test::Options::vector_length()); } template void execute_vector_test(F impl, bool is_nv21) { size_t vector_path_width = (2 * test::Options::vector_lanes()) - 3; - execute_test(impl, vector_path_width, is_nv21); + execute_test(impl, vector_path_width, is_nv21, 0); + // Padding version + execute_test(impl, vector_path_width, is_nv21, + test::Options::vector_length()); } private: template - void execute_test(F impl, size_t logical_width, bool is_nv21) { - test::Array2D input_y{logical_width, 7}; + void execute_test(F impl, size_t logical_width, bool is_nv21, + size_t padding) { + test::Array2D input_y{logical_width, 5, padding}; input_y.set(0, 0, {10, 20, 255, 199}); input_y.set(1, 0, {1, 120, 0, 17}); input_y.set(2, 0, {2, 3, 240, 228}); - input_y.set(6, 0, {7, 11, 128, 129}); + input_y.set(4, 0, {7, 11, 128, 129}); // the width of the UV input must be even - test::Array2D input_uv{__builtin_align_up(logical_width, 2), 3}; + test::Array2D input_uv{__builtin_align_up(logical_width, 2), 3, + padding}; input_uv.set(0, 0, {100, 130, 255, 255}); input_uv.set(1, 0, {0, 1, 3, 4}); input_uv.set(2, 0, {7, 8, 9, 10}); - test::Array2D expected{logical_width * channel_number_, 6}; + test::Array2D expected{logical_width * channel_number_, + input_y.height(), padding}; calculate_expected(input_y, input_uv, expected, is_nv21); - test::Array2D actual{logical_width * channel_number_, 6}; + test::Array2D actual{logical_width * channel_number_, + input_y.height(), padding}; impl(input_y.data(), input_y.stride(), input_uv.data(), input_uv.stride(), actual.data(), actual.stride(), expected.width() / channel_number_,