diff options
Diffstat (limited to '')
-rw-r--r-- | media/ffvpx/libavcodec/av1_parse.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/media/ffvpx/libavcodec/av1_parse.h b/media/ffvpx/libavcodec/av1_parse.h index d0abd7ac7c..2b8cce4835 100644 --- a/media/ffvpx/libavcodec/av1_parse.h +++ b/media/ffvpx/libavcodec/av1_parse.h @@ -30,6 +30,7 @@ #include "av1.h" #include "get_bits.h" +#include "leb.h" // OBU header fields + max leb128 length #define MAX_OBU_HEADER_SIZE (2 + 8) @@ -88,19 +89,6 @@ int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, */ void ff_av1_packet_uninit(AV1Packet *pkt); -static inline int64_t leb128(GetBitContext *gb) { - int64_t ret = 0; - int i; - - for (i = 0; i < 8; i++) { - int byte = get_bits(gb, 8); - ret |= (int64_t)(byte & 0x7f) << (i * 7); - if (!(byte & 0x80)) - break; - } - return ret; -} - static inline int parse_obu_header(const uint8_t *buf, int buf_size, int64_t *obu_size, int *start_pos, int *type, int *temporal_id, int *spatial_id) @@ -129,7 +117,7 @@ static inline int parse_obu_header(const uint8_t *buf, int buf_size, *temporal_id = *spatial_id = 0; } - *obu_size = has_size_flag ? leb128(&gb) + *obu_size = has_size_flag ? get_leb128(&gb) : buf_size - 1 - extension_flag; if (get_bits_left(&gb) < 0) |