Revision 9c76bd48 libavcodec/motion_est.c

View differences:

libavcodec/motion_est.c
63 63
    return s;
64 64
}
65 65

  
66
static int pix_norm(UINT8 * pix1, UINT8 * pix2, int line_size)
67
{
68
    int s, i, j;
69
    UINT32 *sq = squareTbl + 256;
70

  
71
    s = 0;
72
    for (i = 0; i < 16; i++) {
73
	for (j = 0; j < 16; j += 8) {
74
	    s += sq[pix1[0] - pix2[0]];
75
	    s += sq[pix1[1] - pix2[1]];
76
	    s += sq[pix1[2] - pix2[2]];
77
	    s += sq[pix1[3] - pix2[3]];
78
	    s += sq[pix1[4] - pix2[4]];
79
	    s += sq[pix1[5] - pix2[5]];
80
	    s += sq[pix1[6] - pix2[6]];
81
	    s += sq[pix1[7] - pix2[7]];
82
	    pix1 += 8;
83
	    pix2 += 8;
84
	}
85
	pix1 += line_size - 16;
86
	pix2 += line_size - 16;
87
    }
88
    return s;
89
}
90

  
91 66
static inline void no_motion_search(MpegEncContext * s,
92 67
				    int *mx_ptr, int *my_ptr)
93 68
{
......
1137 1112
    
1138 1113
    varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500 + 128)>>8;
1139 1114
    // FIXME: MMX OPTIMIZE
1140
    vard = (pix_norm(pix, ppix, s->linesize)+128)>>8;
1115
    vard = (s->dsp.pix_norm(pix, ppix, s->linesize)+128)>>8;
1141 1116

  
1142 1117
//printf("%d %d %d %X %X %X\n", s->mb_width, mb_x, mb_y,(int)s, (int)s->mb_var, (int)s->mc_mb_var); fflush(stdout);
1143 1118
    s->mb_var   [s->mb_width * mb_y + mb_x] = varc;

Also available in: Unified diff