44 : _input(nullptr), _output(nullptr), _func(nullptr)
66 num_elems_processed_per_iteration = 16;
79 _func = colorconvert_yuyv_to_rgb<false, false>;
80 num_elems_processed_per_iteration = 32;
83 _func = colorconvert_yuyv_to_rgb<false, true>;
84 num_elems_processed_per_iteration = 32;
97 _func = colorconvert_yuyv_to_rgb<true, false>;
98 num_elems_processed_per_iteration = 32;
101 _func = colorconvert_yuyv_to_rgb<true, true>;
102 num_elems_processed_per_iteration = 32;
116 num_elems_processed_per_iteration = 16;
120 num_elems_processed_per_iteration = 16;
145 INEKernel::configure(win);
166 _func = colorconvert_nv12_to_rgb<true, false>;
167 num_elems_processed_per_iteration = 32;
170 _func = colorconvert_nv12_to_rgb<true, true>;
171 num_elems_processed_per_iteration = 32;
184 _func = colorconvert_nv12_to_rgb<false, false>;
185 num_elems_processed_per_iteration = 32;
188 _func = colorconvert_nv12_to_rgb<false, true>;
189 num_elems_processed_per_iteration = 32;
202 _func = colorconvert_iyuv_to_rgb<false>;
203 num_elems_processed_per_iteration = 32;
206 _func = colorconvert_iyuv_to_rgb<true>;
207 num_elems_processed_per_iteration = 32;
227 unsigned int input_plane_count = 3;
231 input_plane_count = 2;
240 input0_access, input1_access, input2_access,
246 if(input_plane_count == 3)
251 output_access.set_valid_region(win, intersect_region);
253 INEKernel::configure(win);
268 subsampled_shape.
set(0, subsampled_shape[0] / 2);
269 subsampled_shape.
set(1, subsampled_shape[1] / 2);
279 subsampled_shape.
set(0, subsampled_shape[0] / 2);
280 subsampled_shape.
set(1, subsampled_shape[1] / 2);
311 _func = colorconvert_rgb_to_nv12<false>;
312 num_elems_processed_per_iteration = 16;
315 _func = colorconvert_rgb_to_iyuv<false>;
316 num_elems_processed_per_iteration = 16;
319 _func = colorconvert_rgb_to_yuv4<false>;
320 num_elems_processed_per_iteration = 16;
333 _func = colorconvert_rgb_to_nv12<true>;
334 num_elems_processed_per_iteration = 16;
337 _func = colorconvert_rgb_to_iyuv<true>;
338 num_elems_processed_per_iteration = 16;
341 _func = colorconvert_rgb_to_yuv4<true>;
342 num_elems_processed_per_iteration = 16;
355 _func = colorconvert_yuyv_to_nv12<false>;
356 num_elems_processed_per_iteration = 32;
359 _func = colorconvert_yuyv_to_iyuv<false>;
360 num_elems_processed_per_iteration = 32;
373 _func = colorconvert_yuyv_to_nv12<true>;
374 num_elems_processed_per_iteration = 32;
377 _func = colorconvert_yuyv_to_iyuv<true>;
378 num_elems_processed_per_iteration = 32;
397 float sub_sampling = 1.f;
405 unsigned int output_plane_count = 3;
409 output_plane_count = 2;
426 INEKernel::configure(win);
441 subsampled_shape.
set(0, subsampled_shape[0] / 2);
442 subsampled_shape.
set(1, subsampled_shape[1] / 2);
452 subsampled_shape.
set(0, subsampled_shape[0] / 2);
453 subsampled_shape.
set(1, subsampled_shape[1] / 2);
482 _func = colorconvert_nv12_to_iyuv<true>;
485 _func = colorconvert_nv12_to_yuv4<true>;
498 _func = colorconvert_nv12_to_iyuv<false>;
501 _func = colorconvert_nv12_to_yuv4<false>;
534 constexpr
float input_sub_sampling = 0.5f;
541 unsigned int input_plane_count = 3;
545 input_plane_count = 2;
548 unsigned int output_plane_count = 3;
552 output_plane_count = 2;
570 if(input_plane_count == 3)
575 output0_access.set_valid_region(win, intersect_region);
576 output1_access.set_valid_region(win, intersect_region);
577 output2_access.set_valid_region(win, intersect_region);
579 INEKernel::configure(win);
589 (*_func)(_input, _output,
window);
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const Window & window() const
The maximum window the kernel can be executed on.
void colorconvert_iyuv_to_nv12(const void *__restrict input, void *__restrict output, const Window &win)
Convert IYUV to NV12.
#define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t)
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
1 channel, 1 U8 per channel
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
void colorconvert_rgbx_to_rgb(const void *input, void *output, const Window &win)
Convert RGBX to RGB.
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
Interface for Neon tensor.
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
Copyright (c) 2017-2021 Arm Limited.
void colorconvert_rgb_to_u8(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to U8.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
3 channels, 1 U8 per channel
Implementation of a rectangular access pattern.
virtual Format format() const =0
Colour format of the image.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Interface for multi-planar images.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
void colorconvert_rgb_to_rgbx(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to RGBX.
Class to describe a number of elements in each dimension.
NEColorConvertKernel()
Default constructor.
Implementation of a row access pattern.
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES(...)
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
bool set_shape_if_empty(ITensorInfo &info, const TensorShape &shape)
Set the shape to the specified value if the current assignment is empty.
ValidRegion intersect_valid_regions(const Ts &... regions)
Intersect multiple valid regions.
virtual const MultiImageInfo * info() const =0
Interface to be implemented by the child class to return the multi-planar image's metadata...
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
4 channels, 1 U8 per channel
void set_dimension_step(size_t dimension, int step)
Set the step of a given dimension.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS(...)
virtual IImage * plane(unsigned int index)=0
Return a pointer to the requested plane of the image.
void colorconvert_iyuv_to_yuv4(const void *__restrict input, void *__restrict output, const Window &win)
Convert IYUV to YUV4.
unsigned int num_elems_processed_per_iteration
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Container for valid region of a window.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
Format format() const
Colour format of the image.
void configure(const ITensor *input, ITensor *output)
Set the input and output of the kernel.
Describe a multidimensional execution window.
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)