45 internal_init(width, height, format,
false);
50 internal_init(width, height, format,
true);
53 void CLMultiImage::internal_init(
unsigned int width,
unsigned int height,
Format format,
bool auto_padding)
84 std::get<0>(_plane).
allocator()->init(info_full);
98 std::get<0>(_plane).
allocator()->init(info);
99 std::get<1>(_plane).
allocator()->init(info_uv88);
112 std::get<0>(_plane).
allocator()->init(info);
113 std::get<1>(_plane).
allocator()->init(info_sub2);
114 std::get<2>(_plane).
allocator()->init(info_sub2);
118 std::get<0>(_plane).
allocator()->init(info);
119 std::get<1>(_plane).
allocator()->init(info);
120 std::get<2>(_plane).
allocator()->init(info);
127 _info.
init(shape.
x(), shape.
y(), format);
145 std::get<0>(_plane).
allocator()->allocate();
149 std::get<0>(_plane).
allocator()->allocate();
150 std::get<1>(_plane).
allocator()->allocate();
154 std::get<0>(_plane).
allocator()->allocate();
155 std::get<1>(_plane).
allocator()->allocate();
156 std::get<2>(_plane).
allocator()->allocate();
166 return &_plane[index];
171 return &_plane[index];
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
void init(unsigned int width, unsigned int height, Format format)
Init the multi-planar image.
const MultiImageInfo * info() const override
Interface to be implemented by the child class to return the multi-planar image's metadata...
CLMultiImage()
Constructor.
Store the multi-planar image's metadata.
void init_auto_padding(unsigned int width, unsigned int height, Format format)
Init the multi-planar image.
TensorShape calculate_subsampled_shape(const TensorShape &shape, Format format, Channel channel=Channel::UNKNOWN)
Calculate subsampled shape for a given format and channel.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
void init(unsigned int width, unsigned int height, Format format)
Initialize the metadata structure with the given parameters.
1 channel, 1 U8 per channel
1 channel, 1 F32 per channel
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
1 channel, 1 U16 per channel
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
bool auto_padding() override
Update the offset to the first element and the strides to automatically computed values.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
1 channel, 1 S32 per channel
T x() const
Alias to access the size of the first dimension.
3 channels, 1 U8 per channel
1 channel, 1 U32 per channel
Format
Image colour formats.
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
1 channel, 1 S16 per channel
TensorShape adjust_odd_shape(const TensorShape &shape, Format format)
Adjust tensor shape size if width or height are odd for a given multi-planar format.
input allocator() -> allocate()
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
4 channels, 1 U8 per channel
void allocate()
Allocated a previously initialised multi image.
2 channel, 1 U8 per channel
CLImage * cl_plane(unsigned int index) override
Return a pointer to the requested OpenCL plane of the image.
Store the tensor's metadata.
T y() const
Alias to access the size of the second dimension.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
Format format() const
Colour format of the image.
Basic implementation of the OpenCL tensor interface.