[FFmpeg-soc] [soc]: r335 - jpeg2000/j2kenc.c

k.nowosad subversion at mplayerhq.hu
Sat Jul 7 02:00:02 CEST 2007


Author: k.nowosad
Date: Sat Jul  7 02:00:02 2007
New Revision: 335

Log:
changes in bitstream functions


Modified:
   jpeg2000/j2kenc.c

Modified: jpeg2000/j2kenc.c
==============================================================================
--- jpeg2000/j2kenc.c	(original)
+++ jpeg2000/j2kenc.c	Sat Jul  7 02:00:02 2007
@@ -225,7 +225,7 @@ static void put_bits(J2kEncoderContext *
     while (n-- > 0){
         if (s->bit_index == 8)
         {
-            s->bit_index = *s->buf == 0xff ? 1:0;
+            s->bit_index = *s->buf == 0xff;
             *(++s->buf) = 0;
         }
         *s->buf |= val << (7 - s->bit_index++);
@@ -236,7 +236,7 @@ static void put_bits(J2kEncoderContext *
 static void put_num(J2kEncoderContext *s, int num, int n)
 {
     while(--n >= 0)
-        put_bits(s, (num & (1<<n)) ? 1:0, 1);
+        put_bits(s, (num >> n) & 1, 1);
 }
 
 /* flush the bitstream */



More information about the FFmpeg-soc mailing list