xrt: Rename XRT_FORMAT_YUV422 to XRT_FORMAT_YUYV422

This commit is contained in:
Jakob Bornecrantz 2020-04-24 17:48:42 +01:00 committed by Jakob Bornecrantz
parent a8941859d7
commit 59b7794172
7 changed files with 26 additions and 26 deletions

View file

@ -1183,7 +1183,7 @@ t_calibration_frame(struct xrt_frame_sink *xsink, struct xrt_frame *xf)
// Fill both c.gui.rgb and c.gray with the data we got.
switch (xf->format) {
case XRT_FORMAT_YUV888: process_frame_yuv(c, xf); break;
case XRT_FORMAT_YUV422: process_frame_yuyv(c, xf); break;
case XRT_FORMAT_YUYV422: process_frame_yuyv(c, xf); break;
case XRT_FORMAT_L8: process_frame_l8(c, xf); break;
default:
P("ERROR: Bad format '%s'", u_format_str(xf->format));

View file

@ -134,7 +134,7 @@ process_frame(class DebugHSVPicker &d, struct xrt_frame *xf)
switch (xf->format) {
case XRT_FORMAT_YUV888: process_frame_yuv(d, xf); break;
case XRT_FORMAT_YUV422: process_frame_yuyv(d, xf); break;
case XRT_FORMAT_YUYV422: process_frame_yuyv(d, xf); break;
default:
fprintf(stderr, "ERROR: Bad format '%s'",
u_format_str(xf->format));

View file

@ -297,7 +297,7 @@ push_frame(struct xrt_frame_sink *xsink, struct xrt_frame *xf)
ensure_buf_allocated(f, xf);
process_frame_yuv(f, xf);
break;
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
ensure_buf_allocated(f, xf);
process_frame_yuyv(f, xf);
break;

View file

@ -25,7 +25,7 @@ u_format_str(enum xrt_format f)
case XRT_FORMAT_BITMAP_8X1: return "XRT_FORMAT_BITMAP_8X1";
case XRT_FORMAT_BITMAP_8X8: return "XRT_FORMAT_BITMAP_8X8";
case XRT_FORMAT_YUV888: return "XRT_FORMAT_YUV888";
case XRT_FORMAT_YUV422: return "XRT_FORMAT_YUV422";
case XRT_FORMAT_YUYV422: return "XRT_FORMAT_YUYV422";
case XRT_FORMAT_MJPEG: return "XRT_FORMAT_MJPEG";
default: assert(!"unsupported format"); return 0;
}
@ -44,7 +44,7 @@ u_format_is_blocks(enum xrt_format f)
case XRT_FORMAT_BITMAP_8X1:
case XRT_FORMAT_BITMAP_8X8:
case XRT_FORMAT_YUV888:
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
// Yes
return true;
case XRT_FORMAT_MJPEG:
@ -67,7 +67,7 @@ u_format_block_width(enum xrt_format f)
case XRT_FORMAT_YUV888:
// Regular one pixel per block formats.
return 1;
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
// Two pixels per block.
return 2;
case XRT_FORMAT_BITMAP_8X8:
@ -90,7 +90,7 @@ u_format_block_height(enum xrt_format f)
case XRT_FORMAT_L8:
case XRT_FORMAT_BITMAP_8X1:
case XRT_FORMAT_YUV888:
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
// One pixel high.
return 1;
case XRT_FORMAT_BITMAP_8X8:
@ -118,7 +118,7 @@ u_format_block_size(enum xrt_format f)
return 3;
case XRT_FORMAT_R8G8B8X8:
case XRT_FORMAT_R8G8B8A8:
case XRT_FORMAT_YUV422: // Four bytes per two pixels.
case XRT_FORMAT_YUYV422: // Four bytes per two pixels.
// 32bit pixel formats.
return 4;
case XRT_FORMAT_BITMAP_8X8: // 64 bits.

View file

@ -98,7 +98,7 @@ generate_lookup_YUV_to_RGBX()
#endif
inline static void
YUV422_to_R8G8B8X8(const uint8_t *input, uint32_t *rgb1, uint32_t *rgb2)
YUYV422_to_R8G8B8X8(const uint8_t *input, uint32_t *rgb1, uint32_t *rgb2)
{
uint8_t y0 = input[0];
uint8_t u = input[1];
@ -115,7 +115,7 @@ YUV422_to_R8G8B8X8(const uint8_t *input, uint32_t *rgb1, uint32_t *rgb2)
}
inline static void
YUV422_to_R8G8B8(const uint8_t *input, uint8_t *dst)
YUYV422_to_R8G8B8(const uint8_t *input, uint8_t *dst)
{
uint8_t y0 = input[0];
uint8_t u = input[1];
@ -160,11 +160,11 @@ YUV444_to_R8G8B8(const uint8_t *input, uint8_t *dst)
}
static void
from_YUV422_to_R8G8B8(struct u_sink_converter *s,
uint32_t w,
uint32_t h,
size_t stride,
const uint8_t *data)
from_YUYV422_to_R8G8B8(struct u_sink_converter *s,
uint32_t w,
uint32_t h,
size_t stride,
const uint8_t *data)
{
for (uint32_t y = 0; y < h; y++) {
for (uint32_t x = 0; x < w; x += 2) {
@ -173,7 +173,7 @@ from_YUV422_to_R8G8B8(struct u_sink_converter *s,
src = src + (y * stride) + (x * 2);
dst = dst + (y * s->frame->stride) + (x * 3);
YUV422_to_R8G8B8(src, dst);
YUYV422_to_R8G8B8(src, dst);
}
}
}
@ -355,10 +355,10 @@ receive_frame_r8g8b8_or_l8(struct xrt_frame_sink *xs, struct xrt_frame *xf)
case XRT_FORMAT_R8G8B8:
s->downstream->push_frame(s->downstream, xf);
return;
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
ensure_data(s, XRT_FORMAT_R8G8B8, xf->width, xf->height);
from_YUV422_to_R8G8B8(s, xf->width, xf->height, xf->stride,
xf->data);
from_YUYV422_to_R8G8B8(s, xf->width, xf->height, xf->stride,
xf->data);
break;
case XRT_FORMAT_YUV888:
ensure_data(s, XRT_FORMAT_R8G8B8, xf->width, xf->height);
@ -392,10 +392,10 @@ receive_frame_r8g8b8(struct xrt_frame_sink *xs, struct xrt_frame *xf)
case XRT_FORMAT_R8G8B8:
s->downstream->push_frame(s->downstream, xf);
return;
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
ensure_data(s, XRT_FORMAT_R8G8B8, xf->width, xf->height);
from_YUV422_to_R8G8B8(s, xf->width, xf->height, xf->stride,
xf->data);
from_YUYV422_to_R8G8B8(s, xf->width, xf->height, xf->stride,
xf->data);
break;
case XRT_FORMAT_YUV888:
ensure_data(s, XRT_FORMAT_R8G8B8, xf->width, xf->height);
@ -427,7 +427,7 @@ receive_frame_yuv_yuyv_or_l8(struct xrt_frame_sink *xs, struct xrt_frame *xf)
switch (xf->format) {
case XRT_FORMAT_L8:
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
case XRT_FORMAT_YUV888:
s->downstream->push_frame(s->downstream, xf);
return;
@ -457,7 +457,7 @@ receive_frame_yuv_or_yuyv(struct xrt_frame_sink *xs, struct xrt_frame *xf)
switch (xf->format) {
case XRT_FORMAT_YUV422:
case XRT_FORMAT_YUYV422:
case XRT_FORMAT_YUV888:
s->downstream->push_frame(s->downstream, xf);
return;

View file

@ -489,7 +489,7 @@ v4l2_list_modes_size(struct v4l2_fs *vid,
enum xrt_format format = (enum xrt_format)0;
switch (interval.pixel_format) {
case V4L2_PIX_FMT_YUYV: format = XRT_FORMAT_YUV422; break;
case V4L2_PIX_FMT_YUYV: format = XRT_FORMAT_YUYV422; break;
case V4L2_PIX_FMT_MJPEG: format = XRT_FORMAT_MJPEG; break;
default: V_ERROR(vid, "error: Format not supported."); return;
}

View file

@ -72,7 +72,7 @@ enum xrt_format
XRT_FORMAT_BITMAP_8X8, // One bit format tiled in 8X8 blocks.
XRT_FORMAT_YUV888,
XRT_FORMAT_YUV422,
XRT_FORMAT_YUYV422,
XRT_FORMAT_MJPEG,
};