[FFmpeg-devel] [PATCH 7/7] get_bits: use immediate in skip_remaining

Christophe Gisquet christophe.gisquet at gmail.com
Tue Apr 14 13:25:03 EEST 2020


When the entry informs to continue reading, this means the current read
will be entirely skipped. Small object size reduction, depending on
inlining.
---
 libavcodec/get_bits.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index baff86ecf6..d1e29b9917 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -793,7 +793,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s)
             code  = table[index][0];                            \
             n     = table[index][1];                            \
             if (max_depth > 2 && n < 0) {                       \
-                LAST_SKIP_BITS(name, gb, nb_bits);              \
+                LAST_SKIP_BITS(name, gb, bits);                 \
                 UPDATE_CACHE(name, gb);                         \
                                                                 \
                 nb_bits = -n;                                   \
@@ -878,7 +878,7 @@ static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
         skip_remaining(s, bits);
         code = set_idx(s, code, &n, &nb_bits, table);
         if (max_depth > 2 && n < 0) {
-            skip_remaining(s, nb_bits);
+            skip_remaining(s, bits);
             code = set_idx(s, code, &n, &nb_bits, table);
         }
     }
-- 
2.26.0



More information about the ffmpeg-devel mailing list