[FFmpeg-cvslog] proresenc_anatoliy: use put_sbits()

James Almer git at videolan.org
Sat Apr 18 19:20:11 CEST 2015


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Apr 18 04:31:30 2015 -0300| [d8c52f5d04fce8d9a1a86782fba95b26b6ecd951] | committer: James Almer

proresenc_anatoliy: use put_sbits()

Reviewed-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8c52f5d04fce8d9a1a86782fba95b26b6ecd951
---

 libavcodec/proresenc_anatoliy.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index bf6e671..cc98c66 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -156,8 +156,7 @@ typedef struct {
 
 static void encode_codeword(PutBitContext *pb, int val, int codebook)
 {
-    unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros,
-            mask;
+    unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros;
 
     /* number of bits to switch between rice and exp golomb */
     switch_bits = codebook & 3;
@@ -174,10 +173,9 @@ static void encode_codeword(PutBitContext *pb, int val, int codebook)
         put_bits(pb, zeros, 0);
         put_bits(pb, exp + 1, val);
     } else if (rice_order) {
-        mask = (1 << rice_order) - 1;
         put_bits(pb, (val >> rice_order), 0);
         put_bits(pb, 1, 1);
-        put_bits(pb, rice_order, val & mask);
+        put_sbits(pb, rice_order, val);
     } else {
         put_bits(pb, val, 0);
         put_bits(pb, 1, 1);



More information about the ffmpeg-cvslog mailing list