24 #ifndef ARM_COMPUTE_TEST_VALIDATION_COLOR_CONVERT_H 25 #define ARM_COMPUTE_TEST_VALIDATION_COLOR_CONVERT_H 33 namespace colorconvert_helper
58 int width = src.
shape().x();
59 int height = src.
shape().y();
61 for(
int y = 0; y < height; ++y)
63 for(
int x = 0; x < width; ++x)
68 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
69 auto *rvec_pixel =
reinterpret_cast<T *
>(rvec(vec_coord));
70 auto *gvec_pixel =
reinterpret_cast<T *
>(gvec(vec_coord));
71 auto *bvec_pixel =
reinterpret_cast<T *
>(bvec(vec_coord));
73 rvec_pixel[0] = src_pixel[0];
74 gvec_pixel[0] = src_pixel[1];
75 bvec_pixel[0] = src_pixel[2];
84 int width = rvec.
shape().x();
85 int height = rvec.
shape().y();
89 Coordinates uvec_coord{ uvec_coord_x, uvec_coord_y };
91 for(
int y = 0; y < height; ++y)
93 for(
int x = 0; x < width; x += 2)
96 auto *yvec_pixel =
reinterpret_cast<T *
>(yvec(coord));
97 auto *uvec_top_pixel =
reinterpret_cast<T *
>(uvec_top(uvec_coord));
98 auto *uvec_bottom_pixel =
reinterpret_cast<T *
>(uvec_bottom(uvec_coord));
99 auto *vvec_top_pixel =
reinterpret_cast<T *
>(vvec_top(uvec_coord));
100 auto *vvec_bottom_pixel =
reinterpret_cast<T *
>(vvec_bottom(uvec_coord));
106 float result = rvec_val * rgb2yuv_bt709_kr + gvec_val * rgb2yuv_bt709_kg + bvec_val *
rgb2yuv_bt709_kb;
108 yvec_pixel[0] = result;
109 uvec_top_pixel[0] = (bvec_val - result) * rgb2yuv_bt709_cu + 128.f;
110 vvec_top_pixel[0] = (rvec_val - result) * rgb2yuv_bt709_cv + 128.f;
116 result = rvec_val * rgb2yuv_bt709_kr + gvec_val * rgb2yuv_bt709_kg + bvec_val *
rgb2yuv_bt709_kb;
118 yvec_pixel[1] = result;
119 uvec_bottom_pixel[0] = (bvec_val - result) * rgb2yuv_bt709_cu + 128.f;
120 vvec_bottom_pixel[0] = (rvec_val - result) * rgb2yuv_bt709_cv + 128.f;
122 uvec_coord.set(0, ++uvec_coord_x);
126 inline float compute_rgb_value(
int y_value,
int v_value,
int u_value,
unsigned char channel_idx)
133 const float red = (v_value - 128.f) * red_coef_bt709;
134 result = y_value + red;
139 const float green = (u_value - 128.f) * green_coef_bt709 + (v_value - 128.f) *
green_coef2_bt709;
140 result = y_value + green;
145 const float blue = (u_value - 128.f) * blue_coef_bt709;
146 result = y_value + blue;
155 return std::min(std::max(0.f, result), 255.f);
158 template <
typename T>
161 const int dst_width = dst.
shape().x();
162 const int dst_height = dst.
shape().y();
163 for(
int y = 0; y < dst_height; ++y)
166 for(
int x = 0; x < dst_width; x += 2, ++x_coord)
169 auto *dst_pixel =
reinterpret_cast<T *
>(
dst(dst_coord));
170 const T border_value(0);
176 for(
int channel_idx = 0; channel_idx < dst.
num_channels(); ++channel_idx)
178 const float channel_value =
compute_rgb_value(yvec_val, vvec_val, uvec_val, channel_idx);
179 dst_pixel[channel_idx] = channel_value;
186 dst_pixel =
reinterpret_cast<T *
>(
dst(dst_coord2));
187 for(
int channel_idx = 0; channel_idx < dst.
num_channels(); ++channel_idx)
189 const float channel_value =
compute_rgb_value(yyvec_val, vvec_val, uvec_val, channel_idx);
190 dst_pixel[channel_idx] = channel_value;
196 template <
typename T>
199 for(
int channel_idx = 0; channel_idx < dst.
num_channels(); ++channel_idx)
201 const int width = dst.
shape().x();
202 const int height = dst.
shape().y();
204 for(
int y = 0; y < height; ++y)
206 for(
int x = 0; x < width; ++x)
211 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
212 auto *dst_pixel =
reinterpret_cast<T *
>(
dst(dst_coord));
215 dst_pixel[channel_idx] = 255;
219 dst_pixel[channel_idx] = src_pixel[channel_idx];
225 template <
typename T>
228 const int width = dst.
shape().x();
229 const int height = dst.
shape().y();
231 for(
int y = 0; y < height; ++y)
233 for(
int x = 0; x < width; ++x)
238 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
239 auto *dst_pixel =
reinterpret_cast<T *
>(
dst(dst_coord));
241 const float result = rgb2u8_red_coef * src_pixel[0] + rgb2u8_green_coef * src_pixel[1] + rgb2u8_blue_coef * src_pixel[2];
243 dst_pixel[0] = utility::clamp<float>(result, 0, 255);
248 template <
typename T>
251 for(
int channel_idx = 0; channel_idx < dst.
num_channels(); ++channel_idx)
253 const int width = dst.
shape().x();
254 const int height = dst.
shape().y();
256 for(
int y = 0; y < height; ++y)
258 for(
int x = 0; x < width; ++x)
263 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
264 auto *dst_pixel =
reinterpret_cast<T *
>(
dst(dst_coord));
266 dst_pixel[channel_idx] = src_pixel[channel_idx];
272 template <
typename T>
284 const int width = yvec.shape().
x();
285 const int height = yvec.shape().y();
287 for(
int y = 0; y < height; ++y)
289 for(
int x = 0; x < width; ++x)
292 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
293 auto *yvec_pixel =
reinterpret_cast<T *
>(yvec(elem_coord));
294 auto *uvec_pixel =
reinterpret_cast<T *
>(uvec(elem_coord));
295 auto *yyvec_pixel =
reinterpret_cast<T *
>(yyvec(elem_coord));
296 auto *vvec_pixel =
reinterpret_cast<T *
>(vvec(elem_coord));
297 yvec_pixel[x] = src_pixel[0 +
offset];
298 uvec_pixel[x] = src_pixel[1 -
offset];
299 yyvec_pixel[x] = src_pixel[2 +
offset];
300 vvec_pixel[x] = src_pixel[3 -
offset];
302 elem_coord.set(1, y + 1);
308 template <
typename T>
317 const int yvec_width = yvec.shape().
x();
318 const int yvec_height = yvec.shape().y();
320 for(
int y = 0; y < yvec_height; ++y)
322 for(
int x = 0; x < yvec_width; ++x)
325 const auto *src_pixel =
reinterpret_cast<const T *
>(tensor_planes[0](src_coord));
326 auto *yvec_pixel =
reinterpret_cast<T *
>(yvec(elem_coord));
327 auto *yyvec_pixel =
reinterpret_cast<T *
>(yyvec(elem_coord));
328 yvec_pixel[x] = src_pixel[x];
329 yyvec_pixel[x] = src_pixel[x + 1];
331 elem_coord.
set(1, y + 1);
334 const int uvec_width = uvec.shape().x();
335 const int uvec_height = uvec.shape().y();
339 for(
int y = 0; y < uvec_height; y += 2)
341 for(
int x = 0; x < uvec_width; ++x)
344 const auto *u_pixel =
reinterpret_cast<const T *
>(tensor_planes[1](src_coord));
345 const auto *v_pixel =
reinterpret_cast<const T *
>(tensor_planes[2](src_coord));
346 auto *uvec_pixel_top =
reinterpret_cast<T *
>(uvec(top_elem_coord));
347 auto *vvec_pixel_top =
reinterpret_cast<T *
>(vvec(top_elem_coord));
349 auto *uvec_pixel_bottom =
reinterpret_cast<T *
>(uvec(bottom_elem_coord));
350 auto *vvec_pixel_bottom =
reinterpret_cast<T *
>(vvec(bottom_elem_coord));
351 uvec_pixel_top[x] = u_pixel[0];
352 vvec_pixel_top[x] = v_pixel[0];
353 uvec_pixel_bottom[x] = u_pixel[0];
354 vvec_pixel_bottom[x] = v_pixel[0];
356 top_elem_coord.
set(1, y + 2);
357 bottom_elem_coord.set(1, top_elem_coord.y() + 1);
363 template <
typename T>
374 const int yvec_width = yvec.shape().
x();
375 const int yvec_height = yvec.shape().y();
377 for(
int y = 0; y < yvec_height; ++y)
379 for(
int x = 0; x < yvec_width; ++x)
382 const auto *src_pixel =
reinterpret_cast<const T *
>(tensor_planes[0](src_coord));
383 auto *yvec_pixel =
reinterpret_cast<T *
>(yvec(elem_coord));
384 auto *yyvec_pixel =
reinterpret_cast<T *
>(yyvec(elem_coord));
385 yvec_pixel[x] = src_pixel[x];
386 yyvec_pixel[x] = src_pixel[x + 1];
388 elem_coord.
set(1, y + 1);
391 const int uvec_width = uvec.shape().x();
392 const int uvec_height = uvec.shape().y();
396 for(
int y = 0; y < uvec_height; y += 2)
398 for(
int x = 0; x < uvec_width; ++x)
401 const auto *src_pixel =
reinterpret_cast<const T *
>(tensor_planes[1](src_coord));
402 auto *uvec_pixel_top =
reinterpret_cast<T *
>(uvec(top_elem_coord));
403 auto *vvec_pixel_top =
reinterpret_cast<T *
>(vvec(top_elem_coord));
405 auto *uvec_pixel_bottom =
reinterpret_cast<T *
>(uvec(bottom_elem_coord));
406 auto *vvec_pixel_bottom =
reinterpret_cast<T *
>(vvec(bottom_elem_coord));
407 uvec_pixel_top[x] = src_pixel[0 +
offset];
408 vvec_pixel_top[x] = src_pixel[1 -
offset];
409 uvec_pixel_bottom[x] = src_pixel[0 +
offset];
410 vvec_pixel_bottom[x] = src_pixel[1 -
offset];
412 top_elem_coord.
set(1, y + 2);
413 bottom_elem_coord.set(1, top_elem_coord.y() + 1);
419 template <
typename T>
427 int vec_shape_x = src.
shape().x() * src.
shape().y();
440 uint32_t utmp_width = utmp.
shape().
x();
441 uint32_t utmp_height = utmp.shape().y();
443 uint32_t uvec_coord_x = 0;
444 uint32_t uvec_coord_y = 0;
445 Coordinates uvec_coord{ uvec_coord_x, uvec_coord_y };
446 for(uint32_t y = 0; y < utmp_height; y++)
448 for(uint32_t x = 0; x < utmp_width; x++)
451 auto *utmp_pixel =
reinterpret_cast<T *
>(utmp(coord));
452 auto *vtmp_pixel =
reinterpret_cast<T *
>(vtmp(coord));
460 utmp_pixel[0] = std::ceil(
float(uvec_top_val + uvec_bottom_val) / 2);
461 vtmp_pixel[0] = std::ceil(
float(vvec_top_val + vvec_bottom_val) / 2);
463 uvec_coord.set(0, ++uvec_coord_x);
467 uint32_t second_plane_x =
dst[1].shape().x();
468 uint32_t second_plane_y =
dst[1].shape().y();
470 uint32_t utmp_coord_x = 0;
471 uint32_t utmp_coord_y = 0;
473 for(uint32_t y = 0; y < second_plane_y; y++)
475 for(uint32_t x = 0; x < second_plane_x; x++)
478 Coordinates utmp_top_coord{ utmp_coord_x, utmp_coord_y };
479 Coordinates utmp_bottom_coord{ utmp_coord_x, utmp_coord_y + 1 };
481 auto *dst_pixel =
reinterpret_cast<T *
>(
dst[1](coord));
487 int result = (utmp_top_val + utmp_bottom_val) / 2;
488 dst_pixel[0] = result;
493 result = (vtmp_top_val + vtmp_bottom_val) / 2;
494 dst_pixel[1] = result;
498 if(utmp_coord_x >= utmp_width)
507 template <
typename T>
515 int vec_shape_x = src.
shape().x() * src.
shape().y();
527 uint32_t utmp_width = utmp.
shape().
x();
528 uint32_t utmp_height = utmp.shape().y();
530 uint32_t uvec_coord_x = 0;
531 uint32_t uvec_coord_y = 0;
532 Coordinates uvec_coord{ uvec_coord_x, uvec_coord_y };
533 for(uint32_t y = 0; y < utmp_height; y++)
535 for(uint32_t x = 0; x < utmp_width; x++)
538 auto *utmp_pixel =
reinterpret_cast<T *
>(utmp(coord));
539 auto *vtmp_pixel =
reinterpret_cast<T *
>(vtmp(coord));
547 utmp_pixel[0] = std::ceil(
float(uvec_top_val + uvec_bottom_val) / 2);
548 vtmp_pixel[0] = std::ceil(
float(vvec_top_val + vvec_bottom_val) / 2);
550 uvec_coord.set(0, ++uvec_coord_x);
554 uint32_t second_plane_x =
dst[1].shape().x();
555 uint32_t second_plane_y =
dst[1].shape().y();
557 uint32_t utmp_coord_x = 0;
558 uint32_t utmp_coord_y = 0;
560 for(uint32_t y = 0; y < second_plane_y; y++)
562 for(uint32_t x = 0; x < second_plane_x; x++)
565 Coordinates utmp_top_coord{ utmp_coord_x, utmp_coord_y };
566 Coordinates utmp_bottom_coord{ utmp_coord_x, utmp_coord_y + 1 };
568 auto *u_pixel =
reinterpret_cast<T *
>(
dst[1](coord));
569 auto *v_pixel =
reinterpret_cast<T *
>(
dst[2](coord));
575 int result = (utmp_top_val + utmp_bottom_val) / 2;
581 result = (vtmp_top_val + vtmp_bottom_val) / 2;
586 if(utmp_coord_x >= utmp_width)
595 template <
typename T>
603 int vec_shape_x = src.
shape().x() * src.
shape().y();
610 int width = src.
shape().x();
611 int height = src.
shape().y();
618 for(
int y = 0; y < height; y++)
620 for(
int x = 0; x < width; x += 2)
623 auto *plane_1_pixel =
reinterpret_cast<T *
>(
dst[1](coord));
624 auto *plane_2_pixel =
reinterpret_cast<T *
>(
dst[2](coord));
630 plane_1_pixel[0] = uvec_top_val;
631 plane_1_pixel[1] = uvec_bottom_val;
636 plane_2_pixel[0] = vvec_top_val;
637 plane_2_pixel[1] = vvec_bottom_val;
639 uvec_coord.increment(0);
644 template <
typename T>
652 int width =
dst[0].shape().x();
653 int height =
dst[0].shape().y();
655 for(
int y = 0; y < height; ++y)
657 for(
int x = 0; x < width; x++)
662 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(dst_coord));
663 auto *y_pixel =
reinterpret_cast<T *
>(
dst[0](dst_coord));
664 auto *uvvec_top_pixel =
reinterpret_cast<T *
>(uvvec_top(uv_coord));
665 auto *uvvec_bottom_pixel =
reinterpret_cast<T *
>(uvvec_bottom(uv_coord));
667 y_pixel[0] = src_pixel[0 +
offset];
671 uvvec_top_pixel[0] = src_pixel[1 -
offset];
675 uvvec_bottom_pixel[0] = src_pixel[1 -
offset];
680 width =
dst[1].shape().x();
681 height =
dst[1].shape().y();
686 for(
int y = 0; y < height; ++y)
688 for(
int x = 0; x < width; x++)
691 const Coordinates uv_coord{ uv_coord_x, uv_coord_y };
693 auto *uv_pixel =
reinterpret_cast<T *
>(
dst[1](dst_coord));
694 const auto *uvvec_top_pixel =
reinterpret_cast<T *
>(uvvec_top(uv_coord));
695 const auto *uvvec_bottom_pixel =
reinterpret_cast<T *
>(uvvec_bottom(uv_coord));
697 uv_pixel[0] = (uvvec_top_pixel[0] + uvvec_bottom_pixel[0]) / 2;
698 uv_pixel[1] = (uvvec_top_pixel[1] + uvvec_bottom_pixel[1]) / 2;
706 template <
typename T>
714 int width =
dst[0].shape().x();
715 int height =
dst[0].shape().y();
717 for(
int y = 0; y < height; ++y)
719 for(
int x = 0; x < width; x++)
724 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(dst_coord));
725 auto *y_pixel =
reinterpret_cast<T *
>(
dst[0](dst_coord));
726 auto *uvvec_top_pixel =
reinterpret_cast<T *
>(uvvec_top(uv_coord));
727 auto *uvvec_bottom_pixel =
reinterpret_cast<T *
>(uvvec_bottom(uv_coord));
729 y_pixel[0] = src_pixel[0 +
offset];
733 uvvec_top_pixel[0] = src_pixel[1 -
offset];
737 uvvec_bottom_pixel[0] = src_pixel[1 -
offset];
742 width =
dst[1].shape().x();
743 height =
dst[1].shape().y();
748 for(
int y = 0; y < height; ++y)
750 for(
int x = 0; x < width; x++)
753 const Coordinates uv_coord{ uv_coord_x, uv_coord_y };
755 auto *u_pixel =
reinterpret_cast<T *
>(
dst[1](dst_coord));
756 auto *v_pixel =
reinterpret_cast<T *
>(
dst[2](dst_coord));
757 const auto *uvvec_top_pixel =
reinterpret_cast<T *
>(uvvec_top(uv_coord));
758 const auto *uvvec_bottom_pixel =
reinterpret_cast<T *
>(uvvec_bottom(uv_coord));
760 u_pixel[0] = (uvvec_top_pixel[0] + uvvec_bottom_pixel[0]) / 2;
761 v_pixel[0] = (uvvec_top_pixel[1] + uvvec_bottom_pixel[1]) / 2;
769 template <
typename T>
772 int width = src.
shape().x();
773 int height = src.
shape().y();
777 for(
int y = 0; y < height; ++y)
779 for(
int x = 0; x < width; x++)
782 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
783 auto *u_pixel =
reinterpret_cast<T *
>(nv1(src_coord));
784 auto *v_pixel =
reinterpret_cast<T *
>(nv2(src_coord));
786 u_pixel[0] = src_pixel[1 -
offset];
787 v_pixel[0] = src_pixel[0 +
offset];
792 template <
typename T>
795 int width = src.
shape().x();
796 int height = src.
shape().y();
800 for(
int y = 0; y < height; ++y)
802 for(
int x = 0; x < width; x++)
806 const auto *src_pixel =
reinterpret_cast<const T *
>(
src(src_coord));
807 auto *u_pixel =
reinterpret_cast<T *
>(nv1(dst_coord));
808 auto *v_pixel =
reinterpret_cast<T *
>(nv2(dst_coord));
810 u_pixel[0] = src_pixel[1 -
offset];
811 u_pixel[1] = src_pixel[1 -
offset];
813 v_pixel[0] = src_pixel[0 +
offset];
814 v_pixel[1] = src_pixel[0 +
offset];
816 dst_coord.
set(1, y * 2 + 1);
817 u_pixel =
reinterpret_cast<T *
>(nv1(dst_coord));
818 v_pixel =
reinterpret_cast<T *
>(nv2(dst_coord));
819 u_pixel[0] = src_pixel[1 -
offset];
820 u_pixel[1] = src_pixel[1 -
offset];
822 v_pixel[0] = src_pixel[0 +
offset];
823 v_pixel[1] = src_pixel[0 +
offset];
828 template <
typename T>
831 int width =
dst[0].shape().x();
832 int height =
dst[0].shape().y();
834 for(
int y = 0; y < height; ++y)
836 for(
int x = 0; x < width; ++x)
840 const auto *src_pixel =
reinterpret_cast<const T *
>(
src[0](dst_coord));
841 auto *y_pixel =
reinterpret_cast<T *
>(
dst[0](dst_coord));
843 y_pixel[0] = src_pixel[0];
850 template <
typename T>
853 int width =
dst[0].shape().x();
854 int height =
dst[0].shape().y();
856 for(
int y = 0; y < height; ++y)
858 for(
int x = 0; x < width; ++x)
862 const auto *src_pixel =
reinterpret_cast<const T *
>(
src[0](dst_coord));
863 auto *y_pixel =
reinterpret_cast<T *
>(
dst[0](dst_coord));
865 y_pixel[0] = src_pixel[0];
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
void store_rgb_from_src(const SimpleTensor< T > src, SimpleTensor< T > &rvec, SimpleTensor< T > &gvec, SimpleTensor< T > &bvec)
float compute_rgb_value(int y_value, int v_value, int u_value, unsigned char channel_idx)
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
T tensor_elem_at(const SimpleTensor< T > &src, Coordinates coord, BorderMode border_mode, T constant_border_value)
constexpr float blue_coef_bt709
void colorconvert_yuyv_to_iyuv(const SimpleTensor< T > src, const Format format, std::vector< SimpleTensor< T >> &dst)
constexpr float green_coef_bt709
void colorconvert_nv_to_iyuv(const std::vector< SimpleTensor< T >> src, const Format src_format, std::vector< SimpleTensor< T >> &dst)
void nv_to_yuv4(const SimpleTensor< T > src, const Format src_format, SimpleTensor< T > &nv1, SimpleTensor< T > &nv2)
void colorconvert_yuyv_to_nv12(const SimpleTensor< T > src, const Format format, std::vector< SimpleTensor< T >> &dst)
1 channel, 1 U8 per channel
void colorconvert_yuyv_to_rgb(const SimpleTensor< T > src, const Format format, SimpleTensor< T > &dst)
constexpr float rgb2yuv_bt709_kr
constexpr float rgb2yuv_bt709_kg
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
void colorconvert_nv_to_yuv4(const std::vector< SimpleTensor< T >> src, const Format src_format, std::vector< SimpleTensor< T >> &dst)
void colorconvert_iyuv_to_rgb(const std::vector< SimpleTensor< T >> &tensor_planes, SimpleTensor< T > &dst)
TensorShape shape() const override
Shape of the tensor.
constexpr float rgb2u8_red_coef
constexpr float green_coef2_bt709
void nv_to_iyuv(const SimpleTensor< T > src, const Format src_format, SimpleTensor< T > &nv1, SimpleTensor< T > &nv2)
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
T x() const
Alias to access the size of the first dimension.
void yuyv_to_rgb_calculation(const SimpleTensor< T > yvec, const SimpleTensor< T > vvec, const SimpleTensor< T > yyvec, const SimpleTensor< T > uvec, SimpleTensor< T > &dst)
constexpr float rgb2u8_blue_coef
void colorconvert_rgb_to_nv12(const SimpleTensor< T > src, std::vector< SimpleTensor< T >> &dst)
constexpr float red_coef_bt709
void colorconvert_rgbx_to_rgb(const SimpleTensor< T > src, SimpleTensor< T > &dst)
Format
Image colour formats.
void rgb_to_yuv_calculation(const SimpleTensor< T > rvec, const SimpleTensor< T > gvec, const SimpleTensor< T > bvec, SimpleTensor< T > &yvec, SimpleTensor< T > &uvec_top, SimpleTensor< T > &uvec_bottom, SimpleTensor< T > &vvec_top, SimpleTensor< T > &vvec_bottom)
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_channels() const override
Number of channels of the tensor.
void colorconvert_rgb_to_u8(const SimpleTensor< T > src, SimpleTensor< T > &dst)
constexpr float rgb2u8_green_coef
void colorconvert_rgb_to_rgbx(const SimpleTensor< T > src, SimpleTensor< T > &dst)
void colorconvert_rgb_to_iyuv(const SimpleTensor< T > src, std::vector< SimpleTensor< T >> &dst)
void colorconvert_nv12_to_rgb(const Format format, const std::vector< SimpleTensor< T >> &tensor_planes, SimpleTensor< T > &dst)
void colorconvert_rgb_to_yuv4(const SimpleTensor< T > src, std::vector< SimpleTensor< T >> &dst)
constexpr float rgb2yuv_bt709_cv
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
constexpr float rgb2yuv_bt709_cu
constexpr float rgb2yuv_bt709_kb