diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-06-09 02:24:51 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-06-09 02:24:51 +0000 |
commit | 5e20f836b3ad06a591ff232e742ef17c9c235297 (patch) | |
tree | 85a716861a0de6c715ba5029b064b61c51354a24 /libavcodec/cabac.h | |
parent | cd394651c946436353e16db0d37cd4ede94111ba (diff) | |
download | ffmpeg-5e20f836b3ad06a591ff232e742ef17c9c235297.tar.gz |
FFV1 codec (our very simple lossless intra only codec, compresses much better then huffyuv)
Originally committed as revision 1939 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cabac.h')
-rw-r--r-- | libavcodec/cabac.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 7ac18cc535..f0c4910d5b 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -37,6 +37,7 @@ typedef struct CABACContext{ uint8_t lps_range[2*64][4]; ///< rangeTabLPS uint8_t lps_state[2*64]; ///< transIdxLPS uint8_t mps_state[2*64]; ///< transIdxMPS + uint8_t *bytestream_start; uint8_t *bytestream; int bits_left; ///< PutBitContext pb; @@ -138,7 +139,11 @@ static inline void put_cabac_bypass(CABACContext *c, int bit){ #endif } -static inline void put_cabac_terminate(CABACContext *c, int bit){ +/** + * + * @return the number of bytes written + */ +static inline int put_cabac_terminate(CABACContext *c, int bit){ c->range -= 2; if(!bit){ @@ -159,6 +164,8 @@ static inline void put_cabac_terminate(CABACContext *c, int bit){ #ifdef STRICT_LIMITS c->symCount++; #endif + + return (get_bit_count(&c->pb)+7)>>3; } /** @@ -303,13 +310,17 @@ static inline int get_cabac_bypass(CABACContext *c){ } } +/** + * + * @return the number of bytes read or 0 if no end + */ static inline int get_cabac_terminate(CABACContext *c){ c->range -= 2<<8; if(c->low < c->range){ renorm_cabac_decoder(c); return 0; }else{ - return 1; + return c->bytestream - c->bytestream_start; } } |