This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit fb5d3cf15ecd2a8d8f4b0667533a3cf65a77f241 Author: Lynne <[email protected]> AuthorDate: Wed Feb 4 18:18:07 2026 +0100 Commit: Lynne <[email protected]> CommitDate: Thu Feb 19 19:42:29 2026 +0100 vulkan_ffv1: use a loop to decode slice header symbols All known drivers and implementations inline every single function. This ends up being faster. --- libavcodec/vulkan/ffv1_dec_setup.comp.glsl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libavcodec/vulkan/ffv1_dec_setup.comp.glsl b/libavcodec/vulkan/ffv1_dec_setup.comp.glsl index 3502b4a176..cebff23517 100644 --- a/libavcodec/vulkan/ffv1_dec_setup.comp.glsl +++ b/libavcodec/vulkan/ffv1_dec_setup.comp.glsl @@ -37,7 +37,9 @@ layout (set = 1, binding = 2, scalar) writeonly buffer slice_status_buf { uint32_t slice_status[]; }; -uint8_t setup_state[CONTEXT_SIZE]; +shared uint8_t setup_state[CONTEXT_SIZE]; +shared uint hdr_sym[4 + 4 + 3]; +const int nb_hdr_sym = 4 + codec_planes + 3; uint get_usymbol(inout RangeCoder c) { @@ -68,10 +70,13 @@ bool decode_slice_header(inout SliceContext sc) for (int i = 0; i < CONTEXT_SIZE; i++) setup_state[i] = uint8_t(128); - uint sx = get_usymbol(sc.c); - uint sy = get_usymbol(sc.c); - uint sw = get_usymbol(sc.c) + 1; - uint sh = get_usymbol(sc.c) + 1; + for (int i = 0; i < nb_hdr_sym; i++) + hdr_sym[i] = get_usymbol(sc.c); + + uint sx = hdr_sym[0]; + uint sy = hdr_sym[1]; + uint sw = hdr_sym[2] + 1; + uint sh = hdr_sym[3] + 1; if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0 || sx > (gl_NumWorkGroups.x - sw) || sy > (gl_NumWorkGroups.y - sh) || @@ -91,16 +96,12 @@ bool decode_slice_header(inout SliceContext sc) sc.slice_coding_mode = int(0); for (uint i = 0; i < codec_planes; i++) { - uint idx = get_usymbol(sc.c); + uint idx = hdr_sym[4 + i]; if (idx >= quant_table_count) return true; sc.quant_table_idx[i] = uint8_t(idx); } - get_usymbol(sc.c); - get_usymbol(sc.c); - get_usymbol(sc.c); - if (version >= 4) { sc.slice_reset_contexts = get_rac_direct(sc.c, setup_state[0]); sc.slice_coding_mode = get_usymbol(sc.c); _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
