* [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Introduce VUYX format
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 ` Philip Langdale
2022-08-20 4:31 ` [FFmpeg-devel] [PATCH 2/3] libswscale: add support for " Philip Langdale
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Philip Langdale @ 2022-08-20 4:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
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 | 11 +++++++++++
libavutil/pixfmt.h | 2 ++
libavutil/tests/pixfmt_best.c | 1 +
tests/ref/fate/imgutils | 1 +
tests/ref/fate/pixfmt_best | 2 +-
tests/ref/fate/sws-pixdesc-query | 3 +++
6 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f7558ff8b9..79ebfd3f16 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2504,6 +2504,17 @@ 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 */
+ },
+ },
[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/pixfmt_best b/tests/ref/fate/pixfmt_best
index 1da1846275..783c5fe640 100644
--- a/tests/ref/fate/pixfmt_best
+++ b/tests/ref/fate/pixfmt_best
@@ -1 +1 @@
-74 tests passed, 0 tests failed.
+75 tests passed, 0 tests failed.
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index f79d99e513..f54372d364 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
@@ -753,6 +754,7 @@ Packed:
uyvy422
uyyvyy411
vuya
+ vuyx
x2bgr10be
x2bgr10le
x2rgb10be
@@ -984,5 +986,6 @@ SwappedChroma:
nv21
nv42
vuya
+ vuyx
yvyu422
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] libswscale: add support for VUYX format
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
@ 2022-08-20 4:31 ` Philip Langdale
2022-08-20 4:31 ` [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Switch preferred 8bit 444 format to VUYX Philip Langdale
2022-08-23 21:45 ` [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch " Philip Langdale
3 siblings, 0 replies; 8+ messages in thread
From: Philip Langdale @ 2022-08-20 4:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
As we already have support for VUYA, I figured I should do the small
amount of work to support VUYX as well. That means a little refactoring
to share code.
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libswscale/input.c | 10 ++++---
libswscale/output.c | 35 +++++++++++++++++++++---
libswscale/utils.c | 1 +
tests/ref/fate/filter-pixdesc-vuyx | 1 +
tests/ref/fate/filter-pixfmts-copy | 1 +
tests/ref/fate/filter-pixfmts-crop | 1 +
tests/ref/fate/filter-pixfmts-field | 1 +
tests/ref/fate/filter-pixfmts-fieldorder | 1 +
tests/ref/fate/filter-pixfmts-hflip | 1 +
tests/ref/fate/filter-pixfmts-il | 1 +
tests/ref/fate/filter-pixfmts-null | 1 +
tests/ref/fate/filter-pixfmts-pad | 1 +
tests/ref/fate/filter-pixfmts-scale | 1 +
tests/ref/fate/filter-pixfmts-transpose | 1 +
tests/ref/fate/filter-pixfmts-vflip | 1 +
15 files changed, 50 insertions(+), 8 deletions(-)
create mode 100644 tests/ref/fate/filter-pixdesc-vuyx
diff --git a/libswscale/input.c b/libswscale/input.c
index 1077d01e91..92681c9c53 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -659,7 +659,7 @@ static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *u
AV_WN16(dst + i * 2, AV_RL16(src + i * 8));
}
-static void read_vuya_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
+static void read_vuyx_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, void *opq)
{
int i;
@@ -669,7 +669,7 @@ static void read_vuya_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0,
}
}
-static void read_vuya_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
+static void read_vuyx_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
uint32_t *unused2, void *opq)
{
int i;
@@ -1375,7 +1375,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
break;
#endif
case AV_PIX_FMT_VUYA:
- c->chrToYV12 = read_vuya_UV_c;
+ case AV_PIX_FMT_VUYX:
+ c->chrToYV12 = read_vuyx_UV_c;
break;
case AV_PIX_FMT_AYUV64LE:
c->chrToYV12 = read_ayuv64le_UV_c;
@@ -1752,7 +1753,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->lumToYV12 = read_ya16be_gray_c;
break;
case AV_PIX_FMT_VUYA:
- c->lumToYV12 = read_vuya_Y_c;
+ case AV_PIX_FMT_VUYX:
+ c->lumToYV12 = read_vuyx_Y_c;
break;
case AV_PIX_FMT_AYUV64LE:
c->lumToYV12 = read_ayuv64le_Y_c;
diff --git a/libswscale/output.c b/libswscale/output.c
index 74f992ae80..40a4476c6d 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2585,13 +2585,14 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
}
static void
-yuv2vuya_X_c(SwsContext *c, const int16_t *lumFilter,
+yuv2vuyX_X_c(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
- const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y,
+ int destHasAlpha)
{
- int hasAlpha = !!alpSrc;
+ int hasAlpha = destHasAlpha && (!!alpSrc);
int i;
for (i = 0; i < dstW; i++) {
@@ -2634,10 +2635,33 @@ yuv2vuya_X_c(SwsContext *c, const int16_t *lumFilter,
dest[4 * i ] = V;
dest[4 * i + 1] = U;
dest[4 * i + 2] = Y;
- dest[4 * i + 3] = A;
+ if (destHasAlpha)
+ dest[4 * i + 3] = A;
}
}
+static void
+yuv2vuya_X_c(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+{
+ yuv2vuyX_X_c(c, lumFilter, lumSrc, lumFilterSize, chrFilter,
+ chrUSrc, chrVSrc, chrFilterSize, alpSrc, dest, dstW, y, 1);
+}
+
+static void
+yuv2vuyx_X_c(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+{
+ yuv2vuyX_X_c(c, lumFilter, lumSrc, lumFilterSize, chrFilter,
+ chrUSrc, chrVSrc, chrFilterSize, alpSrc, dest, dstW, y, 0);
+}
+
av_cold void ff_sws_init_output_funcs(SwsContext *c,
yuv2planar1_fn *yuv2plane1,
yuv2planarX_fn *yuv2planeX,
@@ -3143,5 +3167,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case AV_PIX_FMT_VUYA:
*yuv2packedX = yuv2vuya_X_c;
break;
+ case AV_PIX_FMT_VUYX:
+ *yuv2packedX = yuv2vuyx_X_c;
+ break;
}
}
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 9ef157c006..a621a35862 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -259,6 +259,7 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_P416LE] = { 1, 1 },
[AV_PIX_FMT_NV16] = { 1, 1 },
[AV_PIX_FMT_VUYA] = { 1, 1 },
+ [AV_PIX_FMT_VUYX] = { 1, 1 },
[AV_PIX_FMT_RGBAF16BE] = { 1, 0 },
[AV_PIX_FMT_RGBAF16LE] = { 1, 0 },
};
diff --git a/tests/ref/fate/filter-pixdesc-vuyx b/tests/ref/fate/filter-pixdesc-vuyx
new file mode 100644
index 0000000000..99871e05d0
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-vuyx
@@ -0,0 +1 @@
+pixdesc-vuyx ebc83f9793eb4eddbb0a37fdcb67a33d
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index 93dd611f97..371b94c62e 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -90,6 +90,7 @@ rgba64be ae2ae04b5efedca3505f47c4dd6ea6ea
rgba64le b91e1d77f799eb92241a2d2d28437b15
uyvy422 3bcf3c80047592f2211fae3260b1b65d
vuya 3d5e934651cae1ce334001cb1829ad22
+vuyx 3f68ea6ec492b30d867cb5401562264e
x2bgr10le 550c0d190cf695afa4eaacb644db6b75
x2rgb10le c1e3ac21be04a16bb157b22784524520
xyz12be a1ef56bf746d71f59669c28e48fc8450
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index 739b99713a..364e881aef 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -87,6 +87,7 @@ rgba 9488ac85abceaf99a9309eac5a87697e
rgba64be 89910046972ab3c68e2a348302cc8ca9
rgba64le fea8ebfc869b52adf353778f29eac7a7
vuya 76578a705ff3a37559653c1289bd03dd
+vuyx 5d2bae51a2f4892bd5f177f190cc323b
x2bgr10le 84de725b85662c362862820dc4a309aa
x2rgb10le f4265aca7a67dbfa9354370098ca6f33
xyz12be cb4571f9aaa7b59f999ef327276104b7
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index e08161bc0d..768b3f474a 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -90,6 +90,7 @@ rgba64be 23c8c0edaabe3eaec89ce69633fb0048
rgba64le dfdba4de4a7cac9abf08852666c341d3
uyvy422 1c49e44ab3f060e85fc4a3a9464f045e
vuya f72bcf29d75cd143d0c565f7cc49119a
+vuyx 6257cd1ce11330660e9fa9c675acbdcc
x2bgr10le dbe21538d7cb1744914f6bd46ec09b55
x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677
xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index de5c4fe59b..258c8563f0 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -81,6 +81,7 @@ rgba64be 5598f44514d122b9a57c5c92c20bbc61
rgba64le b34e6e30621ae579519a2d91a96a0acf
uyvy422 75de70e31c435dde878002d3f22b238a
vuya a3891d4168ff208948fd0b3ba0910495
+vuyx d7a900e970c9a69ed41f8b220114b9fa
x2bgr10le 86474d84f26c5c51d6f75bf7e1de8da8
x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676
xyz12be 15f5cda71de5fef9cec5e75e3833b6bc
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index b0f6754bbf..6fbc472a4e 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -87,6 +87,7 @@ rgba 51961c723ea6707e0a410cd3f21f15d3
rgba64be c910444019f4cfbf4d995227af55da8d
rgba64le 0c810d8b3a6bca10321788e1cb145340
vuya 7e530261e7ac4eae4fd616fd7572d0b8
+vuyx 3ce9890363cad3984521293be1eb679c
x2bgr10le 827cc659f29378e00c5a7d2c0ada8f9a
x2rgb10le d4a8189b65395a88d0a38a7053f3359f
xyz12be 25f90259ff8a226befdaec3dfe82996e
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 04efcb8a56..09748c2d08 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -89,6 +89,7 @@ rgba64be db70d33aa6c06f3e0a1c77bd11284261
rgba64le a8a2daae04374a27219bc1c890204007
uyvy422 d6ee3ca43356d08c392382b24b22cda5
vuya b9deab5ba249dd608b709c09255a4932
+vuyx 49cc92fcc002ec0f312017014dd68c0c
x2bgr10le 135acaff8318cf9861bb0f7849a9e5e9
x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94
xyz12be 7c7d54c55f136cbbc50b18029f3be0b3
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index 93dd611f97..371b94c62e 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -90,6 +90,7 @@ rgba64be ae2ae04b5efedca3505f47c4dd6ea6ea
rgba64le b91e1d77f799eb92241a2d2d28437b15
uyvy422 3bcf3c80047592f2211fae3260b1b65d
vuya 3d5e934651cae1ce334001cb1829ad22
+vuyx 3f68ea6ec492b30d867cb5401562264e
x2bgr10le 550c0d190cf695afa4eaacb644db6b75
x2rgb10le c1e3ac21be04a16bb157b22784524520
xyz12be a1ef56bf746d71f59669c28e48fc8450
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 0f00affdce..07aaea6b06 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -36,6 +36,7 @@ rgb0 0984eb985dabbe757ed6beb53db84eff
rgb24 17f9e2e0c609009acaf2175c42d4a2a5
rgba b157c90191463d34fb3ce77b36c96386
vuya 44368c0a758ee68e24ce976e3b1b8535
+vuyx bc7c4f693a22cd1ac95e33d473086474
xyz12le 23dadbbba70b2925ce75fb8ba8080ba3
ya16le 8dbfcb586abf626da7d1aca887a581b9
ya8 495daaca2dcb4f7aeba7652768b41ced
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index f4822f5bae..e1bbe961e1 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -90,6 +90,7 @@ rgba64be ee73e57923af984b31cc7795d13929da
rgba64le 783d2779adfafe3548bdb671ec0de69e
uyvy422 aeb4ba4f9f003ae21f6d18089198244f
vuya ffa817e283bf6a0b6fba21b07523ccaa
+vuyx ba182200e20e0c82765eba15217848d3
x2bgr10le d57b9a99033cc7b65ddd111578f2d385
x2rgb10le d56bdb23fa6a8e12a0b4394987f89935
xyz12be c7ba8345998c0141ddc079cdd29b1a40
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index b3f2d5c5a0..0c2993d5b0 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -81,6 +81,7 @@ rgba 4d76a9542143752a4ac30f82f88f68f1
rgba64be a60041217f4c0cd796d19d3940a12a41
rgba64le ad47197774858858ae7b0c177dffa459
vuya 9ece18a345beb17cd19e09e443eca4bf
+vuyx 4c2929cd1c6e5512f62e802f482f0ef2
x2bgr10le 4aa774b6d8f6d446a64f1f288e5c97eb
x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845
xyz12be 68e5cba640f6e4ef72dff950e88b5342
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 9081ce4f18..5cac61a9d2 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -90,6 +90,7 @@ rgba64be 17e6273323b5779b5f3f775f150c1011
rgba64le 48f45b10503b7dd140329c3dd0d54c98
uyvy422 3a237e8376264e0cfa78f8a3fdadec8a
vuya fb849f76e56181e005c31fce75d7038c
+vuyx 7a8079a97610e2c1c97aa8832b58a102
x2bgr10le 795b66a5fc83cd2cf300aae51c230f80
x2rgb10le 262c502230cf3724f8e2cf4737f18a42
xyz12be 810644e008deb231850d779aaa27cc7e
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Switch preferred 8bit 444 format to VUYX
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
2022-08-20 4:31 ` [FFmpeg-devel] [PATCH 2/3] libswscale: add support for " Philip Langdale
@ 2022-08-20 4:31 ` Philip Langdale
2022-08-23 21:45 ` [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch " Philip Langdale
3 siblings, 0 replies; 8+ messages in thread
From: Philip Langdale @ 2022-08-20 4:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
As vaapi doesn't actually do anything useful with the alpha channel,
and we have an alphaless format available, let's use that instead.
The changes here are mostly 1:1 switching, but do note the explicit
change in the number of declared channels from 4 to 3 to reflect that
the alpha is being ignored.
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libavcodec/vaapi_decode.c | 4 +++-
libavcodec/vaapi_encode.c | 2 +-
libavcodec/vaapi_encode_h265.c | 3 +--
libavcodec/vaapi_encode_vp9.c | 3 +--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index bc2d3ed803..8c13a4f098 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -267,7 +267,9 @@ static const struct {
MAP(422V, YUV440P),
// 4:4:4
MAP(444P, YUV444P),
- MAP(AYUV, VUYA),
+#ifdef VA_FOURCC_XYUV
+ MAP(XYUV, VUYX),
+#endif
// 4:2:0 10-bit
#ifdef VA_FOURCC_P010
MAP(P010, P010),
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index f13daa5cff..2dc5c96f7b 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1308,7 +1308,7 @@ static const VAAPIEncodeRTFormat vaapi_encode_rt_formats[] = {
{ "YUV422_10", VA_RT_FORMAT_YUV422_10, 10, 3, 1, 0 },
#endif
{ "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
- { "AYUV", VA_RT_FORMAT_YUV444, 8, 4, 0, 0 },
+ { "XYUV", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
{ "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 },
#if VA_CHECK_VERSION(0, 38, 1)
{ "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 },
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 1de323af78..967d71e998 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -1278,8 +1278,7 @@ static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
#if VA_CHECK_VERSION(1, 2, 0)
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
- // Four channels because this uses the AYUV format which has Alpha
- { FF_PROFILE_HEVC_REXT, 8, 4, 0, 0, VAProfileHEVCMain444 },
+ { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 },
#endif
{ FF_PROFILE_UNKNOWN }
};
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index 9b455e10c9..9530b2f462 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -228,8 +228,7 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
{ FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
- // Four channels because this uses the AYUV format which has Alpha
- { FF_PROFILE_VP9_1, 8, 4, 0, 0, VAProfileVP9Profile1 },
+ { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
{ FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
{ FF_PROFILE_UNKNOWN }
};
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch 8bit 444 format to VUYX
2022-08-20 4:31 [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch 8bit 444 format to VUYX Philip Langdale
` (2 preceding siblings ...)
2022-08-20 4:31 ` [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Switch preferred 8bit 444 format to VUYX Philip Langdale
@ 2022-08-23 21:45 ` Philip Langdale
2022-08-26 2:13 ` Philip Langdale
3 siblings, 1 reply; 8+ messages in thread
From: Philip Langdale @ 2022-08-23 21:45 UTC (permalink / raw)
To: ffmpeg-devel
On Fri, 19 Aug 2022 21:31:43 -0700
Philip Langdale <philipl@overt.org> wrote:
> After discussion with Mark, I'm switching the preferred format for
> 8bit 444 content in vaapi to VUYX, which is the alpha-less variant of
> VUYA.
>
> This format is formally supported by the driver, so we don't even need
> to do any fudging.
>
> I am not removing VUYA because we found another use for it, replacing
> the previous requirement to use v408[enc|dec] to work with it.
>
> * v2: Fix test update in wrong change
> * v3: Remove incorrect alpha flag from pix_fmt
>
> Philip Langdale (3):
> lavu/pixfmt: Introduce VUYX format
> libswscale: add support for VUYX format
> lavc/vaapi: Switch preferred 8bit 444 format to VUYX
I will push this in a few days if there are no comments.
--phil
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch 8bit 444 format to VUYX
2022-08-23 21:45 ` [FFmpeg-devel] [PATCH 0/3] v2: vaapi: switch " Philip Langdale
@ 2022-08-26 2:13 ` Philip Langdale
0 siblings, 0 replies; 8+ messages in thread
From: Philip Langdale @ 2022-08-26 2:13 UTC (permalink / raw)
To: ffmpeg-devel
On Tue, 23 Aug 2022 14:45:37 -0700
Philip Langdale <philipl@overt.org> wrote:
> On Fri, 19 Aug 2022 21:31:43 -0700
> Philip Langdale <philipl@overt.org> wrote:
>
> > After discussion with Mark, I'm switching the preferred format for
> > 8bit 444 content in vaapi to VUYX, which is the alpha-less variant
> > of VUYA.
> >
> > This format is formally supported by the driver, so we don't even
> > need to do any fudging.
> >
> > I am not removing VUYA because we found another use for it,
> > replacing the previous requirement to use v408[enc|dec] to work
> > with it.
> >
> > * v2: Fix test update in wrong change
> > * v3: Remove incorrect alpha flag from pix_fmt
> >
> > Philip Langdale (3):
> > lavu/pixfmt: Introduce VUYX format
> > libswscale: add support for VUYX format
> > lavc/vaapi: Switch preferred 8bit 444 format to VUYX
>
> I will push this in a few days if there are no comments.
>
Pushed.
--phil
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Switch preferred 8bit 444 format to VUYX
2022-08-20 2:14 Philip Langdale
@ 2022-08-20 2:14 ` Philip Langdale
0 siblings, 0 replies; 8+ messages in thread
From: Philip Langdale @ 2022-08-20 2:14 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
As vaapi doesn't actually do anything useful with the alpha channel,
and we have an alphaless format available, let's use that instead.
The changes here are mostly 1:1 switching, but do note the explicit
change in the number of declared channels from 4 to 3 to reflect that
the alpha is being ignored.
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libavcodec/vaapi_decode.c | 4 +++-
libavcodec/vaapi_encode.c | 2 +-
libavcodec/vaapi_encode_h265.c | 3 +--
libavcodec/vaapi_encode_vp9.c | 3 +--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index bc2d3ed803..8c13a4f098 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -267,7 +267,9 @@ static const struct {
MAP(422V, YUV440P),
// 4:4:4
MAP(444P, YUV444P),
- MAP(AYUV, VUYA),
+#ifdef VA_FOURCC_XYUV
+ MAP(XYUV, VUYX),
+#endif
// 4:2:0 10-bit
#ifdef VA_FOURCC_P010
MAP(P010, P010),
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index f13daa5cff..2dc5c96f7b 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1308,7 +1308,7 @@ static const VAAPIEncodeRTFormat vaapi_encode_rt_formats[] = {
{ "YUV422_10", VA_RT_FORMAT_YUV422_10, 10, 3, 1, 0 },
#endif
{ "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
- { "AYUV", VA_RT_FORMAT_YUV444, 8, 4, 0, 0 },
+ { "XYUV", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
{ "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 },
#if VA_CHECK_VERSION(0, 38, 1)
{ "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 },
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 1de323af78..967d71e998 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -1278,8 +1278,7 @@ static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
#if VA_CHECK_VERSION(1, 2, 0)
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
- // Four channels because this uses the AYUV format which has Alpha
- { FF_PROFILE_HEVC_REXT, 8, 4, 0, 0, VAProfileHEVCMain444 },
+ { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 },
#endif
{ FF_PROFILE_UNKNOWN }
};
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index 9b455e10c9..9530b2f462 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -228,8 +228,7 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
{ FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
- // Four channels because this uses the AYUV format which has Alpha
- { FF_PROFILE_VP9_1, 8, 4, 0, 0, VAProfileVP9Profile1 },
+ { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
{ FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
{ FF_PROFILE_UNKNOWN }
};
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Switch preferred 8bit 444 format to VUYX
2022-08-20 1:24 [FFmpeg-devel] [PATCH 0/3] vaapi: switch " Philip Langdale
@ 2022-08-20 1:24 ` Philip Langdale
0 siblings, 0 replies; 8+ messages in thread
From: Philip Langdale @ 2022-08-20 1:24 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
As vaapi doesn't actually do anything useful with the alpha channel,
and we have an alphaless format available, let's use that instead.
The changes here are mostly 1:1 switching, but do note the explicit
change in the number of declared channels from 4 to 3 to reflect that
the alpha is being ignored.
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libavcodec/vaapi_decode.c | 4 +++-
libavcodec/vaapi_encode.c | 2 +-
libavcodec/vaapi_encode_h265.c | 3 +--
libavcodec/vaapi_encode_vp9.c | 3 +--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index bc2d3ed803..8c13a4f098 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -267,7 +267,9 @@ static const struct {
MAP(422V, YUV440P),
// 4:4:4
MAP(444P, YUV444P),
- MAP(AYUV, VUYA),
+#ifdef VA_FOURCC_XYUV
+ MAP(XYUV, VUYX),
+#endif
// 4:2:0 10-bit
#ifdef VA_FOURCC_P010
MAP(P010, P010),
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index f13daa5cff..2dc5c96f7b 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1308,7 +1308,7 @@ static const VAAPIEncodeRTFormat vaapi_encode_rt_formats[] = {
{ "YUV422_10", VA_RT_FORMAT_YUV422_10, 10, 3, 1, 0 },
#endif
{ "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
- { "AYUV", VA_RT_FORMAT_YUV444, 8, 4, 0, 0 },
+ { "XYUV", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
{ "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 },
#if VA_CHECK_VERSION(0, 38, 1)
{ "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 },
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 1de323af78..967d71e998 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -1278,8 +1278,7 @@ static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
#if VA_CHECK_VERSION(1, 2, 0)
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
- // Four channels because this uses the AYUV format which has Alpha
- { FF_PROFILE_HEVC_REXT, 8, 4, 0, 0, VAProfileHEVCMain444 },
+ { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 },
#endif
{ FF_PROFILE_UNKNOWN }
};
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index 9b455e10c9..9530b2f462 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -228,8 +228,7 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
{ FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
- // Four channels because this uses the AYUV format which has Alpha
- { FF_PROFILE_VP9_1, 8, 4, 0, 0, VAProfileVP9Profile1 },
+ { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
{ FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
{ FF_PROFILE_UNKNOWN }
};
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread