[svn] / branches / dev-api-3 / xvidcore / src / image / image.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/image/image.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 769, Sat Jan 11 14:59:24 2003 UTC revision 810, Sun Jan 26 05:09:00 2003 UTC
# Line 938  Line 938 
938          return psnr_y;          return psnr_y;
939  }  }
940    
941    
942    float sse_to_PSNR(long sse, int pixels)
943    {
944            if (sse==0)
945                    return 99.99F;
946    
947            return 48.131F - 10*(float)log10((float)sse/(float)(pixels));   // log10(255*255)=4.8131
948    
949    }
950    
951    long plane_sse(uint8_t * orig,
952                       uint8_t * recon,
953                       uint16_t stride,
954                       uint16_t width,
955                       uint16_t height)
956    {
957            int diff, x, y;
958            long sse=0;
959    
960            for (y = 0; y < height; y++) {
961                    for (x = 0; x < width; x++) {
962                            diff = *(orig + x) - *(recon + x);
963                            sse += diff * diff;
964                    }
965                    orig += stride;
966                    recon += stride;
967            }
968            return sse;
969    }
970    
971  /*  /*
972    
973  #include <stdio.h>  #include <stdio.h>

Legend:
Removed from v.769  
changed lines
  Added in v.810

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4