[FFmpeg-cvslog] vulkan_ffv1: shortcut +-1 coeffs in symbol reading

Lynne git at videolan.org
Mon Apr 14 07:16:31 EEST 2025


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Tue Apr  8 05:45:16 2025 +0000| [985a26be28f838e47cf2208e0254a7edf731ab41] | committer: Lynne

vulkan_ffv1: shortcut +-1 coeffs in symbol reading

Slightly faster, and allows for further optimizations.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=985a26be28f838e47cf2208e0254a7edf731ab41
---

 libavcodec/vulkan/ffv1_dec.comp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vulkan/ffv1_dec.comp b/libavcodec/vulkan/ffv1_dec.comp
index 4cc3b9987f..fd9b98023c 100644
--- a/libavcodec/vulkan/ffv1_dec.comp
+++ b/libavcodec/vulkan/ffv1_dec.comp
@@ -119,7 +119,10 @@ int get_isymbol(inout RangeCoder c, uint64_t state)
     for (e = 0; e < 32; e++)
         if (!get_rac(c, state + min(e, 9)))
             break;
-    if (e > 31) {
+
+    if (e == 0) {
+        return get_rac(c, state + 10) ? -1 : 1;
+    } else if (e > 31) {
         corrupt = true;
         return 0;
     }



More information about the ffmpeg-cvslog mailing list