This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit f32111f3f747b67e114ed07c6a79e4d5e95f809c Author: Lynne <[email protected]> AuthorDate: Fri Feb 13 13:49:42 2026 +0100 Commit: Lynne <[email protected]> CommitDate: Thu Feb 19 19:42:34 2026 +0100 vulkan/ffv1: improve compiler hints Don't unroll unless needed, don't use const in function arguments, don't use expect unless actually needed. --- libavcodec/vulkan/ffv1_common.glsl | 8 ++++---- libavcodec/vulkan/ffv1_dec.comp.glsl | 3 +-- libavcodec/vulkan/ffv1_enc.comp.glsl | 9 ++++----- libavcodec/vulkan/ffv1_vlc.glsl | 2 +- libavcodec/vulkan/rangecoder.glsl | 4 ++-- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/libavcodec/vulkan/ffv1_common.glsl b/libavcodec/vulkan/ffv1_common.glsl index f7caa9f7b8..9032bdf612 100644 --- a/libavcodec/vulkan/ffv1_common.glsl +++ b/libavcodec/vulkan/ffv1_common.glsl @@ -151,7 +151,7 @@ const uint32_t log2_run[41] = { ivec2 get_pred(readonly uimage2D pred, ivec2 sp, ivec2 off, uint comp, int sw, uint8_t quant_table_idx, bool extend_lookup) { - const ivec2 yoff_border1 = expectEXT(off.x == 0, false) ? off + ivec2(1, -1) : off; + ivec2 yoff_border1 = expectEXT(off.x == 0, false) ? off + ivec2(1, -1) : off; /* Thanks to the same coincidence as below, we can skip checking if off == 0, 1 */ VTYPE3 top = VTYPE3(TYPE(imageLoad(pred, sp + LADDR(yoff_border1 + ivec2(-1, -1)))[comp]), @@ -170,7 +170,7 @@ ivec2 get_pred(readonly uimage2D pred, ivec2 sp, ivec2 off, if (has_extend_lookup && extend_lookup) { TYPE cur2 = TYPE(0); if (expectEXT(off.x > 0, true)) { - const ivec2 yoff_border2 = expectEXT(off.x == 1, false) ? ivec2(-1, -1) : ivec2(-2, 0); + ivec2 yoff_border2 = expectEXT(off.x == 1, false) ? ivec2(-1, -1) : ivec2(-2, 0); cur2 = TYPE(imageLoad(pred, sp + LADDR(off + yoff_border2))[comp]); } base += quant_table[quant_table_idx][3][(cur2 - cur) & MAX_QUANT_TABLE_MASK]; @@ -195,7 +195,7 @@ ivec2 get_pred(readonly uimage2D pred, ivec2 sp, ivec2 off, ivec2 get_pred(readonly uimage2D pred, ivec2 sp, ivec2 off, uint comp, int sw, uint8_t quant_table_idx, bool extend_lookup) { - const ivec2 yoff_border1 = off.x == 0 ? ivec2(1, -1) : ivec2(0, 0); + ivec2 yoff_border1 = off.x == 0 ? ivec2(1, -1) : ivec2(0, 0); sp += off; VTYPE3 top = VTYPE3(TYPE(0), @@ -219,7 +219,7 @@ ivec2 get_pred(readonly uimage2D pred, ivec2 sp, ivec2 off, if (has_extend_lookup && extend_lookup) { TYPE cur2 = TYPE(0); if (off.x > 0 && off != ivec2(1, 0)) { - const ivec2 yoff_border2 = off.x == 1 ? ivec2(1, -1) : ivec2(0, 0); + ivec2 yoff_border2 = off.x == 1 ? ivec2(1, -1) : ivec2(0, 0); cur2 = TYPE(imageLoad(pred, sp + ivec2(-2, 0) + yoff_border2)[comp]); } base += quant_table[quant_table_idx][3][(cur2 - cur) & MAX_QUANT_TABLE_MASK]; diff --git a/libavcodec/vulkan/ffv1_dec.comp.glsl b/libavcodec/vulkan/ffv1_dec.comp.glsl index bcec99fed9..a6fa01df96 100644 --- a/libavcodec/vulkan/ffv1_dec.comp.glsl +++ b/libavcodec/vulkan/ffv1_dec.comp.glsl @@ -98,7 +98,6 @@ void decode_line_pcm(ivec2 sp, int w, int y, int p) for (int x = 0; x < w; x++) { uint v = 0; - [[unroll]] for (uint i = (rct_offset >> 1); i > 0; i >>= 1) v |= get_rac_equi() ? i : 0; @@ -259,7 +258,7 @@ void writeout_rgb(in SliceContext sc, ivec2 sp, int w, int y, bool apply_rct) if (transparency) pix.a = int(imageLoad(dec[3], lpos)[0]); - if (expectEXT(apply_rct, true)) + if (apply_rct) pix = transform_sample(pix, sc.slice_rct_coef); else pix = ivec4(pix[fmt_lut[0]], pix[fmt_lut[1]], diff --git a/libavcodec/vulkan/ffv1_enc.comp.glsl b/libavcodec/vulkan/ffv1_enc.comp.glsl index 6a42747e84..cde9b941bd 100644 --- a/libavcodec/vulkan/ffv1_enc.comp.glsl +++ b/libavcodec/vulkan/ffv1_enc.comp.glsl @@ -81,7 +81,6 @@ void encode_line_pcm(in SliceContext sc, readonly uimage2D img, for (int x = 0; x < w; x++) { uint v = imageLoad(img, sp + LADDR(ivec2(x, y)))[comp]; - [[unroll]] for (uint i = (rct_offset >> 1); i > 0; i >>= 1) put_rac_equi(bool(v & i)); } @@ -89,7 +88,7 @@ void encode_line_pcm(in SliceContext sc, readonly uimage2D img, void encode_line(in SliceContext sc, readonly uimage2D img, uint state_off, ivec2 sp, int y, uint p, uint comp, - uint8_t quant_table_idx, const int run_index) + uint8_t quant_table_idx, in int run_index) { int w = sc.slice_dim.x; @@ -241,7 +240,7 @@ void preload_rgb(in SliceContext sc, ivec2 sp, int w, int y, bool apply_rct) ivec4 pix = load_components(pos); - if (expectEXT(apply_rct, true)) + if (apply_rct) transform_sample(pix, sc.slice_rct_coef); imageStore(tmp, lpos, pix); @@ -325,7 +324,7 @@ void encode_slice(in SliceContext sc, uint slice_idx) #endif } -void finalize_slice(const uint slice_idx) +void finalize_slice(in uint slice_idx) { #ifdef GOLOMB uint32_t enc_len = hdr_len + flush_put_bits(pb); @@ -367,7 +366,7 @@ void finalize_slice(const uint slice_idx) void main(void) { - const uint slice_idx = gl_WorkGroupID.y*gl_NumWorkGroups.x + gl_WorkGroupID.x; + uint slice_idx = gl_WorkGroupID.y*gl_NumWorkGroups.x + gl_WorkGroupID.x; if (gl_LocalInvocationID.x == 0) rc = slice_ctx[slice_idx].c; diff --git a/libavcodec/vulkan/ffv1_vlc.glsl b/libavcodec/vulkan/ffv1_vlc.glsl index 23e3c3ab42..f362d3afbb 100644 --- a/libavcodec/vulkan/ffv1_vlc.glsl +++ b/libavcodec/vulkan/ffv1_vlc.glsl @@ -30,7 +30,7 @@ struct VlcState { uint8_t count; }; -void update_vlc_state(inout VlcState state, const int v) +void update_vlc_state(inout VlcState state, in int v) { int drift = state.drift; int count = state.count; diff --git a/libavcodec/vulkan/rangecoder.glsl b/libavcodec/vulkan/rangecoder.glsl index 6bd8d2f264..ba85a67a98 100644 --- a/libavcodec/vulkan/rangecoder.glsl +++ b/libavcodec/vulkan/rangecoder.glsl @@ -120,7 +120,7 @@ void renorm_encoder(void) } #endif -void put_rac_internal(const uint range1, bool bit) +void put_rac_internal(in uint range1, bool bit) { #ifdef DEBUG if (range1 >= rc.range) @@ -208,7 +208,7 @@ void refill(void) rc.bs_off++; } -bool get_rac_internal(const uint range1) +bool get_rac_internal(in uint range1) { uint ranged = rc.range - range1; bool bit = rc.low >= ranged; _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
