summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/cabac.h
diff options
context:
space:
mode:
authorJames Stembridge <jstembridge@users.sourceforge.net>2004-09-11 20:01:38 +0000
committerJames Stembridge <jstembridge@users.sourceforge.net>2004-09-11 20:01:38 +0000
commitabb6ce74beb401ef996c7a66f9b103d4fa566640 (patch)
treeb2a763cadd4369944fbdd7c1ce46a1615a74ebb3 /src/libffmpeg/libavcodec/cabac.h
parenta958fd5a24107fb894903fc5f5955e6d69eb2de0 (diff)
downloadxine-lib-abb6ce74beb401ef996c7a66f9b103d4fa566640.tar.gz
xine-lib-abb6ce74beb401ef996c7a66f9b103d4fa566640.tar.bz2
Support for H.264/AVC video
CVS patchset: 6959 CVS date: 2004/09/11 20:01:38
Diffstat (limited to 'src/libffmpeg/libavcodec/cabac.h')
-rw-r--r--src/libffmpeg/libavcodec/cabac.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libffmpeg/libavcodec/cabac.h b/src/libffmpeg/libavcodec/cabac.h
index 05c47363d..21085b21e 100644
--- a/src/libffmpeg/libavcodec/cabac.h
+++ b/src/libffmpeg/libavcodec/cabac.h
@@ -39,6 +39,7 @@ typedef struct CABACContext{
uint8_t mps_state[2*64]; ///< transIdxMPS
const uint8_t *bytestream_start;
const uint8_t *bytestream;
+ const uint8_t *bytestream_end;
int bits_left; ///<
PutBitContext pb;
}CABACContext;
@@ -253,7 +254,9 @@ static inline void renorm_cabac_decoder(CABACContext *c){
c->range+= c->range;
c->low+= c->low;
if(--c->bits_left == 0){
- c->low+= *c->bytestream++;
+ if(c->bytestream < c->bytestream_end)
+ c->low+= *c->bytestream;
+ c->bytestream++;
c->bits_left= 8;
}
}
@@ -298,7 +301,9 @@ static inline int get_cabac_bypass(CABACContext *c){
c->low += c->low;
if(--c->bits_left == 0){
- c->low+= *c->bytestream++;
+ if(c->bytestream < c->bytestream_end)
+ c->low+= *c->bytestream;
+ c->bytestream++;
c->bits_left= 8;
}