/* .y_chroma_shift = */ 0,
/* .depth = */ 8,
},
+ /* [PIX_FMT_YVYU422] = */ {
+ /* .format = */ PIX_FMT_YVYU422,
+ /* .name = */ "yvyu422",
+ /* .nb_channels = */ 1,
+ /* .color_type = */ FF_COLOR_YUV,
+ /* .pixel_type = */ FF_PIXEL_PACKED,
+ /* .is_alpha = */ 0,
+ /* .x_chroma_shift = */ 1,
+ /* .y_chroma_shift = */ 0,
+ /* .depth = */ 8,
+ },
/* [PIX_FMT_V308] = */ {
/* .format = */ PIX_FMT_V308,
/* .name = */ "v308",
switch (pix_fmt) {
case PIX_FMT_YUV422:
case PIX_FMT_UYVY422:
+ case PIX_FMT_YVYU422:
case PIX_FMT_RGB565:
case PIX_FMT_RGB555:
bits = 16;
switch (pix_fmt) {
case PIX_FMT_YUV422:
case PIX_FMT_UYVY422:
+ case PIX_FMT_YVYU422:
case PIX_FMT_RGB565:
case PIX_FMT_RGB555:
bits = 16;
}
}
+static void
+yvyu422_to_gray (AVPicture * dst, const AVPicture * src, int width, int height)
+{
+ const uint8_t *p, *p1;
+ uint8_t *lum, *lum1;
+ int w;
+
+ p1 = src->data[0];
+ lum1 = dst->data[0];
+ for (; height > 0; height--) {
+ p = p1;
+ lum = lum1;
+
+ for (w = width; w >= 2; w -= 2) {
+ lum[0] = p[0];
+ lum[1] = p[2];
+ p += 4;
+ lum += 2;
+ }
+ p1 += src->linesize[0];
+ lum1 += dst->linesize[0];
+ }
+}
+
+
+static void
+yvyu422_to_yuv420p (AVPicture * dst, const AVPicture * src,
+ int width, int height)
+{
+ const uint8_t *p, *p1;
+ uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
+ int w;
+
+ p1 = src->data[0];
+
+ lum1 = dst->data[0];
+ cb1 = dst->data[1];
+ cr1 = dst->data[2];
+
+ for (; height >= 1; height -= 2) {
+ p = p1;
+ lum = lum1;
+ cb = cb1;
+ cr = cr1;
+ for (w = width; w >= 2; w -= 2) {
+ lum[0] = p[0];
+ cb[0] = p[3];
+ lum[1] = p[2];
+ cr[0] = p[1];
+ p += 4;
+ lum += 2;
+ cb++;
+ cr++;
+ }
+ if (w) {
+ lum[0] = p[0];
+ cb[0] = p[3];
+ cr[0] = p[1];
+ cb++;
+ cr++;
+ }
+ p1 += src->linesize[0];
+ lum1 += dst->linesize[0];
+ if (height > 1) {
+ p = p1;
+ lum = lum1;
+ for (w = width; w >= 2; w -= 2) {
+ lum[0] = p[0];
+ lum[1] = p[2];
+ p += 4;
+ lum += 2;
+ }
+ if (w) {
+ lum[0] = p[0];
+ }
+ p1 += src->linesize[0];
+ lum1 += dst->linesize[0];
+ }
+ cb1 += dst->linesize[1];
+ cr1 += dst->linesize[2];
+ }
+}
+
+static void
+yvyu422_to_yuv422p (AVPicture * dst, const AVPicture * src,
+ int width, int height)
+{
+ const uint8_t *p, *p1;
+ uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
+ int w;
+
+ p1 = src->data[0];
+ lum1 = dst->data[0];
+ cb1 = dst->data[1];
+ cr1 = dst->data[2];
+ for (; height > 0; height--) {
+ p = p1;
+ lum = lum1;
+ cb = cb1;
+ cr = cr1;
+ for (w = width; w >= 2; w -= 2) {
+ lum[0] = p[0];
+ cb[0] = p[3];
+ lum[1] = p[2];
+ cr[0] = p[1];
+ p += 4;
+ lum += 2;
+ cb++;
+ cr++;
+ }
+ p1 += src->linesize[0];
+ lum1 += dst->linesize[0];
+ cb1 += dst->linesize[1];
+ cr1 += dst->linesize[2];
+ }
+}
static void
yuv422_to_yuv422p (AVPicture * dst, const AVPicture * src,
}
static void
+yuv422p_to_yvyu422 (AVPicture * dst, const AVPicture * src,
+ int width, int height)
+{
+ uint8_t *p, *p1;
+ const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
+ int w;
+
+ p1 = dst->data[0];
+ lum1 = src->data[0];
+ cb1 = src->data[1];
+ cr1 = src->data[2];
+ for (; height > 0; height--) {
+ p = p1;
+ lum = lum1;
+ cb = cb1;
+ cr = cr1;
+ for (w = width; w >= 2; w -= 2) {
+ p[0] = lum[0];
+ p[3] = cb[0];
+ p[2] = lum[1];
+ p[1] = cr[0];
+ p += 4;
+ lum += 2;
+ cb++;
+ cr++;
+ }
+ p1 += dst->linesize[0];
+ lum1 += src->linesize[0];
+ cb1 += src->linesize[1];
+ cr1 += src->linesize[2];
+ }
+}
+
+static void
uyvy411_to_yuv411p (AVPicture * dst, const AVPicture * src,
int width, int height)
{
}
}
-
static void
yuv420p_to_yuv422 (AVPicture * dst, const AVPicture * src,
int width, int height)
{PIX_FMT_YUV422P, PIX_FMT_YUV422, yuv422p_to_yuv422},
{PIX_FMT_YUV422P, PIX_FMT_UYVY422, yuv422p_to_uyvy422},
+ {PIX_FMT_YUV422P, PIX_FMT_YVYU422, yuv422p_to_yvyu422},
{PIX_FMT_YUV444P, PIX_FMT_RGB24, yuv444p_to_rgb24},
{PIX_FMT_UYVY422, PIX_FMT_YUV422P, uyvy422_to_yuv422p},
{PIX_FMT_UYVY422, PIX_FMT_GRAY8, uyvy422_to_gray},
+ {PIX_FMT_YVYU422, PIX_FMT_YUV420P, yvyu422_to_yuv420p},
+ {PIX_FMT_YVYU422, PIX_FMT_YUV422P, yvyu422_to_yuv422p},
+ {PIX_FMT_YVYU422, PIX_FMT_GRAY8, yvyu422_to_gray},
+
{PIX_FMT_RGB24, PIX_FMT_YUV420P, rgb24_to_yuv420p},
{PIX_FMT_RGB24, PIX_FMT_NV12, rgb24_to_nv12},
{PIX_FMT_RGB24, PIX_FMT_NV21, rgb24_to_nv21},
if (src_pix_fmt == PIX_FMT_YUV422 || dst_pix_fmt == PIX_FMT_YUV422) {
/* specific case: convert to YUV422P first */
int_pix_fmt = PIX_FMT_YUV422P;
- } else if (src_pix_fmt == PIX_FMT_UYVY422 || dst_pix_fmt == PIX_FMT_UYVY422) {
+ } else if (src_pix_fmt == PIX_FMT_UYVY422 || dst_pix_fmt == PIX_FMT_UYVY422 ||
+ src_pix_fmt == PIX_FMT_YVYU422 || dst_pix_fmt == PIX_FMT_YVYU422) {
/* specific case: convert to YUV422P first */
int_pix_fmt = PIX_FMT_YUV422P;
} else if (src_pix_fmt == PIX_FMT_UYVY411 || dst_pix_fmt == PIX_FMT_UYVY411) {