Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] Pixel format support fixes in swscale and drawutils
@ 2021-12-24  3:08 rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 01/16] swscale/output: template-ize yuv2nv12cX 10-bit and 16-bit cases rcombs
                   ` (17 more replies)
  0 siblings, 18 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

This patchset is also available as a GitHub pull request for review simplicity:
https://github.com/FFmpeg/FFmpeg/pull/380

- Reduce hardcoding of pixfmt lists, preferring deriving properties from pixdesc
- Fix big-endian support for P[N]10/P[N]16 in swscale
- Fix several drawutils issues and add new pixfmt support
- Add more defensive checks in drawutils


_______________________________________________
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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 01/16] swscale/output: template-ize yuv2nv12cX 10-bit and 16-bit cases
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 02/16] swscale: introduce isDataInHighBits rcombs
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

Fixes incorrect big-endian output introduced in 88d804b7ffa20caab2e8e2809da974c41f7fd8fc

Avoids making the filter-time BE check more expensive
---
 libswscale/output.c                      | 48 ++++++++++++++++++++----
 tests/ref/fate/filter-pixdesc-p210be     |  2 +-
 tests/ref/fate/filter-pixdesc-p216be     |  2 +-
 tests/ref/fate/filter-pixdesc-p410be     |  2 +-
 tests/ref/fate/filter-pixdesc-p416be     |  2 +-
 tests/ref/fate/filter-pixfmts-copy       |  8 ++--
 tests/ref/fate/filter-pixfmts-crop       |  8 ++--
 tests/ref/fate/filter-pixfmts-field      |  8 ++--
 tests/ref/fate/filter-pixfmts-fieldorder |  8 ++--
 tests/ref/fate/filter-pixfmts-hflip      |  8 ++--
 tests/ref/fate/filter-pixfmts-il         |  8 ++--
 tests/ref/fate/filter-pixfmts-null       |  8 ++--
 tests/ref/fate/filter-pixfmts-scale      |  8 ++--
 tests/ref/fate/filter-pixfmts-transpose  |  4 +-
 tests/ref/fate/filter-pixfmts-vflip      |  8 ++--
 15 files changed, 83 insertions(+), 49 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 4b4b186be9..e7cea49096 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -180,17 +180,18 @@ yuv2planeX_16_c_template(const int16_t *filter, int filterSize,
     }
 }
 
-static void yuv2p016cX_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
+static av_always_inline void
+yuv2nv12cX_16_c_template(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;
     const int32_t **uSrc = (const int32_t **)chrUSrc;
     const int32_t **vSrc = (const int32_t **)chrVSrc;
     int shift = 15;
-    int big_endian = dstFormat == AV_PIX_FMT_P016BE;
     int i, j;
+    av_assert0(output_bits == 16);
 
     for (i = 0; i < chrDstW; i++) {
         int u = 1 << (shift - 1);
@@ -367,6 +368,7 @@ static void yuv2planeX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filter
                          filterSize, (const typeX_t **) src, \
                          (uint16_t *) dest, dstW, is_be, bits); \
 }
+
 yuv2NBPS( 9, BE, 1, 10, int16_t)
 yuv2NBPS( 9, LE, 0, 10, int16_t)
 yuv2NBPS(10, BE, 1, 10, int16_t)
@@ -378,6 +380,23 @@ yuv2NBPS(14, LE, 0, 10, int16_t)
 yuv2NBPS(16, BE, 1, 16, int32_t)
 yuv2NBPS(16, LE, 0, 16, int32_t)
 
+
+static void yuv2nv12cX_16LE_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)
+{
+    yuv2nv12cX_16_c_template(0, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, dest8, chrDstW, 16);
+}
+
+static void yuv2nv12cX_16BE_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)
+{
+    yuv2nv12cX_16_c_template(1, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, dest8, chrDstW, 16);
+}
+
 static void yuv2planeX_8_c(const int16_t *filter, int filterSize,
                            const int16_t **src, uint8_t *dest, int dstW,
                            const uint8_t *dither, int offset)
@@ -477,14 +496,13 @@ static void yuv2p010lX_c(const int16_t *filter, int filterSize,
     }
 }
 
-static void yuv2p010cX_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
+static void yuv2p010cX_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)
 {
     uint16_t *dest = (uint16_t*)dest8;
     int shift = 17;
-    int big_endian = dstFormat == AV_PIX_FMT_P010BE;
     int i, j;
 
     for (i = 0; i < chrDstW; i++) {
@@ -529,6 +547,22 @@ static void yuv2p010lX_BE_c(const int16_t *filter, int filterSize,
     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
 
 
@@ -2568,14 +2602,14 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
         dstFormat == AV_PIX_FMT_P410LE || dstFormat == AV_PIX_FMT_P410BE) {
         *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c;
         *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c;
-        *yuv2nv12cX = yuv2p010cX_c;
+        *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c;
     } else if (is16BPS(dstFormat)) {
         *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c  : yuv2planeX_16LE_c;
         *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c  : yuv2plane1_16LE_c;
         if (dstFormat == AV_PIX_FMT_P016LE || dstFormat == AV_PIX_FMT_P016BE ||
             dstFormat == AV_PIX_FMT_P216LE || dstFormat == AV_PIX_FMT_P216BE ||
             dstFormat == AV_PIX_FMT_P416LE || dstFormat == AV_PIX_FMT_P416BE) {
-          *yuv2nv12cX = yuv2p016cX_c;
+          *yuv2nv12cX = isBE(dstFormat) ? yuv2nv12cX_16BE_c : yuv2nv12cX_16LE_c;
         }
     } else if (isNBPS(dstFormat)) {
         if (desc->comp[0].depth == 9) {
diff --git a/tests/ref/fate/filter-pixdesc-p210be b/tests/ref/fate/filter-pixdesc-p210be
index b7d15ff93d..9ff89d14a0 100644
--- a/tests/ref/fate/filter-pixdesc-p210be
+++ b/tests/ref/fate/filter-pixdesc-p210be
@@ -1 +1 @@
-pixdesc-p210be      9f3465e388d91beeb5cb7fe0011c5a67
+pixdesc-p210be      016fd90989d14914bbbcc7dc2968bef0
diff --git a/tests/ref/fate/filter-pixdesc-p216be b/tests/ref/fate/filter-pixdesc-p216be
index 657136996a..932c5b2708 100644
--- a/tests/ref/fate/filter-pixdesc-p216be
+++ b/tests/ref/fate/filter-pixdesc-p216be
@@ -1 +1 @@
-pixdesc-p216be      db5cabe6e5f1814a6d20e8398aec4785
+pixdesc-p216be      d95084fa0758169851f57455a9624a2e
diff --git a/tests/ref/fate/filter-pixdesc-p410be b/tests/ref/fate/filter-pixdesc-p410be
index 26ff981622..27de3ee0bb 100644
--- a/tests/ref/fate/filter-pixdesc-p410be
+++ b/tests/ref/fate/filter-pixdesc-p410be
@@ -1 +1 @@
-pixdesc-p410be      85671676fa52d0350c918f45417f3c64
+pixdesc-p410be      33d7e8e5d6a85cc22fcbf0c12c7bafd0
diff --git a/tests/ref/fate/filter-pixdesc-p416be b/tests/ref/fate/filter-pixdesc-p416be
index 5a23be5d72..f67b553d42 100644
--- a/tests/ref/fate/filter-pixdesc-p416be
+++ b/tests/ref/fate/filter-pixdesc-p416be
@@ -1 +1 @@
-pixdesc-p416be      a7d8a859ce47c3860e0fee31539a84b0
+pixdesc-p416be      6a4b1b2fc8435acfc82312109f13bc58
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index b090739bd2..f06fa1574e 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -63,13 +63,13 @@ p010be              7f9842d6015026136bad60d03c035cc3
 p010le              c453421b9f726bdaf2bacf59a492c43b
 p016be              7f9842d6015026136bad60d03c035cc3
 p016le              c453421b9f726bdaf2bacf59a492c43b
-p210be              6df2a72ee297e53f9ac7f96acf0ef5d5
+p210be              847e9c6e292b17349e69570829252b3e
 p210le              c06e4b76cf504e908128081f92b60ce2
-p216be              01d10b0d17c9f575b512dff36623a85b
+p216be              f5009974fc1cd5d552705eeb52de35d9
 p216le              2f634e1a3cd5c9c122e0f2ebadb3503d
-p410be              d9af5b8126ea7457edaf0c90ad0cb2b7
+p410be              7c2509d2df4bbb199ab653ebb6dce61e
 p410le              527761e1f4381007044679710a352ecc
-p416be              fc5c1c45567de4a6bc9dbc8eef30116d
+p416be              fd828e966d45ae908f5d2d4b3349b816
 p416le              983064bfd506be1e26cd57bafc14ae50
 pal8                ff5929f5b42075793b2c34cb441bede5
 rgb0                0de71e5a1f97f81fb51397a0435bfa72
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index 93353ad16a..8b26ab9c53 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -61,13 +61,13 @@ p010be              8b2de2eb6b099bbf355bfc55a0694ddc
 p010le              373b50c766dfd0a8e79c9a73246d803a
 p016be              8b2de2eb6b099bbf355bfc55a0694ddc
 p016le              373b50c766dfd0a8e79c9a73246d803a
-p210be              b75f0e53a245e49af955fe210fc31bb8
+p210be              2947f43774352ef61f9e83777548c7c5
 p210le              74fcd5a32eee687eebe002c884103963
-p216be              89cb3a4bd44ba624c1395e7ea6998dde
+p216be              41351128eaf636041c8987698730391a
 p216le              e56f5e5b0d4460d56f27a5df8a4a1462
-p410be              37e56737c2421aa59a33c57423d58616
+p410be              e17c78ff059363177548412e6ab4e65f
 p410le              75f910c7282d8065d97f502ba974c481
-p416be              13b2dc247bdb0ab7e5532f75048f5a2c
+p416be              52f08b8a56a09d6e954c2eab6cf24d99
 p416le              ecb78b327ea5cfe1fff82945c1fca310
 pal8                1f2cdc8e718f95c875dbc1034a688bfb
 rgb0                736646b70dd9a0be22b8da8041e35035
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index bcd1a0a45b..c4838d1446 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -63,13 +63,13 @@ p010be              a0311a09bba7383553267d2b3b9c075e
 p010le              ee09a18aefa3ebe97715b3a7312cb8ff
 p016be              a0311a09bba7383553267d2b3b9c075e
 p016le              ee09a18aefa3ebe97715b3a7312cb8ff
-p210be              341db7c98afd2767d48cdd72e224df2f
+p210be              58d46f566ab28e3bcfb715c7aa53cf58
 p210le              8d68f7655a3d76f2f8436bd25beb3973
-p216be              0dde930860e940dced179884c359f720
+p216be              dd1f3e0bb5c49775a598ab29802fc268
 p216le              b573c0473a1368813d077487cc9bce0e
-p410be              9e9a812b74854226271c5f7dc18c37b7
+p410be              658fd0d92eb327cbd562abafc8694db7
 p410le              c981188c7fd9f32988a9f4732303f82b
-p416be              203203e6788a80b52d2ca6ba629beb9c
+p416be              66616bf2320464b5e9b6372d48b6b9a9
 p416le              1039b97bbe42ef0af1bc46d2c0fc819e
 pal8                0658c18dcd8d052d59dfbe23f5b368d9
 rgb0                ca3fa6e865b91b3511c7f2bf62830059
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 761ef422b5..32c06bae4c 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -55,13 +55,13 @@ grayf32be           1aa7960131f880c54fe3c77f13448674
 grayf32le           4029ac9d197f255794c1b9e416520fc7
 nv24                4fdbef26042c77f012df114e666efdb2
 nv42                59608290fece913e6b7d61edf581a529
-p210be              82958903f553e9d2d91549bd44559a5a
+p210be              ca2ce2c25db43dcd14729b2a72a7c604
 p210le              755363012d8801b96ead2e8b1b4d2ab8
-p216be              7159f11beb9138932f8d60b95efe96dc
+p216be              17741c0cdb65914ad13c5114121a175f
 p216le              c0c888ab7bde56638732344076b3b2ba
-p410be              411f89fadbee1ca43d2918eba583bea5
+p410be              b6d65b820198ca6ff0103d9794727792
 p410le              2771dd3ae54a439921f51c29e79b6799
-p416be              de6b84bd524e8fcfc251634cae416069
+p416be              a0f8b5acad8fafc45fc7b2275fac1d84
 p416le              2e73af44eb933580da59981176848dcc
 rgb0                2e3d8c91c7a83d451593dfd06607ff39
 rgb24               b82577f8215d3dc2681be60f1da247af
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index 1fc26b9fb5..4d3efe3cdc 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -61,13 +61,13 @@ p010be              744b13e44d39e1ff7588983fa03e0101
 p010le              a50b160346ab94f55a425065b57006f0
 p016be              744b13e44d39e1ff7588983fa03e0101
 p016le              a50b160346ab94f55a425065b57006f0
-p210be              174cdf99f18658724e269bf38d2b653b
+p210be              6f5a76d6467b86d55fe5589d3af8a7ea
 p210le              b6982912b2376371edea4fccf99fe40c
-p216be              c58f03c6668ab0fbc3ee1a2da051e28c
+p216be              c1b58f61cd6df9cf01c3086786fb8a69
 p216le              1f5213bebf4c99634f57290f5ad99c0d
-p410be              aa40aa32be7aa353252bac70b5edc175
+p410be              2e06214ea84595aa1294239b0f1e900f
 p410le              1143c811c383e4461b1192dca0c74246
-p416be              8863e9156ee7edcb6b9e6ac01a2e338c
+p416be              da6807d924b63a54b804d32e427524bf
 p416le              a42b88cabc4395aa0bf1bcbbc876f48f
 pal8                5b7c77d99817b4f52339742a47de7797
 rgb0                0092452f37d73da20193265ace0b7d57
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 7e7f057afa..4623f2420c 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -63,13 +63,13 @@ p010be              3df51286ef66b53e3e283dbbab582263
 p010le              eadcd8241e97e35b2b47d5eb2eaea6cd
 p016be              3df51286ef66b53e3e283dbbab582263
 p016le              eadcd8241e97e35b2b47d5eb2eaea6cd
-p210be              4992fe87c600dfb177b1e2e6aa0f922c
+p210be              29ec4e8912d456cd15203a96487c42e8
 p210le              c695064fb9f2cc4e35957d4d649cc281
-p216be              98b73479f0ea9843768c162c449c3ac5
+p216be              ad85bdc59755608602608a9438bb82ea
 p216le              77757390da383a90981e461d128d8789
-p410be              a7183a01888b47a4d9f3672073c7ea7d
+p410be              2128861337e660232e6fb664cc4de3e6
 p410le              6cf3a3e199b327f4f013e0346410d7a8
-p416be              4dc4aebf18e09e8f8b49db90ae5ec127
+p416be              47dec75cefeb6220be7731bc25b7be9c
 p416le              4990b51ff889d9ee23e68997f81c09f1
 rgb0                cfaf68671e43248267d8cd50cae8c13f
 rgb24               88894f608cf33ba310f21996748d77a7
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index b090739bd2..f06fa1574e 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -63,13 +63,13 @@ p010be              7f9842d6015026136bad60d03c035cc3
 p010le              c453421b9f726bdaf2bacf59a492c43b
 p016be              7f9842d6015026136bad60d03c035cc3
 p016le              c453421b9f726bdaf2bacf59a492c43b
-p210be              6df2a72ee297e53f9ac7f96acf0ef5d5
+p210be              847e9c6e292b17349e69570829252b3e
 p210le              c06e4b76cf504e908128081f92b60ce2
-p216be              01d10b0d17c9f575b512dff36623a85b
+p216be              f5009974fc1cd5d552705eeb52de35d9
 p216le              2f634e1a3cd5c9c122e0f2ebadb3503d
-p410be              d9af5b8126ea7457edaf0c90ad0cb2b7
+p410be              7c2509d2df4bbb199ab653ebb6dce61e
 p410le              527761e1f4381007044679710a352ecc
-p416be              fc5c1c45567de4a6bc9dbc8eef30116d
+p416be              fd828e966d45ae908f5d2d4b3349b816
 p416le              983064bfd506be1e26cd57bafc14ae50
 pal8                ff5929f5b42075793b2c34cb441bede5
 rgb0                0de71e5a1f97f81fb51397a0435bfa72
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index a5a4ac4cba..43074b84a7 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -63,13 +63,13 @@ p010be              1d6726d94bf1385996a9a9840dd0e878
 p010le              4b316f2b9e18972299beb73511278fa8
 p016be              31e204018cbb53f8988c4e1174ea8ce9
 p016le              d5afe557f492a09317e525d7cb782f5b
-p210be              42be1e97427247317444afa836969667
+p210be              2cc6dfcf5e006c8ed5238988a06fd45e
 p210le              04efb8f14a9d98417af40954a06aa187
-p216be              caa0268d0f6779343a4432b6bc832c5b
+p216be              2f649a226812c8e5a553c4e22d301684
 p216le              c8f65811f717a12706a598561c6df46d
-p410be              f580b8dcf5a826c94258eeba837fd874
+p410be              354cd1324ad382df1a3d573833323cce
 p410le              90fdd95ec4482c127d98307550a885c6
-p416be              a1242f80d32705a757f4d3553542ae1f
+p416be              aa54294859a8e6cb2c9cf64d343fdb60
 p416le              d91a0858ea8d2cf1ed29f179c9ad9666
 pal8                29e10892009b2cfe431815ec3052ed3b
 rgb0                fbd27e98154efb7535826afed41e9bb0
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index dc3a0628ee..922666cf95 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -61,9 +61,9 @@ p010be              ad0de2cc9bff81688b182a870fcf7000
 p010le              e7ff5143595021246733ce6bd0a769e8
 p016be              ad0de2cc9bff81688b182a870fcf7000
 p016le              e7ff5143595021246733ce6bd0a769e8
-p410be              171453dc34dd3c77659914e2202c5aa6
+p410be              8b3e0ccb31b6a20ff00a29253fb2dec3
 p410le              4e5f78dfccda9a6387e81354a56a033a
-p416be              ff09601f127101a8ce8997b9ae0fd6bf
+p416be              350a90bda53349435d89ec13533726b7
 p416le              7bb46e2aec65669a27502ec452941237
 rgb0                31ea5da7fe779c6ea0a33f1d28aad918
 rgb24               47654cabaaad79170b90afd5a02161dd
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index 7736e372ad..3a53bb5837 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -63,13 +63,13 @@ p010be              06e9354b6e0e38ba41736352cedc0bd5
 p010le              fd18d322bffbf5816902c13102872e22
 p016be              06e9354b6e0e38ba41736352cedc0bd5
 p016le              fd18d322bffbf5816902c13102872e22
-p210be              328b09bb0c70571617901322b4194023
+p210be              ca886ab2b3ea5c153f1954b3709f7249
 p210le              d71c2d4e483030ffd87fa6a68c83fce0
-p216be              e4ab026532db1dfee38cedef384e605b
+p216be              7f268f755ed02592b3a49fd5f7bd48bb
 p216le              2c0a660762527706799c4705ca50a9c5
-p410be              637fb064c2ce173de5cf431aa9267914
+p410be              4c603e4464ed3f34cc432b4d1f912082
 p410le              849308a1cdf41e055019cf311d1b2201
-p416be              8e9cf1b695c0a33b6094dd6c7b3722d9
+p416be              7e7657ab40cf953351a14ea76e296519
 p416le              0991d7fff4e2caf36be219ecdd9619d4
 pal8                450b0155d0f2d5628bf95a442db5f817
 rgb0                56a7ea69541bcd27bef6a5615784722b
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 02/16] swscale: introduce isDataInHighBits
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 01/16] swscale/output: template-ize yuv2nv12cX 10-bit and 16-bit cases rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 03/16] swscale/output: use isSemiPlanarYUV for 16-bit case rcombs
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libswscale/swscale_internal.h    | 19 +++++++++++++++++++
 libswscale/tests/pixdesc_query.c |  1 +
 tests/ref/fate/sws-pixdesc-query | 12 ++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 64aa0b9804..b4acaceebd 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -892,6 +892,25 @@ static av_always_inline int usePal(enum AVPixelFormat pix_fmt)
     }
 }
 
+/*
+ * Identity formats where the data is in the high bits, and the low bits are shifted away.
+ */
+static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt)
+{
+    int i;
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+    av_assert0(desc);
+    if (desc->flags & (AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_HWACCEL))
+        return 0;
+    for (i = 0; i < desc->nb_components; i++) {
+        if (!desc->comp[i].shift)
+            return 0;
+        if ((desc->comp[i].shift + desc->comp[i].depth) & 0x7)
+            return 0;
+    }
+    return 1;
+}
+
 extern const uint64_t ff_dither4[2];
 extern const uint64_t ff_dither8[2];
 
diff --git a/libswscale/tests/pixdesc_query.c b/libswscale/tests/pixdesc_query.c
index f6dd8bae68..dce2e50577 100644
--- a/libswscale/tests/pixdesc_query.c
+++ b/libswscale/tests/pixdesc_query.c
@@ -45,6 +45,7 @@ static const struct {
     {"PackedRGB",   isPackedRGB},
     {"PlanarRGB",   isPlanarRGB},
     {"usePal",      usePal},
+    {"DataInHighBits", isDataInHighBits},
 };
 
 static int cmp_str(const void *a, const void *b)
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index 553c039061..a17284784f 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -952,3 +952,15 @@ usePal:
   rgb4_byte
   rgb8
 
+DataInHighBits:
+  p010be
+  p010le
+  p210be
+  p210le
+  p410be
+  p410le
+  xyz12be
+  xyz12le
+  y210be
+  y210le
+
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 03/16] swscale/output: use isSemiPlanarYUV for 16-bit case
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 01/16] swscale/output: template-ize yuv2nv12cX 10-bit and 16-bit cases rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 02/16] swscale: introduce isDataInHighBits rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 04/16] swscale/output: use isDataInHighBits for 10-bit case rcombs
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libswscale/output.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index e7cea49096..e43eb7835e 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2606,9 +2606,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
     } else if (is16BPS(dstFormat)) {
         *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c  : yuv2planeX_16LE_c;
         *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c  : yuv2plane1_16LE_c;
-        if (dstFormat == AV_PIX_FMT_P016LE || dstFormat == AV_PIX_FMT_P016BE ||
-            dstFormat == AV_PIX_FMT_P216LE || dstFormat == AV_PIX_FMT_P216BE ||
-            dstFormat == AV_PIX_FMT_P416LE || dstFormat == AV_PIX_FMT_P416BE) {
+        if (isSemiPlanarYUV(dstFormat)) {
           *yuv2nv12cX = isBE(dstFormat) ? yuv2nv12cX_16BE_c : yuv2nv12cX_16LE_c;
         }
     } else if (isNBPS(dstFormat)) {
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 04/16] swscale/output: use isDataInHighBits for 10-bit case
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (2 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 03/16] swscale/output: use isSemiPlanarYUV for 16-bit case rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 05/16] swscale: introduce isSwappedChroma rcombs
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

This code will need fleshing-out (probably templating) if we ever add
e.g. a P012 format.
---
 libswscale/output.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index e43eb7835e..7cedb145aa 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2597,9 +2597,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
     enum AVPixelFormat dstFormat = c->dstFormat;
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
 
-    if (dstFormat == AV_PIX_FMT_P010LE || dstFormat == AV_PIX_FMT_P010BE ||
-        dstFormat == AV_PIX_FMT_P210LE || dstFormat == AV_PIX_FMT_P210BE ||
-        dstFormat == AV_PIX_FMT_P410LE || dstFormat == AV_PIX_FMT_P410BE) {
+    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;
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 05/16] swscale: introduce isSwappedChroma
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (3 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 04/16] swscale/output: use isDataInHighBits for 10-bit case rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 06/16] swscale/output: use isSemiPlanarYUV for NV12/21/24/42 case rcombs
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libswscale/swscale_internal.h    | 19 +++++++++++++++++++
 libswscale/tests/pixdesc_query.c |  1 +
 tests/ref/fate/sws-pixdesc-query |  5 +++++
 3 files changed, 25 insertions(+)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index b4acaceebd..3a78d95ba6 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -911,6 +911,25 @@ static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt)
     return 1;
 }
 
+/*
+ * Identity formats where the chroma planes are swapped (CrCb order).
+ */
+static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt)
+{
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+    av_assert0(desc);
+    if (!isYUV(pix_fmt))
+        return 0;
+    if ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) && desc->nb_components < 4)
+        return 0;
+    if (desc->nb_components < 3)
+        return 0;
+    if (!isPlanarYUV(pix_fmt) || isSemiPlanarYUV(pix_fmt))
+        return desc->comp[1].offset > desc->comp[2].offset;
+    else
+        return desc->comp[1].plane > desc->comp[2].plane;
+}
+
 extern const uint64_t ff_dither4[2];
 extern const uint64_t ff_dither8[2];
 
diff --git a/libswscale/tests/pixdesc_query.c b/libswscale/tests/pixdesc_query.c
index dce2e50577..eb793877a0 100644
--- a/libswscale/tests/pixdesc_query.c
+++ b/libswscale/tests/pixdesc_query.c
@@ -46,6 +46,7 @@ static const struct {
     {"PlanarRGB",   isPlanarRGB},
     {"usePal",      usePal},
     {"DataInHighBits", isDataInHighBits},
+    {"SwappedChroma", isSwappedChroma},
 };
 
 static int cmp_str(const void *a, const void *b)
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index a17284784f..76104bc5a6 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -964,3 +964,8 @@ DataInHighBits:
   y210be
   y210le
 
+SwappedChroma:
+  nv21
+  nv42
+  yvyu422
+
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 06/16] swscale/output: use isSemiPlanarYUV for NV12/21/24/42 case
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (4 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 05/16] swscale: introduce isSwappedChroma rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 07/16] swscale/output: use isSwappedChroma rcombs
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libswscale/output.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 7cedb145aa..90f5efa16e 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2632,8 +2632,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
     } else {
         *yuv2plane1 = yuv2plane1_8_c;
         *yuv2planeX = yuv2planeX_8_c;
-        if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21 ||
-            dstFormat == AV_PIX_FMT_NV24 || dstFormat == AV_PIX_FMT_NV42)
+        if (isSemiPlanarYUV(dstFormat))
             *yuv2nv12cX = yuv2nv12cX_c;
     }
 
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 07/16] swscale/output: use isSwappedChroma
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (5 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 06/16] swscale/output: use isSemiPlanarYUV for NV12/21/24/42 case rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 08/16] lavfi/drawutils: move BE check out of loop rcombs
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libswscale/output.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 90f5efa16e..773f3ce059 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -429,8 +429,7 @@ static void yuv2nv12cX_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither,
 {
     int i;
 
-    if (dstFormat == AV_PIX_FMT_NV12 ||
-        dstFormat == AV_PIX_FMT_NV24)
+    if (!isSwappedChroma(dstFormat))
         for (i=0; i<chrDstW; i++) {
             int u = chrDither[i & 7] << 12;
             int v = chrDither[(i + 3) & 7] << 12;
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 08/16] lavfi/drawutils: move BE check out of loop
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (6 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 07/16] swscale/output: use isSwappedChroma rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 09/16] lavfi/drawutils: remove redundant BE format checks rcombs
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libavfilter/drawutils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 88218b913f..79570e71da 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -89,6 +89,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
 
     if (!desc || !desc->name)
         return AVERROR(EINVAL);
+    if (desc->flags & AV_PIX_FMT_FLAG_BE)
+        return AVERROR(ENOSYS);
     if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA))
         return AVERROR(ENOSYS);
     if (format == AV_PIX_FMT_P010LE || format == AV_PIX_FMT_P010BE || format == AV_PIX_FMT_P016LE || format == AV_PIX_FMT_P016BE)
@@ -101,8 +103,6 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         /* for now, only 8-16 bits formats */
         if (c->depth < 8 || c->depth > 16)
             return AVERROR(ENOSYS);
-        if (desc->flags & AV_PIX_FMT_FLAG_BE)
-            return AVERROR(ENOSYS);
         if (c->plane >= MAX_PLANES)
             return AVERROR(ENOSYS);
         /* strange interleaving */
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 09/16] lavfi/drawutils: remove redundant BE format checks
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (7 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 08/16] lavfi/drawutils: move BE check out of loop rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 10/16] lavfi/drawutils: reject shift-packed formats rcombs
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

We already explicitly don't support big-endian in general
---
 libavfilter/drawutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 79570e71da..6b46f5803d 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -93,7 +93,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         return AVERROR(ENOSYS);
     if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA))
         return AVERROR(ENOSYS);
-    if (format == AV_PIX_FMT_P010LE || format == AV_PIX_FMT_P010BE || format == AV_PIX_FMT_P016LE || format == AV_PIX_FMT_P016BE)
+    if (format == AV_PIX_FMT_P010LE || format == AV_PIX_FMT_P016LE)
         return AVERROR(ENOSYS);
     if (format == AV_PIX_FMT_YUVJ420P || format == AV_PIX_FMT_YUVJ422P || format == AV_PIX_FMT_YUVJ444P ||
         format == AV_PIX_FMT_YUVJ411P || format == AV_PIX_FMT_YUVJ440P)
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 10/16] lavfi/drawutils: reject shift-packed formats
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (8 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 09/16] lavfi/drawutils: remove redundant BE format checks rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 11/16] lavfi/drawutils: reimplement ff_fill_rgba_map without hardcoding the list rcombs
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

Disables x2bgr10/x2rgb10 (which did not behave correctly before).
---
 libavfilter/drawutils.c           | 3 +++
 tests/ref/fate/filter-pixfmts-pad | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 6b46f5803d..0965afb03e 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -105,6 +105,9 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
             return AVERROR(ENOSYS);
         if (c->plane >= MAX_PLANES)
             return AVERROR(ENOSYS);
+        /* data must either be in the high or low bits, never middle */
+        if (c->shift && ((c->shift + c->depth) & 0x7))
+            return AVERROR(ENOSYS);
         /* strange interleaving */
         if (pixelstep[c->plane] != 0 &&
             pixelstep[c->plane] != c->step)
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 1362d198b4..74981cd6c1 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -32,8 +32,6 @@ p416le              6db094f8d7d27d7299bf9496ad66e2e0
 rgb0                78d500c8361ab6423a4826a00268c908
 rgb24               17f9e2e0c609009acaf2175c42d4a2a5
 rgba                b157c90191463d34fb3ce77b36c96386
-x2bgr10le           d4aff89f5e15ccbb1812f319874ed444
-x2rgb10le           a0c5925bd56b6f85f918c4e9fb93e90e
 xyz12le             85abf80b77a9236a76ba0b00fcbdea2d
 ya16le              940fafa240b9916de5f73cb20a552f24
 ya8                 5fc0f471207ddf7aa01b07027d56b672
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 11/16] lavfi/drawutils: reimplement ff_fill_rgba_map without hardcoding the list
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (9 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 10/16] lavfi/drawutils: reject shift-packed formats rcombs
@ 2021-12-24  3:08 ` rcombs
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 12/16] lavfi/drawutils: ensure we don't allow mixed-byte-depth formats rcombs
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:08 UTC (permalink / raw)
  To: ffmpeg-devel

Same outputs, but computed instead of statically known, so new formats will be
supported more easily. Asserts in place to ensure we update this if we add
anything incompatible with its logic.
---
 libavfilter/drawutils.c | 81 ++++++++++++++++++++---------------------
 1 file changed, 39 insertions(+), 42 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 0965afb03e..e4d6ddcf4c 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include "libavutil/avassert.h"
 #include "libavutil/avutil.h"
 #include "libavutil/colorspace.h"
 #include "libavutil/intreadwrite.h"
@@ -32,50 +33,46 @@ enum { RED = 0, GREEN, BLUE, ALPHA };
 
 int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
 {
-    switch (pix_fmt) {
-    case AV_PIX_FMT_0RGB:
-    case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
-    case AV_PIX_FMT_0BGR:
-    case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
-    case AV_PIX_FMT_RGB48LE:
-    case AV_PIX_FMT_RGB48BE:
-    case AV_PIX_FMT_RGBA64BE:
-    case AV_PIX_FMT_RGBA64LE:
-    case AV_PIX_FMT_RGB0:
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
-    case AV_PIX_FMT_BGR48LE:
-    case AV_PIX_FMT_BGR48BE:
-    case AV_PIX_FMT_BGRA64BE:
-    case AV_PIX_FMT_BGRA64LE:
-    case AV_PIX_FMT_BGRA:
-    case AV_PIX_FMT_BGR0:
-    case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
-    case AV_PIX_FMT_GBRP9LE:
-    case AV_PIX_FMT_GBRP9BE:
-    case AV_PIX_FMT_GBRP10LE:
-    case AV_PIX_FMT_GBRP10BE:
-    case AV_PIX_FMT_GBRP12LE:
-    case AV_PIX_FMT_GBRP12BE:
-    case AV_PIX_FMT_GBRP14LE:
-    case AV_PIX_FMT_GBRP14BE:
-    case AV_PIX_FMT_GBRP16LE:
-    case AV_PIX_FMT_GBRP16BE:
-    case AV_PIX_FMT_GBRAP:
-    case AV_PIX_FMT_GBRAP10LE:
-    case AV_PIX_FMT_GBRAP10BE:
-    case AV_PIX_FMT_GBRAP12LE:
-    case AV_PIX_FMT_GBRAP12BE:
-    case AV_PIX_FMT_GBRAP16LE:
-    case AV_PIX_FMT_GBRAP16BE:
-    case AV_PIX_FMT_GBRPF32LE:
-    case AV_PIX_FMT_GBRPF32BE:
-    case AV_PIX_FMT_GBRAPF32LE:
-    case AV_PIX_FMT_GBRAPF32BE:
-    case AV_PIX_FMT_GBRP:  rgba_map[GREEN] = 0; rgba_map[BLUE ] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
-    default:                    /* unsupported */
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+    if (!(desc->flags & AV_PIX_FMT_FLAG_RGB))
         return AVERROR(EINVAL);
+    if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM)
+        return AVERROR(EINVAL);
+    av_assert0(desc->nb_components == 3 + !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA));
+    if (desc->flags & AV_PIX_FMT_FLAG_PLANAR) {
+        rgba_map[RED]   = desc->comp[0].plane;
+        rgba_map[GREEN] = desc->comp[1].plane;
+        rgba_map[BLUE]  = desc->comp[2].plane;
+        rgba_map[ALPHA] = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? desc->comp[3].plane : 3;
+    } else {
+        int had0 = 0;
+        unsigned depthb = 0;
+        unsigned i;
+        for (i = 0; i < desc->nb_components; i++) {
+            /* all components must have same depth in bytes */
+            unsigned db = (desc->comp[i].depth + 7) / 8;
+            unsigned pos = desc->comp[i].offset / db;
+            if (depthb && (depthb != db))
+                return AVERROR(ENOSYS);
+
+            if (desc->comp[i].offset % db)
+                return AVERROR(ENOSYS);
+
+            had0 |= pos == 0;
+            rgba_map[i] = pos;
+        }
+
+        if (desc->nb_components == 3)
+            rgba_map[ALPHA] = had0 ? 3 : 0;
     }
+
+    av_assert0(rgba_map[RED]   != rgba_map[GREEN]);
+    av_assert0(rgba_map[GREEN] != rgba_map[BLUE]);
+    av_assert0(rgba_map[BLUE]  != rgba_map[RED]);
+    av_assert0(rgba_map[RED]   != rgba_map[ALPHA]);
+    av_assert0(rgba_map[GREEN] != rgba_map[ALPHA]);
+    av_assert0(rgba_map[BLUE]  != rgba_map[ALPHA]);
+
     return 0;
 }
 
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 12/16] lavfi/drawutils: ensure we don't allow mixed-byte-depth formats
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (10 preceding siblings ...)
  2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 11/16] lavfi/drawutils: reimplement ff_fill_rgba_map without hardcoding the list rcombs
@ 2021-12-24  3:09 ` rcombs
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 13/16] lavfi/drawutils: ensure we can't overflow a component rcombs
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:09 UTC (permalink / raw)
  To: ffmpeg-devel

These could be hazardous because of FFDrawColor's union
---
 libavfilter/drawutils.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index e4d6ddcf4c..99c124822d 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -83,6 +83,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
     unsigned i, nb_planes = 0;
     int pixelstep[MAX_PLANES] = { 0 };
     int full_range = 0;
+    int depthb = 0;
 
     if (!desc || !desc->name)
         return AVERROR(EINVAL);
@@ -96,6 +97,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         format == AV_PIX_FMT_YUVJ411P || format == AV_PIX_FMT_YUVJ440P)
         full_range = 1;
     for (i = 0; i < desc->nb_components; i++) {
+        int db;
         c = &desc->comp[i];
         /* for now, only 8-16 bits formats */
         if (c->depth < 8 || c->depth > 16)
@@ -105,6 +107,11 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         /* data must either be in the high or low bits, never middle */
         if (c->shift && ((c->shift + c->depth) & 0x7))
             return AVERROR(ENOSYS);
+        /* mixed >8 and <=8 depth */
+        db = (c->depth + 7) / 8;
+        if (depthb && (depthb != db))
+            return AVERROR(ENOSYS);
+        depthb = db;
         /* strange interleaving */
         if (pixelstep[c->plane] != 0 &&
             pixelstep[c->plane] != c->step)
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 13/16] lavfi/drawutils: ensure we can't overflow a component
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (11 preceding siblings ...)
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 12/16] lavfi/drawutils: ensure we don't allow mixed-byte-depth formats rcombs
@ 2021-12-24  3:09 ` rcombs
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 14/16] lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsets rcombs
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:09 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libavfilter/drawutils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 99c124822d..bcdb669bd3 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -112,6 +112,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         if (depthb && (depthb != db))
             return AVERROR(ENOSYS);
         depthb = db;
+        if (db * (c->offset + 1) > 16)
+            return AVERROR(ENOSYS);
         /* strange interleaving */
         if (pixelstep[c->plane] != 0 &&
             pixelstep[c->plane] != c->step)
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 14/16] lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsets
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (12 preceding siblings ...)
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 13/16] lavfi/drawutils: ensure we can't overflow a component rcombs
@ 2021-12-24  3:09 ` rcombs
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 15/16] lavfi/drawutils: overhaul to improve pixel format support rcombs
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:09 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libavfilter/drawutils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index bcdb669bd3..5308fcbc0f 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -114,6 +114,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         depthb = db;
         if (db * (c->offset + 1) > 16)
             return AVERROR(ENOSYS);
+        if (c->offset % db)
+            return AVERROR(ENOSYS);
         /* strange interleaving */
         if (pixelstep[c->plane] != 0 &&
             pixelstep[c->plane] != c->step)
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 15/16] lavfi/drawutils: overhaul to improve pixel format support
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (13 preceding siblings ...)
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 14/16] lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsets rcombs
@ 2021-12-24  3:09 ` rcombs
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 16/16] lavfi/drawutils: re-enable P010 and P016 support rcombs
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:09 UTC (permalink / raw)
  To: ffmpeg-devel

- No longer mixes u8 and u16 component accesses (this was UB)
- De-duplicated 8->16 conversion
- De-duplicated component -> plane+offset conversion
- De-duplicated planar + packed RGB
- No longer calls ff_fill_rgba_map
- Removed redundant comp_mask data member
- RGB0 and related formats no longer write an alpha value to the 0 byte
- Non-planar YA formats now work correctly
- High-bit-depth semi-planar YUV now works correctly
---
 libavfilter/drawutils.c           | 110 +++++++++++++-----------------
 libavfilter/drawutils.h           |   1 -
 tests/ref/fate/filter-pixfmts-pad |  20 +++---
 3 files changed, 58 insertions(+), 73 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 5308fcbc0f..cbb2582fe0 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -137,66 +137,49 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
     memcpy(draw->pixelstep, pixelstep, sizeof(draw->pixelstep));
     draw->hsub[1] = draw->hsub[2] = draw->hsub_max = desc->log2_chroma_w;
     draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h;
-    for (i = 0; i < (desc->nb_components - !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(flags & FF_DRAW_PROCESS_ALPHA))); i++)
-        draw->comp_mask[desc->comp[i].plane] |=
-            1 << desc->comp[i].offset;
     return 0;
 }
 
 void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
 {
     unsigned i;
-    uint8_t rgba_map[4];
+    uint8_t tmp8[4];
+    const AVPixFmtDescriptor *desc = draw->desc;
 
     if (rgba != color->rgba)
         memcpy(color->rgba, rgba, sizeof(color->rgba));
-    if ((draw->desc->flags & AV_PIX_FMT_FLAG_RGB) &&
-        ff_fill_rgba_map(rgba_map, draw->format) >= 0) {
-        if (draw->nb_planes == 1) {
-            for (i = 0; i < 4; i++) {
-                color->comp[0].u8[rgba_map[i]] = rgba[i];
-                if (draw->desc->comp[rgba_map[i]].depth > 8) {
-                    color->comp[0].u16[rgba_map[i]] = color->comp[0].u8[rgba_map[i]] << 8;
-                }
-            }
-        } else {
-            for (i = 0; i < 4; i++) {
-                color->comp[rgba_map[i]].u8[0] = rgba[i];
-                if (draw->desc->comp[rgba_map[i]].depth > 8)
-                    color->comp[rgba_map[i]].u16[0] = color->comp[rgba_map[i]].u8[0] << (draw->desc->comp[rgba_map[i]].depth - 8);
-            }
-        }
+
+    memset(color->comp, 0, sizeof(color->comp));
+
+    if (draw->desc->flags & AV_PIX_FMT_FLAG_RGB) {
+        memcpy(tmp8, rgba, sizeof(tmp8));
     } else if (draw->nb_planes >= 2) {
         /* assume YUV */
-        const AVPixFmtDescriptor *desc = draw->desc;
-        color->comp[desc->comp[0].plane].u8[desc->comp[0].offset] = draw->full_range ? RGB_TO_Y_JPEG(rgba[0], rgba[1], rgba[2]) : RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
-        color->comp[desc->comp[1].plane].u8[desc->comp[1].offset] = draw->full_range ? RGB_TO_U_JPEG(rgba[0], rgba[1], rgba[2]) : RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0);
-        color->comp[desc->comp[2].plane].u8[desc->comp[2].offset] = draw->full_range ? RGB_TO_V_JPEG(rgba[0], rgba[1], rgba[2]) : RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0);
-        color->comp[3].u8[0] = rgba[3];
-#define EXPAND(compn) \
-        if (desc->comp[compn].depth > 8) \
-            color->comp[desc->comp[compn].plane].u16[desc->comp[compn].offset] = \
-            color->comp[desc->comp[compn].plane].u8[desc->comp[compn].offset] << \
-                (draw->desc->comp[compn].depth + draw->desc->comp[compn].shift - 8)
-        EXPAND(3);
-        EXPAND(2);
-        EXPAND(1);
-        EXPAND(0);
+        tmp8[0] = draw->full_range ? RGB_TO_Y_JPEG(rgba[0], rgba[1], rgba[2]) : RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
+        tmp8[1] = draw->full_range ? RGB_TO_U_JPEG(rgba[0], rgba[1], rgba[2]) : RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0);
+        tmp8[2] = draw->full_range ? RGB_TO_V_JPEG(rgba[0], rgba[1], rgba[2]) : RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0);
+        tmp8[3] = rgba[3];
     } else if (draw->format == AV_PIX_FMT_GRAY8 || draw->format == AV_PIX_FMT_GRAY8A ||
                draw->format == AV_PIX_FMT_GRAY16LE || draw->format == AV_PIX_FMT_YA16LE ||
                draw->format == AV_PIX_FMT_GRAY9LE  ||
                draw->format == AV_PIX_FMT_GRAY10LE ||
                draw->format == AV_PIX_FMT_GRAY12LE ||
                draw->format == AV_PIX_FMT_GRAY14LE) {
-        const AVPixFmtDescriptor *desc = draw->desc;
-        color->comp[0].u8[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
-        EXPAND(0);
-        color->comp[1].u8[0] = rgba[3];
-        EXPAND(1);
+        tmp8[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
+        tmp8[1] = rgba[3];
     } else {
         av_log(NULL, AV_LOG_WARNING,
                "Color conversion not implemented for %s\n", draw->desc->name);
         memset(color, 128, sizeof(*color));
+        return;
+    }
+
+    for (i = 0; i < desc->nb_components; i++) {
+        if (desc->comp[i].depth > 8)
+            color->comp[desc->comp[i].plane].u16[desc->comp[i].offset / 2] = tmp8[i] <<
+                (draw->desc->comp[i].depth + draw->desc->comp[i].shift - 8);
+        else
+            color->comp[desc->comp[i].plane].u8[desc->comp[i].offset] = tmp8[i];
     }
 }
 
@@ -302,11 +285,6 @@ static void subsampling_bounds(int sub, int *x, int *w, int *start, int *end)
     *w >>= sub;
 }
 
-static int component_used(FFDrawContext *draw, int plane, int comp)
-{
-    return (draw->comp_mask[plane] >> comp) & 1;
-}
-
 /* If alpha is in the [ 0 ; 0x1010101 ] range,
    then alpha * value is in the [ 0 ; 0xFFFFFFFF ] range,
    and >> 24 gives a correct rounding. */
@@ -366,6 +344,9 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color,
     int w_sub, h_sub, x_sub, y_sub, left, right, top, bottom, y;
     uint8_t *p0, *p;
 
+    nb_comp = draw->desc->nb_components -
+        !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));
+
     /* TODO optimize if alpha = 0xFF */
     clip_interval(dst_w, &x0, &w, NULL);
     clip_interval(dst_h, &y0, &h, NULL);
@@ -381,7 +362,6 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color,
     nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));
     nb_planes += !nb_planes;
     for (plane = 0; plane < nb_planes; plane++) {
-        nb_comp = draw->pixelstep[plane];
         p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
         w_sub = w;
         h_sub = h;
@@ -391,17 +371,19 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color,
         subsampling_bounds(draw->vsub[plane], &y_sub, &h_sub, &top, &bottom);
         for (comp = 0; comp < nb_comp; comp++) {
             const int depth = draw->desc->comp[comp].depth;
+            const int offset = draw->desc->comp[comp].offset;
+            const int index = offset / ((depth + 7) / 8);
 
-            if (!component_used(draw, plane, comp))
+            if (draw->desc->comp[comp].plane != plane)
                 continue;
-            p = p0 + comp;
+            p = p0 + offset;
             if (top) {
                 if (depth <= 8) {
-                    blend_line(p, color->comp[plane].u8[comp], alpha >> 1,
+                    blend_line(p, color->comp[plane].u8[index], alpha >> 1,
                                draw->pixelstep[plane], w_sub,
                                draw->hsub[plane], left, right);
                 } else {
-                    blend_line16(p, color->comp[plane].u16[comp], alpha >> 1,
+                    blend_line16(p, color->comp[plane].u16[index], alpha >> 1,
                                  draw->pixelstep[plane], w_sub,
                                  draw->hsub[plane], left, right);
                 }
@@ -409,14 +391,14 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color,
             }
             if (depth <= 8) {
                 for (y = 0; y < h_sub; y++) {
-                    blend_line(p, color->comp[plane].u8[comp], alpha,
+                    blend_line(p, color->comp[plane].u8[index], alpha,
                                draw->pixelstep[plane], w_sub,
                                draw->hsub[plane], left, right);
                     p += dst_linesize[plane];
                 }
             } else {
                 for (y = 0; y < h_sub; y++) {
-                    blend_line16(p, color->comp[plane].u16[comp], alpha,
+                    blend_line16(p, color->comp[plane].u16[index], alpha,
                                  draw->pixelstep[plane], w_sub,
                                  draw->hsub[plane], left, right);
                     p += dst_linesize[plane];
@@ -424,11 +406,11 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color,
             }
             if (bottom) {
                 if (depth <= 8) {
-                    blend_line(p, color->comp[plane].u8[comp], alpha >> 1,
+                    blend_line(p, color->comp[plane].u8[index], alpha >> 1,
                                draw->pixelstep[plane], w_sub,
                                draw->hsub[plane], left, right);
                 } else {
-                    blend_line16(p, color->comp[plane].u16[comp], alpha >> 1,
+                    blend_line16(p, color->comp[plane].u16[index], alpha >> 1,
                                  draw->pixelstep[plane], w_sub,
                                  draw->hsub[plane], left, right);
                 }
@@ -544,6 +526,9 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
     uint8_t *p0, *p;
     const uint8_t *m;
 
+    nb_comp = draw->desc->nb_components -
+        !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));
+
     clip_interval(dst_w, &x0, &mask_w, &xm0);
     clip_interval(dst_h, &y0, &mask_h, &ym0);
     mask += ym0 * mask_linesize;
@@ -559,7 +544,6 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
     nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & FF_DRAW_PROCESS_ALPHA));
     nb_planes += !nb_planes;
     for (plane = 0; plane < nb_planes; plane++) {
-        nb_comp = draw->pixelstep[plane];
         p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
         w_sub = mask_w;
         h_sub = mask_h;
@@ -569,21 +553,23 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
         subsampling_bounds(draw->vsub[plane], &y_sub, &h_sub, &top, &bottom);
         for (comp = 0; comp < nb_comp; comp++) {
             const int depth = draw->desc->comp[comp].depth;
+            const int offset = draw->desc->comp[comp].offset;
+            const int index = offset / ((depth + 7) / 8);
 
-            if (!component_used(draw, plane, comp))
+            if (draw->desc->comp[comp].plane != plane)
                 continue;
-            p = p0 + comp;
+            p = p0 + offset;
             m = mask;
             if (top) {
                 if (depth <= 8) {
                     blend_line_hv(p, draw->pixelstep[plane],
-                                  color->comp[plane].u8[comp], alpha,
+                                  color->comp[plane].u8[index], alpha,
                                   m, mask_linesize, l2depth, w_sub,
                                   draw->hsub[plane], draw->vsub[plane],
                                   xm0, left, right, top);
                 } else {
                     blend_line_hv16(p, draw->pixelstep[plane],
-                                    color->comp[plane].u16[comp], alpha,
+                                    color->comp[plane].u16[index], alpha,
                                     m, mask_linesize, l2depth, w_sub,
                                     draw->hsub[plane], draw->vsub[plane],
                                     xm0, left, right, top);
@@ -594,7 +580,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
             if (depth <= 8) {
                 for (y = 0; y < h_sub; y++) {
                     blend_line_hv(p, draw->pixelstep[plane],
-                                  color->comp[plane].u8[comp], alpha,
+                                  color->comp[plane].u8[index], alpha,
                                   m, mask_linesize, l2depth, w_sub,
                                   draw->hsub[plane], draw->vsub[plane],
                                   xm0, left, right, 1 << draw->vsub[plane]);
@@ -604,7 +590,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
             } else {
                 for (y = 0; y < h_sub; y++) {
                     blend_line_hv16(p, draw->pixelstep[plane],
-                                    color->comp[plane].u16[comp], alpha,
+                                    color->comp[plane].u16[index], alpha,
                                     m, mask_linesize, l2depth, w_sub,
                                     draw->hsub[plane], draw->vsub[plane],
                                     xm0, left, right, 1 << draw->vsub[plane]);
@@ -615,13 +601,13 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
             if (bottom) {
                 if (depth <= 8) {
                     blend_line_hv(p, draw->pixelstep[plane],
-                                  color->comp[plane].u8[comp], alpha,
+                                  color->comp[plane].u8[index], alpha,
                                   m, mask_linesize, l2depth, w_sub,
                                   draw->hsub[plane], draw->vsub[plane],
                                   xm0, left, right, bottom);
                 } else {
                     blend_line_hv16(p, draw->pixelstep[plane],
-                                    color->comp[plane].u16[comp], alpha,
+                                    color->comp[plane].u16[index], alpha,
                                     m, mask_linesize, l2depth, w_sub,
                                     draw->hsub[plane], draw->vsub[plane],
                                     xm0, left, right, bottom);
diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h
index 2ca2475585..396688514e 100644
--- a/libavfilter/drawutils.h
+++ b/libavfilter/drawutils.h
@@ -37,7 +37,6 @@ typedef struct FFDrawContext {
     enum AVPixelFormat format;
     unsigned nb_planes;
     int pixelstep[MAX_PLANES]; /*< offset between pixels */
-    uint8_t comp_mask[MAX_PLANES]; /*< bitmask of used non-alpha components */
     uint8_t hsub[MAX_PLANES];  /*< horizontal subsampling */
     uint8_t vsub[MAX_PLANES];  /*< vertical subsampling */
     uint8_t hsub_max;
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 74981cd6c1..d8c348a0fe 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -1,8 +1,8 @@
-0bgr                7bc6f5a1c44cdd7506174dccf52c68d7
-0rgb                ff12e0f1e576b47a4c962729d5c0b868
+0bgr                55d41bba3609383bf658169f90b30b42
+0rgb                8e076dd0f8a9f4652595dffe3544f0f0
 abgr                52738042432893de555e6a3833172806
 argb                2a10108ac524b422b8a2393c064b3eab
-bgr0                32207a2de1b2ac7937e940a8459b97c0
+bgr0                025d4d5e5691801ba39bc9de70e39df0
 bgr24               f8b65ad845905c7d0c93ca28dfbb826f
 bgra                929aac15e848038e367c250037575f9f
 gbrap               5f16cccab5a17cb766c882e865995167
@@ -25,16 +25,16 @@ nv12                381574979cb04be10c9168540310afad
 nv21                0fdeb2cdd56cf5a7147dc273456fa217
 nv24                193b9eadcc06ad5081609f76249b3e47
 nv42                1738ad3c31c6c16e17679f5b09ce4677
-p210le              10b53de63b086de93c076d1d40f9da42
-p216le              0bbf778e1b6101a3f650ce0454a357f2
-p410le              fcab6381bde9cd84b813925ff29be4d2
-p416le              6db094f8d7d27d7299bf9496ad66e2e0
-rgb0                78d500c8361ab6423a4826a00268c908
+p210le              abc02945a9b9585f0914716e4787cefb
+p216le              1b43feb94b8a030c0c699aa0deff017b
+p410le              1f0294141ae1657d6c10c6a0d46a879f
+p416le              320e558b7ee8d598231ae0763ecca275
+rgb0                0984eb985dabbe757ed6beb53db84eff
 rgb24               17f9e2e0c609009acaf2175c42d4a2a5
 rgba                b157c90191463d34fb3ce77b36c96386
 xyz12le             85abf80b77a9236a76ba0b00fcbdea2d
-ya16le              940fafa240b9916de5f73cb20a552f24
-ya8                 5fc0f471207ddf7aa01b07027d56b672
+ya16le              d85740ba2cac9fa9ea8aaea8a5864407
+ya8                 495daaca2dcb4f7aeba7652768b41ced
 yuv410p             cb871dcc1e84a7ef1d21f9237b88cf6e
 yuv411p             aec2c1740de9a62db0d41f4dda9121b0
 yuv420p             4398e408fc35436ce4b20468946f58b6
-- 
2.33.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] 21+ messages in thread

* [FFmpeg-devel] [PATCH 16/16] lavfi/drawutils: re-enable P010 and P016 support
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (14 preceding siblings ...)
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 15/16] lavfi/drawutils: overhaul to improve pixel format support rcombs
@ 2021-12-24  3:09 ` rcombs
  2021-12-24  9:12 ` [FFmpeg-devel] Pixel format support fixes in swscale and drawutils Diederick C. Niehorster
  2021-12-24 18:17 ` Michael Niedermayer
  17 siblings, 0 replies; 21+ messages in thread
From: rcombs @ 2021-12-24  3:09 UTC (permalink / raw)
  To: ffmpeg-devel

These formats now work as expected.
---
 libavfilter/drawutils.c           | 2 --
 tests/ref/fate/filter-pixfmts-pad | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index cbb2582fe0..65ed61aa92 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -91,8 +91,6 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
         return AVERROR(ENOSYS);
     if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA))
         return AVERROR(ENOSYS);
-    if (format == AV_PIX_FMT_P010LE || format == AV_PIX_FMT_P016LE)
-        return AVERROR(ENOSYS);
     if (format == AV_PIX_FMT_YUVJ420P || format == AV_PIX_FMT_YUVJ422P || format == AV_PIX_FMT_YUVJ444P ||
         format == AV_PIX_FMT_YUVJ411P || format == AV_PIX_FMT_YUVJ440P)
         full_range = 1;
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index d8c348a0fe..519473032e 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -25,6 +25,8 @@ nv12                381574979cb04be10c9168540310afad
 nv21                0fdeb2cdd56cf5a7147dc273456fa217
 nv24                193b9eadcc06ad5081609f76249b3e47
 nv42                1738ad3c31c6c16e17679f5b09ce4677
+p010le              c57224f2dc09601c66aa3365b3cd7254
+p016le              c57224f2dc09601c66aa3365b3cd7254
 p210le              abc02945a9b9585f0914716e4787cefb
 p216le              1b43feb94b8a030c0c699aa0deff017b
 p410le              1f0294141ae1657d6c10c6a0d46a879f
-- 
2.33.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] 21+ messages in thread

* Re: [FFmpeg-devel] Pixel format support fixes in swscale and drawutils
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (15 preceding siblings ...)
  2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 16/16] lavfi/drawutils: re-enable P010 and P016 support rcombs
@ 2021-12-24  9:12 ` Diederick C. Niehorster
  2021-12-24  9:52   ` Ridley Combs
  2021-12-24 18:17 ` Michael Niedermayer
  17 siblings, 1 reply; 21+ messages in thread
From: Diederick C. Niehorster @ 2021-12-24  9:12 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Fri, Dec 24, 2021 at 4:09 AM rcombs <rcombs@rcombs.me> wrote:
>
> This patchset is also available as a GitHub pull request for review simplicity:
> https://github.com/FFmpeg/FFmpeg/pull/380
>
> - Reduce hardcoding of pixfmt lists, preferring deriving properties from pixdesc
> - Fix big-endian support for P[N]10/P[N]16 in swscale
> - Fix several drawutils issues and add new pixfmt support
> - Add more defensive checks in drawutils

Does this patch address https://trac.ffmpeg.org/ticket/8454, and this
patch https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210601040239.2690-1-val.zapod.vz@gmail.com/?
Would be good to pick those up too if you could (not a blocker of course!)
_______________________________________________
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] 21+ messages in thread

* Re: [FFmpeg-devel] Pixel format support fixes in swscale and drawutils
  2021-12-24  9:12 ` [FFmpeg-devel] Pixel format support fixes in swscale and drawutils Diederick C. Niehorster
@ 2021-12-24  9:52   ` Ridley Combs
  0 siblings, 0 replies; 21+ messages in thread
From: Ridley Combs @ 2021-12-24  9:52 UTC (permalink / raw)
  To: ffmpeg-devel



> On Dec 24, 2021, at 03:12, Diederick C. Niehorster <dcnieho@gmail.com> wrote:
> 
> On Fri, Dec 24, 2021 at 4:09 AM rcombs <rcombs@rcombs.me> wrote:
>> 
>> This patchset is also available as a GitHub pull request for review simplicity:
>> https://github.com/FFmpeg/FFmpeg/pull/380
>> 
>> - Reduce hardcoding of pixfmt lists, preferring deriving properties from pixdesc
>> - Fix big-endian support for P[N]10/P[N]16 in swscale
>> - Fix several drawutils issues and add new pixfmt support
>> - Add more defensive checks in drawutils
> 
> Does this patch address https://trac.ffmpeg.org/ticket/8454, and this
> patch https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210601040239.2690-1-val.zapod.vz@gmail.com/?
> Would be good to pick those up too if you could (not a blocker of course!)

No relation to those at all.

> _______________________________________________
> 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".

_______________________________________________
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] 21+ messages in thread

* Re: [FFmpeg-devel] Pixel format support fixes in swscale and drawutils
  2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
                   ` (16 preceding siblings ...)
  2021-12-24  9:12 ` [FFmpeg-devel] Pixel format support fixes in swscale and drawutils Diederick C. Niehorster
@ 2021-12-24 18:17 ` Michael Niedermayer
  2022-01-04 14:52   ` Michael Niedermayer
  17 siblings, 1 reply; 21+ messages in thread
From: Michael Niedermayer @ 2021-12-24 18:17 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 770 bytes --]

On Thu, Dec 23, 2021 at 09:08:48PM -0600, rcombs wrote:
> This patchset is also available as a GitHub pull request for review simplicity:
> https://github.com/FFmpeg/FFmpeg/pull/380
> 
> - Reduce hardcoding of pixfmt lists, preferring deriving properties from pixdesc
> - Fix big-endian support for P[N]10/P[N]16 in swscale
> - Fix several drawutils issues and add new pixfmt support
> - Add more defensive checks in drawutils

I can confirm that this fixes the failed test on MIPS

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] 21+ messages in thread

* Re: [FFmpeg-devel] Pixel format support fixes in swscale and drawutils
  2021-12-24 18:17 ` Michael Niedermayer
@ 2022-01-04 14:52   ` Michael Niedermayer
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Niedermayer @ 2022-01-04 14:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 880 bytes --]

On Fri, Dec 24, 2021 at 07:17:10PM +0100, Michael Niedermayer wrote:
> On Thu, Dec 23, 2021 at 09:08:48PM -0600, rcombs wrote:
> > This patchset is also available as a GitHub pull request for review simplicity:
> > https://github.com/FFmpeg/FFmpeg/pull/380
> > 
> > - Reduce hardcoding of pixfmt lists, preferring deriving properties from pixdesc
> > - Fix big-endian support for P[N]10/P[N]16 in swscale
> > - Fix several drawutils issues and add new pixfmt support
> > - Add more defensive checks in drawutils
> 
> I can confirm that this fixes the failed test on MIPS

please apply and backport this to 5.0 to fix the MIPS regression

thx


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] 21+ messages in thread

end of thread, other threads:[~2022-01-04 14:52 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24  3:08 [FFmpeg-devel] Pixel format support fixes in swscale and drawutils rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 01/16] swscale/output: template-ize yuv2nv12cX 10-bit and 16-bit cases rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 02/16] swscale: introduce isDataInHighBits rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 03/16] swscale/output: use isSemiPlanarYUV for 16-bit case rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 04/16] swscale/output: use isDataInHighBits for 10-bit case rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 05/16] swscale: introduce isSwappedChroma rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 06/16] swscale/output: use isSemiPlanarYUV for NV12/21/24/42 case rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 07/16] swscale/output: use isSwappedChroma rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 08/16] lavfi/drawutils: move BE check out of loop rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 09/16] lavfi/drawutils: remove redundant BE format checks rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 10/16] lavfi/drawutils: reject shift-packed formats rcombs
2021-12-24  3:08 ` [FFmpeg-devel] [PATCH 11/16] lavfi/drawutils: reimplement ff_fill_rgba_map without hardcoding the list rcombs
2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 12/16] lavfi/drawutils: ensure we don't allow mixed-byte-depth formats rcombs
2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 13/16] lavfi/drawutils: ensure we can't overflow a component rcombs
2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 14/16] lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsets rcombs
2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 15/16] lavfi/drawutils: overhaul to improve pixel format support rcombs
2021-12-24  3:09 ` [FFmpeg-devel] [PATCH 16/16] lavfi/drawutils: re-enable P010 and P016 support rcombs
2021-12-24  9:12 ` [FFmpeg-devel] Pixel format support fixes in swscale and drawutils Diederick C. Niehorster
2021-12-24  9:52   ` Ridley Combs
2021-12-24 18:17 ` Michael Niedermayer
2022-01-04 14:52   ` Michael Niedermayer

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