diff -ru /tmp/mpeg2dec-0.4.0/libmpeg2/idct.c mpeg2dec-0.4.0/libmpeg2/idct.c --- /tmp/mpeg2dec-0.4.0/libmpeg2/idct.c 2003-09-19 12:26:42.000000000 +0300 +++ mpeg2dec-0.4.0/libmpeg2/idct.c 2006-09-18 16:05:48.000000000 +0300 @@ -71,18 +71,38 @@ int d0, d1, d2, d3; int a0, a1, a2, a3, b0, b1, b2, b3; int t0, t1, t2, t3; +#ifdef _WIN32_WCE + int32_t bl1, bl2, bl3; + int8_t *block8 = (int8_t*)block; +#endif - /* shortcut */ +#ifndef _WIN32_WCE + /* shortcut */ if (likely (!(block[1] | ((int32_t *)block)[1] | ((int32_t *)block)[2] | ((int32_t *)block)[3]))) { - uint32_t tmp = (uint16_t) (block[0] >> 1); - tmp |= tmp << 16; - ((int32_t *)block)[0] = tmp; - ((int32_t *)block)[1] = tmp; - ((int32_t *)block)[2] = tmp; - ((int32_t *)block)[3] = tmp; - return; + uint32_t tmp = (uint16_t) (block[0] >> 1); + tmp |= tmp << 16; + ((int32_t *)block)[0] = tmp; + ((int32_t *)block)[1] = tmp; + ((int32_t *)block)[2] = tmp; + ((int32_t *)block)[3] = tmp; + return; + } +#else + memcpy(&bl1, block8 + sizeof(int32_t), sizeof(int32_t)); + memcpy(&bl2, block8 + 2 * sizeof(int32_t), sizeof(int32_t)); + memcpy(&bl3, block8 + 3 * sizeof(int32_t), sizeof(int32_t)); + + if (likely (!(block[1] | bl1 | bl2 | bl3))) { + uint32_t tmp = (uint16_t) (block[0] >> 1); + tmp |= tmp << 16; + memcpy(block8, &tmp, sizeof(uint32_t)); + memcpy(block8 + sizeof(int32_t), &tmp, sizeof(uint32_t)); + memcpy(block8 + 2 * sizeof(int32_t), &tmp, sizeof(uint32_t)); + memcpy(block8 + 3 * sizeof(int32_t), &tmp, sizeof(uint32_t)); + return; } +#endif d0 = (block[0] << 11) + 2048; d1 = block[1]; @@ -179,8 +199,12 @@ dest[6] = CLIP (block[6]); dest[7] = CLIP (block[7]); +#ifndef _WIN32_WCE ((int32_t *)block)[0] = 0; ((int32_t *)block)[1] = 0; ((int32_t *)block)[2] = 0; ((int32_t *)block)[3] = 0; +#else + memset(block, 0, 4 * sizeof(int32_t)); +#endif dest += stride; block += 8; @@ -207,8 +231,12 @@ dest[6] = CLIP (block[6] + dest[6]); dest[7] = CLIP (block[7] + dest[7]); +#ifndef _WIN32_WCE ((int32_t *)block)[0] = 0; ((int32_t *)block)[1] = 0; ((int32_t *)block)[2] = 0; ((int32_t *)block)[3] = 0; +#else + memset(block, 0, 4 * sizeof(int32_t)); +#endif dest += stride; block += 8; diff -ru /tmp/mpeg2dec-0.4.0/vc++/config.h mpeg2dec-0.4.0/vc++/config.h --- /tmp/mpeg2dec-0.4.0/vc++/config.h 2003-12-23 11:14:57.000000000 +0200 +++ mpeg2dec-0.4.0/vc++/config.h 2006-09-18 16:05:48.000000000 +0300 @@ -1,7 +1,9 @@ /* vc++/config.h - manually adapted from include/config.h.in */ /* autodetect accelerations */ +#ifndef _WIN32_WCE #define ACCEL_DETECT +#endif /* alpha architecture */ /* #undef ARCH_ALPHA */ @@ -13,7 +15,9 @@ /* #undef ARCH_SPARC */ /* x86 architecture */ +#ifndef _WIN32_WCE #define ARCH_X86 +#endif /* maximum supported data alignment */ /* #undef ATTRIBUTE_ALIGNED_MAX */ @@ -79,7 +83,7 @@ /* #undef HAVE_UNISTD_H */ /* libvo DirectX support */ -#define LIBVO_DX +/*#define LIBVO_DX*/ /* libvo SDL support */ /* #undef LIBVO_SDL */