48 : _planes{ {
nullptr } }, _output(
nullptr), _output_multi(
nullptr), _x_subsampling{ { 1, 1, 1 } }, _y_subsampling{ { 1, 1, 1 } }
104 _output_multi =
nullptr;
109 _x_subsampling[1] = 2;
110 _x_subsampling[2] = 2;
131 if(plane3 !=
nullptr)
137 ICLKernel::configure_internal(win);
189 _planes[3] =
nullptr;
193 _output_multi = output;
195 bool has_two_planars =
false;
199 std::set<std::string> build_opts;
203 _x_subsampling = { { 1, 2, 2 } };
204 _y_subsampling = { { 1, 2, 2 } };
205 kernel_name =
"channel_combine_NV";
206 build_opts.emplace(
Format::NV12 == output_format ?
"-DNV12" :
"-DNV21");
207 has_two_planars =
true;
213 _x_subsampling = { { 1, 2, 2 } };
214 _y_subsampling = { { 1, 2, 2 } };
217 kernel_name =
"copy_planes_3p";
218 build_opts.emplace(
Format::IYUV == output_format ?
"-DIYUV" :
"-DYUV444");
222 _kernel =
create_kernel(compile_context, kernel_name, build_opts);
235 input_plane0_access, input_plane1_access, input_plane2_access,
236 output_plane0_access, output_plane1_access, output_plane2_access);
244 ICLKernel::configure_internal(win);
258 Window win_sub_plane1(slice);
263 Window win_sub_plane2(slice);
267 unsigned int idx = 0;
276 if(
nullptr != _output)
289 _kernel.setArg(idx++, slice.
y().
end());
Window first_slice_window_2D() const
First 2D slice of the 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 add_2D_tensor_argument_if(bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx ...
void enqueue(IGCKernel &kernel, const Window &window, const gles::NDRange &lws=gles::NDRange(1U, 1U, 1U))
Add the kernel to the command queue with the given window.
#define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t)
size_t num_planes_from_format(Format format)
Return the number of planes for a given format.
constexpr int step() const
Return the step of the dimension.
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
1 channel, 1 U8 per channel
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Interface for OpenCL multi-planar images.
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
Describe one of the image's dimensions with a start, end and step.
virtual ICLImage * cl_plane(unsigned int index)=0
Return a pointer to the requested OpenCL plane of the image.
#define ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN(t,...)
const ValidRegion valid_region
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
bool slide_window_slice_2D(Window &slice) const
Slide the passed 2D window slice.
Copyright (c) 2017-2021 Arm Limited.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
3 channels, 1 U8 per channel
#define ARM_COMPUTE_ERROR_ON_TENSORS_NOT_EVEN(...)
Implementation of a rectangular access pattern.
virtual Format format() const =0
Colour format of the image.
cl::Kernel create_kernel(const CLCompileContext &ctx, const std::string &kernel_name, const std::set< std::string > &build_opts=std::set< std::string >())
Creates an opencl kernel using a compile context.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Format
Image colour formats.
Class to describe a number of elements in each dimension.
Implementation of a row access pattern.
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.
ValidRegion intersect_valid_regions(const Ts &... regions)
Intersect multiple valid regions.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
IImage * plane(unsigned int index) override
Return a pointer to the requested plane of the image.
void configure(const ICLTensor *plane0, const ICLTensor *plane1, const ICLTensor *plane2, const ICLTensor *plane3, ICLTensor *output)
Configure function's inputs and outputs.
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)
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
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.
void add_2D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx...
Interface for OpenCL tensor.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
constexpr const Dimension & y() const
Alias to access the second dimension of the window.
Wrapper to configure the Khronos OpenCL C++ header.
unsigned int num_elems_processed_per_iteration
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Container for valid region of a window.
constexpr int end() const
Return the end of the dimension.
CLChannelCombineKernel()
Default constructor.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
Format format() const
Colour format of the image.
constexpr int start() const
Return the start of the dimension.
void run(const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue...
Describe a multidimensional execution window.
Coordinates anchor
Anchor for the start of the valid region.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
#define ARM_COMPUTE_ERROR_ON_TENSORS_NOT_SUBSAMPLED(...)
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
constexpr const Dimension & x() const
Alias to access the first dimension of the window.
const std::string & string_from_format(Format format)
Convert a tensor format into a string.