--- trunk/xvidcore/src/image/image.c 2004/04/01 11:11:28 1397 +++ trunk/xvidcore/src/image/image.c 2005/05/23 09:29:43 1617 @@ -19,22 +19,21 @@ * 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.31 2005-05-23 09:29:43 Skal Exp $ * ****************************************************************************/ #include #include /* memcpy, memset */ #include - #include "../portab.h" #include "../global.h" /* XVID_CSP_XXX's */ #include "../xvid.h" /* XVID_CSP_XXX's */ #include "image.h" #include "colorspace.h" #include "interpolate8x8.h" -#include "reduced.h" #include "../utils/mem_align.h" +#include "../motion/sad.h" #include "font.h" /* XXX: remove later */ @@ -718,7 +717,7 @@ int height, uint32_t edged_width, uint8_t * dst[4], - uint32_t dst_stride[4], + int dst_stride[4], int csp, int interlacing) { @@ -893,24 +892,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; yy + (j*block - 1)*edged_width + i*block, - img->y + (j*block + 0)*edged_width + i*block, nblocks); - } - } - - for (j = 0; j < mb_height*2; j++) /* vertical deblocking */ - for (i = 1; i < mb_width*2; i++) - { - if (mbs[(j/2)*mb_stride + (i-1)/2].mode != MODE_NOT_CODED || - mbs[(j/2)*mb_stride + (i+0)/2].mode != MODE_NOT_CODED) - { - vfilter_31(img->y + (j*block)*edged_width + i*block - 1, - img->y + (j*block)*edged_width + i*block + 0, - edged_width, nblocks); - } - } - - - - /* chroma */ - - for (j = 1; j < mb_height; j++) /* horizontal deblocking */ - for (i = 0; i < mb_width; i++) - { - if (mbs[(j-1)*mb_stride + i].mode != MODE_NOT_CODED || - mbs[(j+0)*mb_stride + i].mode != MODE_NOT_CODED) - { - hfilter_31(img->u + (j*block - 1)*edged_width2 + i*block, - img->u + (j*block + 0)*edged_width2 + i*block, nblocks); - hfilter_31(img->v + (j*block - 1)*edged_width2 + i*block, - img->v + (j*block + 0)*edged_width2 + i*block, nblocks); - } - } - - for (j = 0; j < mb_height; j++) /* vertical deblocking */ - for (i = 1; i < mb_width; i++) - { - if (mbs[j*mb_stride + i - 1].mode != MODE_NOT_CODED || - mbs[j*mb_stride + i + 0].mode != MODE_NOT_CODED) - { - vfilter_31(img->u + (j*block)*edged_width2 + i*block - 1, - img->u + (j*block)*edged_width2 + i*block + 0, - edged_width2, nblocks); - vfilter_31(img->v + (j*block)*edged_width2 + i*block - 1, - img->v + (j*block)*edged_width2 + i*block + 0, - edged_width2, nblocks); - } - } - - -} -