summaryrefslogtreecommitdiff
path: root/libavcodec/rangecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/rangecoder.h')
-rw-r--r--libavcodec/rangecoder.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/rangecoder.h b/libavcodec/rangecoder.h
index 68bd3b60e4..3aac8c6238 100644
--- a/libavcodec/rangecoder.h
+++ b/libavcodec/rangecoder.h
@@ -66,6 +66,13 @@ static inline void renorm_encoder(RangeCoder *c){
}
}
+static inline int get_rac_count(RangeCoder *c){
+ int x= c->bytestream - c->bytestream_start + c->outstanding_count;
+ if(c->outstanding_byte >= 0)
+ x++;
+ return 8*x - av_log2(c->range);
+}
+
static inline void put_rac(RangeCoder *c, uint8_t * const state, int bit){
int range1= (c->range * (*state)) >> 8;