Add swscale input support for Y210, output support and fate test could be added later if there is requirement for software CSC to this packed format.
Signed-off-by: Linjie Fu <linjie...@intel.com> --- libswscale/input.c | 36 ++++++++++++++++++++++++++++++++++++ libswscale/utils.c | 2 ++ 2 files changed, 38 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 73d1aa9..527a923 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -571,6 +571,42 @@ static void ayuvToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con av_assert1(src1 == src2); } +static void y210le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, + const uint8_t *unused1, int width, uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) { + AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> 6); + AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> 6); + } +} + +static void y210be_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, + const uint8_t *unused1, int width, uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) { + AV_WN16(dstU + i * 2, AV_RB16(src + i * 8 + 2) >> 6); + AV_WN16(dstV + i * 2, AV_RB16(src + i * 8 + 6) >> 6); + } +} + +static void y210le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, + const uint8_t *unused1, int width, uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) + AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> 6); +} + +static void y210be_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, + const uint8_t *unused1, int width, uint32_t *unused2) +{ + int i; + for (i = 0; i < width; i++) + AV_WN16(dst + i * 2 ,AV_RB16(src + i * 4) >> 6); +} + static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) { diff --git a/libswscale/utils.c b/libswscale/utils.c index 1e12e21..ad5f669 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -266,6 +266,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { [AV_PIX_FMT_YUVA444P12LE] = { 1, 1 }, [AV_PIX_FMT_NV24] = { 1, 1 }, [AV_PIX_FMT_NV42] = { 1, 1 }, + [AV_PIX_FMT_Y210BE] = { 1, 0 }, + [AV_PIX_FMT_Y210LE] = { 1, 0 }, [AV_PIX_FMT_AYUV] = { 1, 1 }, }; -- 2.7.4 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".