--- trunk/xvidcore/src/image/image.c 2004/04/12 14:05:08 1423 +++ trunk/xvidcore/src/image/image.c 2004/04/12 15:49:56 1424 @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $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 $ * ****************************************************************************/ @@ -35,6 +35,7 @@ #include "interpolate8x8.h" #include "reduced.h" #include "../utils/mem_align.h" +#include "../motion/sad.h" #include "font.h" /* XXX: remove later */ @@ -893,24 +894,64 @@ } -long plane_sse(uint8_t * orig, - uint8_t * recon, - uint16_t stride, - uint16_t width, - uint16_t height) +long plane_sse(uint8_t *orig, + uint8_t *recon, + uint16_t stride, + uint16_t width, + uint16_t height) { - int diff, x, y; - long sse=0; + int y, bwidth, bheight; + long sse = 0; - for (y = 0; y < height; y++) { + bwidth = width & (~0x07); + bheight = height & (~0x07); + + /* Compute the 8x8 integer part */ + for (y = 0; y