get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL
authorKieran Kunhya <kierank@ob-encoder.com>
Sun, 13 Dec 2015 18:01:50 +0000 (18:01 +0000)
committerKieran Kunhya <kierank@ob-encoder.com>
Sun, 13 Dec 2015 22:56:49 +0000 (22:56 +0000)
libavcodec/get_bits.h

index 0d3db1f..0a61c80 100644 (file)
@@ -539,6 +539,17 @@ void ff_free_vlc(VLC *vlc);
             index = SHOW_UBITS(name, gb, nb_bits) + level;      \
             level = table[index].level;                         \
             n     = table[index].len;                           \
+            if (max_depth > 2 && n < 0) {                       \
+                LAST_SKIP_BITS(name, gb, nb_bits);              \
+                if (need_update) {                              \
+                    UPDATE_CACHE(name, gb);                     \
+                }                                               \
+                nb_bits = -n;                                   \
+                                                                \
+                index = SHOW_UBITS(name, gb, nb_bits) + level;  \
+                level = table[index].level;                     \
+                n     = table[index].len;                       \
+            }                                                   \
         }                                                       \
         run = table[index].run;                                 \
         SKIP_BITS(name, gb, n);                                 \