This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 4805f317a605228126c85aace2dbe2a28767d4f9
Author:     Lynne <[email protected]>
AuthorDate: Tue Mar 3 12:30:24 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Tue Mar 24 15:21:17 2026 +0100

    swscale/vulkan: implement SWS_OP_DITHER
    
    Sponsored-by: Sovereign Tech Fund
---
 libswscale/vulkan/ops.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/libswscale/vulkan/ops.c b/libswscale/vulkan/ops.c
index cb2a901eab..0e8fc1eaea 100644
--- a/libswscale/vulkan/ops.c
+++ b/libswscale/vulkan/ops.c
@@ -314,6 +314,28 @@ static int add_ops_glsl(VulkanPriv *p, FFVulkanOpsCtx *s,
                            type_name, type_v, 
ff_sws_pixel_type_name(op->type));
             }
             break;
+        case SWS_OP_DITHER:
+            av_bprintf(&shd->src, "    precise const float dm%i[%i][%i] = {\n",
+                       n, 1 << op->dither.size_log2, 1 << 
op->dither.size_log2);
+            int size = (1 << op->dither.size_log2);
+            for (int i = 0; i < size; i++) {
+                av_bprintf(&shd->src, "        { ");
+                for (int j = 0; j < size; j++)
+                    av_bprintf(&shd->src, "%i/%i.0, ",
+                               op->dither.matrix[i*size + j].num,
+                               op->dither.matrix[i*size + j].den);
+                av_bprintf(&shd->src, "}, %s\n", i == (size - 1) ? "\n    };" 
: "");
+            }
+            for (int i = 0; i < 4; i++) {
+                if (op->dither.y_offset[i] < 0)
+                    continue;
+                av_bprintf(&shd->src, "    %s.%c += dm%i[(pos.y + %i) & %i]"
+                                                        "[pos.x & %i];\n",
+                           type_name, "xyzw"[i], n,
+                           op->dither.y_offset[i], size - 1,
+                           size - 1);
+            }
+            break;
         default:
             return AVERROR(ENOTSUP);
         }

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to