diff options
author | Fei Wang <fei.w.wang@intel.com> | 2020-04-22 13:23:02 +0800 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2020-06-12 17:56:15 +0100 |
commit | c721b450141d6bbe1e977212a0bcb70118965c34 (patch) | |
tree | 7b830e41fcbea1cd67686485a8c3faf5b78b8236 /libswscale/input.c | |
parent | b09fb030c15fea2a1cbddf0074c498a415f3fed2 (diff) | |
download | ffmpeg-c721b450141d6bbe1e977212a0bcb70118965c34.tar.gz |
swscale: Add swscale input/output support for X2RGB10LE
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Diffstat (limited to 'libswscale/input.c')
-rw-r--r-- | libswscale/input.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libswscale/input.c b/libswscale/input.c index e74cf04133..0bd1aa7bc9 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -244,7 +244,8 @@ rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE) #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \ origin == AV_PIX_FMT_BGRA || \ origin == AV_PIX_FMT_ARGB || \ - origin == AV_PIX_FMT_ABGR) \ + origin == AV_PIX_FMT_ABGR || \ + origin == AV_PIX_FMT_X2RGB10) \ ? AV_RN32A(&src[(i) * 4]) \ : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \ : AV_RL16(&src[(i) * 2]))) @@ -391,6 +392,7 @@ rgb16_32_wrapper(AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, rgb16_32_wrapper(AV_PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8) rgb16_32_wrapper(AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7) rgb16_32_wrapper(AV_PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4) +rgb16_32_wrapper(AV_PIX_FMT_X2RGB10LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4, RGB2YUV_SHIFT + 6) static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc, @@ -1341,6 +1343,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_RGB444BE: c->chrToYV12 = rgb12beToUV_half_c; break; + case AV_PIX_FMT_X2RGB10LE: + c->chrToYV12 = rgb30leToUV_half_c; + break; } } else { switch (srcFormat) { @@ -1422,6 +1427,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_RGB444BE: c->chrToYV12 = rgb12beToUV_c; break; + case AV_PIX_FMT_X2RGB10LE: + c->chrToYV12 = rgb30leToUV_c; + break; } } @@ -1701,6 +1709,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_Y210LE: c->lumToYV12 = y210le_Y_c; break; + case AV_PIX_FMT_X2RGB10LE: + c->lumToYV12 =rgb30leToY_c; + break; } if (c->needAlpha) { if (is16BPS(srcFormat) || isNBPS(srcFormat)) { |