From: Philip Langdale <philipl@overt.org> To: ffmpeg-devel@ffmpeg.org Cc: Philip Langdale <philipl@overt.org> Subject: [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Introduce VUYX format Date: Fri, 19 Aug 2022 18:24:02 -0700 Message-ID: <20220820012404.932086-2-philipl@overt.org> (raw) In-Reply-To: <20220820012404.932086-1-philipl@overt.org> This is the alphaless version of VUYA that I introduced recently. After further discussion and noting that the Intel vaapi driver explicitly lists XYUV as a support format for encoding and decoding 8bit 444 content, we decided to switch our usage and avoid the overhead of having a declared alpha channel around. Note that I am not removing VUYA, as this turned out to have another use, which was to replace the need for v408enc/dec when dealing with the format. The vaapi switching will happen in the next change Signed-off-by: Philip Langdale <philipl@overt.org> --- libavutil/pixdesc.c | 12 ++++++++++++ libavutil/pixfmt.h | 2 ++ libavutil/tests/pixfmt_best.c | 1 + tests/ref/fate/imgutils | 1 + tests/ref/fate/sws-pixdesc-query | 3 +++ 5 files changed, 19 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f7558ff8b9..a7aadc18cc 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2504,6 +2504,18 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_ALPHA, }, + [AV_PIX_FMT_VUYX] = { + .name = "vuyx", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 2, 0, 8 }, /* Y */ + { 0, 4, 1, 0, 8 }, /* U */ + { 0, 4, 0, 0, 8 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_ALPHA, + }, [AV_PIX_FMT_RGBAF16BE] = { .name = "rgbaf16be", .nb_components = 4, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 86c9bdefeb..7d45561395 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -372,6 +372,8 @@ enum AVPixelFormat { AV_PIX_FMT_RGBAF16BE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian AV_PIX_FMT_RGBAF16LE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian + AV_PIX_FMT_VUYX, ///< packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined + AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; diff --git a/libavutil/tests/pixfmt_best.c b/libavutil/tests/pixfmt_best.c index de53baf092..0542af494f 100644 --- a/libavutil/tests/pixfmt_best.c +++ b/libavutil/tests/pixfmt_best.c @@ -84,6 +84,7 @@ int main(void) TEST(AV_PIX_FMT_GBRP, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_0RGB, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_GBRP16, AV_PIX_FMT_RGB48); + TEST(AV_PIX_FMT_VUYX, AV_PIX_FMT_YUV444P); // Formats additionally containing alpha (here ignored). TEST(AV_PIX_FMT_YA8, AV_PIX_FMT_GRAY8); diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils index 01c9877de5..47b73b1b64 100644 --- a/tests/ref/fate/imgutils +++ b/tests/ref/fate/imgutils @@ -249,3 +249,4 @@ p416le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 vuya planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 rgbaf16be planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 rgbaf16le planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 +vuyx planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index f79d99e513..045f751831 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -219,6 +219,7 @@ isYUV: uyvy422 uyyvyy411 vuya + vuyx xyz12be xyz12le y210be @@ -665,6 +666,7 @@ ALPHA: rgbaf16be rgbaf16le vuya + vuyx ya16be ya16le ya8 @@ -753,6 +755,7 @@ Packed: uyvy422 uyyvyy411 vuya + vuyx x2bgr10be x2bgr10le x2rgb10be -- 2.34.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".
next prev parent reply other threads:[~2022-08-20 1:24 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-20 1:24 [FFmpeg-devel] [PATCH 0/3] vaapi: switch 8bit 444 format to VUYX Philip Langdale 2022-08-20 1:24 ` Philip Langdale [this message] 2022-08-20 1:24 ` [FFmpeg-devel] [PATCH 2/3] libswscale: add support for VUYX format Philip Langdale 2022-08-20 1:37 ` James Almer 2022-08-20 2:15 ` Philip Langdale 2022-08-20 1:24 ` [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Switch preferred 8bit 444 format to VUYX Philip Langdale 2022-08-20 2:14 [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch " Philip Langdale 2022-08-20 2:14 ` [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Introduce VUYX format Philip Langdale 2022-08-20 4:31 [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch 8bit 444 format to VUYX Philip Langdale 2022-08-20 4:31 ` [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Introduce VUYX format Philip Langdale
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=20220820012404.932086-2-philipl@overt.org \ --to=philipl@overt.org \ --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