Skip to content

Commit 04cd6d4

Browse files
committed
added yuv444p10le_to_y416
+ announce Y416 lavd conversions (to Y416 and internal Y416) closes GH-275
1 parent ae70df1 commit 04cd6d4

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/libavcodec/from_lavc_vid_conv.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,25 @@ static void yuv444p10le_to_uyvy(char * __restrict dst_buffer, AVFrame * __restri
14341434
}
14351435
}
14361436

1437+
static void yuv444p10le_to_y416(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
1438+
int width, int height, int pitch, const int * __restrict rgb_shift)
1439+
{
1440+
UNUSED(rgb_shift);
1441+
for(int y = 0; y < (int) height; ++y) {
1442+
uint16_t *src_y = (uint16_t *)(void *)(in_frame->data[0] + in_frame->linesize[0] * y);
1443+
uint16_t *src_cb = (uint16_t *)(void *)(in_frame->data[1] + in_frame->linesize[1] * y);
1444+
uint16_t *src_cr = (uint16_t *)(void *)(in_frame->data[2] + in_frame->linesize[2] * y);
1445+
uint16_t *dst = (uint16_t *)(void *)(dst_buffer + y * pitch);
1446+
1447+
OPTIMIZED_FOR (int x = 0; x < width; ++x) {
1448+
*dst++ = *src_cb++ << 6U; // U
1449+
*dst++ = *src_y++ << 6U; // Y
1450+
*dst++ = *src_cr++ << 6U; // V
1451+
*dst++ = 0xFFFFU; // A
1452+
}
1453+
}
1454+
}
1455+
14371456
#if defined __GNUC__
14381457
static inline void yuvp10le_to_rgb(int subsampling, char * __restrict dst_buffer, AVFrame * __restrict frame,
14391458
int width, int height, int pitch, const int * __restrict rgb_shift, int out_bit_depth) __attribute__((always_inline));
@@ -1873,13 +1892,14 @@ const struct av_to_uv_conversion *get_av_to_uv_conversions() {
18731892
{AV_PIX_FMT_YUV422P10LE, RGB, yuv422p10le_to_rgb24, false},
18741893
{AV_PIX_FMT_YUV422P10LE, RGBA, yuv422p10le_to_rgb32, false},
18751894
{AV_PIX_FMT_YUV422P10LE, R10k, yuv422p10le_to_rgb30, false},
1876-
{AV_PIX_FMT_YUV444P10LE, v210, yuv444p10le_to_v210, true},
1895+
{AV_PIX_FMT_YUV444P10LE, v210, yuv444p10le_to_v210, false},
18771896
{AV_PIX_FMT_YUV444P10LE, UYVY, yuv444p10le_to_uyvy, false},
18781897
{AV_PIX_FMT_YUV444P10LE, R10k, yuv444p10le_to_r10k, false},
18791898
{AV_PIX_FMT_YUV444P10LE, RGB, yuv444p10le_to_rgb24, false},
18801899
{AV_PIX_FMT_YUV444P10LE, RGBA, yuv444p10le_to_rgb32, false},
18811900
{AV_PIX_FMT_YUV444P10LE, R12L, yuv444p10le_to_r12l, false},
18821901
{AV_PIX_FMT_YUV444P10LE, RG48, yuv444p10le_to_rg48, false},
1902+
{AV_PIX_FMT_YUV444P10LE, Y416, yuv444p10le_to_y416, true},
18831903
#ifdef HAVE_P210
18841904
{AV_PIX_FMT_P210LE, v210, p210le_to_v210, true},
18851905
{AV_PIX_FMT_P210LE, UYVY, p210le_to_uyvy, false},

src/video_decompress/libavcodec.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,13 +1097,17 @@ static const struct decode_from_to dec_template[] = {
10971097
{ VIDEO_CODEC_NONE, v210, RGBA, 800 },
10981098
{ VIDEO_CODEC_NONE, v210, UYVY, 500 },
10991099
{ VIDEO_CODEC_NONE, v210, v210, 500 },
1100+
{ VIDEO_CODEC_NONE, Y416, UYVY, 800 },
1101+
{ VIDEO_CODEC_NONE, Y416, v210, 800 },
1102+
{ VIDEO_CODEC_NONE, Y416, Y416, 500 },
11001103
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, UYVY, 900 }, // provide also generic decoders
11011104
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, RG48, 950 },
11021105
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, RGB, 950 },
11031106
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, RGBA, 950 },
11041107
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, R10k, 950 },
11051108
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, R12L, 950 },
11061109
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, v210, 950 },
1110+
{ VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, Y416, 950 },
11071111
};
11081112
#define SUPP_CODECS_CNT (sizeof decoders / sizeof decoders[0])
11091113
#define DEC_TEMPLATE_CNT (sizeof dec_template / sizeof dec_template[0])

0 commit comments

Comments
 (0)