changeset 8469:5b63a9da46f4 libavcodec

Avoid negation in put_line().
author michael
date Fri, 26 Dec 2008 13:50:00 +0000
parents 75328d3e788e
children e765aa020de9
files faxcompr.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/faxcompr.c	Fri Dec 26 13:48:09 2008 +0000
+++ b/faxcompr.c	Fri Dec 26 13:50:00 2008 +0000
@@ -232,19 +232,19 @@
 static void put_line(uint8_t *dst, int size, int width, const int *runs)
 {
     PutBitContext pb;
-    int run, mode = 1, pix_left = width, run_idx = 0;
+    int run, mode = ~0, pix_left = width, run_idx = 0;
 
     init_put_bits(&pb, dst, size*8);
     while(pix_left > 0){
         run = runs[run_idx++];
-        mode = !mode;
+        mode = ~mode;
         if(!run){
             continue;
         }
         pix_left -= run;
         for(; run > 16; run -= 16)
-            put_sbits(&pb, 16, -mode);
-        put_sbits(&pb, run, -mode);
+            put_sbits(&pb, 16, mode);
+        put_sbits(&pb, run, mode);
     }
 }