diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-11 22:28:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 12:49:26 +0200 |
commit | fc9e307043bec8d3f3980cd36a4f92e2bb600b13 (patch) | |
tree | 8f367c0251655310203ceaf62d12cbb4ae1f5ac4 | |
parent | c51e5227ecb0cde27b52b2e7dc907b1f8ecaaad9 (diff) | |
download | ffmpeg-fc9e307043bec8d3f3980cd36a4f92e2bb600b13.tar.gz |
avcodec/vp56: Add vpX_rac_is_end() to check for the end of input
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0fb83b4c91d5a0784ca81df4283f25740c263f20)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vp56.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h index c049399df8..456a998769 100644 --- a/libavcodec/vp56.h +++ b/libavcodec/vp56.h @@ -226,6 +226,14 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, extern const uint8_t ff_vp56_norm_shift[256]; int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size); +/** + * vp5689 returns 1 if the end of the stream has been reached, 0 otherwise. + */ +static av_always_inline int vpX_rac_is_end(VP56RangeCoder *c) +{ + return c->end <= c->buffer && c->bits >= 0; +} + static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c) { int shift = ff_vp56_norm_shift[c->high]; |