From: James Almer <jamrial@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] swscale/input: add support for UYYVYY411 Date: Thu, 6 Mar 2025 14:01:13 -0300 Message-ID: <20250306170113.1113-1-jamrial@gmail.com> (raw) Signed-off-by: James Almer <jamrial@gmail.com> --- Untested as i don't have a camera that outputs this, and no decoder or filter seems to generate it either, but it seemed simple enough to write. Anyone that can use the libdc1394 device and test would be welcome. libswscale/input.c | 23 +++++++++++++++++++++++ libswscale/utils.c | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/libswscale/input.c b/libswscale/input.c index dfa8ed15ab..6d600385a1 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -904,6 +904,23 @@ static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con av_assert1(src1 == src2); } +static void uyyvyyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, + int width, uint32_t *unused, void *opq) +{ + for (int i = 0; i < width; i++) + dst[i] = src[3 * (i >> 1) + 1 + (i & 1)]; +} + +static void uyyvyyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, + const uint8_t *src2, int width, uint32_t *unused, void *opq) +{ + for (int i = 0; i < width; i++) { + dstU[i] = src1[6 * i + 0]; + dstV[i] = src1[6 * i + 3]; + } + av_assert1(src1 == src2); +} + static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2, const uint8_t *src, int width) { @@ -1714,6 +1731,9 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c, case AV_PIX_FMT_UYVY422: *chrToYV12 = uyvyToUV_c; break; + case AV_PIX_FMT_UYYVYY411: + *chrToYV12 = uyyvyyToUV_c; + break; case AV_PIX_FMT_VYU444: *chrToYV12 = vyuToUV_c; break; @@ -2351,6 +2371,9 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c, case AV_PIX_FMT_UYVY422: *lumToYV12 = uyvyToY_c; break; + case AV_PIX_FMT_UYYVYY411: + *lumToYV12 = uyyvyyToY_c; + break; case AV_PIX_FMT_VYU444: *lumToYV12 = vyuToY_c; break; diff --git a/libswscale/utils.c b/libswscale/utils.c index 953bf015e4..389efd7c68 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -91,7 +91,7 @@ static const FormatEntry format_entries[] = { [AV_PIX_FMT_YUVJ444P] = { 1, 1 }, [AV_PIX_FMT_YVYU422] = { 1, 1 }, [AV_PIX_FMT_UYVY422] = { 1, 1 }, - [AV_PIX_FMT_UYYVYY411] = { 0, 0 }, + [AV_PIX_FMT_UYYVYY411] = { 1, 0 }, [AV_PIX_FMT_BGR8] = { 1, 1 }, [AV_PIX_FMT_BGR4] = { 0, 1 }, [AV_PIX_FMT_BGR4_BYTE] = { 1, 1 }, -- 2.48.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2025-03-06 17:01 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20250306170113.1113-1-jamrial@gmail.com \ --to=jamrial@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git