added vc_copylineV210toY416

+ fixed description of v210 codec in types.h
This commit is contained in:
Martin Pulec
2022-10-17 15:01:53 +02:00
parent 2b8ab0f82b
commit 2d69e343ac
2 changed files with 52 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ typedef enum {
YUYV, ///< YCbCr 422 8-bit - Y0 Cb Y1 Cr
R10k, ///< RGB 10-bit packed - RGBX, big-endian (2 bit padding)
R12L, ///< RGB 12-bit packed, little-endian
v210, ///< YCbCr 422 10-bit - UYVX|YUYX|VYUX|YVYX, little-endian (2 bit padding), line aligned to 128 B
v210, ///< YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/), line aligned to 128 B
DVS10, ///< DVS 10-bit format
DXT1, ///< S3 Texture Compression DXT1
DXT1_YUV, ///< Structure same as DXT1, instead of RGB, YCbCr values are stored

View File

@@ -2747,6 +2747,56 @@ static void vc_copylineV210toY216(unsigned char * __restrict dst, const unsigned
}
}
static void vc_copylineV210toY416(unsigned char * __restrict dst, const unsigned char * __restrict src, int dst_len, int rshift,
int gshift, int bshift)
{
UNUSED(rshift);
UNUSED(gshift);
UNUSED(bshift);
assert((uintptr_t) dst % 2 == 0);
assert((uintptr_t) src % 4 == 0);
OPTIMIZED_FOR (int x = 0; x < dst_len / 48; ++x) {
const uint32_t *s = (const void *) (src + x * 16);
uint16_t *d = (void *) (dst + x * 48);
uint16_t u, v;
uint32_t tmp;
tmp = *s++;
u = (tmp & 0x3FFU) << 6U;
*d++ = u; // 1 U
*d++ = ((tmp >> 10U) & 0x3FFU) << 6U; // Y
v = ((tmp >> 20U) & 0x3FFU) << 6U;
*d++ = v; // V
*d++ = 0xFFFFU; // A
*d++ = u; // 2 U
tmp = *s++;
*d++ = (tmp & 0x3FFU) << 6U; // Y
*d++ = v; // V
*d++ = 0xFFFFU; // A
u = ((tmp >> 10U) & 0x3FFU) << 6U;
*d++ = u; // 3 U
*d++ = ((tmp >> 20U) & 0x3FFU) << 6U; // Y
tmp = *s++;
v = (tmp & 0x3FFU) << 6U;
*d++ = v; // V
*d++ = 0xFFFFU; // A
*d++ = u; // 4 U
*d++ = ((tmp >> 10U) & 0x3FFU) << 6U; // Y
*d++ = v; // V
*d++ = 0xFFFFU; // A
u = ((tmp >> 20U) & 0x3FFU) << 6U;
*d++ = u; // 5 U
tmp = *s++;
*d++ = (tmp & 0x3FFU) << 6U; // Y
v = ((tmp >> 10U) & 0x3FFU) << 6U;
*d++ = v; // V
*d++ = 0xFFFFU; // A
*d++ = u; // 6 U
*d++ = ((tmp >> 20U) & 0x3FFU) << 6U; // Y
*d++ = v; // V
*d++ = 0xFFFFU; // A
}
}
static void vc_copylineY416toV210(unsigned char * __restrict dst, const unsigned char * __restrict src, int dst_len, int rshift,
int gshift, int bshift)
{
@@ -2831,6 +2881,7 @@ static const struct decoder_item decoders[] = {
{ vc_copylineY416toUYVY, Y416, UYVY, false },
{ vc_copylineY416toV210, Y416, v210, false },
{ vc_copylineV210toY216, v210, Y216, false },
{ vc_copylineV210toY416, v210, Y416, false },
};
// @param[in] slow include also slow decoders