diff mbox series

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

Message ID 20200414102503.7858-8-christophe.gisquet@gmail.com
State New
Headers show
Series Port cache bitstream reader to 32bits, and improve | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate fail Make fate failed

Commit Message

Christophe Gisquet April 14, 2020, 10:25 a.m. UTC
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(-)

Comments

Michael Niedermayer April 14, 2020, 11:36 p.m. UTC | #1
On Tue, Apr 14, 2020 at 10:25:03AM +0000, Christophe Gisquet wrote:
> 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(-)

interresting we all missed this before, should be ok

thx


[...]
diff mbox series

Patch

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);
         }
     }