[libav-commits] rv34: use get_bits_left()

Janne Grunau git at libav.org
Tue Jan 10 17:01:42 CET 2012


Module: libav
Branch: master
Commit: e652cc9606068189cb512a36f0335a5cf2ecf287

Author:    Janne Grunau <janne-libav at jannau.net>
Committer: Janne Grunau <janne-libav at jannau.net>
Date:      Mon Jan  9 02:06:59 2012 +0100

rv34: use get_bits_left()

It is not necessary to store the bit stream length in a RV34DecContext
field.

---

 libavcodec/rv34.c |    3 +--
 libavcodec/rv34.h |    1 -
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 91d6788..f9f8677 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1186,7 +1186,7 @@ static int check_slice_end(RV34DecContext *r, MpegEncContext *s)
         return 1;
     if(r->s.mb_skip_run > 1)
         return 0;
-    bits = r->bits - get_bits_count(&s->gb);
+    bits = get_bits_left(&s->gb);
     if(bits < 0 || (bits < 8 && !show_bits(&s->gb, bits)))
         return 1;
     return 0;
@@ -1266,7 +1266,6 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
 
     r->si.end = end;
     s->qscale = r->si.quant;
-    r->bits = buf_size*8;
     s->mb_num_left = r->si.end - r->si.start;
     r->s.mb_skip_run = 0;
 
diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h
index 12607fb..3f3b879 100644
--- a/libavcodec/rv34.h
+++ b/libavcodec/rv34.h
@@ -92,7 +92,6 @@ typedef struct RV34DecContext{
     const uint8_t *luma_dc_quant_p;///< luma subblock DC quantizer for interframes
 
     RV34VLC *cur_vlcs;       ///< VLC set used for current frame decoding
-    int bits;                ///< slice size in bits
     H264PredContext h;       ///< functions for 4x4 and 16x16 intra block prediction
     SliceInfo si;            ///< current slice information
 



More information about the libav-commits mailing list