Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/obu.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio@vimeo.com>2019-02-08 15:33:29 +0300
committerVittorio Giovara <vittorio@vimeo.com>2019-02-13 19:28:30 +0300
commitb4e6377a5b7aa5a34b67873d76e6f45b7b75d444 (patch)
treeff656d7434fdeefde87280ac23477be39bd7ee0e /src/obu.c
parentc45f6b379d98c3b32dfa7abda74434978aa94094 (diff)
get_bits: Factor out leb parsing to dav1d_get_uleb128()
Diffstat (limited to 'src/obu.c')
-rw-r--r--src/obu.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/obu.c b/src/obu.c
index 89e3ae3..a434348 100644
--- a/src/obu.c
+++ b/src/obu.c
@@ -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;