Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017-2018 ARM Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/runtime/MultiImage.h" |
| 25 | #include "arm_compute/runtime/NEON/functions/NEColorConvert.h" |
| 26 | #include "arm_compute/runtime/Tensor.h" |
| 27 | #include "arm_compute/runtime/TensorAllocator.h" |
| 28 | #include "tests/NEON/Accessor.h" |
| 29 | #include "tests/datasets/ShapeDatasets.h" |
| 30 | #include "tests/framework/Asserts.h" |
| 31 | #include "tests/framework/Macros.h" |
| 32 | #include "tests/validation/Validation.h" |
| 33 | #include "tests/validation/fixtures/ColorConvertFixture.h" |
| 34 | |
| 35 | namespace arm_compute |
| 36 | { |
| 37 | namespace test |
| 38 | { |
| 39 | namespace validation |
| 40 | { |
| 41 | namespace |
| 42 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 43 | constexpr AbsoluteTolerance<uint8_t> tolerance_nv(2); |
| 44 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 45 | // Input data sets |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 46 | const auto RGBDataset = framework::dataset::make("FormatType", { Format::RGB888, Format::RGBA8888 }); |
| 47 | const auto YUYVDataset = framework::dataset::make("FormatType", { Format::YUYV422, Format::UYVY422 }); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 48 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 49 | const auto ColorConvert_RGBA_to_RGB = combine(framework::dataset::make("FormatType", { Format::RGBA8888 }), |
| 50 | framework::dataset::make("FormatType", { Format::RGB888 })); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 51 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 52 | const auto ColorConvert_RGB_to_RGBA = combine(framework::dataset::make("FormatType", { Format::RGB888 }), |
| 53 | framework::dataset::make("FormatType", { Format::RGBA8888 })); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 54 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 55 | const auto ColorConvert_YUYVDataset_to_RGBDataset = combine(YUYVDataset, |
| 56 | RGBDataset); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 57 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 58 | const auto ColorConvert_YUVPlanar_to_RGBDataset = combine(framework::dataset::make("FormatType", { Format::IYUV, Format::NV12, Format::NV21 }), |
| 59 | RGBDataset); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 60 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 61 | const auto ColorConvert_RGBDataset_to_NVDataset = combine(RGBDataset, |
| 62 | framework::dataset::make("FormatType", { Format::NV12, Format::IYUV, Format::YUV444 })); |
| 63 | |
| 64 | const auto ColorConvert_YUYVDataset_to_NVDataset = combine(YUYVDataset, |
| 65 | framework::dataset::make("FormatType", { Format::NV12, Format::IYUV })); |
| 66 | |
| 67 | const auto ColorConvert_NVDataset_to_YUVDataset = combine(framework::dataset::make("FormatType", { Format::NV12, Format::NV21 }), |
| 68 | framework::dataset::make("FormatType", { Format::IYUV, Format::YUV444 })); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 69 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 70 | inline void validate_configuration(const TensorShape &shape, Format src_format, Format dst_format) |
| 71 | { |
| 72 | const unsigned int src_num_planes = num_planes_from_format(src_format); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 73 | const unsigned int dst_num_planes = num_planes_from_format(dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 74 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 75 | TensorShape input = adjust_odd_shape(shape, src_format); |
| 76 | input = adjust_odd_shape(input, dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 77 | |
| 78 | // Create tensors |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 79 | MultiImage ref_src = create_multi_image<MultiImage>(input, src_format); |
| 80 | MultiImage ref_dst = create_multi_image<MultiImage>(input, dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 81 | |
| 82 | // Create and Configure function |
| 83 | NEColorConvert color_convert; |
| 84 | |
| 85 | if(1U == src_num_planes) |
| 86 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 87 | const Tensor *src_plane = ref_src.plane(0); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 88 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 89 | if(1U == dst_num_planes) |
| 90 | { |
| 91 | Tensor *dst_plane = ref_dst.plane(0); |
| 92 | color_convert.configure(src_plane, dst_plane); |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | color_convert.configure(src_plane, &ref_dst); |
| 97 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 98 | } |
| 99 | else |
| 100 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 101 | if(1U == dst_num_planes) |
| 102 | { |
| 103 | Tensor *dst_plane = ref_dst.plane(0); |
| 104 | color_convert.configure(&ref_src, dst_plane); |
| 105 | } |
| 106 | else |
| 107 | { |
| 108 | color_convert.configure(&ref_src, &ref_dst); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | for(unsigned int plane_idx = 0; plane_idx < src_num_planes; ++plane_idx) |
| 113 | { |
| 114 | const Tensor *src_plane = ref_src.plane(plane_idx); |
| 115 | |
| 116 | ARM_COMPUTE_EXPECT(src_plane->info()->is_resizable(), framework::LogLevel::ERRORS); |
| 117 | } |
| 118 | for(unsigned int plane_idx = 0; plane_idx < dst_num_planes; ++plane_idx) |
| 119 | { |
| 120 | const Tensor *dst_plane = ref_dst.plane(plane_idx); |
| 121 | |
| 122 | ARM_COMPUTE_EXPECT(dst_plane->info()->is_resizable(), framework::LogLevel::ERRORS); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 123 | } |
| 124 | } |
| 125 | } // namespace |
| 126 | |
| 127 | TEST_SUITE(NEON) |
| 128 | TEST_SUITE(ColorConvert) |
| 129 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 130 | template <typename T> |
| 131 | using NEColorConvertFixture = ColorConvertValidationFixture<MultiImage, Tensor, Accessor, NEColorConvert, T>; |
| 132 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 133 | TEST_SUITE(Configuration) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 134 | DATA_TEST_CASE(RGBA, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_RGBA_to_RGB), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 135 | shape, src_format, dst_format) |
| 136 | { |
| 137 | validate_configuration(shape, src_format, dst_format); |
| 138 | } |
| 139 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 140 | DATA_TEST_CASE(RGB, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_RGB_to_RGBA), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 141 | shape, src_format, dst_format) |
| 142 | { |
| 143 | validate_configuration(shape, src_format, dst_format); |
| 144 | } |
| 145 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 146 | DATA_TEST_CASE(YUV, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_YUYVDataset_to_RGBDataset), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 147 | shape, src_format, dst_format) |
| 148 | { |
| 149 | validate_configuration(shape, src_format, dst_format); |
| 150 | } |
| 151 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 152 | DATA_TEST_CASE(YUVPlanar, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_YUVPlanar_to_RGBDataset), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 153 | shape, src_format, dst_format) |
| 154 | { |
| 155 | validate_configuration(shape, src_format, dst_format); |
| 156 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 157 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 158 | DATA_TEST_CASE(NV, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_RGBDataset_to_NVDataset), |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 159 | shape, src_format, dst_format) |
| 160 | { |
| 161 | validate_configuration(shape, src_format, dst_format); |
| 162 | } |
| 163 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 164 | DATA_TEST_CASE(YUYVtoNV, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_YUYVDataset_to_NVDataset), |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 165 | shape, src_format, dst_format) |
| 166 | { |
| 167 | validate_configuration(shape, src_format, dst_format); |
| 168 | } |
| 169 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 170 | DATA_TEST_CASE(NVtoYUV, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ColorConvert_NVDataset_to_YUVDataset), |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 171 | shape, src_format, dst_format) |
| 172 | { |
| 173 | validate_configuration(shape, src_format, dst_format); |
| 174 | } |
| 175 | TEST_SUITE_END() |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 176 | |
| 177 | TEST_SUITE(RGBA) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 178 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGBA_to_RGB)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 179 | { |
| 180 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 181 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 182 | { |
| 183 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 184 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 185 | } |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 186 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 187 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGBA_to_RGB)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 188 | { |
| 189 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 190 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 191 | { |
| 192 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 193 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 194 | } |
| 195 | TEST_SUITE_END() |
| 196 | |
| 197 | TEST_SUITE(RGB) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 198 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_RGBA)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 199 | { |
| 200 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 201 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 202 | { |
| 203 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 204 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 205 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 206 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGB_to_RGBA)) |
| 207 | { |
| 208 | // Validate output |
| 209 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 210 | { |
| 211 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 212 | } |
| 213 | } |
| 214 | TEST_SUITE_END() |
| 215 | |
| 216 | TEST_SUITE(YUV) |
| 217 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUYVDataset_to_RGBDataset)) |
| 218 | { |
| 219 | // Validate output |
| 220 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 221 | { |
| 222 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 223 | } |
| 224 | } |
| 225 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUYVDataset_to_RGBDataset)) |
| 226 | { |
| 227 | // Validate output |
| 228 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 229 | { |
| 230 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 231 | } |
| 232 | } |
| 233 | TEST_SUITE_END() |
| 234 | |
| 235 | TEST_SUITE(YUVPlanar) |
| 236 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset)) |
| 237 | { |
| 238 | // Validate output |
| 239 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 240 | { |
| 241 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 242 | } |
| 243 | } |
| 244 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 245 | { |
| 246 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 247 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 248 | { |
| 249 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 250 | } |
| 251 | } |
| 252 | TEST_SUITE_END() |
| 253 | |
| 254 | TEST_SUITE(NV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 255 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGBDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 256 | { |
| 257 | // Validate output |
| 258 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 259 | { |
| 260 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx], tolerance_nv); |
| 261 | } |
| 262 | } |
| 263 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 264 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGBDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 265 | { |
| 266 | // Validate output |
| 267 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 268 | { |
| 269 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx], tolerance_nv); |
| 270 | } |
| 271 | } |
| 272 | TEST_SUITE_END() |
| 273 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 274 | TEST_SUITE(YUYVtoNV) |
| 275 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUYVDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 276 | { |
| 277 | // Validate output |
| 278 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 279 | { |
| 280 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 281 | } |
| 282 | } |
| 283 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 284 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUYVDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 285 | { |
| 286 | // Validate output |
| 287 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 288 | { |
| 289 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 290 | } |
| 291 | } |
| 292 | TEST_SUITE_END() |
| 293 | |
| 294 | TEST_SUITE(NVtoYUV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 295 | FIXTURE_DATA_TEST_CASE(RunSmall, NEColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_NVDataset_to_YUVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 296 | { |
| 297 | // Validate output |
| 298 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 299 | { |
| 300 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 301 | } |
| 302 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame^] | 303 | FIXTURE_DATA_TEST_CASE(RunLarge, NEColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_NVDataset_to_YUVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 304 | { |
| 305 | // Validate output |
| 306 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 307 | { |
| 308 | validate(Accessor(*_target.plane(plane_idx)), _reference[plane_idx]); |
| 309 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 310 | } |
| 311 | TEST_SUITE_END() |
| 312 | |
| 313 | TEST_SUITE_END() |
| 314 | TEST_SUITE_END() |
| 315 | } // namespace validation |
| 316 | } // namespace test |
| 317 | } // namespace arm_compute |