]> git.sesse.net Git - ffmpeg/commitdiff
simplify
authorLoren Merritt <lorenm@u.washington.edu>
Tue, 26 Feb 2008 07:35:56 +0000 (07:35 +0000)
committerLoren Merritt <lorenm@u.washington.edu>
Tue, 26 Feb 2008 07:35:56 +0000 (07:35 +0000)
Originally committed as revision 12224 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/pngenc.c

index 10ed5afad0706504983326bbd032738d968aea30..703371d856190475efbebb8b7ed904a50d517ccd 100644 (file)
@@ -158,7 +158,7 @@ static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst,
             buf1[0] = pred;
             cost = 0;
             for(i=0; i<=size; i++)
-                cost += abs(0x80 - (buf1[i] ^ 0x80));
+                cost += abs((int8_t)buf1[i]);
             if(cost < bcost) {
                 bcost = cost;
                 FFSWAP(uint8_t*, buf1, buf2);