* [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats
@ 2022-09-06 19:58 Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 1/4] swscale/output: add support for P012 Philip Langdale
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Philip Langdale @ 2022-09-06 19:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
This patch set adds output support to complement the input supported
added previously.
As in the input changes, I did not implement BE support where the
infrastructure didn't already exist (ie: only P012 has it) because
these formats aren't expected to be used except in conjunction with
Intel VAAPI which will always be little endina.
Philip Langdale (4):
swscale/output: add support for P012
swscale/output: add support for XV36LE
swscale/output: add support for XV30LE
swscale/output: add support for Y210LE and Y212LE
libswscale/output.c | 248 +++++++++++++++++------
libswscale/utils.c | 12 +-
tests/ref/fate/filter-pixdesc-p012be | 1 +
tests/ref/fate/filter-pixdesc-p012le | 1 +
tests/ref/fate/filter-pixdesc-xv30le | 1 +
tests/ref/fate/filter-pixdesc-xv36le | 1 +
tests/ref/fate/filter-pixdesc-y210le | 1 +
tests/ref/fate/filter-pixdesc-y212le | 1 +
tests/ref/fate/filter-pixfmts-copy | 6 +
tests/ref/fate/filter-pixfmts-crop | 4 +
tests/ref/fate/filter-pixfmts-field | 6 +
tests/ref/fate/filter-pixfmts-fieldorder | 4 +
tests/ref/fate/filter-pixfmts-hflip | 4 +
tests/ref/fate/filter-pixfmts-il | 6 +
tests/ref/fate/filter-pixfmts-null | 6 +
tests/ref/fate/filter-pixfmts-pad | 1 +
tests/ref/fate/filter-pixfmts-scale | 6 +
tests/ref/fate/filter-pixfmts-transpose | 4 +
tests/ref/fate/filter-pixfmts-vflip | 6 +
19 files changed, 254 insertions(+), 65 deletions(-)
create mode 100644 tests/ref/fate/filter-pixdesc-p012be
create mode 100644 tests/ref/fate/filter-pixdesc-p012le
create mode 100644 tests/ref/fate/filter-pixdesc-xv30le
create mode 100644 tests/ref/fate/filter-pixdesc-xv36le
create mode 100644 tests/ref/fate/filter-pixdesc-y210le
create mode 100644 tests/ref/fate/filter-pixdesc-y212le
--
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 1/4] swscale/output: add support for P012
2022-09-06 19:58 [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
@ 2022-09-06 19:58 ` Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 2/4] swscale/output: add support for XV36LE Philip Langdale
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Philip Langdale @ 2022-09-06 19:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
This generalises the existing P010 support.
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libswscale/output.c | 140 ++++++++++++++----------
libswscale/utils.c | 4 +-
tests/ref/fate/filter-pixdesc-p012be | 1 +
tests/ref/fate/filter-pixdesc-p012le | 1 +
tests/ref/fate/filter-pixfmts-copy | 2 +
tests/ref/fate/filter-pixfmts-crop | 2 +
tests/ref/fate/filter-pixfmts-field | 2 +
tests/ref/fate/filter-pixfmts-hflip | 2 +
tests/ref/fate/filter-pixfmts-il | 2 +
tests/ref/fate/filter-pixfmts-null | 2 +
tests/ref/fate/filter-pixfmts-pad | 1 +
tests/ref/fate/filter-pixfmts-scale | 2 +
tests/ref/fate/filter-pixfmts-transpose | 2 +
tests/ref/fate/filter-pixfmts-vflip | 2 +
14 files changed, 104 insertions(+), 61 deletions(-)
create mode 100644 tests/ref/fate/filter-pixdesc-p012be
create mode 100644 tests/ref/fate/filter-pixdesc-p012le
diff --git a/libswscale/output.c b/libswscale/output.c
index 40a4476c6d..5cbc7ab748 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -460,17 +460,18 @@ static void yuv2nv12cX_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
#define output_pixel(pos, val) \
if (big_endian) { \
- AV_WB16(pos, av_clip_uintp2(val >> shift, 10) << 6); \
+ AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits) << output_shift); \
} else { \
- AV_WL16(pos, av_clip_uintp2(val >> shift, 10) << 6); \
+ AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits) << output_shift); \
}
-static void yuv2p010l1_c(const int16_t *src,
+static void yuv2p01xl1_c(const int16_t *src,
uint16_t *dest, int dstW,
- int big_endian)
+ int big_endian, int output_bits)
{
int i;
- int shift = 5;
+ int shift = 15 - output_bits;
+ int output_shift = 16 - output_bits;
for (i = 0; i < dstW; i++) {
int val = src[i] + (1 << (shift - 1));
@@ -478,12 +479,13 @@ static void yuv2p010l1_c(const int16_t *src,
}
}
-static void yuv2p010lX_c(const int16_t *filter, int filterSize,
+static void yuv2p01xlX_c(const int16_t *filter, int filterSize,
const int16_t **src, uint16_t *dest, int dstW,
- int big_endian)
+ int big_endian, int output_bits)
{
int i, j;
- int shift = 17;
+ int shift = 11 + 16 - output_bits;
+ int output_shift = 16 - output_bits;
for (i = 0; i < dstW; i++) {
int val = 1 << (shift - 1);
@@ -495,14 +497,15 @@ static void yuv2p010lX_c(const int16_t *filter, int filterSize,
}
}
-static void yuv2p010cX_c(int big_endian, const uint8_t *chrDither,
+static void yuv2p01xcX_c(int big_endian, const uint8_t *chrDither,
const int16_t *chrFilter, int chrFilterSize,
const int16_t **chrUSrc, const int16_t **chrVSrc,
- uint8_t *dest8, int chrDstW)
+ uint8_t *dest8, int chrDstW, int output_bits)
{
uint16_t *dest = (uint16_t*)dest8;
- int shift = 17;
int i, j;
+ int shift = 11 + 16 - output_bits;
+ int output_shift = 16 - output_bits;
for (i = 0; i < chrDstW; i++) {
int u = 1 << (shift - 1);
@@ -518,52 +521,65 @@ static void yuv2p010cX_c(int big_endian, const uint8_t *chrDither,
}
}
-static void yuv2p010l1_LE_c(const int16_t *src,
- uint8_t *dest, int dstW,
- const uint8_t *dither, int offset)
-{
- yuv2p010l1_c(src, (uint16_t*)dest, dstW, 0);
-}
-
-static void yuv2p010l1_BE_c(const int16_t *src,
- uint8_t *dest, int dstW,
- const uint8_t *dither, int offset)
-{
- yuv2p010l1_c(src, (uint16_t*)dest, dstW, 1);
-}
-
-static void yuv2p010lX_LE_c(const int16_t *filter, int filterSize,
- const int16_t **src, uint8_t *dest, int dstW,
- const uint8_t *dither, int offset)
-{
- yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0);
-}
-
-static void yuv2p010lX_BE_c(const int16_t *filter, int filterSize,
- const int16_t **src, uint8_t *dest, int dstW,
- const uint8_t *dither, int offset)
-{
- yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1);
-}
-
-static void yuv2p010cX_LE_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
- const int16_t *chrFilter, int chrFilterSize,
- const int16_t **chrUSrc, const int16_t **chrVSrc,
- uint8_t *dest8, int chrDstW)
-{
- yuv2p010cX_c(0, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, dest8, chrDstW);
-}
-
-static void yuv2p010cX_BE_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
- const int16_t *chrFilter, int chrFilterSize,
- const int16_t **chrUSrc, const int16_t **chrVSrc,
- uint8_t *dest8, int chrDstW)
-{
- yuv2p010cX_c(1, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, dest8, chrDstW);
-}
-
#undef output_pixel
+#define yuv2p01x_wrapper(bits) \
+ static void yuv2p0 ## bits ## l1_LE_c(const int16_t *src, \
+ uint8_t *dest, int dstW, \
+ const uint8_t *dither, int offset) \
+ { \
+ yuv2p01xl1_c(src, (uint16_t*)dest, dstW, 0, bits); \
+ } \
+ \
+ static void yuv2p0 ## bits ## l1_BE_c(const int16_t *src, \
+ uint8_t *dest, int dstW, \
+ const uint8_t *dither, int offset) \
+ { \
+ yuv2p01xl1_c(src, (uint16_t*)dest, dstW, 1, bits); \
+ } \
+ \
+ static void yuv2p0 ## bits ## lX_LE_c(const int16_t *filter, \
+ int filterSize, const int16_t **src, \
+ uint8_t *dest, int dstW, \
+ const uint8_t *dither, int offset) \
+ { \
+ yuv2p01xlX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0, bits); \
+ } \
+ \
+ static void yuv2p0 ## bits ## lX_BE_c(const int16_t *filter, \
+ int filterSize, const int16_t **src, \
+ uint8_t *dest, int dstW, \
+ const uint8_t *dither, int offset) \
+ { \
+ yuv2p01xlX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1, bits); \
+ } \
+ \
+ static void yuv2p0 ## bits ## cX_LE_c(enum AVPixelFormat dstFormat, \
+ const uint8_t *chrDither, \
+ const int16_t *chrFilter, \
+ int chrFilterSize, \
+ const int16_t **chrUSrc, \
+ const int16_t **chrVSrc, \
+ uint8_t *dest8, int chrDstW) \
+ { \
+ yuv2p01xcX_c(0, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, \
+ dest8, chrDstW, bits); \
+ } \
+ \
+ static void yuv2p0 ## bits ## cX_BE_c(enum AVPixelFormat dstFormat, \
+ const uint8_t *chrDither, \
+ const int16_t *chrFilter, \
+ int chrFilterSize, \
+ const int16_t **chrUSrc, \
+ const int16_t **chrVSrc, \
+ uint8_t *dest8, int chrDstW) \
+ { \
+ yuv2p01xcX_c(1, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, \
+ dest8, chrDstW, bits); \
+ }
+
+yuv2p01x_wrapper(10);
+yuv2p01x_wrapper(12);
#define accumulate_bit(acc, val) \
acc <<= 1; \
@@ -2675,10 +2691,16 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
if (isSemiPlanarYUV(dstFormat) && isDataInHighBits(dstFormat)) {
- av_assert0(desc->comp[0].depth == 10);
- *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c;
- *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c;
- *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c;
+ if (desc->comp[0].depth == 10) {
+ *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c;
+ *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c;
+ *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c;
+ } else if (desc->comp[0].depth == 12) {
+ *yuv2plane1 = isBE(dstFormat) ? yuv2p012l1_BE_c : yuv2p012l1_LE_c;
+ *yuv2planeX = isBE(dstFormat) ? yuv2p012lX_BE_c : yuv2p012lX_LE_c;
+ *yuv2nv12cX = isBE(dstFormat) ? yuv2p012cX_BE_c : yuv2p012cX_LE_c;
+ } else
+ av_assert0(0);
} else if (is16BPS(dstFormat)) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a5a9bc589a..599c326754 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -236,8 +236,8 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_AYUV64LE] = { 1, 1},
[AV_PIX_FMT_P010LE] = { 1, 1 },
[AV_PIX_FMT_P010BE] = { 1, 1 },
- [AV_PIX_FMT_P012LE] = { 1, 0 },
- [AV_PIX_FMT_P012BE] = { 1, 0 },
+ [AV_PIX_FMT_P012LE] = { 1, 1 },
+ [AV_PIX_FMT_P012BE] = { 1, 1 },
[AV_PIX_FMT_P016LE] = { 1, 1 },
[AV_PIX_FMT_P016BE] = { 1, 1 },
[AV_PIX_FMT_GRAYF32LE] = { 1, 1 },
diff --git a/tests/ref/fate/filter-pixdesc-p012be b/tests/ref/fate/filter-pixdesc-p012be
new file mode 100644
index 0000000000..217ca49157
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-p012be
@@ -0,0 +1 @@
+pixdesc-p012be 784a49bf554861da9d0809a615bcf813
diff --git a/tests/ref/fate/filter-pixdesc-p012le b/tests/ref/fate/filter-pixdesc-p012le
new file mode 100644
index 0000000000..681cd48b4b
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-p012le
@@ -0,0 +1 @@
+pixdesc-p012le 0268fd44f63022e21ada69704534fc85
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index 371b94c62e..d92dd169dc 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -62,6 +62,8 @@ nv24 f30fc8d0ac40af69e119ea919a314572
nv42 29a212f70f8780fe0eb99abcae81894d
p010be 7f9842d6015026136bad60d03c035cc3
p010le c453421b9f726bdaf2bacf59a492c43b
+p012be 7f9842d6015026136bad60d03c035cc3
+p012le 1929db89609c4b8c6d9c9030a9e7843d
p016be 7f9842d6015026136bad60d03c035cc3
p016le c453421b9f726bdaf2bacf59a492c43b
p210be 847e9c6e292b17349e69570829252b3e
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index 364e881aef..f7103a5906 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -60,6 +60,8 @@ nv24 514c8f12082f0737e558778cbe7de258
nv42 ece9baae1c5de579dac2c66a89e08ef3
p010be 8b2de2eb6b099bbf355bfc55a0694ddc
p010le 373b50c766dfd0a8e79c9a73246d803a
+p012be 8b2de2eb6b099bbf355bfc55a0694ddc
+p012le a1e4f713e145dfc465bfe0cc77096a03
p016be 8b2de2eb6b099bbf355bfc55a0694ddc
p016le 373b50c766dfd0a8e79c9a73246d803a
p210be 2947f43774352ef61f9e83777548c7c5
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 768b3f474a..910728e512 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -62,6 +62,8 @@ nv24 3b100fb527b64ee2b2d7120da573faf5
nv42 1841ce853152d86b27c130f319ea0db2
p010be a0311a09bba7383553267d2b3b9c075e
p010le ee09a18aefa3ebe97715b3a7312cb8ff
+p012be a0311a09bba7383553267d2b3b9c075e
+p012le f1cc90d292046109a626db2da9f0f9b6
p016be a0311a09bba7383553267d2b3b9c075e
p016le ee09a18aefa3ebe97715b3a7312cb8ff
p210be 58d46f566ab28e3bcfb715c7aa53cf58
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index 6fbc472a4e..1e37027ec2 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -60,6 +60,8 @@ nv24 f0c5b2f42970f8d4003621d8857a872f
nv42 4dcf9aec82b110712b396a8b365dcb13
p010be 744b13e44d39e1ff7588983fa03e0101
p010le a50b160346ab94f55a425065b57006f0
+p012be 744b13e44d39e1ff7588983fa03e0101
+p012le aeb31f50c66f376b0530c7bb6287212b
p016be 744b13e44d39e1ff7588983fa03e0101
p016le a50b160346ab94f55a425065b57006f0
p210be 6f5a76d6467b86d55fe5589d3af8a7ea
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 09748c2d08..9efbf5d8e1 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -62,6 +62,8 @@ nv24 554153c71d142e3fd8e40b7dcaaec229
nv42 d699724c8deaeb4f87faf2766512eec3
p010be 3df51286ef66b53e3e283dbbab582263
p010le eadcd8241e97e35b2b47d5eb2eaea6cd
+p012be 3df51286ef66b53e3e283dbbab582263
+p012le 38945445b360fa737e9e37257393e823
p016be 3df51286ef66b53e3e283dbbab582263
p016le eadcd8241e97e35b2b47d5eb2eaea6cd
p210be 29ec4e8912d456cd15203a96487c42e8
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index 371b94c62e..d92dd169dc 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -62,6 +62,8 @@ nv24 f30fc8d0ac40af69e119ea919a314572
nv42 29a212f70f8780fe0eb99abcae81894d
p010be 7f9842d6015026136bad60d03c035cc3
p010le c453421b9f726bdaf2bacf59a492c43b
+p012be 7f9842d6015026136bad60d03c035cc3
+p012le 1929db89609c4b8c6d9c9030a9e7843d
p016be 7f9842d6015026136bad60d03c035cc3
p016le c453421b9f726bdaf2bacf59a492c43b
p210be 847e9c6e292b17349e69570829252b3e
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 07aaea6b06..d659ef6121 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -27,6 +27,7 @@ nv21 0fdeb2cdd56cf5a7147dc273456fa217
nv24 193b9eadcc06ad5081609f76249b3e47
nv42 1738ad3c31c6c16e17679f5b09ce4677
p010le fbbc23cc1d764a5e6fb71883d985f3ed
+p012le 3a92c1bd3e9de050bf6abcc3fd911ab7
p016le fbbc23cc1d764a5e6fb71883d985f3ed
p210le 680912c059de39c3401cac856bd1b0c1
p216le 8718662e226a4581561e7bb532af2d83
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index e1bbe961e1..017eeee84f 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -62,6 +62,8 @@ nv24 2aa6e805bf6d4179ed8d7dea37d75db3
nv42 80714d1eb2d8bcaeab3abc3124df1abd
p010be 1d6726d94bf1385996a9a9840dd0e878
p010le 4b316f2b9e18972299beb73511278fa8
+p012be e4dc7ccd654c2d74fde9c7b2711d960b
+p012le cd4b6bdcd8967fc0e869ce3b8a014133
p016be 31e204018cbb53f8988c4e1174ea8ce9
p016le d5afe557f492a09317e525d7cb782f5b
p210be 2cc6dfcf5e006c8ed5238988a06fd45e
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index 0c2993d5b0..f1b16ca528 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -59,6 +59,8 @@ nv24 ea9de8b47faed722ee40182f89489beb
nv42 636af6cd6a4f3ac5edc0fc3ce3c56d63
p010be ad0de2cc9bff81688b182a870fcf7000
p010le e7ff5143595021246733ce6bd0a769e8
+p012be ad0de2cc9bff81688b182a870fcf7000
+p012le 024ef1cf56a4872f202b96a6a4bbf10a
p016be ad0de2cc9bff81688b182a870fcf7000
p016le e7ff5143595021246733ce6bd0a769e8
p410be 8b3e0ccb31b6a20ff00a29253fb2dec3
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 5cac61a9d2..814008cefd 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -62,6 +62,8 @@ nv24 334420b9d3df84499d2ca16bb66eed2b
nv42 ba4063e2795c17fea3c8a646b01fd1f5
p010be 06e9354b6e0e38ba41736352cedc0bd5
p010le fd18d322bffbf5816902c13102872e22
+p012be 06e9354b6e0e38ba41736352cedc0bd5
+p012le cdf6a3c38d9d4e3f079fa369e1dda662
p016be 06e9354b6e0e38ba41736352cedc0bd5
p016le fd18d322bffbf5816902c13102872e22
p210be ca886ab2b3ea5c153f1954b3709f7249
--
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 2/4] swscale/output: add support for XV36LE
2022-09-06 19:58 [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 1/4] swscale/output: add support for P012 Philip Langdale
@ 2022-09-06 19:58 ` Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 3/4] swscale/output: add support for XV30LE Philip Langdale
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Philip Langdale @ 2022-09-06 19:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libswscale/output.c | 29 ++++++++++++++++++++++++
libswscale/utils.c | 2 +-
tests/ref/fate/filter-pixdesc-xv36le | 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-scale | 1 +
tests/ref/fate/filter-pixfmts-transpose | 1 +
tests/ref/fate/filter-pixfmts-vflip | 1 +
13 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 tests/ref/fate/filter-pixdesc-xv36le
diff --git a/libswscale/output.c b/libswscale/output.c
index 5cbc7ab748..ba7ecb52d7 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2600,6 +2600,32 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
}
}
+static void
+yuv2xv36le_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)
+{
+ int i;
+ for (i = 0; i < dstW; i++) {
+ int Y = 1 << 14, U = 1 << 14, V = 1 << 14;
+ int j;
+
+ for (j = 0; j < lumFilterSize; j++)
+ Y += lumSrc[j][i] * lumFilter[j];
+
+ for (j = 0; j < chrFilterSize; j++) {
+ U += chrUSrc[j][i] * chrFilter[j];
+ V += chrVSrc[j][i] * chrFilter[j];
+ }
+
+ AV_WL16(dest + 8 * i + 2, av_clip_uintp2(Y >> 15, 12) << 4);
+ AV_WL16(dest + 8 * i + 0, av_clip_uintp2(U >> 15, 12) << 4);
+ AV_WL16(dest + 8 * i + 4, av_clip_uintp2(V >> 15, 12) << 4);
+ }
+}
+
static void
yuv2vuyX_X_c(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
@@ -3192,5 +3218,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case AV_PIX_FMT_VUYX:
*yuv2packedX = yuv2vuyx_X_c;
break;
+ case AV_PIX_FMT_XV36LE:
+ *yuv2packedX = yuv2xv36le_X_c;
+ break;
}
}
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 599c326754..9166e80002 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -266,7 +266,7 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_RGBAF16BE] = { 1, 0 },
[AV_PIX_FMT_RGBAF16LE] = { 1, 0 },
[AV_PIX_FMT_XV30LE] = { 1, 0 },
- [AV_PIX_FMT_XV36LE] = { 1, 0 },
+ [AV_PIX_FMT_XV36LE] = { 1, 1 },
};
int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,
diff --git a/tests/ref/fate/filter-pixdesc-xv36le b/tests/ref/fate/filter-pixdesc-xv36le
new file mode 100644
index 0000000000..8ba8099423
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-xv36le
@@ -0,0 +1 @@
+pixdesc-xv36le 9d00bb58092f8b6d5d6fd71a8aec719a
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index d92dd169dc..c88594f3aa 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -95,6 +95,7 @@ vuya 3d5e934651cae1ce334001cb1829ad22
vuyx 3f68ea6ec492b30d867cb5401562264e
x2bgr10le 550c0d190cf695afa4eaacb644db6b75
x2rgb10le c1e3ac21be04a16bb157b22784524520
+xv36le 3f8ced42a081639a39ec5929dd77b017
xyz12be a1ef56bf746d71f59669c28e48fc8450
xyz12le 831ff03c1ba4ef19374686f16a064d8c
ya16be 37c07787e544f900c87b853253bfc8dd
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index f7103a5906..bdad0d02cd 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -92,6 +92,7 @@ vuya 76578a705ff3a37559653c1289bd03dd
vuyx 5d2bae51a2f4892bd5f177f190cc323b
x2bgr10le 84de725b85662c362862820dc4a309aa
x2rgb10le f4265aca7a67dbfa9354370098ca6f33
+xv36le 90a187adf00a1b15c33d064ae2582804
xyz12be cb4571f9aaa7b59f999ef327276104b7
xyz12le cd6aae8d26b18bdb4b9d068586276d91
ya16be a3d18014454942a96f15a49947c0c55d
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 910728e512..04c51dba45 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -95,6 +95,7 @@ vuya f72bcf29d75cd143d0c565f7cc49119a
vuyx 6257cd1ce11330660e9fa9c675acbdcc
x2bgr10le dbe21538d7cb1744914f6bd46ec09b55
x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677
+xv36le aa5a867879a70e1040dfafe3e03167d5
xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437
xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5
ya16be 40403b5277364777e0671da4d38e01ac
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 258c8563f0..27d72b72aa 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -84,6 +84,7 @@ vuya a3891d4168ff208948fd0b3ba0910495
vuyx d7a900e970c9a69ed41f8b220114b9fa
x2bgr10le 86474d84f26c5c51d6f75bf7e1de8da8
x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676
+xv36le 1bde4bee8b938d7bf20e75bc848e4765
xyz12be 15f5cda71de5fef9cec5e75e3833b6bc
xyz12le 7be6c8781f38c21a6b8f602f62ca31e6
ya16be 0f13e0f52586d172aaa07710fa3e8f31
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index 1e37027ec2..b949628061 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -92,6 +92,7 @@ vuya 7e530261e7ac4eae4fd616fd7572d0b8
vuyx 3ce9890363cad3984521293be1eb679c
x2bgr10le 827cc659f29378e00c5a7d2c0ada8f9a
x2rgb10le d4a8189b65395a88d0a38a7053f3359f
+xv36le cc569285784e38a489f4a286598f05da
xyz12be 25f90259ff8a226befdaec3dfe82996e
xyz12le 926c0791d59aaff61b2778e8ada3316d
ya16be d5b342355bdd9e3197e01b13b7c6301e
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 9efbf5d8e1..064f75b125 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -94,6 +94,7 @@ vuya b9deab5ba249dd608b709c09255a4932
vuyx 49cc92fcc002ec0f312017014dd68c0c
x2bgr10le 135acaff8318cf9861bb0f7849a9e5e9
x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94
+xv36le 066378fad80e34bc3edd22f657be6ff8
xyz12be 7c7d54c55f136cbbc50b18029f3be0b3
xyz12le 090ba6b1170baf2b1358b43b971d33b0
ya16be 7bc720918bc0132e9717acbde89874e0
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index d92dd169dc..c88594f3aa 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -95,6 +95,7 @@ vuya 3d5e934651cae1ce334001cb1829ad22
vuyx 3f68ea6ec492b30d867cb5401562264e
x2bgr10le 550c0d190cf695afa4eaacb644db6b75
x2rgb10le c1e3ac21be04a16bb157b22784524520
+xv36le 3f8ced42a081639a39ec5929dd77b017
xyz12be a1ef56bf746d71f59669c28e48fc8450
xyz12le 831ff03c1ba4ef19374686f16a064d8c
ya16be 37c07787e544f900c87b853253bfc8dd
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index 017eeee84f..3381a118d6 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -95,6 +95,7 @@ vuya ffa817e283bf6a0b6fba21b07523ccaa
vuyx ba182200e20e0c82765eba15217848d3
x2bgr10le d57b9a99033cc7b65ddd111578f2d385
x2rgb10le d56bdb23fa6a8e12a0b4394987f89935
+xv36le eaf5fbd9d5ea04aeefb40f3d7c2ea289
xyz12be c7ba8345998c0141ddc079cdd29b1a40
xyz12le 95f5d3a0de834cc495c9032a14987cde
ya16be 20d4842899d61068f5fb6af478bf26a6
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index f1b16ca528..e270096a60 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -86,6 +86,7 @@ vuya 9ece18a345beb17cd19e09e443eca4bf
vuyx 4c2929cd1c6e5512f62e802f482f0ef2
x2bgr10le 4aa774b6d8f6d446a64f1f288e5c97eb
x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845
+xv36le f15a1d1af2a2967ec6a5efebc87e1ef1
xyz12be 68e5cba640f6e4ef72dff950e88b5342
xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9
ya16be 3e161cb5f225922a80fefdc9cc02a4f9
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 814008cefd..73a7ba0ee8 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -95,6 +95,7 @@ vuya fb849f76e56181e005c31fce75d7038c
vuyx 7a8079a97610e2c1c97aa8832b58a102
x2bgr10le 795b66a5fc83cd2cf300aae51c230f80
x2rgb10le 262c502230cf3724f8e2cf4737f18a42
+xv36le aad3c6b5799b4e46a9c9ac27ee7db9bd
xyz12be 810644e008deb231850d779aaa27cc7e
xyz12le 829701db461b43533cf9241e0743bc61
ya16be 55b1dbbe4d56ed0d22461685ce85520d
--
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 3/4] swscale/output: add support for XV30LE
2022-09-06 19:58 [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 1/4] swscale/output: add support for P012 Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 2/4] swscale/output: add support for XV36LE Philip Langdale
@ 2022-09-06 19:58 ` Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 4/4] swscale/output: add support for Y210LE and Y212LE Philip Langdale
2022-09-10 19:30 ` [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
4 siblings, 0 replies; 6+ messages in thread
From: Philip Langdale @ 2022-09-06 19:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libswscale/output.c | 31 ++++++++++++++++++++++++
libswscale/utils.c | 2 +-
tests/ref/fate/filter-pixdesc-xv30le | 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-scale | 1 +
tests/ref/fate/filter-pixfmts-transpose | 1 +
tests/ref/fate/filter-pixfmts-vflip | 1 +
13 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 tests/ref/fate/filter-pixdesc-xv30le
diff --git a/libswscale/output.c b/libswscale/output.c
index ba7ecb52d7..d8aa5f39db 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2600,6 +2600,34 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
}
}
+static void
+yuv2xv30le_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)
+{
+ int i;
+ for (i = 0; i < dstW; i++) {
+ int Y = 1 << 16, U = 1 << 16, V = 1 << 16;
+ int j;
+
+ for (j = 0; j < lumFilterSize; j++)
+ Y += lumSrc[j][i] * lumFilter[j];
+
+ for (j = 0; j < chrFilterSize; j++) {
+ U += chrUSrc[j][i] * chrFilter[j];
+ V += chrVSrc[j][i] * chrFilter[j];
+ }
+
+ Y = av_clip_uintp2(Y >> 17, 10);
+ U = av_clip_uintp2(U >> 17, 10);
+ V = av_clip_uintp2(V >> 17, 10);
+
+ AV_WL32(dest + 4 * i, U | Y << 10 | V << 20);
+ }
+}
+
static void
yuv2xv36le_X_c(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
@@ -3218,6 +3246,9 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case AV_PIX_FMT_VUYX:
*yuv2packedX = yuv2vuyx_X_c;
break;
+ case AV_PIX_FMT_XV30LE:
+ *yuv2packedX = yuv2xv30le_X_c;
+ break;
case AV_PIX_FMT_XV36LE:
*yuv2packedX = yuv2xv36le_X_c;
break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 9166e80002..ec67020cc9 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -265,7 +265,7 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_VUYX] = { 1, 1 },
[AV_PIX_FMT_RGBAF16BE] = { 1, 0 },
[AV_PIX_FMT_RGBAF16LE] = { 1, 0 },
- [AV_PIX_FMT_XV30LE] = { 1, 0 },
+ [AV_PIX_FMT_XV30LE] = { 1, 1 },
[AV_PIX_FMT_XV36LE] = { 1, 1 },
};
diff --git a/tests/ref/fate/filter-pixdesc-xv30le b/tests/ref/fate/filter-pixdesc-xv30le
new file mode 100644
index 0000000000..9b5ad5417e
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-xv30le
@@ -0,0 +1 @@
+pixdesc-xv30le fb76a14d6d5cf3a0b48f30b2fb59becd
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index c88594f3aa..67383c43f8 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -95,6 +95,7 @@ vuya 3d5e934651cae1ce334001cb1829ad22
vuyx 3f68ea6ec492b30d867cb5401562264e
x2bgr10le 550c0d190cf695afa4eaacb644db6b75
x2rgb10le c1e3ac21be04a16bb157b22784524520
+xv30le c14b5a953bf3be56346f66ca174a5b1b
xv36le 3f8ced42a081639a39ec5929dd77b017
xyz12be a1ef56bf746d71f59669c28e48fc8450
xyz12le 831ff03c1ba4ef19374686f16a064d8c
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index bdad0d02cd..bdb2536f7d 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -92,6 +92,7 @@ vuya 76578a705ff3a37559653c1289bd03dd
vuyx 5d2bae51a2f4892bd5f177f190cc323b
x2bgr10le 84de725b85662c362862820dc4a309aa
x2rgb10le f4265aca7a67dbfa9354370098ca6f33
+xv30le a9edb820819b900a4a897fee4562a4fb
xv36le 90a187adf00a1b15c33d064ae2582804
xyz12be cb4571f9aaa7b59f999ef327276104b7
xyz12le cd6aae8d26b18bdb4b9d068586276d91
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 04c51dba45..853e1b064c 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -95,6 +95,7 @@ vuya f72bcf29d75cd143d0c565f7cc49119a
vuyx 6257cd1ce11330660e9fa9c675acbdcc
x2bgr10le dbe21538d7cb1744914f6bd46ec09b55
x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677
+xv30le e940366c78efc9e292e9de28cf04dba9
xv36le aa5a867879a70e1040dfafe3e03167d5
xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437
xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 27d72b72aa..3e190c2d43 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -84,6 +84,7 @@ vuya a3891d4168ff208948fd0b3ba0910495
vuyx d7a900e970c9a69ed41f8b220114b9fa
x2bgr10le 86474d84f26c5c51d6f75bf7e1de8da8
x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676
+xv30le 25aac48128d94010a3660839500caee5
xv36le 1bde4bee8b938d7bf20e75bc848e4765
xyz12be 15f5cda71de5fef9cec5e75e3833b6bc
xyz12le 7be6c8781f38c21a6b8f602f62ca31e6
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index b949628061..fd5e9723fd 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -92,6 +92,7 @@ vuya 7e530261e7ac4eae4fd616fd7572d0b8
vuyx 3ce9890363cad3984521293be1eb679c
x2bgr10le 827cc659f29378e00c5a7d2c0ada8f9a
x2rgb10le d4a8189b65395a88d0a38a7053f3359f
+xv30le 072aa2b61ce1e764f9d1957e8abee9a9
xv36le cc569285784e38a489f4a286598f05da
xyz12be 25f90259ff8a226befdaec3dfe82996e
xyz12le 926c0791d59aaff61b2778e8ada3316d
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 064f75b125..d82f08d637 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -94,6 +94,7 @@ vuya b9deab5ba249dd608b709c09255a4932
vuyx 49cc92fcc002ec0f312017014dd68c0c
x2bgr10le 135acaff8318cf9861bb0f7849a9e5e9
x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94
+xv30le 7f6414a3fc700380025c29812e8376a9
xv36le 066378fad80e34bc3edd22f657be6ff8
xyz12be 7c7d54c55f136cbbc50b18029f3be0b3
xyz12le 090ba6b1170baf2b1358b43b971d33b0
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index c88594f3aa..67383c43f8 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -95,6 +95,7 @@ vuya 3d5e934651cae1ce334001cb1829ad22
vuyx 3f68ea6ec492b30d867cb5401562264e
x2bgr10le 550c0d190cf695afa4eaacb644db6b75
x2rgb10le c1e3ac21be04a16bb157b22784524520
+xv30le c14b5a953bf3be56346f66ca174a5b1b
xv36le 3f8ced42a081639a39ec5929dd77b017
xyz12be a1ef56bf746d71f59669c28e48fc8450
xyz12le 831ff03c1ba4ef19374686f16a064d8c
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index 3381a118d6..10b94ac516 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -95,6 +95,7 @@ vuya ffa817e283bf6a0b6fba21b07523ccaa
vuyx ba182200e20e0c82765eba15217848d3
x2bgr10le d57b9a99033cc7b65ddd111578f2d385
x2rgb10le d56bdb23fa6a8e12a0b4394987f89935
+xv30le afe68d8a47e8460e0164970b1da0c5be
xv36le eaf5fbd9d5ea04aeefb40f3d7c2ea289
xyz12be c7ba8345998c0141ddc079cdd29b1a40
xyz12le 95f5d3a0de834cc495c9032a14987cde
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index e270096a60..24f4249639 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -86,6 +86,7 @@ vuya 9ece18a345beb17cd19e09e443eca4bf
vuyx 4c2929cd1c6e5512f62e802f482f0ef2
x2bgr10le 4aa774b6d8f6d446a64f1f288e5c97eb
x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845
+xv30le b1ac5a12f46d32c70acb63f89838ab76
xv36le f15a1d1af2a2967ec6a5efebc87e1ef1
xyz12be 68e5cba640f6e4ef72dff950e88b5342
xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 73a7ba0ee8..4fff17e7ab 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -95,6 +95,7 @@ vuya fb849f76e56181e005c31fce75d7038c
vuyx 7a8079a97610e2c1c97aa8832b58a102
x2bgr10le 795b66a5fc83cd2cf300aae51c230f80
x2rgb10le 262c502230cf3724f8e2cf4737f18a42
+xv30le 7e29ee107a1fabf3c7251f337d4b9fe5
xv36le aad3c6b5799b4e46a9c9ac27ee7db9bd
xyz12be 810644e008deb231850d779aaa27cc7e
xyz12le 829701db461b43533cf9241e0743bc61
--
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] 6+ messages in thread
* [FFmpeg-devel] [PATCH 4/4] swscale/output: add support for Y210LE and Y212LE
2022-09-06 19:58 [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
` (2 preceding siblings ...)
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 3/4] swscale/output: add support for XV30LE Philip Langdale
@ 2022-09-06 19:58 ` Philip Langdale
2022-09-10 19:30 ` [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
4 siblings, 0 replies; 6+ messages in thread
From: Philip Langdale @ 2022-09-06 19:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libswscale/output.c | 48 ++++++++++++++++++++++++
libswscale/utils.c | 4 +-
tests/ref/fate/filter-pixdesc-y210le | 1 +
tests/ref/fate/filter-pixdesc-y212le | 1 +
tests/ref/fate/filter-pixfmts-copy | 2 +
tests/ref/fate/filter-pixfmts-field | 2 +
tests/ref/fate/filter-pixfmts-fieldorder | 2 +
tests/ref/fate/filter-pixfmts-il | 2 +
tests/ref/fate/filter-pixfmts-null | 2 +
tests/ref/fate/filter-pixfmts-scale | 2 +
tests/ref/fate/filter-pixfmts-vflip | 2 +
11 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 tests/ref/fate/filter-pixdesc-y210le
create mode 100644 tests/ref/fate/filter-pixdesc-y212le
diff --git a/libswscale/output.c b/libswscale/output.c
index d8aa5f39db..496b3caeb8 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2732,6 +2732,48 @@ yuv2vuyx_X_c(SwsContext *c, const int16_t *lumFilter,
chrUSrc, chrVSrc, chrFilterSize, alpSrc, dest, dstW, y, 0);
}
+#define output_pixel(pos, val, bits) \
+ AV_WL16(pos, av_clip_uintp2(val >> shift, bits) << output_shift);
+
+#define yuv2y2xx_wrapper(bits) \
+ static void \
+ yuv2y2 ## bits ## le_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) \
+ { \
+ int i, j; \
+ int shift = 11 + 16 - bits; \
+ int output_shift = 16 - bits; \
+ for (i = 0; i < ((dstW + 1) >> 1); i++) { \
+ int Y1 = 1 << (shift - 1), Y2 = 1 << (shift - 1); \
+ int U = 1 << (shift - 1), V = 1 << (shift - 1); \
+ \
+ for (j = 0; j < lumFilterSize; j++) { \
+ Y1 += lumSrc[j][i * 2] * lumFilter[j]; \
+ Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j]; \
+ } \
+ \
+ for (j = 0; j < chrFilterSize; j++) { \
+ U += chrUSrc[j][i] * chrFilter[j]; \
+ V += chrVSrc[j][i] * chrFilter[j]; \
+ } \
+ \
+ output_pixel(dest + 8 * i + 0, Y1, bits); \
+ output_pixel(dest + 8 * i + 2, U, bits); \
+ output_pixel(dest + 8 * i + 4, Y2, bits); \
+ output_pixel(dest + 8 * i + 6, V, bits); \
+ } \
+ }
+
+yuv2y2xx_wrapper(10);
+yuv2y2xx_wrapper(12);
+
+#undef output_pixel
+
av_cold void ff_sws_init_output_funcs(SwsContext *c,
yuv2planar1_fn *yuv2plane1,
yuv2planarX_fn *yuv2planeX,
@@ -3252,5 +3294,11 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case AV_PIX_FMT_XV36LE:
*yuv2packedX = yuv2xv36le_X_c;
break;
+ case AV_PIX_FMT_Y210LE:
+ *yuv2packedX = yuv2y210le_X_c;
+ break;
+ case AV_PIX_FMT_Y212LE:
+ *yuv2packedX = yuv2y212le_X_c;
+ break;
}
}
diff --git a/libswscale/utils.c b/libswscale/utils.c
index ec67020cc9..14e2700733 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -248,8 +248,8 @@ static const FormatEntry format_entries[] = {
[AV_PIX_FMT_YUVA444P12LE] = { 1, 1 },
[AV_PIX_FMT_NV24] = { 1, 1 },
[AV_PIX_FMT_NV42] = { 1, 1 },
- [AV_PIX_FMT_Y210LE] = { 1, 0 },
- [AV_PIX_FMT_Y212LE] = { 1, 0 },
+ [AV_PIX_FMT_Y210LE] = { 1, 1 },
+ [AV_PIX_FMT_Y212LE] = { 1, 1 },
[AV_PIX_FMT_X2RGB10LE] = { 1, 1 },
[AV_PIX_FMT_X2BGR10LE] = { 1, 1 },
[AV_PIX_FMT_P210BE] = { 1, 1 },
diff --git a/tests/ref/fate/filter-pixdesc-y210le b/tests/ref/fate/filter-pixdesc-y210le
new file mode 100644
index 0000000000..c6dc202948
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-y210le
@@ -0,0 +1 @@
+pixdesc-y210le 7b0ba4b531e7dccca7f2a49102b23991
diff --git a/tests/ref/fate/filter-pixdesc-y212le b/tests/ref/fate/filter-pixdesc-y212le
new file mode 100644
index 0000000000..5dd6357bf3
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-y212le
@@ -0,0 +1 @@
+pixdesc-y212le d481592126b10ef2d5f71a2ccac0ebe5
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index 67383c43f8..b28a114c7b 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -99,6 +99,8 @@ xv30le c14b5a953bf3be56346f66ca174a5b1b
xv36le 3f8ced42a081639a39ec5929dd77b017
xyz12be a1ef56bf746d71f59669c28e48fc8450
xyz12le 831ff03c1ba4ef19374686f16a064d8c
+y210le 0736b017e0814daf38d3350c42796f7a
+y212le 825768be8fe92708ae80be84855066ed
ya16be 37c07787e544f900c87b853253bfc8dd
ya16le e8cab8fad88cba6d285b224d8bf0d4df
ya8 dbb99fbcdc204aaa1a7397ff561f1a67
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 853e1b064c..4e5a798471 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -99,6 +99,8 @@ xv30le e940366c78efc9e292e9de28cf04dba9
xv36le aa5a867879a70e1040dfafe3e03167d5
xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437
xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5
+y210le 025beb25f047a762e3788dbea4b60864
+y212le ac2a47c45187dd54d0f55293cbffd954
ya16be 40403b5277364777e0671da4d38e01ac
ya16le 54f3295f5326a13d456ac53e973ba398
ya8 28cea4f98ed452bd3da9c752e5e3399c
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 3e190c2d43..bebaf07371 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -88,6 +88,8 @@ xv30le 25aac48128d94010a3660839500caee5
xv36le 1bde4bee8b938d7bf20e75bc848e4765
xyz12be 15f5cda71de5fef9cec5e75e3833b6bc
xyz12le 7be6c8781f38c21a6b8f602f62ca31e6
+y210le ee45acfb1386288af98af5313162ff3e
+y212le 2f08fb195b948056c844acb1eee8d649
ya16be 0f13e0f52586d172aaa07710fa3e8f31
ya16le d481d93ea1a1a04d759d9994958983de
ya8 055ac5ab5ff8533dd319edc17a398af1
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index d82f08d637..ec9d809721 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -98,6 +98,8 @@ xv30le 7f6414a3fc700380025c29812e8376a9
xv36le 066378fad80e34bc3edd22f657be6ff8
xyz12be 7c7d54c55f136cbbc50b18029f3be0b3
xyz12le 090ba6b1170baf2b1358b43b971d33b0
+y210le 306ec4238b49dbc8625a97b678ea1c5f
+y212le d5a2b4677ddb4a3bc3e5cd5cbb20f426
ya16be 7bc720918bc0132e9717acbde89874e0
ya16le 61203295a8d39601b841de90f2c9797b
ya8 a38d6e288f582f1a04310232ed764afc
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index 67383c43f8..b28a114c7b 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -99,6 +99,8 @@ xv30le c14b5a953bf3be56346f66ca174a5b1b
xv36le 3f8ced42a081639a39ec5929dd77b017
xyz12be a1ef56bf746d71f59669c28e48fc8450
xyz12le 831ff03c1ba4ef19374686f16a064d8c
+y210le 0736b017e0814daf38d3350c42796f7a
+y212le 825768be8fe92708ae80be84855066ed
ya16be 37c07787e544f900c87b853253bfc8dd
ya16le e8cab8fad88cba6d285b224d8bf0d4df
ya8 dbb99fbcdc204aaa1a7397ff561f1a67
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index 10b94ac516..525306ec12 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -99,6 +99,8 @@ xv30le afe68d8a47e8460e0164970b1da0c5be
xv36le eaf5fbd9d5ea04aeefb40f3d7c2ea289
xyz12be c7ba8345998c0141ddc079cdd29b1a40
xyz12le 95f5d3a0de834cc495c9032a14987cde
+y210le 1c2708a520477f955d1fedf6ca7a41bd
+y212le 39a3c0c843041ad4501b3107dd91ef17
ya16be 20d4842899d61068f5fb6af478bf26a6
ya16le 6a05895adce85143ae1c1b3470cb4070
ya8 0a9db5bb4b009de9197eede5e9d19e16
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 4fff17e7ab..b7b0526588 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -99,6 +99,8 @@ xv30le 7e29ee107a1fabf3c7251f337d4b9fe5
xv36le aad3c6b5799b4e46a9c9ac27ee7db9bd
xyz12be 810644e008deb231850d779aaa27cc7e
xyz12le 829701db461b43533cf9241e0743bc61
+y210le 9544c81f8e1fc95e9fa4009dbecfea25
+y212le c801725ae31e3b8f5be269359d49f191
ya16be 55b1dbbe4d56ed0d22461685ce85520d
ya16le d5bf02471823a16dc523a46cace0101a
ya8 4299c6ca3b470a7d8a420e26eb485b1d
--
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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats
2022-09-06 19:58 [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
` (3 preceding siblings ...)
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 4/4] swscale/output: add support for Y210LE and Y212LE Philip Langdale
@ 2022-09-10 19:30 ` Philip Langdale
4 siblings, 0 replies; 6+ messages in thread
From: Philip Langdale @ 2022-09-10 19:30 UTC (permalink / raw)
To: ffmpeg-devel
On Tue, 6 Sep 2022 12:58:18 -0700
Philip Langdale <philipl@overt.org> wrote:
> This patch set adds output support to complement the input supported
> added previously.
>
> As in the input changes, I did not implement BE support where the
> infrastructure didn't already exist (ie: only P012 has it) because
> these formats aren't expected to be used except in conjunction with
> Intel VAAPI which will always be little endina.
>
> Philip Langdale (4):
> swscale/output: add support for P012
> swscale/output: add support for XV36LE
> swscale/output: add support for XV30LE
> swscale/output: add support for Y210LE and Y212LE
>
> libswscale/output.c | 248
> +++++++++++++++++------ libswscale/utils.c |
> 12 +- tests/ref/fate/filter-pixdesc-p012be | 1 +
> tests/ref/fate/filter-pixdesc-p012le | 1 +
> tests/ref/fate/filter-pixdesc-xv30le | 1 +
> tests/ref/fate/filter-pixdesc-xv36le | 1 +
> tests/ref/fate/filter-pixdesc-y210le | 1 +
> tests/ref/fate/filter-pixdesc-y212le | 1 +
> tests/ref/fate/filter-pixfmts-copy | 6 +
> tests/ref/fate/filter-pixfmts-crop | 4 +
> tests/ref/fate/filter-pixfmts-field | 6 +
> tests/ref/fate/filter-pixfmts-fieldorder | 4 +
> tests/ref/fate/filter-pixfmts-hflip | 4 +
> tests/ref/fate/filter-pixfmts-il | 6 +
> tests/ref/fate/filter-pixfmts-null | 6 +
> tests/ref/fate/filter-pixfmts-pad | 1 +
> tests/ref/fate/filter-pixfmts-scale | 6 +
> tests/ref/fate/filter-pixfmts-transpose | 4 +
> tests/ref/fate/filter-pixfmts-vflip | 6 +
> 19 files changed, 254 insertions(+), 65 deletions(-)
> create mode 100644 tests/ref/fate/filter-pixdesc-p012be
> create mode 100644 tests/ref/fate/filter-pixdesc-p012le
> create mode 100644 tests/ref/fate/filter-pixdesc-xv30le
> create mode 100644 tests/ref/fate/filter-pixdesc-xv36le
> create mode 100644 tests/ref/fate/filter-pixdesc-y210le
> create mode 100644 tests/ref/fate/filter-pixdesc-y212le
>
Series pushed. Thanks.
--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] 6+ messages in thread
end of thread, other threads:[~2022-09-10 19:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 19:58 [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 1/4] swscale/output: add support for P012 Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 2/4] swscale/output: add support for XV36LE Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 3/4] swscale/output: add support for XV30LE Philip Langdale
2022-09-06 19:58 ` [FFmpeg-devel] [PATCH 4/4] swscale/output: add support for Y210LE and Y212LE Philip Langdale
2022-09-10 19:30 ` [FFmpeg-devel] [PATCH 0/4] swscale/output: Add support for new VAAPI formats Philip Langdale
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