diff options
author | Vittorio Giovara <vittorio@vimeo.com> | 2019-02-08 15:33:29 +0300 |
---|---|---|
committer | Vittorio Giovara <vittorio@vimeo.com> | 2019-02-13 19:28:30 +0300 |
commit | b4e6377a5b7aa5a34b67873d76e6f45b7b75d444 (patch) | |
tree | ff656d7434fdeefde87280ac23477be39bd7ee0e /src/obu.c | |
parent | c45f6b379d98c3b32dfa7abda74434978aa94094 (diff) |
get_bits: Factor out leb parsing to dav1d_get_uleb128()
Diffstat (limited to 'src/obu.c')
-rw-r--r-- | src/obu.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -1187,17 +1187,9 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in, int global) { } // obu length field - unsigned len = 0, more, i = 0; + unsigned len = 0; if (has_length_field) - do { - more = dav1d_get_bits(&gb, 1); - unsigned bits = dav1d_get_bits(&gb, 7); - if (i <= 3 || (i == 4 && bits < (1 << 4))) - len |= bits << (i * 7); - else if (bits) - goto error; - if (more && ++i == 8) goto error; - } while (more); + len = dav1d_get_uleb128(&gb); else len = (int) in->sz - 1 - has_extension; if (gb.error) goto error; |