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

Git pushed a commit to branch master
in repository ffmpeg.

commit 7234f1b167240d400869e99dc9a7d0f30ac2e58f
Author:     Lynne <[email protected]>
AuthorDate: Wed Feb 4 18:30:18 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Thu Feb 19 19:42:29 2026 +0100

    ffv1enc_vulkan: use a loop to write slice header symbols
    
    Same as with the decoder.
---
 libavcodec/vulkan/ffv1_enc_setup.comp.glsl | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/libavcodec/vulkan/ffv1_enc_setup.comp.glsl 
b/libavcodec/vulkan/ffv1_enc_setup.comp.glsl
index 53b43e73fc..900aa7432c 100644
--- a/libavcodec/vulkan/ffv1_enc_setup.comp.glsl
+++ b/libavcodec/vulkan/ffv1_enc_setup.comp.glsl
@@ -72,23 +72,30 @@ void put_usymbol(inout RangeCoder c, uint v)
         put_rac_direct(c, state[22 + min(i, 9)], bool(bitfieldExtract(v, i, 
1)));
 }
 
+shared uint hdr_sym[4 + 4 + 3];
+const int nb_hdr_sym = 4 + codec_planes + 3;
+
 void write_slice_header(inout SliceContext sc)
 {
     [[unroll]]
     for (int i = 0; i < CONTEXT_SIZE; i++)
         state[i] = uint8_t(128);
 
-    put_usymbol(sc.c, gl_WorkGroupID.x);
-    put_usymbol(sc.c, gl_WorkGroupID.y);
-    put_usymbol(sc.c, 0);
-    put_usymbol(sc.c, 0);
+    hdr_sym[0] = gl_WorkGroupID.x;
+    hdr_sym[1] = gl_WorkGroupID.y;
+    hdr_sym[2] = 0;
+    hdr_sym[3] = 0;
 
+    [[unroll]]
     for (int i = 0; i < codec_planes; i++)
-        put_usymbol(sc.c, sc.quant_table_idx[i]);
+        hdr_sym[4 + i] = sc.quant_table_idx[i];
+
+    hdr_sym[nb_hdr_sym - 3] = pic_mode;
+    hdr_sym[nb_hdr_sym - 2] = sar.x;
+    hdr_sym[nb_hdr_sym - 1] = sar.y;
 
-    put_usymbol(sc.c, pic_mode);
-    put_usymbol(sc.c, sar.x);
-    put_usymbol(sc.c, sar.y);
+    for (int i = 0; i < nb_hdr_sym; i++)
+        put_usymbol(sc.c, hdr_sym[i]);
 
     if (version >= 4) {
         put_rac_direct(sc.c, state[0], sc.slice_reset_contexts);

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

Reply via email to