[svn] / trunk / xvidcore / src / image / image.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/image/image.c

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

revision 1397, Thu Apr 1 11:11:28 2004 UTC revision 1424, Mon Apr 12 15:49:56 2004 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: image.c,v 1.28 2004-04-01 11:11:28 suxen_drol Exp $   * $Id: image.c,v 1.29 2004-04-12 15:49:56 edgomez Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 35  Line 35 
35  #include "interpolate8x8.h"  #include "interpolate8x8.h"
36  #include "reduced.h"  #include "reduced.h"
37  #include "../utils/mem_align.h"  #include "../utils/mem_align.h"
38    #include "../motion/sad.h"
39    
40  #include "font.h"               /* XXX: remove later */  #include "font.h"               /* XXX: remove later */
41    
# Line 899  Line 900 
900                     uint16_t width,                     uint16_t width,
901                     uint16_t height)                     uint16_t height)
902  {  {
903          int diff, x, y;          int y, bwidth, bheight;
904          long sse=0;          long sse=0;
905    
906          for (y = 0; y < height; y++) {          bwidth  = width  & (~0x07);
907            bheight = height & (~0x07);
908    
909            /* Compute the 8x8 integer part */
910            for (y = 0; y<bheight; y += 8) {
911                    int x;
912    
913                    /* Compute sse for the band */
914                    for (x = 0; x<bwidth; x += 8)
915                            sse += sse8_8bit(orig  + x, recon + x, stride);
916    
917                    /* remaining pixels of the 8 pixels high band */
918                    for (x = bwidth; x < width; x++) {
919                            int diff;
920                            diff = *(orig + 0*stride + x) - *(recon + 0*stride + x);
921                            sse += diff * diff;
922                            diff = *(orig + 1*stride + x) - *(recon + 1*stride + x);
923                            sse += diff * diff;
924                            diff = *(orig + 2*stride + x) - *(recon + 2*stride + x);
925                            sse += diff * diff;
926                            diff = *(orig + 3*stride + x) - *(recon + 3*stride + x);
927                            sse += diff * diff;
928                            diff = *(orig + 4*stride + x) - *(recon + 4*stride + x);
929                            sse += diff * diff;
930                            diff = *(orig + 5*stride + x) - *(recon + 5*stride + x);
931                            sse += diff * diff;
932                            diff = *(orig + 6*stride + x) - *(recon + 6*stride + x);
933                            sse += diff * diff;
934                            diff = *(orig + 7*stride + x) - *(recon + 7*stride + x);
935                            sse += diff * diff;
936                    }
937    
938                    orig  += 8*stride;
939                    recon += 8*stride;
940            }
941    
942            /* Compute the down rectangle sse */
943            for (y = bheight; y < height; y++) {
944                    int x;
945                  for (x = 0; x < width; x++) {                  for (x = 0; x < width; x++) {
946                            int diff;
947                          diff = *(orig + x) - *(recon + x);                          diff = *(orig + x) - *(recon + x);
948                          sse += diff * diff;                          sse += diff * diff;
949                  }                  }
950                  orig += stride;                  orig += stride;
951                  recon += stride;                  recon += stride;
952          }          }
953          return sse;  
954            return (sse);
955  }  }
956    
957  #if 0  #if 0

Legend:
Removed from v.1397  
changed lines
  Added in v.1424

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