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

Git pushed a commit to branch master
in repository ffmpeg.

commit 5784a775dfbabada9b589f289987a2beef7a9071
Author:     Lynne <[email protected]>
AuthorDate: Fri Jun 12 14:27:33 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Thu Jul 2 16:45:08 2026 +0900

    vulkan/prores_raw: reconstruct DC values in 32-bit
    
    DCs can go over int16_t, and when it does, dc_add wraps, so the wrong sign
    is reported, which causes errors when decoding more DCs.
    
    Do the prediction in int and narrow to int16 only at store time. The
    read_ac_vals() sign change is cosmetic (the value is only ever 0/-1, and
    the old code already widened it).
---
 libavcodec/vulkan/prores_raw_decode.comp.glsl | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/libavcodec/vulkan/prores_raw_decode.comp.glsl 
b/libavcodec/vulkan/prores_raw_decode.comp.glsl
index 92859d59d0..3aed23ef7e 100644
--- a/libavcodec/vulkan/prores_raw_decode.comp.glsl
+++ b/libavcodec/vulkan/prores_raw_decode.comp.glsl
@@ -122,13 +122,14 @@ void store_val(ivec2 offs, int blk, int c, int16_t v)
 void read_dc_vals(ivec2 offs, int nb_blocks)
 {
     int dc;
-    int16_t dc_add;
-    int16_t prev_dc = I16(0), sign = I16(0);
+    int dc_add;
+    int prev_dc = 0;
+    int sign = 0;
 
     /* Special handling for first block */
     dc = get_value(I16(700));
-    prev_dc = I16((dc >> 1) ^ -(dc & 1));
-    store_val(offs, 0, 0, prev_dc);
+    prev_dc = (dc >> 1) ^ -(dc & 1);
+    store_val(offs, 0, 0, I16(prev_dc));
 
     for (int n = 1; n < nb_blocks; n++) {
         if (expectEXT(left_bits(gb) <= 0, false))
@@ -142,12 +143,12 @@ void read_dc_vals(ivec2 offs, int nb_blocks)
 
         dc = get_value(dc_codebook);
 
-        sign ^= I16(dc & 1);
-        dc_add = I16((-int(sign) ^ TODCCODEBOOK(dc)) + int(sign));
-        sign = I16(dc_add < 0);
+        sign ^= dc & 1;
+        dc_add = (-sign ^ TODCCODEBOOK(dc)) + sign;
+        sign = int(dc_add < 0);
         prev_dc += dc_add;
 
-        store_val(offs, n, 0, prev_dc);
+        store_val(offs, n, 0, I16(prev_dc));
     }
 }
 
@@ -161,7 +162,7 @@ void read_ac_vals(ivec2 offs, int nb_blocks)
     int16_t ac_codebook = I16(49);
     int16_t rn_codebook = I16( 0);
     int16_t ln_codebook = I16(66);
-    int16_t sign;
+    int sign;
     int16_t val;
 
     for (int n = nb_blocks; n <= nb_codes;) {
@@ -176,9 +177,9 @@ void read_ac_vals(ivec2 offs, int nb_blocks)
 
             ac = get_value(ac_codebook);
             ac_codebook = ac_cb[min(ac, 95 - 1)];
-            sign = -int16_t(get_bit(gb));
+            sign = -int(get_bit(gb));
 
-            val = I16(((ac + 1) ^ int(sign)) - int(sign));
+            val = I16(((ac + 1) ^ sign) - sign);
             store_val(offs, n & block_mask, n >> log2_nb_blocks, val);
 
             n++;
@@ -198,9 +199,9 @@ void read_ac_vals(ivec2 offs, int nb_blocks)
             break;
 
         ac = get_value(ac_codebook);
-        sign = -int16_t(get_bit(gb));
+        sign = -int(get_bit(gb));
 
-        val = I16(((ac + 1) ^ int(sign)) - int(sign));
+        val = I16(((ac + 1) ^ sign) - sign);
         store_val(offs, n & block_mask, n >> log2_nb_blocks, val);
 
         ac_codebook = ac_cb[min(ac, 95 - 1)];

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

Reply via email to