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

Git pushed a commit to branch master
in repository ffmpeg.

commit 3bc265d484b10bece820280b05421b35210a5c1c
Author:     Lynne <[email protected]>
AuthorDate: Wed Feb 4 21:28:26 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Thu Feb 19 19:42:29 2026 +0100

    ffv1enc_vulkan: make reset shader independent from the setup shader
    
    Allows them to run in parallel.
---
 libavcodec/ffv1enc_vulkan.c                | 28 +++++++++++++++-------------
 libavcodec/vulkan/ffv1_common.glsl         |  2 +-
 libavcodec/vulkan/ffv1_enc_reset.comp.glsl |  6 +-----
 3 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/libavcodec/ffv1enc_vulkan.c b/libavcodec/ffv1enc_vulkan.c
index db41ddcf70..911e7b9e9a 100644
--- a/libavcodec/ffv1enc_vulkan.c
+++ b/libavcodec/ffv1enc_vulkan.c
@@ -433,19 +433,21 @@ static int vulkan_encode_ffv1_submit_frame(AVCodecContext 
*avctx,
     nb_buf_bar = 0;
 
     /* Run reset shader */
-    ff_vk_shader_update_desc_buffer(&fv->s, exec, &fv->reset,
-                                    1, 0, 0,
-                                    slice_data_buf,
-                                    0, slice_data_size*f->slice_count,
-                                    VK_FORMAT_UNDEFINED);
-
-    ff_vk_exec_bind_shader(&fv->s, exec, &fv->reset);
-    ff_vk_shader_update_push_const(&fv->s, exec, &fv->reset,
-                                   VK_SHADER_STAGE_COMPUTE_BIT,
-                                   0, sizeof(FFv1ShaderParams), &pd);
-
-    vk->CmdDispatch(exec->buf, fv->ctx.num_h_slices, fv->ctx.num_v_slices,
-                    f->plane_count);
+    if (f->key_frame || fv->force_pcm) {
+        ff_vk_shader_update_desc_buffer(&fv->s, exec, &fv->reset,
+                                        1, 0, 0,
+                                        slice_data_buf,
+                                        0, slice_data_size*f->slice_count,
+                                        VK_FORMAT_UNDEFINED);
+
+        ff_vk_exec_bind_shader(&fv->s, exec, &fv->reset);
+        ff_vk_shader_update_push_const(&fv->s, exec, &fv->reset,
+                                       VK_SHADER_STAGE_COMPUTE_BIT,
+                                       0, sizeof(FFv1ShaderParams), &pd);
+
+        vk->CmdDispatch(exec->buf, fv->ctx.num_h_slices, fv->ctx.num_v_slices,
+                        f->plane_count);
+    }
 
     /* Sync between reset and encode shaders */
     ff_vk_buf_barrier(buf_bar[nb_buf_bar++], slice_data_buf,
diff --git a/libavcodec/vulkan/ffv1_common.glsl 
b/libavcodec/vulkan/ffv1_common.glsl
index 375ce3a946..e7bc8f5e20 100644
--- a/libavcodec/vulkan/ffv1_common.glsl
+++ b/libavcodec/vulkan/ffv1_common.glsl
@@ -55,7 +55,7 @@ const ivec2 chroma_shift = ivec2(chroma_shift_x, 
chroma_shift_y);
 /* Encoder-only */
 layout (constant_id = 15) const bool force_pcm = false;
 layout (constant_id = 16) const bool rct_search = false;
-layout (constant_id = 17) const bool context_model = false;
+layout (constant_id = 17) const uint context_model = 0;
 
 layout (push_constant, scalar) uniform pushConstants {
     u8buf slice_data;
diff --git a/libavcodec/vulkan/ffv1_enc_reset.comp.glsl 
b/libavcodec/vulkan/ffv1_enc_reset.comp.glsl
index e708d03036..4d8637a0d3 100644
--- a/libavcodec/vulkan/ffv1_enc_reset.comp.glsl
+++ b/libavcodec/vulkan/ffv1_enc_reset.comp.glsl
@@ -30,11 +30,7 @@ void main(void)
 {
     const uint slice_idx = gl_WorkGroupID.y*gl_NumWorkGroups.x + 
gl_WorkGroupID.x;
 
-    if (!key_frame && !slice_ctx[slice_idx].slice_reset_contexts)
-        return;
-
-    const uint8_t qidx = 
slice_ctx[slice_idx].quant_table_idx[gl_WorkGroupID.z];
-    uint contexts = context_count[qidx];
+    uint contexts = context_count[context_model];
     uint64_t slice_state_off = uint64_t(slice_state) +
                                slice_idx*plane_state_size*codec_planes;
 

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

Reply via email to