Skip to content

Commit b9487fa

Browse files
committed
add vc_copylineVUYAtoY416
This allows indirect conversion of 8-bit YUV 4:4:4 at least to Y416 for displays that do not support VUYA directly over VUYA. Previously, due to limited set of conversions from yuv444p and to Y416 it was UYVY, which decimated the subsampling to 4:2:2.
1 parent f7a1504 commit b9487fa

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/pixfmt_conv.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,27 @@ static void vc_copylineUYVYtoY416(unsigned char * __restrict dst, const unsigned
26532653
}
26542654
}
26552655

2656+
static void
2657+
vc_copylineVUYAtoY416(unsigned char *__restrict dst,
2658+
const unsigned char *__restrict src, int dst_len,
2659+
int rshift, int gshift, int bshift)
2660+
{
2661+
(void) rshift, (void) gshift, (void) bshift;
2662+
const int dst_bs = get_pf_block_bytes(Y416); // 8
2663+
while (dst_len > dst_bs - 1) {
2664+
*dst++ = 0;
2665+
*dst++ = src[1]; // U
2666+
*dst++ = 0;
2667+
*dst++ = src[2]; // Y
2668+
*dst++ = 0;
2669+
*dst++ = src[0]; // V
2670+
*dst++ = 0;
2671+
*dst++ = src[3]; // A
2672+
src += 4;
2673+
dst_len -= dst_bs;
2674+
}
2675+
}
2676+
26562677
static void vc_copylineY216toUYVY(unsigned char * __restrict dst, const unsigned char * __restrict src, int dst_len, int rshift,
26572678
int gshift, int bshift)
26582679
{
@@ -3012,6 +3033,7 @@ static const struct decoder_item decoders[] = {
30123033
{ vc_copylineUYVYtoV210, UYVY, v210 },
30133034
{ vc_copylineUYVYtoY216, UYVY, Y216 },
30143035
{ vc_copylineUYVYtoY416, UYVY, Y416 },
3036+
{ vc_copylineVUYAtoY416, VUYA, Y416 },
30153037
{ vc_copylineY216toUYVY, Y216, UYVY },
30163038
{ vc_copylineY216toV210, Y216, v210 },
30173039
{ vc_copylineY416toUYVY, Y416, UYVY },

0 commit comments

Comments
 (0)