changeset 32702:7af3e6f901fd

Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
author cehoyos
date Fri, 14 Jan 2011 22:10:21 +0000
parents 02bc7c860503
children 84a45d5c1102
files libmpcodecs/cmmx.h libmpcodecs/img_format.c libmpcodecs/mp_image.c libmpcodecs/mp_image.h libmpcodecs/pullup.c libmpcodecs/pullup.h libmpcodecs/vf.h libmpcodecs/vf_2xsai.c libmpcodecs/vf_blackframe.c libmpcodecs/vf_boxblur.c libmpcodecs/vf_cropdetect.c libmpcodecs/vf_decimate.c libmpcodecs/vf_delogo.c libmpcodecs/vf_denoise3d.c libmpcodecs/vf_detc.c libmpcodecs/vf_dint.c libmpcodecs/vf_divtc.c libmpcodecs/vf_down3dright.c libmpcodecs/vf_dsize.c libmpcodecs/vf_eq.c libmpcodecs/vf_field.c libmpcodecs/vf_fil.c libmpcodecs/vf_filmdint.c libmpcodecs/vf_framestep.c libmpcodecs/vf_fspp.c libmpcodecs/vf_harddup.c libmpcodecs/vf_hqdn3d.c libmpcodecs/vf_hue.c libmpcodecs/vf_il.c libmpcodecs/vf_ilpack.c libmpcodecs/vf_ivtc.c libmpcodecs/vf_kerndeint.c libmpcodecs/vf_mcdeint.c libmpcodecs/vf_mirror.c libmpcodecs/vf_noise.c libmpcodecs/vf_palette.c libmpcodecs/vf_perspective.c libmpcodecs/vf_phase.c libmpcodecs/vf_pp7.c libmpcodecs/vf_pullup.c libmpcodecs/vf_qp.c libmpcodecs/vf_rectangle.c libmpcodecs/vf_remove_logo.c libmpcodecs/vf_rgbtest.c libmpcodecs/vf_rotate.c libmpcodecs/vf_sab.c libmpcodecs/vf_smartblur.c libmpcodecs/vf_softpulldown.c libmpcodecs/vf_softskip.c libmpcodecs/vf_spp.c libmpcodecs/vf_swapuv.c libmpcodecs/vf_telecine.c libmpcodecs/vf_test.c libmpcodecs/vf_tile.c libmpcodecs/vf_tinterlace.c libmpcodecs/vf_unsharp.c libmpcodecs/vf_uspp.c libmpcodecs/vf_yuvcsp.c libmpcodecs/vf_yvu9.c libvo/fastmemcpy.h libvo/video_out.h mp_msg.h
diffstat 62 files changed, 8300 insertions(+), 8300 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/cmmx.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/cmmx.h	Fri Jan 14 22:10:21 2011 +0000
@@ -141,7 +141,7 @@
     cmmx_t ao = a & (3*ONE_BYTES);
     cmmx_t bo = b & (3*ONE_BYTES);
     return 3*((a^ao)>>2) + ((b^bo)>>2) +
-	(((3*ao+bo+2*ONE_BYTES)>>2) & (3*ONE_BYTES));
+        (((3*ao+bo+2*ONE_BYTES)>>2) & (3*ONE_BYTES));
 }
 
 static inline cmmx_t
@@ -156,9 +156,9 @@
 {
     cmmx_t t = (a & LOWBW_MASK) + ((a>>8) & LOWBW_MASK);
     unsigned long ret =
-	(unsigned long)t + (unsigned long)(t >> (4*sizeof(cmmx_t)));
+        (unsigned long)t + (unsigned long)(t >> (4*sizeof(cmmx_t)));
     if (sizeof(cmmx_t) > 4)
-	ret += ret >> 16;
+        ret += ret >> 16;
     return ret & 0xffff;
 }
 
@@ -166,9 +166,9 @@
 psumbw_s(cmmx_t a)
 {
     unsigned long ret =
-	(unsigned long)a + (unsigned long)(a >> (4*sizeof(cmmx_t)));
+        (unsigned long)a + (unsigned long)(a >> (4*sizeof(cmmx_t)));
     if (sizeof(cmmx_t) <= 4)
-	return (ret & 0xff) + ((ret>>8) & 0xff);
+        return (ret & 0xff) + ((ret>>8) & 0xff);
     ret = (ret & 0xff00ff) + ((ret>>8) & 0xff00ff);
     ret += ret >> 16;
     return ret & 0xffff;
--- a/libmpcodecs/img_format.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/img_format.c	Fri Jan 14 22:10:21 2011 +0000
@@ -25,83 +25,83 @@
     static char unknown_format[20];
     switch(format)
     {
-	case IMGFMT_RGB1: return "RGB 1-bit";
-	case IMGFMT_RGB4: return "RGB 4-bit";
-	case IMGFMT_RG4B: return "RGB 4-bit per byte";
-	case IMGFMT_RGB8: return "RGB 8-bit";
-	case IMGFMT_RGB12: return "RGB 12-bit";
-	case IMGFMT_RGB15: return "RGB 15-bit";
-	case IMGFMT_RGB16: return "RGB 16-bit";
-	case IMGFMT_RGB24: return "RGB 24-bit";
-//	case IMGFMT_RGB32: return "RGB 32-bit";
-	case IMGFMT_RGB48LE: return "RGB 48-bit LE";
-	case IMGFMT_RGB48BE: return "RGB 48-bit BE";
-	case IMGFMT_BGR1: return "BGR 1-bit";
-	case IMGFMT_BGR4: return "BGR 4-bit";
-	case IMGFMT_BG4B: return "BGR 4-bit per byte";
-	case IMGFMT_BGR8: return "BGR 8-bit";
-	case IMGFMT_BGR12: return "BGR 12-bit";
-	case IMGFMT_BGR15: return "BGR 15-bit";
-	case IMGFMT_BGR16: return "BGR 16-bit";
-	case IMGFMT_BGR24: return "BGR 24-bit";
-//	case IMGFMT_BGR32: return "BGR 32-bit";
-	case IMGFMT_ABGR: return "ABGR";
-	case IMGFMT_BGRA: return "BGRA";
-	case IMGFMT_ARGB: return "ARGB";
-	case IMGFMT_RGBA: return "RGBA";
-	case IMGFMT_YVU9: return "Planar YVU9";
-	case IMGFMT_IF09: return "Planar IF09";
-	case IMGFMT_YV12: return "Planar YV12";
-	case IMGFMT_I420: return "Planar I420";
-	case IMGFMT_IYUV: return "Planar IYUV";
-	case IMGFMT_CLPL: return "Planar CLPL";
-	case IMGFMT_Y800: return "Planar Y800";
-	case IMGFMT_Y8: return "Planar Y8";
-	case IMGFMT_420P16_LE: return "Planar 420P 16-bit little-endian";
-	case IMGFMT_420P16_BE: return "Planar 420P 16-bit big-endian";
-	case IMGFMT_422P16_LE: return "Planar 422P 16-bit little-endian";
-	case IMGFMT_422P16_BE: return "Planar 422P 16-bit big-endian";
-	case IMGFMT_444P16_LE: return "Planar 444P 16-bit little-endian";
-	case IMGFMT_444P16_BE: return "Planar 444P 16-bit big-endian";
-	case IMGFMT_420A: return "Planar 420P with alpha";
-	case IMGFMT_444P: return "Planar 444P";
-	case IMGFMT_422P: return "Planar 422P";
-	case IMGFMT_411P: return "Planar 411P";
-	case IMGFMT_NV12: return "Planar NV12";
-	case IMGFMT_NV21: return "Planar NV21";
-        case IMGFMT_HM12: return "Planar NV12 Macroblock";
-	case IMGFMT_IUYV: return "Packed IUYV";
-	case IMGFMT_IY41: return "Packed IY41";
-	case IMGFMT_IYU1: return "Packed IYU1";
-	case IMGFMT_IYU2: return "Packed IYU2";
-	case IMGFMT_UYVY: return "Packed UYVY";
-	case IMGFMT_UYNV: return "Packed UYNV";
-	case IMGFMT_cyuv: return "Packed CYUV";
-	case IMGFMT_Y422: return "Packed Y422";
-	case IMGFMT_YUY2: return "Packed YUY2";
-	case IMGFMT_YUNV: return "Packed YUNV";
-	case IMGFMT_YVYU: return "Packed YVYU";
-	case IMGFMT_Y41P: return "Packed Y41P";
-	case IMGFMT_Y211: return "Packed Y211";
-	case IMGFMT_Y41T: return "Packed Y41T";
-	case IMGFMT_Y42T: return "Packed Y42T";
-	case IMGFMT_V422: return "Packed V422";
-	case IMGFMT_V655: return "Packed V655";
-	case IMGFMT_CLJR: return "Packed CLJR";
-	case IMGFMT_YUVP: return "Packed YUVP";
-	case IMGFMT_UYVP: return "Packed UYVP";
-	case IMGFMT_MPEGPES: return "Mpeg PES";
-	case IMGFMT_ZRMJPEGNI: return "Zoran MJPEG non-interlaced";
-	case IMGFMT_ZRMJPEGIT: return "Zoran MJPEG top field first";
-	case IMGFMT_ZRMJPEGIB: return "Zoran MJPEG bottom field first";
-	case IMGFMT_XVMC_MOCO_MPEG2: return "MPEG1/2 Motion Compensation";
-	case IMGFMT_XVMC_IDCT_MPEG2: return "MPEG1/2 Motion Compensation and IDCT";
-	case IMGFMT_VDPAU_MPEG1: return "MPEG1 VDPAU acceleration";
-	case IMGFMT_VDPAU_MPEG2: return "MPEG2 VDPAU acceleration";
-	case IMGFMT_VDPAU_H264: return "H.264 VDPAU acceleration";
-	case IMGFMT_VDPAU_MPEG4: return "MPEG-4 Part 2 VDPAU acceleration";
-	case IMGFMT_VDPAU_WMV3: return "WMV3 VDPAU acceleration";
-	case IMGFMT_VDPAU_VC1: return "VC1 VDPAU acceleration";
+    case IMGFMT_RGB1: return "RGB 1-bit";
+    case IMGFMT_RGB4: return "RGB 4-bit";
+    case IMGFMT_RG4B: return "RGB 4-bit per byte";
+    case IMGFMT_RGB8: return "RGB 8-bit";
+    case IMGFMT_RGB12: return "RGB 12-bit";
+    case IMGFMT_RGB15: return "RGB 15-bit";
+    case IMGFMT_RGB16: return "RGB 16-bit";
+    case IMGFMT_RGB24: return "RGB 24-bit";
+//  case IMGFMT_RGB32: return "RGB 32-bit";
+    case IMGFMT_RGB48LE: return "RGB 48-bit LE";
+    case IMGFMT_RGB48BE: return "RGB 48-bit BE";
+    case IMGFMT_BGR1: return "BGR 1-bit";
+    case IMGFMT_BGR4: return "BGR 4-bit";
+    case IMGFMT_BG4B: return "BGR 4-bit per byte";
+    case IMGFMT_BGR8: return "BGR 8-bit";
+    case IMGFMT_BGR12: return "BGR 12-bit";
+    case IMGFMT_BGR15: return "BGR 15-bit";
+    case IMGFMT_BGR16: return "BGR 16-bit";
+    case IMGFMT_BGR24: return "BGR 24-bit";
+//  case IMGFMT_BGR32: return "BGR 32-bit";
+    case IMGFMT_ABGR: return "ABGR";
+    case IMGFMT_BGRA: return "BGRA";
+    case IMGFMT_ARGB: return "ARGB";
+    case IMGFMT_RGBA: return "RGBA";
+    case IMGFMT_YVU9: return "Planar YVU9";
+    case IMGFMT_IF09: return "Planar IF09";
+    case IMGFMT_YV12: return "Planar YV12";
+    case IMGFMT_I420: return "Planar I420";
+    case IMGFMT_IYUV: return "Planar IYUV";
+    case IMGFMT_CLPL: return "Planar CLPL";
+    case IMGFMT_Y800: return "Planar Y800";
+    case IMGFMT_Y8: return "Planar Y8";
+    case IMGFMT_420P16_LE: return "Planar 420P 16-bit little-endian";
+    case IMGFMT_420P16_BE: return "Planar 420P 16-bit big-endian";
+    case IMGFMT_422P16_LE: return "Planar 422P 16-bit little-endian";
+    case IMGFMT_422P16_BE: return "Planar 422P 16-bit big-endian";
+    case IMGFMT_444P16_LE: return "Planar 444P 16-bit little-endian";
+    case IMGFMT_444P16_BE: return "Planar 444P 16-bit big-endian";
+    case IMGFMT_420A: return "Planar 420P with alpha";
+    case IMGFMT_444P: return "Planar 444P";
+    case IMGFMT_422P: return "Planar 422P";
+    case IMGFMT_411P: return "Planar 411P";
+    case IMGFMT_NV12: return "Planar NV12";
+    case IMGFMT_NV21: return "Planar NV21";
+    case IMGFMT_HM12: return "Planar NV12 Macroblock";
+    case IMGFMT_IUYV: return "Packed IUYV";
+    case IMGFMT_IY41: return "Packed IY41";
+    case IMGFMT_IYU1: return "Packed IYU1";
+    case IMGFMT_IYU2: return "Packed IYU2";
+    case IMGFMT_UYVY: return "Packed UYVY";
+    case IMGFMT_UYNV: return "Packed UYNV";
+    case IMGFMT_cyuv: return "Packed CYUV";
+    case IMGFMT_Y422: return "Packed Y422";
+    case IMGFMT_YUY2: return "Packed YUY2";
+    case IMGFMT_YUNV: return "Packed YUNV";
+    case IMGFMT_YVYU: return "Packed YVYU";
+    case IMGFMT_Y41P: return "Packed Y41P";
+    case IMGFMT_Y211: return "Packed Y211";
+    case IMGFMT_Y41T: return "Packed Y41T";
+    case IMGFMT_Y42T: return "Packed Y42T";
+    case IMGFMT_V422: return "Packed V422";
+    case IMGFMT_V655: return "Packed V655";
+    case IMGFMT_CLJR: return "Packed CLJR";
+    case IMGFMT_YUVP: return "Packed YUVP";
+    case IMGFMT_UYVP: return "Packed UYVP";
+    case IMGFMT_MPEGPES: return "Mpeg PES";
+    case IMGFMT_ZRMJPEGNI: return "Zoran MJPEG non-interlaced";
+    case IMGFMT_ZRMJPEGIT: return "Zoran MJPEG top field first";
+    case IMGFMT_ZRMJPEGIB: return "Zoran MJPEG bottom field first";
+    case IMGFMT_XVMC_MOCO_MPEG2: return "MPEG1/2 Motion Compensation";
+    case IMGFMT_XVMC_IDCT_MPEG2: return "MPEG1/2 Motion Compensation and IDCT";
+    case IMGFMT_VDPAU_MPEG1: return "MPEG1 VDPAU acceleration";
+    case IMGFMT_VDPAU_MPEG2: return "MPEG2 VDPAU acceleration";
+    case IMGFMT_VDPAU_H264: return "H.264 VDPAU acceleration";
+    case IMGFMT_VDPAU_MPEG4: return "MPEG-4 Part 2 VDPAU acceleration";
+    case IMGFMT_VDPAU_WMV3: return "WMV3 VDPAU acceleration";
+    case IMGFMT_VDPAU_VC1: return "VC1 VDPAU acceleration";
     }
     snprintf(unknown_format,20,"Unknown 0x%04x",format);
     return unknown_format;
--- a/libmpcodecs/mp_image.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/mp_image.c	Fri Jan 14 22:10:21 2011 +0000
@@ -83,15 +83,15 @@
 void copy_mpi(mp_image_t *dmpi, mp_image_t *mpi) {
   if(mpi->flags&MP_IMGFLAG_PLANAR){
     memcpy_pic(dmpi->planes[0],mpi->planes[0], mpi->w, mpi->h,
-	       dmpi->stride[0],mpi->stride[0]);
+               dmpi->stride[0],mpi->stride[0]);
     memcpy_pic(dmpi->planes[1],mpi->planes[1], mpi->chroma_width, mpi->chroma_height,
-	       dmpi->stride[1],mpi->stride[1]);
+               dmpi->stride[1],mpi->stride[1]);
     memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->chroma_width, mpi->chroma_height,
-	       dmpi->stride[2],mpi->stride[2]);
+               dmpi->stride[2],mpi->stride[2]);
   } else {
     memcpy_pic(dmpi->planes[0],mpi->planes[0],
-	       mpi->w*(dmpi->bpp/8), mpi->h,
-	       dmpi->stride[0],mpi->stride[0]);
+               mpi->w*(dmpi->bpp/8), mpi->h,
+               dmpi->stride[0],mpi->stride[0]);
   }
 }
 
@@ -102,24 +102,24 @@
     if(out_fmt == IMGFMT_MPEGPES ||
        out_fmt == IMGFMT_ZRMJPEGNI || out_fmt == IMGFMT_ZRMJPEGIT || out_fmt == IMGFMT_ZRMJPEGIB ||
        IMGFMT_IS_HWACCEL(out_fmt)){
-	mpi->bpp=0;
-	return;
+        mpi->bpp=0;
+        return;
     }
     mpi->num_planes=1;
     if (IMGFMT_IS_RGB(out_fmt)) {
-	if (IMGFMT_RGB_DEPTH(out_fmt) < 8 && !(out_fmt&128))
-	    mpi->bpp = IMGFMT_RGB_DEPTH(out_fmt);
-	else
-	    mpi->bpp=(IMGFMT_RGB_DEPTH(out_fmt)+7)&(~7);
-	return;
+        if (IMGFMT_RGB_DEPTH(out_fmt) < 8 && !(out_fmt&128))
+            mpi->bpp = IMGFMT_RGB_DEPTH(out_fmt);
+        else
+            mpi->bpp=(IMGFMT_RGB_DEPTH(out_fmt)+7)&(~7);
+        return;
     }
     if (IMGFMT_IS_BGR(out_fmt)) {
-	if (IMGFMT_BGR_DEPTH(out_fmt) < 8 && !(out_fmt&128))
-	    mpi->bpp = IMGFMT_BGR_DEPTH(out_fmt);
-	else
-	    mpi->bpp=(IMGFMT_BGR_DEPTH(out_fmt)+7)&(~7);
-	mpi->flags|=MP_IMGFLAG_SWAPPED;
-	return;
+        if (IMGFMT_BGR_DEPTH(out_fmt) < 8 && !(out_fmt&128))
+            mpi->bpp = IMGFMT_BGR_DEPTH(out_fmt);
+        else
+            mpi->bpp=(IMGFMT_BGR_DEPTH(out_fmt)+7)&(~7);
+        mpi->flags|=MP_IMGFLAG_SWAPPED;
+        return;
     }
     mpi->flags|=MP_IMGFLAG_YUV;
     mpi->num_planes=3;
@@ -132,12 +132,12 @@
     switch(out_fmt){
     case IMGFMT_I420:
     case IMGFMT_IYUV:
-	mpi->flags|=MP_IMGFLAG_SWAPPED;
+        mpi->flags|=MP_IMGFLAG_SWAPPED;
     case IMGFMT_YV12:
-	return;
+        return;
     case IMGFMT_420A:
     case IMGFMT_IF09:
-	mpi->num_planes=4;
+        mpi->num_planes=4;
     case IMGFMT_YVU9:
     case IMGFMT_444P:
     case IMGFMT_422P:
@@ -149,30 +149,30 @@
     case IMGFMT_422P16_BE:
     case IMGFMT_420P16_LE:
     case IMGFMT_420P16_BE:
-	return;
+        return;
     case IMGFMT_Y800:
     case IMGFMT_Y8:
-	/* they're planar ones, but for easier handling use them as packed */
-	mpi->flags&=~MP_IMGFLAG_PLANAR;
-	mpi->num_planes=1;
-	return;
+        /* they're planar ones, but for easier handling use them as packed */
+        mpi->flags&=~MP_IMGFLAG_PLANAR;
+        mpi->num_planes=1;
+        return;
     case IMGFMT_UYVY:
-	mpi->flags|=MP_IMGFLAG_SWAPPED;
+        mpi->flags|=MP_IMGFLAG_SWAPPED;
     case IMGFMT_YUY2:
-	mpi->bpp=16;
-	mpi->num_planes=1;
-	return;
+        mpi->bpp=16;
+        mpi->num_planes=1;
+        return;
     case IMGFMT_NV12:
-	mpi->flags|=MP_IMGFLAG_SWAPPED;
+        mpi->flags|=MP_IMGFLAG_SWAPPED;
     case IMGFMT_NV21:
-	mpi->flags|=MP_IMGFLAG_PLANAR;
-	mpi->bpp=12;
-	mpi->num_planes=2;
-	mpi->chroma_width=(mpi->width>>0);
-	mpi->chroma_height=(mpi->height>>1);
-	mpi->chroma_x_shift=0;
-	mpi->chroma_y_shift=1;
-	return;
+        mpi->flags|=MP_IMGFLAG_PLANAR;
+        mpi->bpp=12;
+        mpi->num_planes=2;
+        mpi->chroma_width=(mpi->width>>0);
+        mpi->chroma_height=(mpi->height>>1);
+        mpi->chroma_x_shift=0;
+        mpi->chroma_y_shift=1;
+        return;
     }
     mp_msg(MSGT_DECVIDEO,MSGL_WARN,"mp_image: unknown out_fmt: 0x%X\n",out_fmt);
     mpi->bpp=0;
@@ -190,10 +190,10 @@
 void free_mp_image(mp_image_t* mpi){
     if(!mpi) return;
     if(mpi->flags&MP_IMGFLAG_ALLOCATED){
-	/* becouse we allocate the whole image in once */
-	av_free(mpi->planes[0]);
-	if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
-	    av_free(mpi->planes[1]);
+        /* becouse we allocate the whole image in once */
+        av_free(mpi->planes[0]);
+        if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
+            av_free(mpi->planes[1]);
     }
     free(mpi);
 }
--- a/libmpcodecs/mp_image.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/mp_image.h	Fri Jan 14 22:10:21 2011 +0000
@@ -91,7 +91,7 @@
 // all other cases
 #define MP_IMGTYPE_INCOMPLETE 6
 
-#define MP_MAX_PLANES	4
+#define MP_MAX_PLANES 4
 
 #define MP_IMGFIELD_ORDERED 0x01
 #define MP_IMGFIELD_TOP_FIRST 0x02
--- a/libmpcodecs/pullup.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/pullup.c	Fri Jan 14 22:10:21 2011 +0000
@@ -29,184 +29,184 @@
 #if HAVE_MMX
 static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
 {
-	int ret;
-	__asm__ volatile (
-		"movl $4, %%ecx \n\t"
-		"pxor %%mm4, %%mm4 \n\t"
-		"pxor %%mm7, %%mm7 \n\t"
+    int ret;
+    __asm__ volatile (
+        "movl $4, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t"
+        "pxor %%mm7, %%mm7 \n\t"
 
-		"1: \n\t"
+        "1: \n\t"
 
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
-		"add  %%"REG_a", %%"REG_S" \n\t"
-		"movq (%%"REG_D"), %%mm1 \n\t"
-		"add  %%"REG_a", %%"REG_D" \n\t"
-		"psubusb %%mm1, %%mm2 \n\t"
-		"psubusb %%mm0, %%mm1 \n\t"
-		"movq %%mm2, %%mm0 \n\t"
-		"movq %%mm1, %%mm3 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm0, %%mm4 \n\t"
-		"paddw %%mm1, %%mm4 \n\t"
-		"paddw %%mm2, %%mm4 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
+        "add  %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "add  %%"REG_a", %%"REG_D" \n\t"
+        "psubusb %%mm1, %%mm2 \n\t"
+        "psubusb %%mm0, %%mm1 \n\t"
+        "movq %%mm2, %%mm0 \n\t"
+        "movq %%mm1, %%mm3 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm0, %%mm4 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm2, %%mm4 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz 1b \n\t"
+        "decl %%ecx \n\t"
+        "jnz 1b \n\t"
 
-		"movq %%mm4, %%mm3 \n\t"
-		"punpcklwd %%mm7, %%mm4 \n\t"
-		"punpckhwd %%mm7, %%mm3 \n\t"
-		"paddd %%mm4, %%mm3 \n\t"
-		"movd %%mm3, %%eax \n\t"
-		"psrlq $32, %%mm3 \n\t"
-		"movd %%mm3, %%edx \n\t"
-		"addl %%edx, %%eax \n\t"
-		"emms \n\t"
-		: "=a" (ret)
-		: "S" (a), "D" (b), "a" (s)
-		: "%ecx", "%edx"
-		);
-	return ret;
+        "movq %%mm4, %%mm3 \n\t"
+        "punpcklwd %%mm7, %%mm4 \n\t"
+        "punpckhwd %%mm7, %%mm3 \n\t"
+        "paddd %%mm4, %%mm3 \n\t"
+        "movd %%mm3, %%eax \n\t"
+        "psrlq $32, %%mm3 \n\t"
+        "movd %%mm3, %%edx \n\t"
+        "addl %%edx, %%eax \n\t"
+        "emms \n\t"
+        : "=a" (ret)
+        : "S" (a), "D" (b), "a" (s)
+        : "%ecx", "%edx"
+        );
+    return ret;
 }
 
 static int licomb_y_mmx(unsigned char *a, unsigned char *b, int s)
 {
-	int ret;
-	__asm__ volatile (
-		"movl $4, %%ecx \n\t"
-		"pxor %%mm6, %%mm6 \n\t"
-		"pxor %%mm7, %%mm7 \n\t"
-		"sub  %%"REG_a", %%"REG_D" \n\t"
+    int ret;
+    __asm__ volatile (
+        "movl $4, %%ecx \n\t"
+        "pxor %%mm6, %%mm6 \n\t"
+        "pxor %%mm7, %%mm7 \n\t"
+        "sub  %%"REG_a", %%"REG_D" \n\t"
 
-		"2: \n\t"
+        "2: \n\t"
 
-		"movq (%%"REG_D"), %%mm0 \n\t"
-		"movq (%%"REG_D"), %%mm1 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"movq (%%"REG_D",%%"REG_a"), %%mm2 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpcklbw %%mm7, %%mm2 \n\t"
-		"paddw %%mm0, %%mm0 \n\t"
-		"paddw %%mm2, %%mm1 \n\t"
-		"movq %%mm0, %%mm2 \n\t"
-		"psubusw %%mm1, %%mm0 \n\t"
-		"psubusw %%mm2, %%mm1 \n\t"
-		"paddw %%mm0, %%mm6 \n\t"
-		"paddw %%mm1, %%mm6 \n\t"
+        "movq (%%"REG_D"), %%mm0 \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "movq (%%"REG_D",%%"REG_a"), %%mm2 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpcklbw %%mm7, %%mm2 \n\t"
+        "paddw %%mm0, %%mm0 \n\t"
+        "paddw %%mm2, %%mm1 \n\t"
+        "movq %%mm0, %%mm2 \n\t"
+        "psubusw %%mm1, %%mm0 \n\t"
+        "psubusw %%mm2, %%mm1 \n\t"
+        "paddw %%mm0, %%mm6 \n\t"
+        "paddw %%mm1, %%mm6 \n\t"
 
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_D"), %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm0 \n\t"
-		"movq (%%"REG_D",%%"REG_a"), %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"paddw %%mm0, %%mm0 \n\t"
-		"paddw %%mm2, %%mm1 \n\t"
-		"movq %%mm0, %%mm2 \n\t"
-		"psubusw %%mm1, %%mm0 \n\t"
-		"psubusw %%mm2, %%mm1 \n\t"
-		"paddw %%mm0, %%mm6 \n\t"
-		"paddw %%mm1, %%mm6 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm0 \n\t"
+        "movq (%%"REG_D",%%"REG_a"), %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "paddw %%mm0, %%mm0 \n\t"
+        "paddw %%mm2, %%mm1 \n\t"
+        "movq %%mm0, %%mm2 \n\t"
+        "psubusw %%mm1, %%mm0 \n\t"
+        "psubusw %%mm2, %%mm1 \n\t"
+        "paddw %%mm0, %%mm6 \n\t"
+        "paddw %%mm1, %%mm6 \n\t"
 
-		"movq (%%"REG_D",%%"REG_a"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm1 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpcklbw %%mm7, %%mm2 \n\t"
-		"paddw %%mm0, %%mm0 \n\t"
-		"paddw %%mm2, %%mm1 \n\t"
-		"movq %%mm0, %%mm2 \n\t"
-		"psubusw %%mm1, %%mm0 \n\t"
-		"psubusw %%mm2, %%mm1 \n\t"
-		"paddw %%mm0, %%mm6 \n\t"
-		"paddw %%mm1, %%mm6 \n\t"
+        "movq (%%"REG_D",%%"REG_a"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm1 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpcklbw %%mm7, %%mm2 \n\t"
+        "paddw %%mm0, %%mm0 \n\t"
+        "paddw %%mm2, %%mm1 \n\t"
+        "movq %%mm0, %%mm2 \n\t"
+        "psubusw %%mm1, %%mm0 \n\t"
+        "psubusw %%mm2, %%mm1 \n\t"
+        "paddw %%mm0, %%mm6 \n\t"
+        "paddw %%mm1, %%mm6 \n\t"
 
-		"movq (%%"REG_D",%%"REG_a"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm0 \n\t"
-		"movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"paddw %%mm0, %%mm0 \n\t"
-		"paddw %%mm2, %%mm1 \n\t"
-		"movq %%mm0, %%mm2 \n\t"
-		"psubusw %%mm1, %%mm0 \n\t"
-		"psubusw %%mm2, %%mm1 \n\t"
-		"paddw %%mm0, %%mm6 \n\t"
-		"paddw %%mm1, %%mm6 \n\t"
+        "movq (%%"REG_D",%%"REG_a"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm0 \n\t"
+        "movq (%%"REG_S",%%"REG_a"), %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "paddw %%mm0, %%mm0 \n\t"
+        "paddw %%mm2, %%mm1 \n\t"
+        "movq %%mm0, %%mm2 \n\t"
+        "psubusw %%mm1, %%mm0 \n\t"
+        "psubusw %%mm2, %%mm1 \n\t"
+        "paddw %%mm0, %%mm6 \n\t"
+        "paddw %%mm1, %%mm6 \n\t"
 
-		"add  %%"REG_a", %%"REG_S" \n\t"
-		"add  %%"REG_a", %%"REG_D" \n\t"
-		"decl %%ecx \n\t"
-		"jnz 2b \n\t"
+        "add  %%"REG_a", %%"REG_S" \n\t"
+        "add  %%"REG_a", %%"REG_D" \n\t"
+        "decl %%ecx \n\t"
+        "jnz 2b \n\t"
 
-		"movq %%mm6, %%mm5 \n\t"
-		"punpcklwd %%mm7, %%mm6 \n\t"
-		"punpckhwd %%mm7, %%mm5 \n\t"
-		"paddd %%mm6, %%mm5 \n\t"
-		"movd %%mm5, %%eax \n\t"
-		"psrlq $32, %%mm5 \n\t"
-		"movd %%mm5, %%edx \n\t"
-		"addl %%edx, %%eax \n\t"
+        "movq %%mm6, %%mm5 \n\t"
+        "punpcklwd %%mm7, %%mm6 \n\t"
+        "punpckhwd %%mm7, %%mm5 \n\t"
+        "paddd %%mm6, %%mm5 \n\t"
+        "movd %%mm5, %%eax \n\t"
+        "psrlq $32, %%mm5 \n\t"
+        "movd %%mm5, %%edx \n\t"
+        "addl %%edx, %%eax \n\t"
 
-		"emms \n\t"
-		: "=a" (ret)
-		: "S" (a), "D" (b), "a" (s)
-		: "%ecx", "%edx"
-		);
-	return ret;
+        "emms \n\t"
+        : "=a" (ret)
+        : "S" (a), "D" (b), "a" (s)
+        : "%ecx", "%edx"
+        );
+    return ret;
 }
 
 static int var_y_mmx(unsigned char *a, unsigned char *b, int s)
 {
-	int ret;
-	__asm__ volatile (
-		"movl $3, %%ecx \n\t"
-		"pxor %%mm4, %%mm4 \n\t"
-		"pxor %%mm7, %%mm7 \n\t"
+    int ret;
+    __asm__ volatile (
+        "movl $3, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t"
+        "pxor %%mm7, %%mm7 \n\t"
 
-		"1: \n\t"
+        "1: \n\t"
 
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
-		"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
-		"add  %%"REG_a", %%"REG_S" \n\t"
-		"psubusb %%mm1, %%mm2 \n\t"
-		"psubusb %%mm0, %%mm1 \n\t"
-		"movq %%mm2, %%mm0 \n\t"
-		"movq %%mm1, %%mm3 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm0, %%mm4 \n\t"
-		"paddw %%mm1, %%mm4 \n\t"
-		"paddw %%mm2, %%mm4 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
+        "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+        "add  %%"REG_a", %%"REG_S" \n\t"
+        "psubusb %%mm1, %%mm2 \n\t"
+        "psubusb %%mm0, %%mm1 \n\t"
+        "movq %%mm2, %%mm0 \n\t"
+        "movq %%mm1, %%mm3 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm0, %%mm4 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm2, %%mm4 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz 1b \n\t"
+        "decl %%ecx \n\t"
+        "jnz 1b \n\t"
 
-		"movq %%mm4, %%mm3 \n\t"
-		"punpcklwd %%mm7, %%mm4 \n\t"
-		"punpckhwd %%mm7, %%mm3 \n\t"
-		"paddd %%mm4, %%mm3 \n\t"
-		"movd %%mm3, %%eax \n\t"
-		"psrlq $32, %%mm3 \n\t"
-		"movd %%mm3, %%edx \n\t"
-		"addl %%edx, %%eax \n\t"
-		"emms \n\t"
-		: "=a" (ret)
-		: "S" (a), "a" (s)
-		: "%ecx", "%edx"
-		);
-	return 4*ret;
+        "movq %%mm4, %%mm3 \n\t"
+        "punpcklwd %%mm7, %%mm4 \n\t"
+        "punpckhwd %%mm7, %%mm3 \n\t"
+        "paddd %%mm4, %%mm3 \n\t"
+        "movd %%mm3, %%eax \n\t"
+        "psrlq $32, %%mm3 \n\t"
+        "movd %%mm3, %%edx \n\t"
+        "addl %%edx, %%eax \n\t"
+        "emms \n\t"
+        : "=a" (ret)
+        : "S" (a), "a" (s)
+        : "%ecx", "%edx"
+        );
+    return 4*ret;
 }
 #endif
 #endif
@@ -215,57 +215,57 @@
 
 static int diff_y(unsigned char *a, unsigned char *b, int s)
 {
-	int i, j, diff=0;
-	for (i=4; i; i--) {
-		for (j=0; j<8; j++) diff += ABS(a[j]-b[j]);
-		a+=s; b+=s;
-	}
-	return diff;
+    int i, j, diff=0;
+    for (i=4; i; i--) {
+        for (j=0; j<8; j++) diff += ABS(a[j]-b[j]);
+        a+=s; b+=s;
+    }
+    return diff;
 }
 
 static int licomb_y(unsigned char *a, unsigned char *b, int s)
 {
-	int i, j, diff=0;
-	for (i=4; i; i--) {
-		for (j=0; j<8; j++)
-			diff += ABS((a[j]<<1) - b[j-s] - b[j])
-				+ ABS((b[j]<<1) - a[j] - a[j+s]);
-		a+=s; b+=s;
-	}
-	return diff;
+    int i, j, diff=0;
+    for (i=4; i; i--) {
+        for (j=0; j<8; j++)
+            diff += ABS((a[j]<<1) - b[j-s] - b[j])
+                + ABS((b[j]<<1) - a[j] - a[j+s]);
+        a+=s; b+=s;
+    }
+    return diff;
 }
 
 #if 0
 static int qpcomb_y(unsigned char *a, unsigned char *b, int s)
 {
-	int i, j, diff=0;
-	for (i=4; i; i--) {
-		for (j=0; j<8; j++)
-			diff += ABS(a[j] - 3*b[j-s] + 3*a[j+s] - b[j]);
-		a+=s; b+=s;
-	}
-	return diff;
+    int i, j, diff=0;
+    for (i=4; i; i--) {
+        for (j=0; j<8; j++)
+            diff += ABS(a[j] - 3*b[j-s] + 3*a[j+s] - b[j]);
+        a+=s; b+=s;
+    }
+    return diff;
 }
 
 static int licomb_y_test(unsigned char *a, unsigned char *b, int s)
 {
-	int c = licomb_y(a,b,s);
-	int m = licomb_y_mmx(a,b,s);
-	if (c != m) printf("%d != %d\n", c, m);
-	return m;
+    int c = licomb_y(a,b,s);
+    int m = licomb_y_mmx(a,b,s);
+    if (c != m) printf("%d != %d\n", c, m);
+    return m;
 }
 #endif
 
 static int var_y(unsigned char *a, unsigned char *b, int s)
 {
-	int i, j, var=0;
-	for (i=3; i; i--) {
-		for (j=0; j<8; j++) {
-			var += ABS(a[j]-a[j+s]);
-		}
-		a+=s; b+=s;
-	}
-	return 4*var; /* match comb scaling */
+    int i, j, var=0;
+    for (i=3; i; i--) {
+        for (j=0; j<8; j++) {
+            var += ABS(a[j]-a[j+s]);
+        }
+        a+=s; b+=s;
+    }
+    return 4*var; /* match comb scaling */
 }
 
 
@@ -278,61 +278,61 @@
 
 static void alloc_buffer(struct pullup_context *c, struct pullup_buffer *b)
 {
-	int i;
-	if (b->planes) return;
-	b->planes = calloc(c->nplanes, sizeof(unsigned char *));
-	for (i = 0; i < c->nplanes; i++) {
-		b->planes[i] = malloc(c->h[i]*c->stride[i]);
-		/* Deal with idiotic 128=0 for chroma: */
-		memset(b->planes[i], c->background[i], c->h[i]*c->stride[i]);
-	}
+    int i;
+    if (b->planes) return;
+    b->planes = calloc(c->nplanes, sizeof(unsigned char *));
+    for (i = 0; i < c->nplanes; i++) {
+        b->planes[i] = malloc(c->h[i]*c->stride[i]);
+        /* Deal with idiotic 128=0 for chroma: */
+        memset(b->planes[i], c->background[i], c->h[i]*c->stride[i]);
+    }
 }
 
 struct pullup_buffer *pullup_lock_buffer(struct pullup_buffer *b, int parity)
 {
-	if (!b) return 0;
-	if ((parity+1) & 1) b->lock[0]++;
-	if ((parity+1) & 2) b->lock[1]++;
-	return b;
+    if (!b) return 0;
+    if ((parity+1) & 1) b->lock[0]++;
+    if ((parity+1) & 2) b->lock[1]++;
+    return b;
 }
 
 void pullup_release_buffer(struct pullup_buffer *b, int parity)
 {
-	if (!b) return;
-	if ((parity+1) & 1) b->lock[0]--;
-	if ((parity+1) & 2) b->lock[1]--;
+    if (!b) return;
+    if ((parity+1) & 1) b->lock[0]--;
+    if ((parity+1) & 2) b->lock[1]--;
 }
 
 struct pullup_buffer *pullup_get_buffer(struct pullup_context *c, int parity)
 {
-	int i;
+    int i;
 
-	/* Try first to get the sister buffer for the previous field */
-	if (parity < 2 && c->last && parity != c->last->parity
-	    && !c->last->buffer->lock[parity]) {
-		alloc_buffer(c, c->last->buffer);
-		return pullup_lock_buffer(c->last->buffer, parity);
-	}
+    /* Try first to get the sister buffer for the previous field */
+    if (parity < 2 && c->last && parity != c->last->parity
+        && !c->last->buffer->lock[parity]) {
+        alloc_buffer(c, c->last->buffer);
+        return pullup_lock_buffer(c->last->buffer, parity);
+    }
 
-	/* Prefer a buffer with both fields open */
-	for (i = 0; i < c->nbuffers; i++) {
-		if (c->buffers[i].lock[0]) continue;
-		if (c->buffers[i].lock[1]) continue;
-		alloc_buffer(c, &c->buffers[i]);
-		return pullup_lock_buffer(&c->buffers[i], parity);
-	}
+    /* Prefer a buffer with both fields open */
+    for (i = 0; i < c->nbuffers; i++) {
+        if (c->buffers[i].lock[0]) continue;
+        if (c->buffers[i].lock[1]) continue;
+        alloc_buffer(c, &c->buffers[i]);
+        return pullup_lock_buffer(&c->buffers[i], parity);
+    }
 
-	if (parity == 2) return 0;
+    if (parity == 2) return 0;
 
-	/* Search for any half-free buffer */
-	for (i = 0; i < c->nbuffers; i++) {
-		if (((parity+1) & 1) && c->buffers[i].lock[0]) continue;
-		if (((parity+1) & 2) && c->buffers[i].lock[1]) continue;
-		alloc_buffer(c, &c->buffers[i]);
-		return pullup_lock_buffer(&c->buffers[i], parity);
-	}
+    /* Search for any half-free buffer */
+    for (i = 0; i < c->nbuffers; i++) {
+        if (((parity+1) & 1) && c->buffers[i].lock[0]) continue;
+        if (((parity+1) & 2) && c->buffers[i].lock[1]) continue;
+        alloc_buffer(c, &c->buffers[i]);
+        return pullup_lock_buffer(&c->buffers[i], parity);
+    }
 
-	return 0;
+    return 0;
 }
 
 
@@ -341,35 +341,35 @@
 
 
 static void compute_metric(struct pullup_context *c,
-	struct pullup_field *fa, int pa,
-	struct pullup_field *fb, int pb,
-	int (*func)(unsigned char *, unsigned char *, int), int *dest)
+    struct pullup_field *fa, int pa,
+    struct pullup_field *fb, int pb,
+    int (*func)(unsigned char *, unsigned char *, int), int *dest)
 {
-	unsigned char *a, *b;
-	int x, y;
-	int mp = c->metric_plane;
-	int xstep = c->bpp[mp];
-	int ystep = c->stride[mp]<<3;
-	int s = c->stride[mp]<<1; /* field stride */
-	int w = c->metric_w*xstep;
+    unsigned char *a, *b;
+    int x, y;
+    int mp = c->metric_plane;
+    int xstep = c->bpp[mp];
+    int ystep = c->stride[mp]<<3;
+    int s = c->stride[mp]<<1; /* field stride */
+    int w = c->metric_w*xstep;
 
-	if (!fa->buffer || !fb->buffer) return;
+    if (!fa->buffer || !fb->buffer) return;
 
-	/* Shortcut for duplicate fields (e.g. from RFF flag) */
-	if (fa->buffer == fb->buffer && pa == pb) {
-		memset(dest, 0, c->metric_len * sizeof(int));
-		return;
-	}
+    /* Shortcut for duplicate fields (e.g. from RFF flag) */
+    if (fa->buffer == fb->buffer && pa == pb) {
+        memset(dest, 0, c->metric_len * sizeof(int));
+        return;
+    }
 
-	a = fa->buffer->planes[mp] + pa * c->stride[mp] + c->metric_offset;
-	b = fb->buffer->planes[mp] + pb * c->stride[mp] + c->metric_offset;
+    a = fa->buffer->planes[mp] + pa * c->stride[mp] + c->metric_offset;
+    b = fb->buffer->planes[mp] + pb * c->stride[mp] + c->metric_offset;
 
-	for (y = c->metric_h; y; y--) {
-		for (x = 0; x < w; x += xstep) {
-			*dest++ = func(a + x, b + x, s);
-		}
-		a += ystep; b += ystep;
-	}
+    for (y = c->metric_h; y; y--) {
+        for (x = 0; x < w; x += xstep) {
+            *dest++ = func(a + x, b + x, s);
+        }
+        a += ystep; b += ystep;
+    }
 }
 
 
@@ -378,76 +378,76 @@
 
 static void alloc_metrics(struct pullup_context *c, struct pullup_field *f)
 {
-	f->diffs = calloc(c->metric_len, sizeof(int));
-	f->comb = calloc(c->metric_len, sizeof(int));
-	f->var = calloc(c->metric_len, sizeof(int));
-	/* add more metrics here as needed */
+    f->diffs = calloc(c->metric_len, sizeof(int));
+    f->comb = calloc(c->metric_len, sizeof(int));
+    f->var = calloc(c->metric_len, sizeof(int));
+    /* add more metrics here as needed */
 }
 
 static struct pullup_field *make_field_queue(struct pullup_context *c, int len)
 {
-	struct pullup_field *head, *f;
-	f = head = calloc(1, sizeof(struct pullup_field));
-	alloc_metrics(c, f);
-	for (; len > 0; len--) {
-		f->next = calloc(1, sizeof(struct pullup_field));
-		f->next->prev = f;
-		f = f->next;
-		alloc_metrics(c, f);
-	}
-	f->next = head;
-	head->prev = f;
-	return head;
+    struct pullup_field *head, *f;
+    f = head = calloc(1, sizeof(struct pullup_field));
+    alloc_metrics(c, f);
+    for (; len > 0; len--) {
+        f->next = calloc(1, sizeof(struct pullup_field));
+        f->next->prev = f;
+        f = f->next;
+        alloc_metrics(c, f);
+    }
+    f->next = head;
+    head->prev = f;
+    return head;
 }
 
 static void check_field_queue(struct pullup_context *c)
 {
-	if (c->head->next == c->first) {
-		struct pullup_field *f = calloc(1, sizeof(struct pullup_field));
-		alloc_metrics(c, f);
-		f->prev = c->head;
-		f->next = c->first;
-		c->head->next = f;
-		c->first->prev = f;
-	}
+    if (c->head->next == c->first) {
+        struct pullup_field *f = calloc(1, sizeof(struct pullup_field));
+        alloc_metrics(c, f);
+        f->prev = c->head;
+        f->next = c->first;
+        c->head->next = f;
+        c->first->prev = f;
+    }
 }
 
 void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity)
 {
-	struct pullup_field *f;
+    struct pullup_field *f;
 
-	/* Grow the circular list if needed */
-	check_field_queue(c);
+    /* Grow the circular list if needed */
+    check_field_queue(c);
 
-	/* Cannot have two fields of same parity in a row; drop the new one */
-	if (c->last && c->last->parity == parity) return;
+    /* Cannot have two fields of same parity in a row; drop the new one */
+    if (c->last && c->last->parity == parity) return;
 
-	f = c->head;
-	f->parity = parity;
-	f->buffer = pullup_lock_buffer(b, parity);
-	f->flags = 0;
-	f->breaks = 0;
-	f->affinity = 0;
+    f = c->head;
+    f->parity = parity;
+    f->buffer = pullup_lock_buffer(b, parity);
+    f->flags = 0;
+    f->breaks = 0;
+    f->affinity = 0;
 
-	compute_metric(c, f, parity, f->prev->prev, parity, c->diff, f->diffs);
-	compute_metric(c, parity?f->prev:f, 0, parity?f:f->prev, 1, c->comb, f->comb);
-	compute_metric(c, f, parity, f, -1, c->var, f->var);
+    compute_metric(c, f, parity, f->prev->prev, parity, c->diff, f->diffs);
+    compute_metric(c, parity?f->prev:f, 0, parity?f:f->prev, 1, c->comb, f->comb);
+    compute_metric(c, f, parity, f, -1, c->var, f->var);
 
-	/* Advance the circular list */
-	if (!c->first) c->first = c->head;
-	c->last = c->head;
-	c->head = c->head->next;
+    /* Advance the circular list */
+    if (!c->first) c->first = c->head;
+    c->last = c->head;
+    c->head = c->head->next;
 }
 
 void pullup_flush_fields(struct pullup_context *c)
 {
-	struct pullup_field *f;
+    struct pullup_field *f;
 
-	for (f = c->first; f && f != c->head; f = f->next) {
-		pullup_release_buffer(f->buffer, f->parity);
-		f->buffer = 0;
-	}
-	c->first = c->last = 0;
+    for (f = c->first; f && f != c->head; f = f->next) {
+        pullup_release_buffer(f->buffer, f->parity);
+        f->buffer = 0;
+    }
+    c->first = c->last = 0;
 }
 
 
@@ -469,175 +469,175 @@
 
 static int queue_length(struct pullup_field *begin, struct pullup_field *end)
 {
-	int count = 1;
-	struct pullup_field *f;
+    int count = 1;
+    struct pullup_field *f;
 
-	if (!begin || !end) return 0;
-	for (f = begin; f != end; f = f->next) count++;
-	return count;
+    if (!begin || !end) return 0;
+    for (f = begin; f != end; f = f->next) count++;
+    return count;
 }
 
 static int find_first_break(struct pullup_field *f, int max)
 {
-	int i;
-	for (i = 0; i < max; i++) {
-		if (f->breaks & BREAK_RIGHT || f->next->breaks & BREAK_LEFT)
-			return i+1;
-		f = f->next;
-	}
-	return 0;
+    int i;
+    for (i = 0; i < max; i++) {
+        if (f->breaks & BREAK_RIGHT || f->next->breaks & BREAK_LEFT)
+            return i+1;
+        f = f->next;
+    }
+    return 0;
 }
 
 static void compute_breaks(struct pullup_context *c, struct pullup_field *f0)
 {
-	int i;
-	struct pullup_field *f1 = f0->next;
-	struct pullup_field *f2 = f1->next;
-	struct pullup_field *f3 = f2->next;
-	int l, max_l=0, max_r=0;
-	//struct pullup_field *ff;
-	//for (i=0, ff=c->first; ff != f0; i++, ff=ff->next);
+    int i;
+    struct pullup_field *f1 = f0->next;
+    struct pullup_field *f2 = f1->next;
+    struct pullup_field *f3 = f2->next;
+    int l, max_l=0, max_r=0;
+    //struct pullup_field *ff;
+    //for (i=0, ff=c->first; ff != f0; i++, ff=ff->next);
 
-	if (f0->flags & F_HAVE_BREAKS) return;
-	//printf("\n%d: ", i);
-	f0->flags |= F_HAVE_BREAKS;
+    if (f0->flags & F_HAVE_BREAKS) return;
+    //printf("\n%d: ", i);
+    f0->flags |= F_HAVE_BREAKS;
 
-	/* Special case when fields are 100% identical */
-	if (f0->buffer == f2->buffer && f1->buffer != f3->buffer) {
-		f2->breaks |= BREAK_RIGHT;
-		return;
-	}
-	if (f0->buffer != f2->buffer && f1->buffer == f3->buffer) {
-		f1->breaks |= BREAK_LEFT;
-		return;
-	}
+    /* Special case when fields are 100% identical */
+    if (f0->buffer == f2->buffer && f1->buffer != f3->buffer) {
+        f2->breaks |= BREAK_RIGHT;
+        return;
+    }
+    if (f0->buffer != f2->buffer && f1->buffer == f3->buffer) {
+        f1->breaks |= BREAK_LEFT;
+        return;
+    }
 
-	for (i = 0; i < c->metric_len; i++) {
-		l = f2->diffs[i] - f3->diffs[i];
-		if (l > max_l) max_l = l;
-		if (-l > max_r) max_r = -l;
-	}
-	/* Don't get tripped up when differences are mostly quant error */
-	//printf("%d %d\n", max_l, max_r);
-	if (max_l + max_r < 128) return;
-	if (max_l > 4*max_r) f1->breaks |= BREAK_LEFT;
-	if (max_r > 4*max_l) f2->breaks |= BREAK_RIGHT;
+    for (i = 0; i < c->metric_len; i++) {
+        l = f2->diffs[i] - f3->diffs[i];
+        if (l > max_l) max_l = l;
+        if (-l > max_r) max_r = -l;
+    }
+    /* Don't get tripped up when differences are mostly quant error */
+    //printf("%d %d\n", max_l, max_r);
+    if (max_l + max_r < 128) return;
+    if (max_l > 4*max_r) f1->breaks |= BREAK_LEFT;
+    if (max_r > 4*max_l) f2->breaks |= BREAK_RIGHT;
 }
 
 static void compute_affinity(struct pullup_context *c, struct pullup_field *f)
 {
-	int i;
-	int max_l=0, max_r=0, l;
-	if (f->flags & F_HAVE_AFFINITY) return;
-	f->flags |= F_HAVE_AFFINITY;
-	if (f->buffer == f->next->next->buffer) {
-		f->affinity = 1;
-		f->next->affinity = 0;
-		f->next->next->affinity = -1;
-		f->next->flags |= F_HAVE_AFFINITY;
-		f->next->next->flags |= F_HAVE_AFFINITY;
-		return;
-	}
-	if (1) {
-		for (i = 0; i < c->metric_len; i++) {
-			int lv = f->prev->var[i];
-			int rv = f->next->var[i];
-			int v = f->var[i];
-			int lc = f->comb[i] - (v+lv) + ABS(v-lv);
-			int rc = f->next->comb[i] - (v+rv) + ABS(v-rv);
-			lc = lc>0 ? lc : 0;
-			rc = rc>0 ? rc : 0;
-			l = lc - rc;
-			if (l > max_l) max_l = l;
-			if (-l > max_r) max_r = -l;
-		}
-		if (max_l + max_r < 64) return;
-		if (max_r > 6*max_l) f->affinity = -1;
-		else if (max_l > 6*max_r) f->affinity = 1;
-	} else {
-		for (i = 0; i < c->metric_len; i++) {
-			l = f->comb[i] - f->next->comb[i];
-			if (l > max_l) max_l = l;
-			if (-l > max_r) max_r = -l;
-		}
-		if (max_l + max_r < 64) return;
-		if (max_r > 2*max_l) f->affinity = -1;
-		else if (max_l > 2*max_r) f->affinity = 1;
-	}
+    int i;
+    int max_l=0, max_r=0, l;
+    if (f->flags & F_HAVE_AFFINITY) return;
+    f->flags |= F_HAVE_AFFINITY;
+    if (f->buffer == f->next->next->buffer) {
+        f->affinity = 1;
+        f->next->affinity = 0;
+        f->next->next->affinity = -1;
+        f->next->flags |= F_HAVE_AFFINITY;
+        f->next->next->flags |= F_HAVE_AFFINITY;
+        return;
+    }
+    if (1) {
+        for (i = 0; i < c->metric_len; i++) {
+            int lv = f->prev->var[i];
+            int rv = f->next->var[i];
+            int v = f->var[i];
+            int lc = f->comb[i] - (v+lv) + ABS(v-lv);
+            int rc = f->next->comb[i] - (v+rv) + ABS(v-rv);
+            lc = lc>0 ? lc : 0;
+            rc = rc>0 ? rc : 0;
+            l = lc - rc;
+            if (l > max_l) max_l = l;
+            if (-l > max_r) max_r = -l;
+        }
+        if (max_l + max_r < 64) return;
+        if (max_r > 6*max_l) f->affinity = -1;
+        else if (max_l > 6*max_r) f->affinity = 1;
+    } else {
+        for (i = 0; i < c->metric_len; i++) {
+            l = f->comb[i] - f->next->comb[i];
+            if (l > max_l) max_l = l;
+            if (-l > max_r) max_r = -l;
+        }
+        if (max_l + max_r < 64) return;
+        if (max_r > 2*max_l) f->affinity = -1;
+        else if (max_l > 2*max_r) f->affinity = 1;
+    }
 }
 
 static void foo(struct pullup_context *c)
 {
-	struct pullup_field *f = c->first;
-	int i, n = queue_length(f, c->last);
-	for (i = 0; i < n-1; i++) {
-		if (i < n-3) compute_breaks(c, f);
-		compute_affinity(c, f);
-		f = f->next;
-	}
+    struct pullup_field *f = c->first;
+    int i, n = queue_length(f, c->last);
+    for (i = 0; i < n-1; i++) {
+        if (i < n-3) compute_breaks(c, f);
+        compute_affinity(c, f);
+        f = f->next;
+    }
 }
 
 static int decide_frame_length(struct pullup_context *c)
 {
-	struct pullup_field *f0 = c->first;
-	struct pullup_field *f1 = f0->next;
-	struct pullup_field *f2 = f1->next;
-	int l;
+    struct pullup_field *f0 = c->first;
+    struct pullup_field *f1 = f0->next;
+    struct pullup_field *f2 = f1->next;
+    int l;
 
-	if (queue_length(c->first, c->last) < 4) return 0;
-	foo(c);
+    if (queue_length(c->first, c->last) < 4) return 0;
+    foo(c);
 
-	if (f0->affinity == -1) return 1;
+    if (f0->affinity == -1) return 1;
 
-	l = find_first_break(f0, 3);
-	if (l == 1 && c->strict_breaks < 0) l = 0;
+    l = find_first_break(f0, 3);
+    if (l == 1 && c->strict_breaks < 0) l = 0;
 
-	switch (l) {
-	case 1:
-		if (c->strict_breaks < 1 && f0->affinity == 1 && f1->affinity == -1)
-			return 2;
-		else return 1;
-	case 2:
-		/* FIXME: strictly speaking, f0->prev is no longer valid... :) */
-		if (c->strict_pairs
-			&& (f0->prev->breaks & BREAK_RIGHT) && (f2->breaks & BREAK_LEFT)
-			&& (f0->affinity != 1 || f1->affinity != -1) )
-			return 1;
-		if (f1->affinity == 1) return 1;
-		else return 2;
-	case 3:
-		if (f2->affinity == 1) return 2;
-		else return 3;
-	default:
-		/* 9 possibilities covered before switch */
-		if (f1->affinity == 1) return 1; /* covers 6 */
-		else if (f1->affinity == -1) return 2; /* covers 6 */
-		else if (f2->affinity == -1) { /* covers 2 */
-			if (f0->affinity == 1) return 3;
-			else return 1;
-		}
-		else return 2; /* the remaining 6 */
-	}
+    switch (l) {
+    case 1:
+        if (c->strict_breaks < 1 && f0->affinity == 1 && f1->affinity == -1)
+            return 2;
+        else return 1;
+    case 2:
+        /* FIXME: strictly speaking, f0->prev is no longer valid... :) */
+        if (c->strict_pairs
+            && (f0->prev->breaks & BREAK_RIGHT) && (f2->breaks & BREAK_LEFT)
+            && (f0->affinity != 1 || f1->affinity != -1) )
+            return 1;
+        if (f1->affinity == 1) return 1;
+        else return 2;
+    case 3:
+        if (f2->affinity == 1) return 2;
+        else return 3;
+    default:
+        /* 9 possibilities covered before switch */
+        if (f1->affinity == 1) return 1; /* covers 6 */
+        else if (f1->affinity == -1) return 2; /* covers 6 */
+        else if (f2->affinity == -1) { /* covers 2 */
+            if (f0->affinity == 1) return 3;
+            else return 1;
+        }
+        else return 2; /* the remaining 6 */
+    }
 }
 
 
 static void print_aff_and_breaks(struct pullup_context *c, struct pullup_field *f)
 {
-	int i;
-	struct pullup_field *f0 = f;
-	const char aff_l[] = "+..", aff_r[] = "..+";
-	printf("\naffinity: ");
-	for (i = 0; i < 4; i++) {
-		printf("%c%d%c", aff_l[1+f->affinity], i, aff_r[1+f->affinity]);
-		f = f->next;
-	}
-	f = f0;
-	printf("\nbreaks:   ");
-	for (i=0; i<4; i++) {
-		printf("%c%d%c", f->breaks & BREAK_LEFT ? '|' : '.', i, f->breaks & BREAK_RIGHT ? '|' : '.');
-		f = f->next;
-	}
-	printf("\n");
+    int i;
+    struct pullup_field *f0 = f;
+    const char aff_l[] = "+..", aff_r[] = "..+";
+    printf("\naffinity: ");
+    for (i = 0; i < 4; i++) {
+        printf("%c%d%c", aff_l[1+f->affinity], i, aff_r[1+f->affinity]);
+        f = f->next;
+    }
+    f = f0;
+    printf("\nbreaks:   ");
+    for (i=0; i<4; i++) {
+        printf("%c%d%c", f->breaks & BREAK_LEFT ? '|' : '.', i, f->breaks & BREAK_RIGHT ? '|' : '.');
+        f = f->next;
+    }
+    printf("\n");
 }
 
 
@@ -646,97 +646,97 @@
 
 struct pullup_frame *pullup_get_frame(struct pullup_context *c)
 {
-	int i;
-	struct pullup_frame *fr = c->frame;
-	int n = decide_frame_length(c);
-	int aff = c->first->next->affinity;
+    int i;
+    struct pullup_frame *fr = c->frame;
+    int n = decide_frame_length(c);
+    int aff = c->first->next->affinity;
 
-	if (!n) return 0;
-	if (fr->lock) return 0;
+    if (!n) return 0;
+    if (fr->lock) return 0;
 
-	if (c->verbose) {
-		print_aff_and_breaks(c, c->first);
-		printf("duration: %d    \n", n);
-	}
+    if (c->verbose) {
+        print_aff_and_breaks(c, c->first);
+        printf("duration: %d    \n", n);
+    }
 
-	fr->lock++;
-	fr->length = n;
-	fr->parity = c->first->parity;
-	fr->buffer = 0;
-	for (i = 0; i < n; i++) {
-		/* We cheat and steal the buffer without release+relock */
-		fr->ifields[i] = c->first->buffer;
-		c->first->buffer = 0;
-		c->first = c->first->next;
-	}
+    fr->lock++;
+    fr->length = n;
+    fr->parity = c->first->parity;
+    fr->buffer = 0;
+    for (i = 0; i < n; i++) {
+        /* We cheat and steal the buffer without release+relock */
+        fr->ifields[i] = c->first->buffer;
+        c->first->buffer = 0;
+        c->first = c->first->next;
+    }
 
-	if (n == 1) {
-		fr->ofields[fr->parity] = fr->ifields[0];
-		fr->ofields[fr->parity^1] = 0;
-	} else if (n == 2) {
-		fr->ofields[fr->parity] = fr->ifields[0];
-		fr->ofields[fr->parity^1] = fr->ifields[1];
-	} else if (n == 3) {
-		if (aff == 0)
-			aff = (fr->ifields[0] == fr->ifields[1]) ? -1 : 1;
-		/* else if (c->verbose) printf("forced aff: %d    \n", aff); */
-		fr->ofields[fr->parity] = fr->ifields[1+aff];
-		fr->ofields[fr->parity^1] = fr->ifields[1];
-	}
-	pullup_lock_buffer(fr->ofields[0], 0);
-	pullup_lock_buffer(fr->ofields[1], 1);
+    if (n == 1) {
+        fr->ofields[fr->parity] = fr->ifields[0];
+        fr->ofields[fr->parity^1] = 0;
+    } else if (n == 2) {
+        fr->ofields[fr->parity] = fr->ifields[0];
+        fr->ofields[fr->parity^1] = fr->ifields[1];
+    } else if (n == 3) {
+        if (aff == 0)
+            aff = (fr->ifields[0] == fr->ifields[1]) ? -1 : 1;
+        /* else if (c->verbose) printf("forced aff: %d    \n", aff); */
+        fr->ofields[fr->parity] = fr->ifields[1+aff];
+        fr->ofields[fr->parity^1] = fr->ifields[1];
+    }
+    pullup_lock_buffer(fr->ofields[0], 0);
+    pullup_lock_buffer(fr->ofields[1], 1);
 
-	if (fr->ofields[0] == fr->ofields[1]) {
-		fr->buffer = fr->ofields[0];
-		pullup_lock_buffer(fr->buffer, 2);
-		return fr;
-	}
-	return fr;
+    if (fr->ofields[0] == fr->ofields[1]) {
+        fr->buffer = fr->ofields[0];
+        pullup_lock_buffer(fr->buffer, 2);
+        return fr;
+    }
+    return fr;
 }
 
 static void copy_field(struct pullup_context *c, struct pullup_buffer *dest,
-	struct pullup_buffer *src, int parity)
+    struct pullup_buffer *src, int parity)
 {
-	int i, j;
-	unsigned char *d, *s;
-	for (i = 0; i < c->nplanes; i++) {
-		s = src->planes[i] + parity*c->stride[i];
-		d = dest->planes[i] + parity*c->stride[i];
-		for (j = c->h[i]>>1; j; j--) {
-			memcpy(d, s, c->stride[i]);
-			s += c->stride[i]<<1;
-			d += c->stride[i]<<1;
-		}
-	}
+    int i, j;
+    unsigned char *d, *s;
+    for (i = 0; i < c->nplanes; i++) {
+        s = src->planes[i] + parity*c->stride[i];
+        d = dest->planes[i] + parity*c->stride[i];
+        for (j = c->h[i]>>1; j; j--) {
+            memcpy(d, s, c->stride[i]);
+            s += c->stride[i]<<1;
+            d += c->stride[i]<<1;
+        }
+    }
 }
 
 void pullup_pack_frame(struct pullup_context *c, struct pullup_frame *fr)
 {
-	int i;
-	if (fr->buffer) return;
-	if (fr->length < 2) return; /* FIXME: deal with this */
-	for (i = 0; i < 2; i++)
-	{
-		if (fr->ofields[i]->lock[i^1]) continue;
-		fr->buffer = fr->ofields[i];
-		pullup_lock_buffer(fr->buffer, 2);
-		copy_field(c, fr->buffer, fr->ofields[i^1], i^1);
-		return;
-	}
-	fr->buffer = pullup_get_buffer(c, 2);
-	copy_field(c, fr->buffer, fr->ofields[0], 0);
-	copy_field(c, fr->buffer, fr->ofields[1], 1);
+    int i;
+    if (fr->buffer) return;
+    if (fr->length < 2) return; /* FIXME: deal with this */
+    for (i = 0; i < 2; i++)
+    {
+        if (fr->ofields[i]->lock[i^1]) continue;
+        fr->buffer = fr->ofields[i];
+        pullup_lock_buffer(fr->buffer, 2);
+        copy_field(c, fr->buffer, fr->ofields[i^1], i^1);
+        return;
+    }
+    fr->buffer = pullup_get_buffer(c, 2);
+    copy_field(c, fr->buffer, fr->ofields[0], 0);
+    copy_field(c, fr->buffer, fr->ofields[1], 1);
 }
 
 void pullup_release_frame(struct pullup_frame *fr)
 {
-	int i;
-	for (i = 0; i < fr->length; i++)
-		pullup_release_buffer(fr->ifields[i], fr->parity ^ (i&1));
-	pullup_release_buffer(fr->ofields[0], 0);
-	pullup_release_buffer(fr->ofields[1], 1);
-	if (fr->buffer) pullup_release_buffer(fr->buffer, 2);
-	fr->lock--;
+    int i;
+    for (i = 0; i < fr->length; i++)
+        pullup_release_buffer(fr->ifields[i], fr->parity ^ (i&1));
+    pullup_release_buffer(fr->ofields[0], 0);
+    pullup_release_buffer(fr->ofields[1], 1);
+    if (fr->buffer) pullup_release_buffer(fr->buffer, 2);
+    fr->lock--;
 }
 
 
@@ -746,77 +746,77 @@
 
 struct pullup_context *pullup_alloc_context(void)
 {
-	struct pullup_context *c;
+    struct pullup_context *c;
 
-	c = calloc(1, sizeof(struct pullup_context));
+    c = calloc(1, sizeof(struct pullup_context));
 
-	return c;
+    return c;
 }
 
 void pullup_preinit_context(struct pullup_context *c)
 {
-	c->bpp = calloc(c->nplanes, sizeof(int));
-	c->w = calloc(c->nplanes, sizeof(int));
-	c->h = calloc(c->nplanes, sizeof(int));
-	c->stride = calloc(c->nplanes, sizeof(int));
-	c->background = calloc(c->nplanes, sizeof(int));
+    c->bpp = calloc(c->nplanes, sizeof(int));
+    c->w = calloc(c->nplanes, sizeof(int));
+    c->h = calloc(c->nplanes, sizeof(int));
+    c->stride = calloc(c->nplanes, sizeof(int));
+    c->background = calloc(c->nplanes, sizeof(int));
 }
 
 void pullup_init_context(struct pullup_context *c)
 {
-	int mp = c->metric_plane;
-	if (c->nbuffers < 10) c->nbuffers = 10;
-	c->buffers = calloc(c->nbuffers, sizeof (struct pullup_buffer));
+    int mp = c->metric_plane;
+    if (c->nbuffers < 10) c->nbuffers = 10;
+    c->buffers = calloc(c->nbuffers, sizeof (struct pullup_buffer));
 
-	c->metric_w = (c->w[mp] - ((c->junk_left + c->junk_right) << 3)) >> 3;
-	c->metric_h = (c->h[mp] - ((c->junk_top + c->junk_bottom) << 1)) >> 3;
-	c->metric_offset = c->junk_left*c->bpp[mp] + (c->junk_top<<1)*c->stride[mp];
-	c->metric_len = c->metric_w * c->metric_h;
+    c->metric_w = (c->w[mp] - ((c->junk_left + c->junk_right) << 3)) >> 3;
+    c->metric_h = (c->h[mp] - ((c->junk_top + c->junk_bottom) << 1)) >> 3;
+    c->metric_offset = c->junk_left*c->bpp[mp] + (c->junk_top<<1)*c->stride[mp];
+    c->metric_len = c->metric_w * c->metric_h;
 
-	c->head = make_field_queue(c, 8);
+    c->head = make_field_queue(c, 8);
 
-	c->frame = calloc(1, sizeof (struct pullup_frame));
-	c->frame->ifields = calloc(3, sizeof (struct pullup_buffer *));
+    c->frame = calloc(1, sizeof (struct pullup_frame));
+    c->frame->ifields = calloc(3, sizeof (struct pullup_buffer *));
 
-	switch(c->format) {
-	case PULLUP_FMT_Y:
-		c->diff = diff_y;
-		c->comb = licomb_y;
-		c->var = var_y;
+    switch(c->format) {
+    case PULLUP_FMT_Y:
+        c->diff = diff_y;
+        c->comb = licomb_y;
+        c->var = var_y;
 #if ARCH_X86
 #if HAVE_MMX
-		if (c->cpu & PULLUP_CPU_MMX) {
-			c->diff = diff_y_mmx;
-			c->comb = licomb_y_mmx;
-			c->var = var_y_mmx;
-		}
+        if (c->cpu & PULLUP_CPU_MMX) {
+            c->diff = diff_y_mmx;
+            c->comb = licomb_y_mmx;
+            c->var = var_y_mmx;
+        }
 #endif
 #endif
-		/* c->comb = qpcomb_y; */
-		break;
+        /* c->comb = qpcomb_y; */
+        break;
 #if 0
-	case PULLUP_FMT_YUY2:
-		c->diff = diff_yuy2;
-		break;
-	case PULLUP_FMT_RGB32:
-		c->diff = diff_rgb32;
-		break;
+    case PULLUP_FMT_YUY2:
+        c->diff = diff_yuy2;
+        break;
+    case PULLUP_FMT_RGB32:
+        c->diff = diff_rgb32;
+        break;
 #endif
-	}
+    }
 }
 
 void pullup_free_context(struct pullup_context *c)
 {
-	struct pullup_field *f;
-	free(c->buffers);
-	f = c->head;
-	do {
-		if (!f) break;
-		free(f->diffs);
-		free(f->comb);
-		f = f->next;
-		free(f->prev);
-	} while (f != c->head);
-	free(c->frame);
-	free(c);
+    struct pullup_field *f;
+    free(c->buffers);
+    f = c->head;
+    do {
+        if (!f) break;
+        free(f->diffs);
+        free(f->comb);
+        f = f->next;
+        free(f->prev);
+    } while (f != c->head);
+    free(c->frame);
+    free(c);
 }
--- a/libmpcodecs/pullup.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/pullup.h	Fri Jan 14 22:10:21 2011 +0000
@@ -33,53 +33,53 @@
 
 struct pullup_buffer
 {
-	int lock[2];
-	unsigned char **planes;
+    int lock[2];
+    unsigned char **planes;
 };
 
 struct pullup_field
 {
-	int parity;
-	struct pullup_buffer *buffer;
-	unsigned int flags;
-	int breaks;
-	int affinity;
-	int *diffs;
-	int *comb;
-	int *var;
-	struct pullup_field *prev, *next;
+    int parity;
+    struct pullup_buffer *buffer;
+    unsigned int flags;
+    int breaks;
+    int affinity;
+    int *diffs;
+    int *comb;
+    int *var;
+    struct pullup_field *prev, *next;
 };
 
 struct pullup_frame
 {
-	int lock;
-	int length;
-	int parity;
-	struct pullup_buffer **ifields, *ofields[2];
-	struct pullup_buffer *buffer;
+    int lock;
+    int length;
+    int parity;
+    struct pullup_buffer **ifields, *ofields[2];
+    struct pullup_buffer *buffer;
 };
 
 struct pullup_context
 {
-	/* Public interface */
-	int format;
-	int nplanes;
-	int *bpp, *w, *h, *stride, *background;
-	unsigned int cpu;
-	int junk_left, junk_right, junk_top, junk_bottom;
-	int verbose;
-	int metric_plane;
-	int strict_breaks;
-	int strict_pairs;
-	/* Internal data */
-	struct pullup_field *first, *last, *head;
-	struct pullup_buffer *buffers;
-	int nbuffers;
-	int (*diff)(unsigned char *, unsigned char *, int);
-	int (*comb)(unsigned char *, unsigned char *, int);
-	int (*var)(unsigned char *, unsigned char *, int);
-	int metric_w, metric_h, metric_len, metric_offset;
-	struct pullup_frame *frame;
+    /* Public interface */
+    int format;
+    int nplanes;
+    int *bpp, *w, *h, *stride, *background;
+    unsigned int cpu;
+    int junk_left, junk_right, junk_top, junk_bottom;
+    int verbose;
+    int metric_plane;
+    int strict_breaks;
+    int strict_pairs;
+    /* Internal data */
+    struct pullup_field *first, *last, *head;
+    struct pullup_buffer *buffers;
+    int nbuffers;
+    int (*diff)(unsigned char *, unsigned char *, int);
+    int (*comb)(unsigned char *, unsigned char *, int);
+    int (*var)(unsigned char *, unsigned char *, int);
+    int metric_w, metric_h, metric_len, metric_offset;
+    struct pullup_frame *frame;
 };
 
 
--- a/libmpcodecs/vf.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf.h	Fri Jan 14 22:10:21 2011 +0000
@@ -58,7 +58,7 @@
     // funcs:
     int (*config)(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt);
+        unsigned int flags, unsigned int outfmt);
     int (*control)(struct vf_instance *vf,
         int request, void* data);
     int (*query_format)(struct vf_instance *vf,
@@ -135,7 +135,7 @@
 // default wrappers:
 int vf_next_config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt);
+        unsigned int flags, unsigned int outfmt);
 int vf_next_control(struct vf_instance *vf, int request, void* data);
 void vf_extra_flip(struct vf_instance *vf);
 int vf_next_query_format(struct vf_instance *vf, unsigned int fmt);
@@ -148,8 +148,8 @@
 void vf_uninit_filter_chain(vf_instance_t* vf);
 
 int vf_config_wrapper(struct vf_instance *vf,
-		      int width, int height, int d_width, int d_height,
-		      unsigned int flags, unsigned int outfmt);
+                      int width, int height, int d_width, int d_height,
+                      unsigned int flags, unsigned int outfmt);
 
 static inline int norm_qscale(int qscale, int type)
 {
--- a/libmpcodecs/vf_2xsai.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_2xsai.c	Fri Jan 14 22:10:21 2011 +0000
@@ -46,44 +46,44 @@
 static int Init_2xSaI(int d)
 {
 
-	int minr = 0, ming = 0, minb = 0;
-	int i;
+        int minr = 0, ming = 0, minb = 0;
+        int i;
 
-//	if (d != 15 && d != 16 && d != 24 && d != 32)
-//		return -1;
+//        if (d != 15 && d != 16 && d != 24 && d != 32)
+//                return -1;
 
-	/* Get lowest color bit */
-	for (i = 0; i < 255; i++) {
-		if (!minr)
-			minr = makecol(i, 0, 0);
-		if (!ming)
-			ming = makecol(0, i, 0);
-		if (!minb)
-			minb = makecol(0, 0, i);
-	}
+        /* Get lowest color bit */
+        for (i = 0; i < 255; i++) {
+                if (!minr)
+                        minr = makecol(i, 0, 0);
+                if (!ming)
+                        ming = makecol(0, i, 0);
+                if (!minb)
+                        minb = makecol(0, 0, i);
+        }
 
-	colorMask = (makecol_depth(d, 255, 0, 0) - minr) | (makecol_depth(d, 0, 255, 0) - ming) | (makecol_depth(d, 0, 0, 255) - minb);
-	lowPixelMask = minr | ming | minb;
-	qcolorMask = (makecol_depth(d, 255, 0, 0) - 3 * minr) | (makecol_depth(d, 0, 255, 0) - 3 * ming) | (makecol_depth(d, 0, 0, 255) - 3 * minb);
-	qlowpixelMask = (minr * 3) | (ming * 3) | (minb * 3);
-	redblueMask = makecol_depth(d, 255, 0, 255);
-	greenMask = makecol_depth(d, 0, 255, 0);
+        colorMask = (makecol_depth(d, 255, 0, 0) - minr) | (makecol_depth(d, 0, 255, 0) - ming) | (makecol_depth(d, 0, 0, 255) - minb);
+        lowPixelMask = minr | ming | minb;
+        qcolorMask = (makecol_depth(d, 255, 0, 0) - 3 * minr) | (makecol_depth(d, 0, 255, 0) - 3 * ming) | (makecol_depth(d, 0, 0, 255) - 3 * minb);
+        qlowpixelMask = (minr * 3) | (ming * 3) | (minb * 3);
+        redblueMask = makecol_depth(d, 255, 0, 255);
+        greenMask = makecol_depth(d, 0, 255, 0);
 
-	PixelsPerMask = (d <= 16) ? 2 : 1;
+        PixelsPerMask = (d <= 16) ? 2 : 1;
 
-	if (PixelsPerMask == 2) {
-		colorMask |= (colorMask << 16);
-		qcolorMask |= (qcolorMask << 16);
-		lowPixelMask |= (lowPixelMask << 16);
-		qlowpixelMask |= (qlowpixelMask << 16);
-	}
+        if (PixelsPerMask == 2) {
+                colorMask |= (colorMask << 16);
+                qcolorMask |= (qcolorMask << 16);
+                lowPixelMask |= (lowPixelMask << 16);
+                qlowpixelMask |= (qlowpixelMask << 16);
+        }
 
-//	TRACE("Color Mask:       0x%lX\n", colorMask);
-//	TRACE("Low Pixel Mask:   0x%lX\n", lowPixelMask);
-//	TRACE("QColor Mask:      0x%lX\n", qcolorMask);
-//	TRACE("QLow Pixel Mask:  0x%lX\n", qlowpixelMask);
+//        TRACE("Color Mask:       0x%lX\n", colorMask);
+//        TRACE("Low Pixel Mask:   0x%lX\n", lowPixelMask);
+//        TRACE("QColor Mask:      0x%lX\n", qcolorMask);
+//        TRACE("QLow Pixel Mask:  0x%lX\n", qlowpixelMask);
 
-	return 0;
+        return 0;
 }
 
 
@@ -92,7 +92,7 @@
 #define INTERPOLATE(A, B) (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask))
 
 #define Q_INTERPOLATE(A, B, C, D) ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2) \
-	+ ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask)
+        + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask)
 
 
 static void Super2xSaI_ex(uint8_t *src, uint32_t src_pitch,
@@ -100,181 +100,181 @@
                           uint32_t width, uint32_t height, int sbpp)
 {
 
-	unsigned int x, y;
-	uint32_t color[16];
-	unsigned char *src_line[4];
+        unsigned int x, y;
+        uint32_t color[16];
+        unsigned char *src_line[4];
 
-	/* Point to the first 3 lines. */
-	src_line[0] = src;
-	src_line[1] = src;
-	src_line[2] = src + src_pitch;
-	src_line[3] = src + src_pitch * 2;
+        /* Point to the first 3 lines. */
+        src_line[0] = src;
+        src_line[1] = src;
+        src_line[2] = src + src_pitch;
+        src_line[3] = src + src_pitch * 2;
 
-	x = 0, y = 0;
+        x = 0, y = 0;
 
-	if (PixelsPerMask == 2) {
-		unsigned short *sbp;
-		sbp = (unsigned short*)src_line[0];
-		color[0] = *sbp;       color[1] = color[0];   color[2] = color[0];    color[3] = color[0];
-		color[4] = color[0];   color[5] = color[0];   color[6] = *(sbp + 1);  color[7] = *(sbp + 2);
-		sbp = (unsigned short*)src_line[2];
-		color[8] = *sbp;     color[9] = color[8];     color[10] = *(sbp + 1); color[11] = *(sbp + 2);
-		sbp = (unsigned short*)src_line[3];
-		color[12] = *sbp;    color[13] = color[12];   color[14] = *(sbp + 1); color[15] = *(sbp + 2);
-	}
-	else {
-		uint32_t *lbp;
-		lbp = (uint32_t*)src_line[0];
-		color[0] = *lbp;       color[1] = color[0];   color[2] = color[0];    color[3] = color[0];
-		color[4] = color[0];   color[5] = color[0];   color[6] = *(lbp + 1);  color[7] = *(lbp + 2);
-		lbp = (uint32_t*)src_line[2];
-		color[8] = *lbp;     color[9] = color[8];     color[10] = *(lbp + 1); color[11] = *(lbp + 2);
-		lbp = (uint32_t*)src_line[3];
-		color[12] = *lbp;    color[13] = color[12];   color[14] = *(lbp + 1); color[15] = *(lbp + 2);
-	}
+        if (PixelsPerMask == 2) {
+                unsigned short *sbp;
+                sbp = (unsigned short*)src_line[0];
+                color[0] = *sbp;       color[1] = color[0];   color[2] = color[0];    color[3] = color[0];
+                color[4] = color[0];   color[5] = color[0];   color[6] = *(sbp + 1);  color[7] = *(sbp + 2);
+                sbp = (unsigned short*)src_line[2];
+                color[8] = *sbp;     color[9] = color[8];     color[10] = *(sbp + 1); color[11] = *(sbp + 2);
+                sbp = (unsigned short*)src_line[3];
+                color[12] = *sbp;    color[13] = color[12];   color[14] = *(sbp + 1); color[15] = *(sbp + 2);
+        }
+        else {
+                uint32_t *lbp;
+                lbp = (uint32_t*)src_line[0];
+                color[0] = *lbp;       color[1] = color[0];   color[2] = color[0];    color[3] = color[0];
+                color[4] = color[0];   color[5] = color[0];   color[6] = *(lbp + 1);  color[7] = *(lbp + 2);
+                lbp = (uint32_t*)src_line[2];
+                color[8] = *lbp;     color[9] = color[8];     color[10] = *(lbp + 1); color[11] = *(lbp + 2);
+                lbp = (uint32_t*)src_line[3];
+                color[12] = *lbp;    color[13] = color[12];   color[14] = *(lbp + 1); color[15] = *(lbp + 2);
+        }
 
-	for (y = 0; y < height; y++) {
-		unsigned char *dst_line[2];
+        for (y = 0; y < height; y++) {
+                unsigned char *dst_line[2];
 
-		dst_line[0] = dst + dst_pitch*2*y;
-		dst_line[1] = dst + dst_pitch*(2*y+1);
+                dst_line[0] = dst + dst_pitch*2*y;
+                dst_line[1] = dst + dst_pitch*(2*y+1);
 
-		/* Todo: x = width - 2, x = width - 1 */
+                /* Todo: x = width - 2, x = width - 1 */
 
-		for (x = 0; x < width; x++) {
-			uint32_t product1a, product1b, product2a, product2b;
+                for (x = 0; x < width; x++) {
+                        uint32_t product1a, product1b, product2a, product2b;
 
 //---------------------------------------  B0 B1 B2 B3    0  1  2  3
 //                                         4  5* 6  S2 -> 4  5* 6  7
 //                                         1  2  3  S1    8  9 10 11
 //                                         A0 A1 A2 A3   12 13 14 15
 //--------------------------------------
-			if (color[9] == color[6] && color[5] != color[10]) {
-				product2b = color[9];
-				product1b = product2b;
-			}
-			else if (color[5] == color[10] && color[9] != color[6]) {
-				product2b = color[5];
-				product1b = product2b;
-			}
-			else if (color[5] == color[10] && color[9] == color[6]) {
-				int r = 0;
+                        if (color[9] == color[6] && color[5] != color[10]) {
+                                product2b = color[9];
+                                product1b = product2b;
+                        }
+                        else if (color[5] == color[10] && color[9] != color[6]) {
+                                product2b = color[5];
+                                product1b = product2b;
+                        }
+                        else if (color[5] == color[10] && color[9] == color[6]) {
+                                int r = 0;
 
-				r += GET_RESULT(color[6], color[5], color[8], color[13]);
-				r += GET_RESULT(color[6], color[5], color[4], color[1]);
-				r += GET_RESULT(color[6], color[5], color[14], color[11]);
-				r += GET_RESULT(color[6], color[5], color[2], color[7]);
+                                r += GET_RESULT(color[6], color[5], color[8], color[13]);
+                                r += GET_RESULT(color[6], color[5], color[4], color[1]);
+                                r += GET_RESULT(color[6], color[5], color[14], color[11]);
+                                r += GET_RESULT(color[6], color[5], color[2], color[7]);
 
-				if (r > 0)
-					product1b = color[6];
-				else if (r < 0)
-					product1b = color[5];
-				else
-					product1b = INTERPOLATE(color[5], color[6]);
+                                if (r > 0)
+                                        product1b = color[6];
+                                else if (r < 0)
+                                        product1b = color[5];
+                                else
+                                        product1b = INTERPOLATE(color[5], color[6]);
 
-				product2b = product1b;
+                                product2b = product1b;
 
-			}
-			else {
-				if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12])
-					product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]);
-				else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15])
-					product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]);
-				else
-					product2b = INTERPOLATE(color[9], color[10]);
+                        }
+                        else {
+                                if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12])
+                                        product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]);
+                                else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15])
+                                        product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]);
+                                else
+                                        product2b = INTERPOLATE(color[9], color[10]);
 
-				if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0])
-					product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]);
-				else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3])
-					product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]);
-				else
-					product1b = INTERPOLATE(color[5], color[6]);
-			}
+                                if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0])
+                                        product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]);
+                                else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3])
+                                        product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]);
+                                else
+                                        product1b = INTERPOLATE(color[5], color[6]);
+                        }
 
-			if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14])
-				product2a = INTERPOLATE(color[9], color[5]);
-			else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12])
-				product2a = INTERPOLATE(color[9], color[5]);
-			else
-				product2a = color[9];
+                        if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14])
+                                product2a = INTERPOLATE(color[9], color[5]);
+                        else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12])
+                                product2a = INTERPOLATE(color[9], color[5]);
+                        else
+                                product2a = color[9];
 
-			if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2])
-				product1a = INTERPOLATE(color[9], color[5]);
-			else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0])
-				product1a = INTERPOLATE(color[9], color[5]);
-			else
-				product1a = color[5];
+                        if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2])
+                                product1a = INTERPOLATE(color[9], color[5]);
+                        else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0])
+                                product1a = INTERPOLATE(color[9], color[5]);
+                        else
+                                product1a = color[5];
 
-			if (PixelsPerMask == 2) {
-				*((uint32_t *) (&dst_line[0][x * 4])) = product1a | (product1b << 16);
-				*((uint32_t *) (&dst_line[1][x * 4])) = product2a | (product2b << 16);
-			}
-			else {
-				*((uint32_t *) (&dst_line[0][x * 8])) = product1a;
-				*((uint32_t *) (&dst_line[0][x * 8 + 4])) = product1b;
-				*((uint32_t *) (&dst_line[1][x * 8])) = product2a;
-				*((uint32_t *) (&dst_line[1][x * 8 + 4])) = product2b;
-			}
+                        if (PixelsPerMask == 2) {
+                                *((uint32_t *) (&dst_line[0][x * 4])) = product1a | (product1b << 16);
+                                *((uint32_t *) (&dst_line[1][x * 4])) = product2a | (product2b << 16);
+                        }
+                        else {
+                                *((uint32_t *) (&dst_line[0][x * 8])) = product1a;
+                                *((uint32_t *) (&dst_line[0][x * 8 + 4])) = product1b;
+                                *((uint32_t *) (&dst_line[1][x * 8])) = product2a;
+                                *((uint32_t *) (&dst_line[1][x * 8 + 4])) = product2b;
+                        }
 
-			/* Move color matrix forward */
-			color[0] = color[1]; color[4] = color[5]; color[8] = color[9];   color[12] = color[13];
-			color[1] = color[2]; color[5] = color[6]; color[9] = color[10];  color[13] = color[14];
-			color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15];
+                        /* Move color matrix forward */
+                        color[0] = color[1]; color[4] = color[5]; color[8] = color[9];   color[12] = color[13];
+                        color[1] = color[2]; color[5] = color[6]; color[9] = color[10];  color[13] = color[14];
+                        color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15];
 
-			if (x < width - 3) {
-				x += 3;
-				if (PixelsPerMask == 2) {
-					color[3] = *(((unsigned short*)src_line[0]) + x);
-					color[7] = *(((unsigned short*)src_line[1]) + x);
-					color[11] = *(((unsigned short*)src_line[2]) + x);
-					color[15] = *(((unsigned short*)src_line[3]) + x);
-				}
-				else {
-					color[3] = *(((uint32_t*)src_line[0]) + x);
-					color[7] = *(((uint32_t*)src_line[1]) + x);
-					color[11] = *(((uint32_t*)src_line[2]) + x);
-					color[15] = *(((uint32_t*)src_line[3]) + x);
-				}
-				x -= 3;
-			}
-		}
+                        if (x < width - 3) {
+                                x += 3;
+                                if (PixelsPerMask == 2) {
+                                        color[3] = *(((unsigned short*)src_line[0]) + x);
+                                        color[7] = *(((unsigned short*)src_line[1]) + x);
+                                        color[11] = *(((unsigned short*)src_line[2]) + x);
+                                        color[15] = *(((unsigned short*)src_line[3]) + x);
+                                }
+                                else {
+                                        color[3] = *(((uint32_t*)src_line[0]) + x);
+                                        color[7] = *(((uint32_t*)src_line[1]) + x);
+                                        color[11] = *(((uint32_t*)src_line[2]) + x);
+                                        color[15] = *(((uint32_t*)src_line[3]) + x);
+                                }
+                                x -= 3;
+                        }
+                }
 
-		/* We're done with one line, so we shift the source lines up */
-		src_line[0] = src_line[1];
-		src_line[1] = src_line[2];
-		src_line[2] = src_line[3];
+                /* We're done with one line, so we shift the source lines up */
+                src_line[0] = src_line[1];
+                src_line[1] = src_line[2];
+                src_line[2] = src_line[3];
 
-		/* Read next line */
-		if (y + 3 >= height)
-			src_line[3] = src_line[2];
-		else
-			src_line[3] = src_line[2] + src_pitch;
+                /* Read next line */
+                if (y + 3 >= height)
+                        src_line[3] = src_line[2];
+                else
+                        src_line[3] = src_line[2] + src_pitch;
 
-		/* Then shift the color matrix up */
-		if (PixelsPerMask == 2) {
-			unsigned short *sbp;
-			sbp = (unsigned short*)src_line[0];
-			color[0] = *sbp;     color[1] = color[0];    color[2] = *(sbp + 1);  color[3] = *(sbp + 2);
-			sbp = (unsigned short*)src_line[1];
-			color[4] = *sbp;     color[5] = color[4];    color[6] = *(sbp + 1);  color[7] = *(sbp + 2);
-			sbp = (unsigned short*)src_line[2];
-			color[8] = *sbp;     color[9] = color[9];    color[10] = *(sbp + 1); color[11] = *(sbp + 2);
-			sbp = (unsigned short*)src_line[3];
-			color[12] = *sbp;    color[13] = color[12];  color[14] = *(sbp + 1); color[15] = *(sbp + 2);
-		}
-		else {
-			uint32_t *lbp;
-			lbp = (uint32_t*)src_line[0];
-			color[0] = *lbp;     color[1] = color[0];    color[2] = *(lbp + 1);  color[3] = *(lbp + 2);
-			lbp = (uint32_t*)src_line[1];
-			color[4] = *lbp;     color[5] = color[4];    color[6] = *(lbp + 1);  color[7] = *(lbp + 2);
-			lbp = (uint32_t*)src_line[2];
-			color[8] = *lbp;     color[9] = color[9];    color[10] = *(lbp + 1); color[11] = *(lbp + 2);
-			lbp = (uint32_t*)src_line[3];
-			color[12] = *lbp;    color[13] = color[12];  color[14] = *(lbp + 1); color[15] = *(lbp + 2);
-		}
+                /* Then shift the color matrix up */
+                if (PixelsPerMask == 2) {
+                        unsigned short *sbp;
+                        sbp = (unsigned short*)src_line[0];
+                        color[0] = *sbp;     color[1] = color[0];    color[2] = *(sbp + 1);  color[3] = *(sbp + 2);
+                        sbp = (unsigned short*)src_line[1];
+                        color[4] = *sbp;     color[5] = color[4];    color[6] = *(sbp + 1);  color[7] = *(sbp + 2);
+                        sbp = (unsigned short*)src_line[2];
+                        color[8] = *sbp;     color[9] = color[9];    color[10] = *(sbp + 1); color[11] = *(sbp + 2);
+                        sbp = (unsigned short*)src_line[3];
+                        color[12] = *sbp;    color[13] = color[12];  color[14] = *(sbp + 1); color[15] = *(sbp + 2);
+                }
+                else {
+                        uint32_t *lbp;
+                        lbp = (uint32_t*)src_line[0];
+                        color[0] = *lbp;     color[1] = color[0];    color[2] = *(lbp + 1);  color[3] = *(lbp + 2);
+                        lbp = (uint32_t*)src_line[1];
+                        color[4] = *lbp;     color[5] = color[4];    color[6] = *(lbp + 1);  color[7] = *(lbp + 2);
+                        lbp = (uint32_t*)src_line[2];
+                        color[8] = *lbp;     color[9] = color[9];    color[10] = *(lbp + 1); color[11] = *(lbp + 2);
+                        lbp = (uint32_t*)src_line[3];
+                        color[12] = *lbp;    color[13] = color[12];  color[14] = *(lbp + 1); color[15] = *(lbp + 2);
+                }
 
-	} // y loop
+        } // y loop
 
 }
 
@@ -283,7 +283,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
     Init_2xSaI(outfmt&255);
 
@@ -295,12 +295,12 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	2*mpi->w, 2*mpi->h);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        2*mpi->w, 2*mpi->h);
 
     Super2xSaI_ex(mpi->planes[0], mpi->stride[0],
-		  dmpi->planes[0], dmpi->stride[0],
-		  mpi->w, mpi->h, mpi->bpp/8);
+                  dmpi->planes[0], dmpi->stride[0],
+                  mpi->w, mpi->h, mpi->bpp/8);
 
     return vf_next_put_image(vf,dmpi, pts);
 }
@@ -312,7 +312,7 @@
 //    case IMGFMT_BGR15:
 //    case IMGFMT_BGR16:
     case IMGFMT_BGR32:
-	return vf_next_query_format(vf,fmt);
+        return vf_next_query_format(vf,fmt);
     }
     return 0;
 }
--- a/libmpcodecs/vf_blackframe.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_blackframe.c	Fri Jan 14 22:10:21 2011 +0000
@@ -79,10 +79,10 @@
     static const char *const picttypes[4] = { "unknown", "I", "P", "B" };
 
     for (y=1; y<=h; y++) {
-	    for (x=0; x<w; x++)
+        for (x=0; x<w; x++)
             nblack += yplane[x] < bthresh;
-	    pblack = nblack*100/(w*y);
-	    if (pblack < bamount) break;
+        pblack = nblack*100/(w*y);
+        if (pblack < bamount) break;
         yplane += ystride;
     }
 
@@ -90,7 +90,7 @@
     if (pict_type == 1) vf->priv->lastkeyframe = vf->priv->frame;
 
     if (pblack >= bamount)
-	    mp_msg(MSGT_VFILTER, MSGL_INFO,"vf_blackframe: %u, %i%%, %s (I:%u)\n",
+        mp_msg(MSGT_VFILTER, MSGL_INFO,"vf_blackframe: %u, %i%%, %s (I:%u)\n",
                                 vf->priv->frame, pblack, picttypes[pict_type],
                                 vf->priv->lastkeyframe);
 
@@ -134,7 +134,7 @@
     vf->priv->lastkeyframe = 0;
 
     if (args)
-	    sscanf(args, "%u:%u", &vf->priv->bamount, &vf->priv->bthresh);
+        sscanf(args, "%u:%u", &vf->priv->bamount, &vf->priv->bthresh);
     return 1;
 }
 
--- a/libmpcodecs/vf_boxblur.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_boxblur.c	Fri Jan 14 22:10:21 2011 +0000
@@ -33,13 +33,13 @@
 //===========================================================================//
 
 typedef struct FilterParam{
-	int radius;
-	int power;
+        int radius;
+        int power;
 }FilterParam;
 
 struct vf_priv_s {
-	FilterParam lumaParam;
-	FilterParam chromaParam;
+        FilterParam lumaParam;
+        FilterParam chromaParam;
 };
 
 
@@ -48,158 +48,158 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static inline void blur(uint8_t *dst, uint8_t *src, int w, int radius, int dstStep, int srcStep){
-	int x;
-	const int length= radius*2 + 1;
-	const int inv= ((1<<16) + length/2)/length;
+        int x;
+        const int length= radius*2 + 1;
+        const int inv= ((1<<16) + length/2)/length;
 
-	int sum= 0;
+        int sum= 0;
 
-	for(x=0; x<radius; x++){
-		sum+= src[x*srcStep]<<1;
-	}
-	sum+= src[radius*srcStep];
+        for(x=0; x<radius; x++){
+                sum+= src[x*srcStep]<<1;
+        }
+        sum+= src[radius*srcStep];
 
-	for(x=0; x<=radius; x++){
-		sum+= src[(radius+x)*srcStep] - src[(radius-x)*srcStep];
-		dst[x*dstStep]= (sum*inv + (1<<15))>>16;
-	}
+        for(x=0; x<=radius; x++){
+                sum+= src[(radius+x)*srcStep] - src[(radius-x)*srcStep];
+                dst[x*dstStep]= (sum*inv + (1<<15))>>16;
+        }
 
-	for(; x<w-radius; x++){
-		sum+= src[(radius+x)*srcStep] - src[(x-radius-1)*srcStep];
-		dst[x*dstStep]= (sum*inv + (1<<15))>>16;
-	}
+        for(; x<w-radius; x++){
+                sum+= src[(radius+x)*srcStep] - src[(x-radius-1)*srcStep];
+                dst[x*dstStep]= (sum*inv + (1<<15))>>16;
+        }
 
-	for(; x<w; x++){
-		sum+= src[(2*w-radius-x-1)*srcStep] - src[(x-radius-1)*srcStep];
-		dst[x*dstStep]= (sum*inv + (1<<15))>>16;
-	}
+        for(; x<w; x++){
+                sum+= src[(2*w-radius-x-1)*srcStep] - src[(x-radius-1)*srcStep];
+                dst[x*dstStep]= (sum*inv + (1<<15))>>16;
+        }
 }
 
 static inline void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int power, int dstStep, int srcStep){
-	uint8_t temp[2][4096];
-	uint8_t *a= temp[0], *b=temp[1];
+        uint8_t temp[2][4096];
+        uint8_t *a= temp[0], *b=temp[1];
 
-	if(radius){
-		blur(a, src, w, radius, 1, srcStep);
-		for(; power>2; power--){
-			uint8_t *c;
-			blur(b, a, w, radius, 1, 1);
-			c=a; a=b; b=c;
-		}
-		if(power>1)
-			blur(dst, a, w, radius, dstStep, 1);
-		else{
-			int i;
-			for(i=0; i<w; i++)
-				dst[i*dstStep]= a[i];
-		}
-	}else{
-		int i;
-		for(i=0; i<w; i++)
-			dst[i*dstStep]= src[i*srcStep];
-	}
+        if(radius){
+                blur(a, src, w, radius, 1, srcStep);
+                for(; power>2; power--){
+                        uint8_t *c;
+                        blur(b, a, w, radius, 1, 1);
+                        c=a; a=b; b=c;
+                }
+                if(power>1)
+                        blur(dst, a, w, radius, dstStep, 1);
+                else{
+                        int i;
+                        for(i=0; i<w; i++)
+                                dst[i*dstStep]= a[i];
+                }
+        }else{
+                int i;
+                for(i=0; i<w; i++)
+                        dst[i*dstStep]= src[i*srcStep];
+        }
 }
 
 static void hBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int radius, int power){
-	int y;
+        int y;
 
-	if(radius==0 && dst==src) return;
+        if(radius==0 && dst==src) return;
 
-	for(y=0; y<h; y++){
-		blur2(dst + y*dstStride, src + y*srcStride, w, radius, power, 1, 1);
-	}
+        for(y=0; y<h; y++){
+                blur2(dst + y*dstStride, src + y*srcStride, w, radius, power, 1, 1);
+        }
 }
 
 //FIXME optimize (x before y !!!)
 static void vBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int radius, int power){
-	int x;
+        int x;
 
-	if(radius==0 && dst==src) return;
+        if(radius==0 && dst==src) return;
 
-	for(x=0; x<w; x++){
-		blur2(dst + x, src + x, h, radius, power, dstStride, srcStride);
-	}
+        for(x=0; x<w; x++){
+                blur2(dst + x, src + x, h, radius, power, dstStride, srcStride);
+        }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
+        int cw= mpi->w >> mpi->chroma_x_shift;
+        int ch= mpi->h >> mpi->chroma_y_shift;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_READABLE,
-		mpi->w,mpi->h);
+        mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+                MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_READABLE,
+                mpi->w,mpi->h);
 
-	assert(mpi->flags&MP_IMGFLAG_PLANAR);
+        assert(mpi->flags&MP_IMGFLAG_PLANAR);
 
-	hBlur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h,
-		dmpi->stride[0], mpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);
-	hBlur(dmpi->planes[1], mpi->planes[1], cw,ch,
-		dmpi->stride[1], mpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
-	hBlur(dmpi->planes[2], mpi->planes[2], cw,ch,
-		dmpi->stride[2], mpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
+        hBlur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h,
+                dmpi->stride[0], mpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);
+        hBlur(dmpi->planes[1], mpi->planes[1], cw,ch,
+                dmpi->stride[1], mpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
+        hBlur(dmpi->planes[2], mpi->planes[2], cw,ch,
+                dmpi->stride[2], mpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
 
-	vBlur(dmpi->planes[0], dmpi->planes[0], mpi->w,mpi->h,
-		dmpi->stride[0], dmpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);
-	vBlur(dmpi->planes[1], dmpi->planes[1], cw,ch,
-		dmpi->stride[1], dmpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
-	vBlur(dmpi->planes[2], dmpi->planes[2], cw,ch,
-		dmpi->stride[2], dmpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
+        vBlur(dmpi->planes[0], dmpi->planes[0], mpi->w,mpi->h,
+                dmpi->stride[0], dmpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);
+        vBlur(dmpi->planes[1], dmpi->planes[1], cw,ch,
+                dmpi->stride[1], dmpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
+        vBlur(dmpi->planes[2], dmpi->planes[2], cw,ch,
+                dmpi->stride[2], dmpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
-	switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        switch(fmt)
+        {
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_YVU9:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
-	int e;
+        int e;
 
-	vf->config=config;
-	vf->put_image=put_image;
-//	vf->get_image=get_image;
-	vf->query_format=query_format;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
-	memset(vf->priv, 0, sizeof(struct vf_priv_s));
+        vf->config=config;
+        vf->put_image=put_image;
+//        vf->get_image=get_image;
+        vf->query_format=query_format;
+        vf->priv=malloc(sizeof(struct vf_priv_s));
+        memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
-	if(args==NULL) return 0;
+        if(args==NULL) return 0;
 
-	e=sscanf(args, "%d:%d:%d:%d",
-		&vf->priv->lumaParam.radius,
-		&vf->priv->lumaParam.power,
-		&vf->priv->chromaParam.radius,
-		&vf->priv->chromaParam.power
-		);
+        e=sscanf(args, "%d:%d:%d:%d",
+                &vf->priv->lumaParam.radius,
+                &vf->priv->lumaParam.power,
+                &vf->priv->chromaParam.radius,
+                &vf->priv->chromaParam.power
+                );
 
-	if(e==2){
-		vf->priv->chromaParam.radius= vf->priv->lumaParam.radius;
-		vf->priv->chromaParam.power = vf->priv->lumaParam.power;
-	}else if(e!=4)
-		return 0;
+        if(e==2){
+                vf->priv->chromaParam.radius= vf->priv->lumaParam.radius;
+                vf->priv->chromaParam.power = vf->priv->lumaParam.power;
+        }else if(e!=4)
+                return 0;
 
-	if(vf->priv->lumaParam.radius < 0) return 0;
-	if(vf->priv->chromaParam.radius < 0) return 0;
+        if(vf->priv->lumaParam.radius < 0) return 0;
+        if(vf->priv->chromaParam.radius < 0) return 0;
 
-	return 1;
+        return 1;
 }
 
 const vf_info_t vf_info_boxblur = {
--- a/libmpcodecs/vf_cropdetect.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_cropdetect.c	Fri Jan 14 22:10:21 2011 +0000
@@ -42,17 +42,17 @@
     int div=len;
     switch(bpp){
     case 1:
-	while(--len>=0){
-	    total+=src[0]; src+=stride;
-	}
-	break;
+        while(--len>=0){
+            total+=src[0]; src+=stride;
+        }
+        break;
     case 3:
     case 4:
-	while(--len>=0){
-	    total+=src[0]+src[1]+src[2]; src+=stride;
-	}
-	div*=3;
-	break;
+        while(--len>=0){
+            total+=src[0]+src[1]+src[2]; src+=stride;
+        }
+        div*=3;
+        break;
     }
     total/=div;
 //    printf("total=%d\n",total);
@@ -63,7 +63,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
     vf->priv->x1=width - 1;
     vf->priv->y1=height - 1;
     vf->priv->x2=0;
@@ -79,8 +79,8 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_EXPORT, 0,
-	mpi->w, mpi->h);
+        MP_IMGTYPE_EXPORT, 0,
+        mpi->w, mpi->h);
 
     dmpi->planes[0]=mpi->planes[0];
     dmpi->planes[1]=mpi->planes[1];
@@ -91,43 +91,43 @@
     dmpi->width=mpi->width;
     dmpi->height=mpi->height;
 
-if(++vf->priv->fno>0){	// ignore first 2 frames - they may be empty
+if(++vf->priv->fno>0){        // ignore first 2 frames - they may be empty
 
     // Reset the crop area every reset_count frames, if reset_count is > 0
     if(vf->priv->reset_count > 0 && vf->priv->fno > vf->priv->reset_count){
-	vf->priv->x1=mpi->w-1;
-	vf->priv->y1=mpi->h-1;
-	vf->priv->x2=0;
-	vf->priv->y2=0;
-	vf->priv->fno=1;
+        vf->priv->x1=mpi->w-1;
+        vf->priv->y1=mpi->h-1;
+        vf->priv->x2=0;
+        vf->priv->y2=0;
+        vf->priv->fno=1;
     }
 
     for(y=0;y<vf->priv->y1;y++){
-	if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){
-	    vf->priv->y1=y;
-	    break;
-	}
+        if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){
+            vf->priv->y1=y;
+            break;
+        }
     }
 
     for(y=mpi->h-1;y>vf->priv->y2;y--){
-	if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){
-	    vf->priv->y2=y;
-	    break;
-	}
+        if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){
+            vf->priv->y2=y;
+            break;
+        }
     }
 
     for(y=0;y<vf->priv->x1;y++){
-	if(checkline(mpi->planes[0]+bpp*y,mpi->stride[0],mpi->h,bpp)>vf->priv->limit){
-	    vf->priv->x1=y;
-	    break;
-	}
+        if(checkline(mpi->planes[0]+bpp*y,mpi->stride[0],mpi->h,bpp)>vf->priv->limit){
+            vf->priv->x1=y;
+            break;
+        }
     }
 
     for(y=mpi->w-1;y>vf->priv->x2;y--){
-	if(checkline(mpi->planes[0]+bpp*y,mpi->stride[0],mpi->h,bpp)>vf->priv->limit){
-	    vf->priv->x2=y;
-	    break;
-	}
+        if(checkline(mpi->planes[0]+bpp*y,mpi->stride[0],mpi->h,bpp)>vf->priv->limit){
+            vf->priv->x2=y;
+            break;
+        }
     }
 
     // round x and y (up), important for yuv colorspaces
@@ -154,9 +154,9 @@
     y += (shrink_by / 2 + 1) & ~1;
 
     mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_CropArea,
-	vf->priv->x1,vf->priv->x2,
-	vf->priv->y1,vf->priv->y2,
-	w,h,x,y);
+        vf->priv->x1,vf->priv->x2,
+        vf->priv->y1,vf->priv->y2,
+        w,h,x,y);
 
 
 }
--- a/libmpcodecs/vf_decimate.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_decimate.c	Fri Jan 14 22:10:21 2011 +0000
@@ -32,160 +32,160 @@
 
 
 struct vf_priv_s {
-	int hi, lo;
-	float frac;
-	int max, last, cnt;
+    int hi, lo;
+    float frac;
+    int max, last, cnt;
 };
 
 #if HAVE_MMX && HAVE_EBX_AVAILABLE
 static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
 {
-	volatile short out[4];
-	__asm__ (
-		"movl $8, %%ecx \n\t"
-		"pxor %%mm4, %%mm4 \n\t"
-		"pxor %%mm7, %%mm7 \n\t"
+    volatile short out[4];
+    __asm__ (
+        "movl $8, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t"
+        "pxor %%mm7, %%mm7 \n\t"
 
-		ASMALIGN(4)
-		"1: \n\t"
+        ASMALIGN(4)
+        "1: \n\t"
 
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"movq (%%"REG_D"), %%mm1 \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"psubusb %%mm1, %%mm2 \n\t"
-		"psubusb %%mm0, %%mm1 \n\t"
-		"movq %%mm2, %%mm0 \n\t"
-		"movq %%mm1, %%mm3 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm0, %%mm4 \n\t"
-		"paddw %%mm1, %%mm4 \n\t"
-		"paddw %%mm2, %%mm4 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "psubusb %%mm1, %%mm2 \n\t"
+        "psubusb %%mm0, %%mm1 \n\t"
+        "movq %%mm2, %%mm0 \n\t"
+        "movq %%mm1, %%mm3 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm0, %%mm4 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm2, %%mm4 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz 1b \n\t"
-		"movq %%mm4, (%%"REG_d") \n\t"
-		"emms \n\t"
-		:
-		: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
-		: "%ecx", "memory"
-		);
-	return out[0]+out[1]+out[2]+out[3];
+        "decl %%ecx \n\t"
+        "jnz 1b \n\t"
+        "movq %%mm4, (%%"REG_d") \n\t"
+        "emms \n\t"
+        :
+        : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
+        : "%ecx", "memory"
+        );
+    return out[0]+out[1]+out[2]+out[3];
 }
 #endif
 
 static int diff_C(unsigned char *old, unsigned char *new, int os, int ns)
 {
-	int x, y, d=0;
-	for (y = 8; y; y--) {
-		for (x = 8; x; x--) {
-			d += abs(new[x] - old[x]);
-		}
-		new += ns;
-		old += os;
-	}
-	return d;
+    int x, y, d=0;
+    for (y = 8; y; y--) {
+        for (x = 8; x; x--) {
+            d += abs(new[x] - old[x]);
+        }
+        new += ns;
+        old += os;
+    }
+    return d;
 }
 
 static int (*diff)(unsigned char *, unsigned char *, int, int);
 
 static int diff_to_drop_plane(int hi, int lo, float frac, unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
 {
-	int x, y;
-	int d, c=0;
-	int t = (w/16)*(h/16)*frac;
-	for (y = 0; y < h-7; y += 4) {
-		for (x = 8; x < w-7; x += 4) {
-			d = diff(old+x+y*os, new+x+y*ns, os, ns);
-			if (d > hi) return 0;
-			if (d > lo) {
-				c++;
-				if (c > t) return 0;
-			}
-		}
-	}
-	return 1;
+    int x, y;
+    int d, c=0;
+    int t = (w/16)*(h/16)*frac;
+    for (y = 0; y < h-7; y += 4) {
+        for (x = 8; x < w-7; x += 4) {
+            d = diff(old+x+y*os, new+x+y*ns, os, ns);
+            if (d > hi) return 0;
+            if (d > lo) {
+                c++;
+                if (c > t) return 0;
+            }
+        }
+    }
+    return 1;
 }
 
 static int diff_to_drop(int hi, int lo, float frac, mp_image_t *old, mp_image_t *new)
 {
-	if (new->flags & MP_IMGFLAG_PLANAR) {
-		return diff_to_drop_plane(hi,lo,frac, old->planes[0], new->planes[0],
-			new->w, new->h, old->stride[0], new->stride[0])
-			&& diff_to_drop_plane(hi,lo,frac, old->planes[1], new->planes[1],
-			new->chroma_width, new->chroma_height,
-			old->stride[1], new->stride[1])
-			&& diff_to_drop_plane(hi,lo,frac, old->planes[2], new->planes[2],
-			new->chroma_width, new->chroma_height,
-			old->stride[2], new->stride[2]);
-	}
-	return diff_to_drop_plane(hi,lo,frac, old->planes[0], new->planes[0],
-		new->w*(new->bpp/8), new->h, old->stride[0], new->stride[0]);
+    if (new->flags & MP_IMGFLAG_PLANAR) {
+        return diff_to_drop_plane(hi,lo,frac, old->planes[0], new->planes[0],
+            new->w, new->h, old->stride[0], new->stride[0])
+            && diff_to_drop_plane(hi,lo,frac, old->planes[1], new->planes[1],
+            new->chroma_width, new->chroma_height,
+            old->stride[1], new->stride[1])
+            && diff_to_drop_plane(hi,lo,frac, old->planes[2], new->planes[2],
+            new->chroma_width, new->chroma_height,
+            old->stride[2], new->stride[2]);
+    }
+    return diff_to_drop_plane(hi,lo,frac, old->planes[0], new->planes[0],
+        new->w*(new->bpp/8), new->h, old->stride[0], new->stride[0]);
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+    mp_image_t *dmpi;
 
-	dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-		MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
-		mpi->width, mpi->height);
-	dmpi->qscale = mpi->qscale;
-	dmpi->qstride = mpi->qstride;
-	dmpi->qscale_type = mpi->qscale_type;
+    dmpi = vf_get_image(vf->next, mpi->imgfmt,
+        MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+        MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
+        mpi->width, mpi->height);
+    dmpi->qscale = mpi->qscale;
+    dmpi->qstride = mpi->qstride;
+    dmpi->qscale_type = mpi->qscale_type;
 
-	if (diff_to_drop(vf->priv->hi, vf->priv->lo, vf->priv->frac, dmpi, mpi)) {
-		if (vf->priv->max == 0)
-			return 0;
-		else if ((vf->priv->max > 0) && (vf->priv->cnt++ < vf->priv->max))
-			return 0;
-		else if ((vf->priv->max < 0) && (vf->priv->last+1 >= -vf->priv->max))
-			return vf->priv->last=0;
-	}
-	vf->priv->last++;
-	vf->priv->cnt=0;
+    if (diff_to_drop(vf->priv->hi, vf->priv->lo, vf->priv->frac, dmpi, mpi)) {
+        if (vf->priv->max == 0)
+            return 0;
+        else if ((vf->priv->max > 0) && (vf->priv->cnt++ < vf->priv->max))
+            return 0;
+        else if ((vf->priv->max < 0) && (vf->priv->last+1 >= -vf->priv->max))
+            return vf->priv->last=0;
+    }
+    vf->priv->last++;
+    vf->priv->cnt=0;
 
-	memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
-		dmpi->stride[0], mpi->stride[0]);
-	if (mpi->flags & MP_IMGFLAG_PLANAR) {
-		memcpy_pic(dmpi->planes[1], mpi->planes[1],
-			mpi->chroma_width, mpi->chroma_height,
-			dmpi->stride[1], mpi->stride[1]);
-		memcpy_pic(dmpi->planes[2], mpi->planes[2],
-			mpi->chroma_width, mpi->chroma_height,
-			dmpi->stride[2], mpi->stride[2]);
-	}
-	return vf_next_put_image(vf, dmpi, pts);
+    memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
+        dmpi->stride[0], mpi->stride[0]);
+    if (mpi->flags & MP_IMGFLAG_PLANAR) {
+        memcpy_pic(dmpi->planes[1], mpi->planes[1],
+            mpi->chroma_width, mpi->chroma_height,
+            dmpi->stride[1], mpi->stride[1]);
+        memcpy_pic(dmpi->planes[2], mpi->planes[2],
+            mpi->chroma_width, mpi->chroma_height,
+            dmpi->stride[2], mpi->stride[2]);
+    }
+    return vf_next_put_image(vf, dmpi, pts);
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
-	vf->put_image = put_image;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
-	p->max = 0;
-	p->hi = 64*12;
-	p->lo = 64*5;
-	p->frac = 0.33;
-	if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac);
-	diff = diff_C;
+    struct vf_priv_s *p;
+    vf->put_image = put_image;
+    vf->uninit = uninit;
+    vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+    vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+    p->max = 0;
+    p->hi = 64*12;
+    p->lo = 64*5;
+    p->frac = 0.33;
+    if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac);
+    diff = diff_C;
 #if HAVE_MMX && HAVE_EBX_AVAILABLE
-	if(gCpuCaps.hasMMX) diff = diff_MMX;
+    if(gCpuCaps.hasMMX) diff = diff_MMX;
 #endif
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_decimate = {
--- a/libmpcodecs/vf_delogo.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_delogo.c	Fri Jan 14 22:10:21 2011 +0000
@@ -50,7 +50,7 @@
 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
 
 static void delogo(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height,
-		   int logo_x, int logo_y, int logo_w, int logo_h, int band, int show, int direct) {
+                   int logo_x, int logo_y, int logo_w, int logo_h, int band, int show, int direct) {
     int y, x;
     int interp, dist;
     uint8_t *xdst, *xsrc;
@@ -80,46 +80,46 @@
 
     for(y = logo_y1+1; y < logo_y2-1; y++)
     {
-	for (x = logo_x1+1, xdst = dst+logo_x1+1, xsrc = src+logo_x1+1; x < logo_x2-1; x++, xdst++, xsrc++) {
-	    interp = ((topleft[srcStride*(y-logo_y-yclipt)]
-		       + topleft[srcStride*(y-logo_y-1-yclipt)]
-		       + topleft[srcStride*(y-logo_y+1-yclipt)])*(logo_w-(x-logo_x))/logo_w
-		      + (topright[srcStride*(y-logo_y-yclipt)]
-			 + topright[srcStride*(y-logo_y-1-yclipt)]
-			 + topright[srcStride*(y-logo_y+1-yclipt)])*(x-logo_x)/logo_w
-		      + (topleft[x-logo_x-xclipl]
-			 + topleft[x-logo_x-1-xclipl]
-			 + topleft[x-logo_x+1-xclipl])*(logo_h-(y-logo_y))/logo_h
-		      + (botleft[x-logo_x-xclipl]
-			 + botleft[x-logo_x-1-xclipl]
-			 + botleft[x-logo_x+1-xclipl])*(y-logo_y)/logo_h
-		)/6;
-/*		interp = (topleft[srcStride*(y-logo_y)]*(logo_w-(x-logo_x))/logo_w
-			  + topright[srcStride*(y-logo_y)]*(x-logo_x)/logo_w
-			  + topleft[x-logo_x]*(logo_h-(y-logo_y))/logo_h
-			  + botleft[x-logo_x]*(y-logo_y)/logo_h
-			  )/2;*/
-	    if (y >= logo_y+band && y < logo_y+logo_h-band && x >= logo_x+band && x < logo_x+logo_w-band) {
-		    *xdst = interp;
-	    } else {
-		dist = 0;
-		if (x < logo_x+band) dist = MAX(dist, logo_x-x+band);
-		else if (x >= logo_x+logo_w-band) dist = MAX(dist, x-(logo_x+logo_w-1-band));
-		if (y < logo_y+band) dist = MAX(dist, logo_y-y+band);
-		else if (y >= logo_y+logo_h-band) dist = MAX(dist, y-(logo_y+logo_h-1-band));
-		*xdst = (*xsrc*dist + interp*(band-dist))/band;
-		if (show && (dist == band-1)) *xdst = 0;
-	    }
-	}
+        for (x = logo_x1+1, xdst = dst+logo_x1+1, xsrc = src+logo_x1+1; x < logo_x2-1; x++, xdst++, xsrc++) {
+            interp = ((topleft[srcStride*(y-logo_y-yclipt)]
+                       + topleft[srcStride*(y-logo_y-1-yclipt)]
+                       + topleft[srcStride*(y-logo_y+1-yclipt)])*(logo_w-(x-logo_x))/logo_w
+                      + (topright[srcStride*(y-logo_y-yclipt)]
+                         + topright[srcStride*(y-logo_y-1-yclipt)]
+                         + topright[srcStride*(y-logo_y+1-yclipt)])*(x-logo_x)/logo_w
+                      + (topleft[x-logo_x-xclipl]
+                         + topleft[x-logo_x-1-xclipl]
+                         + topleft[x-logo_x+1-xclipl])*(logo_h-(y-logo_y))/logo_h
+                      + (botleft[x-logo_x-xclipl]
+                         + botleft[x-logo_x-1-xclipl]
+                         + botleft[x-logo_x+1-xclipl])*(y-logo_y)/logo_h
+                )/6;
+/*                interp = (topleft[srcStride*(y-logo_y)]*(logo_w-(x-logo_x))/logo_w
+                          + topright[srcStride*(y-logo_y)]*(x-logo_x)/logo_w
+                          + topleft[x-logo_x]*(logo_h-(y-logo_y))/logo_h
+                          + botleft[x-logo_x]*(y-logo_y)/logo_h
+                          )/2;*/
+            if (y >= logo_y+band && y < logo_y+logo_h-band && x >= logo_x+band && x < logo_x+logo_w-band) {
+                    *xdst = interp;
+            } else {
+                dist = 0;
+                if (x < logo_x+band) dist = MAX(dist, logo_x-x+band);
+                else if (x >= logo_x+logo_w-band) dist = MAX(dist, x-(logo_x+logo_w-1-band));
+                if (y < logo_y+band) dist = MAX(dist, logo_y-y+band);
+                else if (y >= logo_y+logo_h-band) dist = MAX(dist, y-(logo_y+logo_h-1-band));
+                *xdst = (*xsrc*dist + interp*(band-dist))/band;
+                if (show && (dist == band-1)) *xdst = 0;
+            }
+        }
 
-	dst+= dstStride;
-	src+= srcStride;
+        dst+= dstStride;
+        src+= srcStride;
     }
 }
 
 static int config(struct vf_instance *vf,
-		  int width, int height, int d_width, int d_height,
-		  unsigned int flags, unsigned int outfmt){
+                  int width, int height, int d_width, int d_height,
+                  unsigned int flags, unsigned int outfmt){
 
     return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
@@ -130,15 +130,15 @@
     if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ
     // ok, we can do pp in-place (or pp disabled):
     vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
-			  mpi->type, mpi->flags, mpi->w, mpi->h);
+                          mpi->type, mpi->flags, mpi->w, mpi->h);
     mpi->planes[0]=vf->dmpi->planes[0];
     mpi->stride[0]=vf->dmpi->stride[0];
     mpi->width=vf->dmpi->width;
     if(mpi->flags&MP_IMGFLAG_PLANAR){
         mpi->planes[1]=vf->dmpi->planes[1];
         mpi->planes[2]=vf->dmpi->planes[2];
-	mpi->stride[1]=vf->dmpi->stride[1];
-	mpi->stride[2]=vf->dmpi->stride[2];
+        mpi->stride[1]=vf->dmpi->stride[1];
+        mpi->stride[2]=vf->dmpi->stride[2];
     }
     mpi->flags|=MP_IMGFLAG_DIRECT;
 }
@@ -147,22 +147,22 @@
     mp_image_t *dmpi;
 
     if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-	// no DR, so get a new image! hope we'll get DR buffer:
-	vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
-			      MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-			      mpi->w,mpi->h);
+        // no DR, so get a new image! hope we'll get DR buffer:
+        vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
+                              MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+                              mpi->w,mpi->h);
     }
     dmpi= vf->dmpi;
 
     delogo(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h,
-	   vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show,
-	   mpi->flags&MP_IMGFLAG_DIRECT);
+           vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show,
+           mpi->flags&MP_IMGFLAG_DIRECT);
     delogo(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2,
-	   vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
-	   mpi->flags&MP_IMGFLAG_DIRECT);
+           vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
+           mpi->flags&MP_IMGFLAG_DIRECT);
     delogo(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2,
-	   vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
-	   mpi->flags&MP_IMGFLAG_DIRECT);
+           vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
+           mpi->flags&MP_IMGFLAG_DIRECT);
 
     vf_clone_mpi_attributes(dmpi, mpi);
 
@@ -184,7 +184,7 @@
     case IMGFMT_YV12:
     case IMGFMT_I420:
     case IMGFMT_IYUV:
-	return vf_next_query_format(vf,vf->priv->outfmt);
+        return vf_next_query_format(vf,vf->priv->outfmt);
     }
     return 0;
 }
@@ -204,15 +204,15 @@
     vf->uninit=uninit;
 
     mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n",
-	   vf->priv->xoff, vf->priv->yoff,
-	   vf->priv->lw, vf->priv->lh,
-	   vf->priv->band);
+           vf->priv->xoff, vf->priv->yoff,
+           vf->priv->lw, vf->priv->lh,
+           vf->priv->band);
 
     vf->priv->show = 0;
 
     if (vf->priv->band < 0) {
-	vf->priv->band = 4;
-	vf->priv->show = 1;
+        vf->priv->band = 4;
+        vf->priv->show = 1;
     }
 
 
@@ -225,7 +225,7 @@
     vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
     if(!vf->priv->outfmt)
     {
-	uninit(vf);
+        uninit(vf);
         return 0; // no csp match :(
     }
 
--- a/libmpcodecs/vf_denoise3d.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_denoise3d.c	Fri Jan 14 22:10:21 2011 +0000
@@ -38,7 +38,7 @@
 struct vf_priv_s {
         int Coefs[4][512];
         unsigned char *Line;
-	mp_image_t *pmpi;
+        mp_image_t *pmpi;
 };
 
 
@@ -47,14 +47,14 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
-	free(vf->priv->Line);
+        free(vf->priv->Line);
         vf->priv->Line = malloc(width);
-	vf->priv->pmpi=NULL;
+        vf->priv->pmpi=NULL;
 //        vf->default_caps &= !VFCAP_ACCEPT_STRIDE;
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 
@@ -91,7 +91,7 @@
 
     for (Y = 1; Y < H; Y++)
     {
-	sLineOffs += sStride, pLineOffs += pStride, dLineOffs += dStride;
+        sLineOffs += sStride, pLineOffs += pStride, dLineOffs += dStride;
         /* First pixel on each line doesn't have previous pixel */
         PixelAnt = Frame[sLineOffs];
         LineAnt[0] = LowPass(LineAnt[0], PixelAnt, Vertical);
@@ -110,56 +110,56 @@
 
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
+        int cw= mpi->w >> mpi->chroma_x_shift;
+        int ch= mpi->h >> mpi->chroma_y_shift;
         int W = mpi->w, H = mpi->h;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE |
-		MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
+        mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+                MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE |
+                MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
                 mpi->w,mpi->h);
 
-	if(!dmpi) return 0;
+        if(!dmpi) return 0;
         if (!vf->priv->pmpi) vf->priv->pmpi=mpi;
 
         deNoise(mpi->planes[0], vf->priv->pmpi->planes[0], dmpi->planes[0],
-		vf->priv->Line, W, H,
+                vf->priv->Line, W, H,
                 mpi->stride[0], vf->priv->pmpi->stride[0], dmpi->stride[0],
                 vf->priv->Coefs[0] + 256,
                 vf->priv->Coefs[0] + 256,
                 vf->priv->Coefs[1] + 256);
         deNoise(mpi->planes[1], vf->priv->pmpi->planes[1], dmpi->planes[1],
-		vf->priv->Line, cw, ch,
+                vf->priv->Line, cw, ch,
                 mpi->stride[1], vf->priv->pmpi->stride[1], dmpi->stride[1],
                 vf->priv->Coefs[2] + 256,
                 vf->priv->Coefs[2] + 256,
                 vf->priv->Coefs[3] + 256);
         deNoise(mpi->planes[2], vf->priv->pmpi->planes[2], dmpi->planes[2],
-		vf->priv->Line, cw, ch,
+                vf->priv->Line, cw, ch,
                 mpi->stride[2], vf->priv->pmpi->stride[2], dmpi->stride[2],
                 vf->priv->Coefs[2] + 256,
                 vf->priv->Coefs[2] + 256,
                 vf->priv->Coefs[3] + 256);
 
-	vf->priv->pmpi=dmpi; // save reference image
-	return vf_next_put_image(vf,dmpi, pts);
+        vf->priv->pmpi=dmpi; // save reference image
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
         switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        {
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_YVU9:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 
@@ -186,11 +186,11 @@
         double LumSpac, LumTmp, ChromSpac, ChromTmp;
         double Param1, Param2, Param3;
 
-	vf->config=config;
-	vf->put_image=put_image;
+        vf->config=config;
+        vf->put_image=put_image;
         vf->query_format=query_format;
         vf->uninit=uninit;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
+        vf->priv=malloc(sizeof(struct vf_priv_s));
         memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
         if (args)
@@ -253,7 +253,7 @@
         PrecalcCoefs(vf->priv->Coefs[2], ChromSpac);
         PrecalcCoefs(vf->priv->Coefs[3], ChromTmp);
 
-	return 1;
+        return 1;
 }
 
 const vf_info_t vf_info_denoise3d = {
--- a/libmpcodecs/vf_detc.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_detc.c	Fri Jan 14 22:10:21 2011 +0000
@@ -30,21 +30,21 @@
 #include "libvo/fastmemcpy.h"
 
 struct metrics {
-	int even;
-	int odd;
-	int noise;
-	int temp;
+        int even;
+        int odd;
+        int noise;
+        int temp;
 };
 
 struct vf_priv_s {
-	int frame;
-	int drop, lastdrop;
-	struct metrics pm;
-	int thres[5];
-	int inframes, outframes;
-	int mode;
-	int (*analyze)(struct vf_priv_s *, mp_image_t *, mp_image_t *);
-	int needread;
+        int frame;
+        int drop, lastdrop;
+        struct metrics pm;
+        int thres[5];
+        int inframes, outframes;
+        int mode;
+        int (*analyze)(struct vf_priv_s *, mp_image_t *, mp_image_t *);
+        int needread;
 };
 
 #define COMPE(a,b,e) (abs((a)-(b)) < (((a)+(b))>>(e)))
@@ -65,330 +65,330 @@
  COMPARABLE((s)[1].m.noise,(h)) ) )
 
 enum {
-	TC_DROP,
-	TC_PROG,
-	TC_IL1,
-	TC_IL2
+        TC_DROP,
+        TC_PROG,
+        TC_IL1,
+        TC_IL2
 };
 
 static void block_diffs(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
 {
-	int x, y, even=0, odd=0, noise, temp;
-	unsigned char *oldp, *newp;
-	m->noise = m->temp = 0;
-	for (x = 8; x; x--) {
-		oldp = old++;
-		newp = new++;
-		noise = temp = 0;
-		for (y = 4; y; y--) {
-			even += abs(newp[0]-oldp[0]);
-			odd += abs(newp[ns]-oldp[os]);
-			noise += newp[ns]-newp[0];
-			temp += oldp[os]-newp[0];
-			oldp += os<<1;
-			newp += ns<<1;
-		}
-		m->noise += abs(noise);
-		m->temp += abs(temp);
-	}
-	m->even = even;
-	m->odd = odd;
+        int x, y, even=0, odd=0, noise, temp;
+        unsigned char *oldp, *newp;
+        m->noise = m->temp = 0;
+        for (x = 8; x; x--) {
+                oldp = old++;
+                newp = new++;
+                noise = temp = 0;
+                for (y = 4; y; y--) {
+                        even += abs(newp[0]-oldp[0]);
+                        odd += abs(newp[ns]-oldp[os]);
+                        noise += newp[ns]-newp[0];
+                        temp += oldp[os]-newp[0];
+                        oldp += os<<1;
+                        newp += ns<<1;
+                }
+                m->noise += abs(noise);
+                m->temp += abs(temp);
+        }
+        m->even = even;
+        m->odd = odd;
 }
 
 static void diff_planes(struct metrics *m, unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
 {
-	int x, y, me=0, mo=0, mn=0, mt=0;
-	struct metrics l;
-	for (y = 0; y < h-7; y += 8) {
-		for (x = 0; x < w-7; x += 8) {
-			block_diffs(&l, old+x+y*os, new+x+y*ns, os, ns);
-			if (l.even > me) me = l.even;
-			if (l.odd > mo) mo = l.odd;
-			if (l.noise > mn) mn = l.noise;
-			if (l.temp > mt) mt = l.temp;
-		}
-	}
-	m->even = me;
-	m->odd = mo;
-	m->noise = mn;
-	m->temp = mt;
+        int x, y, me=0, mo=0, mn=0, mt=0;
+        struct metrics l;
+        for (y = 0; y < h-7; y += 8) {
+                for (x = 0; x < w-7; x += 8) {
+                        block_diffs(&l, old+x+y*os, new+x+y*ns, os, ns);
+                        if (l.even > me) me = l.even;
+                        if (l.odd > mo) mo = l.odd;
+                        if (l.noise > mn) mn = l.noise;
+                        if (l.temp > mt) mt = l.temp;
+                }
+        }
+        m->even = me;
+        m->odd = mo;
+        m->noise = mn;
+        m->temp = mt;
 }
 
 static void diff_fields(struct metrics *metr, mp_image_t *old, mp_image_t *new)
 {
-	struct metrics m, mu, mv;
-	diff_planes(&m, old->planes[0], new->planes[0],
-		new->w, new->h, old->stride[0], new->stride[0]);
-	if (new->flags & MP_IMGFLAG_PLANAR) {
-		diff_planes(&mu, old->planes[1], new->planes[1],
-			new->chroma_width, new->chroma_height,
-			old->stride[1], new->stride[1]);
-		diff_planes(&mv, old->planes[2], new->planes[2],
-			new->chroma_width, new->chroma_height,
-			old->stride[2], new->stride[2]);
-		if (mu.even > m.even) m.even = mu.even;
-		if (mu.odd > m.odd) m.odd = mu.odd;
-		if (mu.noise > m.noise) m.noise = mu.noise;
-		if (mu.temp > m.temp) m.temp = mu.temp;
-		if (mv.even > m.even) m.even = mv.even;
-		if (mv.odd > m.odd) m.odd = mv.odd;
-		if (mv.noise > m.noise) m.noise = mv.noise;
-		if (mv.temp > m.temp) m.temp = mv.temp;
-	}
-	*metr = m;
+        struct metrics m, mu, mv;
+        diff_planes(&m, old->planes[0], new->planes[0],
+                new->w, new->h, old->stride[0], new->stride[0]);
+        if (new->flags & MP_IMGFLAG_PLANAR) {
+                diff_planes(&mu, old->planes[1], new->planes[1],
+                        new->chroma_width, new->chroma_height,
+                        old->stride[1], new->stride[1]);
+                diff_planes(&mv, old->planes[2], new->planes[2],
+                        new->chroma_width, new->chroma_height,
+                        old->stride[2], new->stride[2]);
+                if (mu.even > m.even) m.even = mu.even;
+                if (mu.odd > m.odd) m.odd = mu.odd;
+                if (mu.noise > m.noise) m.noise = mu.noise;
+                if (mu.temp > m.temp) m.temp = mu.temp;
+                if (mv.even > m.even) m.even = mv.even;
+                if (mv.odd > m.odd) m.odd = mv.odd;
+                if (mv.noise > m.noise) m.noise = mv.noise;
+                if (mv.temp > m.temp) m.temp = mv.temp;
+        }
+        *metr = m;
 }
 
 static void status(int f, struct metrics *m)
 {
-	mp_msg(MSGT_VFILTER, MSGL_V, "frame %d: e=%d o=%d n=%d t=%d\n",
-		f, m->even, m->odd, m->noise, m->temp);
+        mp_msg(MSGT_VFILTER, MSGL_V, "frame %d: e=%d o=%d n=%d t=%d\n",
+                f, m->even, m->odd, m->noise, m->temp);
 }
 
 static int analyze_fixed_pattern(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old)
 {
-	if (p->frame >= 0) p->frame = (p->frame+1)%5;
-	mp_msg(MSGT_VFILTER, MSGL_V, "frame %d\n", p->frame);
-	switch (p->frame) {
-	case -1: case 0: case 1: case 2:
-		return TC_PROG;
-	case 3:
-		return TC_IL1;
-	case 4:
-		return TC_IL2;
-	}
-	return 0;
+        if (p->frame >= 0) p->frame = (p->frame+1)%5;
+        mp_msg(MSGT_VFILTER, MSGL_V, "frame %d\n", p->frame);
+        switch (p->frame) {
+        case -1: case 0: case 1: case 2:
+                return TC_PROG;
+        case 3:
+                return TC_IL1;
+        case 4:
+                return TC_IL2;
+        }
+        return 0;
 }
 
 static int analyze_aggressive(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old)
 {
-	struct metrics m, pm;
+        struct metrics m, pm;
 
-	if (p->frame >= 0) p->frame = (p->frame+1)%5;
+        if (p->frame >= 0) p->frame = (p->frame+1)%5;
 
-	diff_fields(&m, old, new);
+        diff_fields(&m, old, new);
 
-	status(p->frame, &m);
+        status(p->frame, &m);
 
-	pm = p->pm;
-	p->pm = m;
+        pm = p->pm;
+        p->pm = m;
 
-	if (p->frame == 4) {
-		/* We need to break at scene changes, but is this a valid test? */
-		if ((m.even > p->thres[2]) && (m.odd > p->thres[2]) && (m.temp > p->thres[3])
-			&& (m.temp > 5*pm.temp) && (m.temp*2 > m.noise)) {
-			mp_msg(MSGT_VFILTER, MSGL_V, "scene change breaking telecine!\n");
-			p->frame = -1;
-			return TC_DROP;
-		}
-		/* Thres. is to compensate for quantization errors when noise is low */
-		if (m.noise - m.temp > -p->thres[4]) {
-			if (COMPARABLE(m.even, pm.odd)) {
-				//mp_msg(MSGT_VFILTER, MSGL_V, "confirmed field match!\n");
-				return TC_IL2;
-			} else if ((m.even < p->thres[0]) && (m.odd < p->thres[0]) && VERYCLOSE(m.even, m.odd)
-				&& VERYCLOSE(m.noise,m.temp) && VERYCLOSE(m.noise,pm.noise)) {
-				mp_msg(MSGT_VFILTER, MSGL_V, "interlaced frame appears in duplicate!!!\n");
-				p->pm = pm; /* hack :) */
-				p->frame = 3;
-				return TC_IL1;
-			}
-		} else {
-			mp_msg(MSGT_VFILTER, MSGL_V, "mismatched telecine fields!\n");
-			p->frame = -1;
-		}
-	}
+        if (p->frame == 4) {
+                /* We need to break at scene changes, but is this a valid test? */
+                if ((m.even > p->thres[2]) && (m.odd > p->thres[2]) && (m.temp > p->thres[3])
+                        && (m.temp > 5*pm.temp) && (m.temp*2 > m.noise)) {
+                        mp_msg(MSGT_VFILTER, MSGL_V, "scene change breaking telecine!\n");
+                        p->frame = -1;
+                        return TC_DROP;
+                }
+                /* Thres. is to compensate for quantization errors when noise is low */
+                if (m.noise - m.temp > -p->thres[4]) {
+                        if (COMPARABLE(m.even, pm.odd)) {
+                                //mp_msg(MSGT_VFILTER, MSGL_V, "confirmed field match!\n");
+                                return TC_IL2;
+                        } else if ((m.even < p->thres[0]) && (m.odd < p->thres[0]) && VERYCLOSE(m.even, m.odd)
+                                && VERYCLOSE(m.noise,m.temp) && VERYCLOSE(m.noise,pm.noise)) {
+                                mp_msg(MSGT_VFILTER, MSGL_V, "interlaced frame appears in duplicate!!!\n");
+                                p->pm = pm; /* hack :) */
+                                p->frame = 3;
+                                return TC_IL1;
+                        }
+                } else {
+                        mp_msg(MSGT_VFILTER, MSGL_V, "mismatched telecine fields!\n");
+                        p->frame = -1;
+                }
+        }
 
-	if (2*m.even*m.temp < m.odd*m.noise) {
-		mp_msg(MSGT_VFILTER, MSGL_V, "caught telecine sync!\n");
-		p->frame = 3;
-		return TC_IL1;
-	}
+        if (2*m.even*m.temp < m.odd*m.noise) {
+                mp_msg(MSGT_VFILTER, MSGL_V, "caught telecine sync!\n");
+                p->frame = 3;
+                return TC_IL1;
+        }
 
-	if (p->frame < 3) {
-		if (m.noise > p->thres[3]) {
-			if (m.noise > 2*m.temp) {
-				mp_msg(MSGT_VFILTER, MSGL_V, "merging fields out of sequence!\n");
-				return TC_IL2;
-			}
-			if ((m.noise > 2*pm.noise) && (m.even > p->thres[2]) && (m.odd > p->thres[2])) {
-				mp_msg(MSGT_VFILTER, MSGL_V, "dropping horrible interlaced frame!\n");
-				return TC_DROP;
-			}
-		}
-	}
+        if (p->frame < 3) {
+                if (m.noise > p->thres[3]) {
+                        if (m.noise > 2*m.temp) {
+                                mp_msg(MSGT_VFILTER, MSGL_V, "merging fields out of sequence!\n");
+                                return TC_IL2;
+                        }
+                        if ((m.noise > 2*pm.noise) && (m.even > p->thres[2]) && (m.odd > p->thres[2])) {
+                                mp_msg(MSGT_VFILTER, MSGL_V, "dropping horrible interlaced frame!\n");
+                                return TC_DROP;
+                        }
+                }
+        }
 
-	switch (p->frame) {
-	case -1:
-		if (4*m.noise > 5*m.temp) {
-			mp_msg(MSGT_VFILTER, MSGL_V, "merging fields out of sequence!\n");
-			return TC_IL2;
-		}
-	case 0:
-	case 1:
-	case 2:
-		return TC_PROG;
-	case 3:
-		if ((m.even > p->thres[1]) && (m.even > m.odd) && (m.temp > m.noise)) {
-			mp_msg(MSGT_VFILTER, MSGL_V, "lost telecine tracking!\n");
-			p->frame = -1;
-			return TC_PROG;
-		}
-		return TC_IL1;
-	case 4:
-		return TC_IL2;
-	}
-	return 0;
+        switch (p->frame) {
+        case -1:
+                if (4*m.noise > 5*m.temp) {
+                        mp_msg(MSGT_VFILTER, MSGL_V, "merging fields out of sequence!\n");
+                        return TC_IL2;
+                }
+        case 0:
+        case 1:
+        case 2:
+                return TC_PROG;
+        case 3:
+                if ((m.even > p->thres[1]) && (m.even > m.odd) && (m.temp > m.noise)) {
+                        mp_msg(MSGT_VFILTER, MSGL_V, "lost telecine tracking!\n");
+                        p->frame = -1;
+                        return TC_PROG;
+                }
+                return TC_IL1;
+        case 4:
+                return TC_IL2;
+        }
+        return 0;
 }
 
 static void copy_image(mp_image_t *dmpi, mp_image_t *mpi, int field)
 {
-	switch (field) {
-	case 0:
-		my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		break;
-	case 1:
-		my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
-			mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
-				mpi->planes[1]+mpi->stride[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
-				mpi->planes[2]+mpi->stride[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		break;
-	case 2:
-		memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
-			dmpi->stride[0], mpi->stride[0]);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			memcpy_pic(dmpi->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height,
-				dmpi->stride[1], mpi->stride[1]);
-			memcpy_pic(dmpi->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height,
-				dmpi->stride[2], mpi->stride[2]);
-		}
-		break;
-	}
+        switch (field) {
+        case 0:
+                my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
+                        dmpi->stride[0]*2, mpi->stride[0]*2);
+                if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                        my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                                mpi->chroma_width, mpi->chroma_height/2,
+                                dmpi->stride[1]*2, mpi->stride[1]*2);
+                        my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                                mpi->chroma_width, mpi->chroma_height/2,
+                                dmpi->stride[2]*2, mpi->stride[2]*2);
+                }
+                break;
+        case 1:
+                my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
+                        mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
+                        dmpi->stride[0]*2, mpi->stride[0]*2);
+                if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                        my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
+                                mpi->planes[1]+mpi->stride[1],
+                                mpi->chroma_width, mpi->chroma_height/2,
+                                dmpi->stride[1]*2, mpi->stride[1]*2);
+                        my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
+                                mpi->planes[2]+mpi->stride[2],
+                                mpi->chroma_width, mpi->chroma_height/2,
+                                dmpi->stride[2]*2, mpi->stride[2]*2);
+                }
+                break;
+        case 2:
+                memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
+                        dmpi->stride[0], mpi->stride[0]);
+                if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                        memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                                mpi->chroma_width, mpi->chroma_height,
+                                dmpi->stride[1], mpi->stride[1]);
+                        memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                                mpi->chroma_width, mpi->chroma_height,
+                                dmpi->stride[2], mpi->stride[2]);
+                }
+                break;
+        }
 }
 
 static int do_put_image(struct vf_instance *vf, mp_image_t *dmpi)
 {
-	struct vf_priv_s *p = vf->priv;
-	int dropflag;
+        struct vf_priv_s *p = vf->priv;
+        int dropflag;
 
-	switch (p->drop) {
-	default:
-		dropflag = 0;
-		break;
-	case 1:
-		dropflag = (++p->lastdrop >= 5);
-		break;
-	case 2:
-		dropflag = (++p->lastdrop >= 5) && (4*p->inframes <= 5*p->outframes);
-		break;
-	}
+        switch (p->drop) {
+        default:
+                dropflag = 0;
+                break;
+        case 1:
+                dropflag = (++p->lastdrop >= 5);
+                break;
+        case 2:
+                dropflag = (++p->lastdrop >= 5) && (4*p->inframes <= 5*p->outframes);
+                break;
+        }
 
-	if (dropflag) {
-		mp_msg(MSGT_VFILTER, MSGL_V, "drop! [%d/%d=%g]\n",
-			p->outframes, p->inframes, (float)p->outframes/p->inframes);
-		p->lastdrop = 0;
-		return 0;
-	}
+        if (dropflag) {
+                mp_msg(MSGT_VFILTER, MSGL_V, "drop! [%d/%d=%g]\n",
+                        p->outframes, p->inframes, (float)p->outframes/p->inframes);
+                p->lastdrop = 0;
+                return 0;
+        }
 
-	p->outframes++;
-	return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+        p->outframes++;
+        return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	int ret=0;
-	mp_image_t *dmpi;
-	struct vf_priv_s *p = vf->priv;
+        int ret=0;
+        mp_image_t *dmpi;
+        struct vf_priv_s *p = vf->priv;
 
-	p->inframes++;
+        p->inframes++;
 
-	if (p->needread) dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-		MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
-		mpi->width, mpi->height);
-	/* FIXME: is there a good way to get rid of static type? */
-	else dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-		MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
+        if (p->needread) dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+                MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
+                mpi->width, mpi->height);
+        /* FIXME: is there a good way to get rid of static type? */
+        else dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+                MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
 
-	switch (p->analyze(p, mpi, dmpi)) {
-	case TC_DROP:
-		/* Don't copy anything unless we'll need to read it. */
-		if (p->needread) copy_image(dmpi, mpi, 2);
-		p->lastdrop = 0;
-		break;
-	case TC_PROG:
-		/* Copy and display the whole frame. */
-		copy_image(dmpi, mpi, 2);
-		ret = do_put_image(vf, dmpi);
-		break;
-	case TC_IL1:
-		/* Only copy bottom field unless we need to read. */
-		if (p->needread) copy_image(dmpi, mpi, 2);
-		else copy_image(dmpi, mpi, 1);
-		p->lastdrop = 0;
-		break;
-	case TC_IL2:
-		/* Copy top field and show frame, then copy bottom if needed. */
-		copy_image(dmpi, mpi, 0);
-		ret = do_put_image(vf, dmpi);
-		if (p->needread) copy_image(dmpi, mpi, 1);
-		break;
-	}
-	return ret;
+        switch (p->analyze(p, mpi, dmpi)) {
+        case TC_DROP:
+                /* Don't copy anything unless we'll need to read it. */
+                if (p->needread) copy_image(dmpi, mpi, 2);
+                p->lastdrop = 0;
+                break;
+        case TC_PROG:
+                /* Copy and display the whole frame. */
+                copy_image(dmpi, mpi, 2);
+                ret = do_put_image(vf, dmpi);
+                break;
+        case TC_IL1:
+                /* Only copy bottom field unless we need to read. */
+                if (p->needread) copy_image(dmpi, mpi, 2);
+                else copy_image(dmpi, mpi, 1);
+                p->lastdrop = 0;
+                break;
+        case TC_IL2:
+                /* Copy top field and show frame, then copy bottom if needed. */
+                copy_image(dmpi, mpi, 0);
+                ret = do_put_image(vf, dmpi);
+                if (p->needread) copy_image(dmpi, mpi, 1);
+                break;
+        }
+        return ret;
 }
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - figure out which other formats work */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        /* FIXME - figure out which other formats work */
+        switch (fmt) {
+        case IMGFMT_YV12:
+        case IMGFMT_IYUV:
+        case IMGFMT_I420:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+        unsigned int flags, unsigned int outfmt)
 {
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+        free(vf->priv);
 }
 
 static struct {
-	char *name;
-	int (*func)(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old);
-	int needread;
+        char *name;
+        int (*func)(struct vf_priv_s *p, mp_image_t *new, mp_image_t *old);
+        int needread;
 } anal_funcs[] = {
-	{ "fixed", analyze_fixed_pattern, 0 },
-	{ "aggressive", analyze_aggressive, 1 },
-	{ NULL, NULL, 0 }
+        { "fixed", analyze_fixed_pattern, 0 },
+        { "aggressive", analyze_aggressive, 1 },
+        { NULL, NULL, 0 }
 };
 
 #define STARTVARS if (0)
@@ -398,49 +398,49 @@
 
 static void parse_var(struct vf_priv_s *p, char *var)
 {
-	STARTVARS;
-	GETVAR(var, "dr", p->drop, atoi);
-	GETVAR(var, "t0", p->thres[0], atoi);
-	GETVAR(var, "t1", p->thres[1], atoi);
-	GETVAR(var, "t2", p->thres[2], atoi);
-	GETVAR(var, "t3", p->thres[3], atoi);
-	GETVAR(var, "t4", p->thres[4], atoi);
-	GETVAR(var, "fr", p->frame, atoi);
-	GETVAR(var, "am", p->mode, atoi);
+        STARTVARS;
+        GETVAR(var, "dr", p->drop, atoi);
+        GETVAR(var, "t0", p->thres[0], atoi);
+        GETVAR(var, "t1", p->thres[1], atoi);
+        GETVAR(var, "t2", p->thres[2], atoi);
+        GETVAR(var, "t3", p->thres[3], atoi);
+        GETVAR(var, "t4", p->thres[4], atoi);
+        GETVAR(var, "fr", p->frame, atoi);
+        GETVAR(var, "am", p->mode, atoi);
 }
 
 static void parse_args(struct vf_priv_s *p, char *args)
 {
-	char *next, *orig;
-	for (args=orig=strdup(args); args; args=next) {
-		next = strchr(args, ':');
-		if (next) *next++ = 0;
-		parse_var(p, args);
-	}
-	free(orig);
+        char *next, *orig;
+        for (args=orig=strdup(args); args; args=next) {
+                next = strchr(args, ':');
+                if (next) *next++ = 0;
+                parse_var(p, args);
+        }
+        free(orig);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
-	vf->config = config;
-	vf->put_image = put_image;
-	vf->query_format = query_format;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
-	p->frame = -1;
-	p->thres[0] = 440;
-	p->thres[1] = 720;
-	p->thres[2] = 2500;
-	p->thres[3] = 2500;
-	p->thres[4] = 800;
-	p->drop = 0;
-	p->mode = 1;
-	if (args) parse_args(p, args);
-	p->analyze = anal_funcs[p->mode].func;
-	p->needread = anal_funcs[p->mode].needread;
-	return 1;
+        struct vf_priv_s *p;
+        vf->config = config;
+        vf->put_image = put_image;
+        vf->query_format = query_format;
+        vf->uninit = uninit;
+        vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+        vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+        p->frame = -1;
+        p->thres[0] = 440;
+        p->thres[1] = 720;
+        p->thres[2] = 2500;
+        p->thres[3] = 2500;
+        p->thres[4] = 800;
+        p->drop = 0;
+        p->mode = 1;
+        if (args) parse_args(p, args);
+        p->analyze = anal_funcs[p->mode].func;
+        p->needread = anal_funcs[p->mode].needread;
+        return 1;
 }
 
 const vf_info_t vf_info_detc = {
--- a/libmpcodecs/vf_dint.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_dint.c	Fri Jan 14 22:10:21 2011 +0000
@@ -44,16 +44,16 @@
 
 static int config (struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+        unsigned int flags, unsigned int outfmt)
 {
     int rowsize;
 
     vf->priv->pmpi = vf_get_image (vf->next, outfmt, MP_IMGTYPE_TEMP,
-				   0, width, height);
+                                   0, width, height);
     if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) &&
-	outfmt != IMGFMT_RGB32 && outfmt != IMGFMT_BGR32 &&
-	outfmt != IMGFMT_RGB24 && outfmt != IMGFMT_BGR24 &&
-	outfmt != IMGFMT_RGB16 && outfmt != IMGFMT_BGR16)
+        outfmt != IMGFMT_RGB32 && outfmt != IMGFMT_BGR32 &&
+        outfmt != IMGFMT_RGB24 && outfmt != IMGFMT_BGR24 &&
+        outfmt != IMGFMT_RGB16 && outfmt != IMGFMT_BGR16)
     {
       mp_msg (MSGT_VFILTER, MSGL_WARN, "Drop-interlaced filter doesn't support this outfmt :(\n");
       return 0;
@@ -69,11 +69,11 @@
       vf->priv->diff = vf->priv->sense * (1 << (vf->priv->pmpi->bpp/3));
     if (vf->priv->diff < 0) vf->priv->diff = 0;
     if (!(vf->priv->pmpi->flags & MP_IMGFLAG_PLANAR) &&
-	vf->priv->pmpi->bpp < 24 && vf->priv->diff > 31)
+        vf->priv->pmpi->bpp < 24 && vf->priv->diff > 31)
       vf->priv->diff = 31;
     mp_msg (MSGT_VFILTER, MSGL_INFO, "Drop-interlaced: %dx%d diff %d / level %u\n",
-	   vf->priv->pmpi->width, vf->priv->pmpi->height,
-	   (int)vf->priv->diff, (unsigned int)vf->priv->max);
+           vf->priv->pmpi->width, vf->priv->pmpi->height,
+           (int)vf->priv->diff, (unsigned int)vf->priv->max);
 //    vf->priv->rdfr = vf->priv->dfr = 0;
     vf->priv->was_dint = 0;
     return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
@@ -101,89 +101,89 @@
       prv0 = mpi->planes[0];
       for (j = 1; j < mpi->height && nok <= max; j++)
       {
-	cur = cur0;
-	prv = prv0;
-	// analyse row (row0)
-	if (mpi->flags & MP_IMGFLAG_PLANAR) // planar YUV - check luminance
-	  for (i = 0; i < rowsize; i++)
-	  {
-	    if (cur[0] - prv[0] > diff)
-	      row0[i] = 1;
-	    else if (cur[0] - prv[0] < -diff)
-	      row0[i] = -1;
-	    else
-	      row0[i] = 0;
-	    cur++;
-	    prv++;
-	    // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
-	    // but row3 is 1 so it's interlaced ptr (nok++)
-	    if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
-		(++nok) > max)
-	      break;
-	  }
-	else if (mpi->bpp < 24) // RGB/BGR 16 - check all colors
-	  for (i = 0; i < rowsize; i++)
-	  {
-	    n1 = cur[0] + (cur[1]<<8);
-	    n2 = prv[0] + (prv[1]<<8);
-	    if ((n1&0x1f) - (n2&0x1f) > diff ||
-		((n1>>5)&0x3f) - ((n2>>5)&0x3f) > diff ||
-		((n1>>11)&0x1f) - ((n2>>11)&0x1f) > diff)
-	      row0[i] = 1;
-	    else if ((n1&0x1f) - (n2&0x1f) < -diff ||
-		     ((n1>>5)&0x3f) - ((n2>>5)&0x3f) < -diff ||
-		     ((n1>>11)&0x1f) - ((n2>>11)&0x1f) < -diff)
-	      row0[i] = -1;
-	    else
-	      row0[i] = 0;
-	    cur += 2;
-	    prv += 2;
-	    // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
-	    // but row3 is 1 so it's interlaced ptr (nok++)
-	    if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
-		(++nok) > max)
-	      break;
-	  }
-	else // RGB/BGR 24/32
-	  for (i = 0; i < rowsize; i++)
-	  {
-	    if (cur[0] - prv[0] > diff ||
-		cur[1] - prv[1] > diff ||
-		cur[2] - prv[2] > diff)
-	      row0[i] = 1;
-	    else if (prv[0] - cur[0] > diff ||
-		     prv[1] - cur[1] > diff ||
-		     prv[2] - cur[2] > diff)
-	      row0[i] = -1;
-	    else
-	      row0[i] = 0;
-	    cur += mpi->bpp/8;
-	    prv += mpi->bpp/8;
-	    // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
-	    // but row3 is 1 so it's interlaced ptr (nok++)
-	    if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
-		(++nok) > max)
-	      break;
-	  }
-	cur0 += mpi->stride[0];
-	prv0 += mpi->stride[0];
-	// rotate rows
-	cur = row2;
-	row2 = row1;
-	row1 = row0;
-	row0 = cur;
+        cur = cur0;
+        prv = prv0;
+        // analyse row (row0)
+        if (mpi->flags & MP_IMGFLAG_PLANAR) // planar YUV - check luminance
+          for (i = 0; i < rowsize; i++)
+          {
+            if (cur[0] - prv[0] > diff)
+              row0[i] = 1;
+            else if (cur[0] - prv[0] < -diff)
+              row0[i] = -1;
+            else
+              row0[i] = 0;
+            cur++;
+            prv++;
+            // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
+            // but row3 is 1 so it's interlaced ptr (nok++)
+            if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
+                (++nok) > max)
+              break;
+          }
+        else if (mpi->bpp < 24) // RGB/BGR 16 - check all colors
+          for (i = 0; i < rowsize; i++)
+          {
+            n1 = cur[0] + (cur[1]<<8);
+            n2 = prv[0] + (prv[1]<<8);
+            if ((n1&0x1f) - (n2&0x1f) > diff ||
+                ((n1>>5)&0x3f) - ((n2>>5)&0x3f) > diff ||
+                ((n1>>11)&0x1f) - ((n2>>11)&0x1f) > diff)
+              row0[i] = 1;
+            else if ((n1&0x1f) - (n2&0x1f) < -diff ||
+                     ((n1>>5)&0x3f) - ((n2>>5)&0x3f) < -diff ||
+                     ((n1>>11)&0x1f) - ((n2>>11)&0x1f) < -diff)
+              row0[i] = -1;
+            else
+              row0[i] = 0;
+            cur += 2;
+            prv += 2;
+            // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
+            // but row3 is 1 so it's interlaced ptr (nok++)
+            if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
+                (++nok) > max)
+              break;
+          }
+        else // RGB/BGR 24/32
+          for (i = 0; i < rowsize; i++)
+          {
+            if (cur[0] - prv[0] > diff ||
+                cur[1] - prv[1] > diff ||
+                cur[2] - prv[2] > diff)
+              row0[i] = 1;
+            else if (prv[0] - cur[0] > diff ||
+                     prv[1] - cur[1] > diff ||
+                     prv[2] - cur[2] > diff)
+              row0[i] = -1;
+            else
+              row0[i] = 0;
+            cur += mpi->bpp/8;
+            prv += mpi->bpp/8;
+            // check if row0 is 1 but row1 is 0, and row2 is 1 or row2 is 0
+            // but row3 is 1 so it's interlaced ptr (nok++)
+            if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
+                (++nok) > max)
+              break;
+          }
+        cur0 += mpi->stride[0];
+        prv0 += mpi->stride[0];
+        // rotate rows
+        cur = row2;
+        row2 = row1;
+        row1 = row0;
+        row0 = cur;
       }
     }
     // check if number of interlaced is above of max
     if (nok > max)
     {
-//      vf->priv->dfr++;
+//    vf->priv->dfr++;
       if (vf->priv->was_dint < 1) // can skip at most one frame!
       {
-	vf->priv->was_dint++;
-//	vf->priv->rdfr++;
-//	mp_msg (MSGT_VFILTER, MSGL_INFO, "DI:%d/%d ", vf->priv->rdfr, vf->priv->dfr);
-	return 0;
+        vf->priv->was_dint++;
+//      vf->priv->rdfr++;
+//      mp_msg (MSGT_VFILTER, MSGL_INFO, "DI:%d/%d ", vf->priv->rdfr, vf->priv->dfr);
+        return 0;
       }
     }
     vf->priv->was_dint = 0;
@@ -194,7 +194,7 @@
 static int vf_open(vf_instance_t *vf, char *args){
     vf->config = config;
     vf->put_image = put_image;
-//    vf->default_reqs=VFCAP_ACCEPT_STRIDE;
+//  vf->default_reqs=VFCAP_ACCEPT_STRIDE;
     vf->priv = malloc (sizeof(struct vf_priv_s));
     vf->priv->sense = 0.1;
     vf->priv->level = 0.15;
--- a/libmpcodecs/vf_divtc.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_divtc.c	Fri Jan 14 22:10:21 2011 +0000
@@ -56,39 +56,39 @@
    {
    volatile short out[4];
    __asm__ (
-	"movl $8, %%ecx \n\t"
-	"pxor %%mm4, %%mm4 \n\t"
-	"pxor %%mm7, %%mm7 \n\t"
+        "movl $8, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t"
+        "pxor %%mm7, %%mm7 \n\t"
 
-	ASMALIGN(4)
-	"1: \n\t"
+        ASMALIGN(4)
+        "1: \n\t"
 
-	"movq (%%"REG_S"), %%mm0 \n\t"
-	"movq (%%"REG_S"), %%mm2 \n\t"
-	"add %%"REG_a", %%"REG_S" \n\t"
-	"movq (%%"REG_D"), %%mm1 \n\t"
-	"add %%"REG_b", %%"REG_D" \n\t"
-	"psubusb %%mm1, %%mm2 \n\t"
-	"psubusb %%mm0, %%mm1 \n\t"
-	"movq %%mm2, %%mm0 \n\t"
-	"movq %%mm1, %%mm3 \n\t"
-	"punpcklbw %%mm7, %%mm0 \n\t"
-	"punpcklbw %%mm7, %%mm1 \n\t"
-	"punpckhbw %%mm7, %%mm2 \n\t"
-	"punpckhbw %%mm7, %%mm3 \n\t"
-	"paddw %%mm0, %%mm4 \n\t"
-	"paddw %%mm1, %%mm4 \n\t"
-	"paddw %%mm2, %%mm4 \n\t"
-	"paddw %%mm3, %%mm4 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "psubusb %%mm1, %%mm2 \n\t"
+        "psubusb %%mm0, %%mm1 \n\t"
+        "movq %%mm2, %%mm0 \n\t"
+        "movq %%mm1, %%mm3 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm0, %%mm4 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm2, %%mm4 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
 
-	"decl %%ecx \n\t"
-	"jnz 1b \n\t"
-	"movq %%mm4, (%%"REG_d") \n\t"
-	"emms \n\t"
-	:
-	: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
-	: "%ecx", "memory"
-	);
+        "decl %%ecx \n\t"
+        "jnz 1b \n\t"
+        "movq %%mm4, (%%"REG_d") \n\t"
+        "emms \n\t"
+        :
+        : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
+        : "%ecx", "memory"
+        );
    return out[0]+out[1]+out[2]+out[3];
    }
 #endif
@@ -99,7 +99,7 @@
 
    for(y=8; y; y--, new+=ns, old+=os)
       for(x=8; x; x--)
-	 d+=abs(new[x]-old[x]);
+         d+=abs(new[x]-old[x]);
 
    return d;
    }
@@ -107,19 +107,19 @@
 static int (*diff)(unsigned char *, unsigned char *, int, int);
 
 static int diff_plane(unsigned char *old, unsigned char *new,
-		      int w, int h, int os, int ns, int arg)
+                      int w, int h, int os, int ns, int arg)
    {
    int x, y, d, max=0, sum=0, n=0;
 
    for(y=0; y<h-7; y+=8)
       {
       for(x=0; x<w-7; x+=8)
-	 {
-	 d=diff(old+x+y*os, new+x+y*ns, os, ns);
-	 if(d>max) max=d;
-	 sum+=d;
-	 n++;
-	 }
+         {
+         d=diff(old+x+y*os, new+x+y*ns, os, ns);
+         if(d>max) max=d;
+         sum+=d;
+         n++;
+         }
       }
 
    return (sum+n*max)/2;
@@ -127,21 +127,21 @@
 
 /*
 static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
-				   int w, int h, int s, int zs, int arg)
+                                   int w, int h, int s, int zs, int arg)
    {
    unsigned int shift, sum;
    unsigned char *e;
 
    for(sum=0; h; h--, p+=s-w)
       for(e=p+w, shift=32; p<e;)
-	 sum^=(*p++)<<(shift=(shift-8)&31);
+         sum^=(*p++)<<(shift=(shift-8)&31);
 
    return sum;
    }
 */
 
 static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
-				   int w, int h, int s, int zs, int arg)
+                                   int w, int h, int s, int zs, int arg)
    {
    unsigned int shift;
    uint32_t sum, t;
@@ -156,10 +156,10 @@
    for(sum=0; h; h--, p+=s-w)
       {
       for(shift=0, e=p+w; (int)p&(sizeof(wsum_t)-1) && p<e;)
-	 sum^=*p++<<(shift=(shift-8)&31);
+         sum^=*p++<<(shift=(shift-8)&31);
 
       for(wsum=0, e2=e-sizeof(wsum_t)+1; p<e2; p+=sizeof(wsum_t))
-	 wsum^=*(wsum_t *)p;
+         wsum^=*(wsum_t *)p;
 
 #if HAVE_FAST_64BIT
       t=be2me_32((uint32_t)(wsum>>32^wsum));
@@ -168,22 +168,22 @@
 #endif
 
       for(sum^=(t<<shift|t>>(32-shift)); p<e;)
-	 sum^=*p++<<(shift=(shift-8)&31);
+         sum^=*p++<<(shift=(shift-8)&31);
       }
 
    return sum;
    }
 
 static int deghost_plane(unsigned char *d, unsigned char *s,
-			 int w, int h, int ds, int ss, int threshold)
+                         int w, int h, int ds, int ss, int threshold)
    {
    int t;
    unsigned char *e;
 
    for(; h; h--, s+=ss-w, d+=ds-w)
       for(e=d+w; d<e; d++, s++)
-	 if(abs(*d-*s)>=threshold)
-	    *d=(t=(*d<<1)-*s)<0?0:t>255?255:t;
+         if(abs(*d-*s)>=threshold)
+            *d=(t=(*d<<1)-*s)<0?0:t>255?255:t;
 
    return 0;
    }
@@ -194,23 +194,23 @@
 }
 
 static int imgop(int(*planeop)(unsigned char *, unsigned char *,
-			       int, int, int, int, int),
-		 mp_image_t *dst, mp_image_t *src, int arg)
+                               int, int, int, int, int),
+                 mp_image_t *dst, mp_image_t *src, int arg)
    {
    if(dst->flags&MP_IMGFLAG_PLANAR)
       return planeop(dst->planes[0], src?src->planes[0]:0,
-		     dst->w, dst->h,
-		     dst->stride[0], src?src->stride[0]:0, arg)+
-	     planeop(dst->planes[1], src?src->planes[1]:0,
-		     dst->chroma_width, dst->chroma_height,
-		     dst->stride[1], src?src->stride[1]:0, arg)+
-	     planeop(dst->planes[2], src?src->planes[2]:0,
-		     dst->chroma_width, dst->chroma_height,
-		     dst->stride[2], src?src->stride[2]:0, arg);
+                     dst->w, dst->h,
+                     dst->stride[0], src?src->stride[0]:0, arg)+
+             planeop(dst->planes[1], src?src->planes[1]:0,
+                     dst->chroma_width, dst->chroma_height,
+                     dst->stride[1], src?src->stride[1]:0, arg)+
+             planeop(dst->planes[2], src?src->planes[2]:0,
+                     dst->chroma_width, dst->chroma_height,
+                     dst->stride[2], src?src->stride[2]:0, arg);
 
    return planeop(dst->planes[0], src?src->planes[0]:0,
-		  dst->w*(dst->bpp/8), dst->h,
-		  dst->stride[0], src?src->stride[0]:0, arg);
+                  dst->w*(dst->bpp/8), dst->h,
+                  dst->stride[0], src?src->stride[0]:0, arg);
    }
 
 /*
@@ -222,7 +222,7 @@
  */
 
 static int match(struct vf_priv_s *p, int *diffs,
-		 int phase1, int phase2, double *strength)
+                 int phase1, int phase2, double *strength)
    {
    static const int pattern1[]={ -4,  1, 1, 1, 1 },
       pattern2[]={ -2, -3, 4, 4, -3 }, *pattern;
@@ -233,12 +233,12 @@
    for(f=0; f<5; f++)
       {
       if(phase1<0 || phase2<0 || f==phase1 || f==phase2)
-	 {
-	 for(n=t[f]=0; n<5; n++)
-	    t[f]+=diffs[n]*pattern[(n-f+5)%5];
-	 }
+         {
+         for(n=t[f]=0; n<5; n++)
+            t[f]+=diffs[n]*pattern[(n-f+5)%5];
+         }
       else
-	 t[f]=INT_MIN;
+         t[f]=INT_MIN;
       }
 
    /* find the best match */
@@ -249,7 +249,7 @@
       {
       /* the second best match */
       for(f=m?0:1, n=f+1; n<5; n++)
-	 if(n!=m && t[n]>t[f]) f=n;
+         if(n!=m && t[n]>t[f]) f=n;
 
       *strength=(t[m]>0?(double)(t[m]-t[f])/t[m]:0.0);
       }
@@ -266,9 +266,9 @@
    double d;
 
    dmpi=vf_get_image(vf->next, mpi->imgfmt,
-		     MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-		     MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
-		     mpi->width, mpi->height);
+                     MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+                     MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
+                     mpi->width, mpi->height);
    vf_clone_mpi_attributes(dmpi, mpi);
 
    newphase=p->phase;
@@ -276,73 +276,73 @@
    switch(p->pass)
       {
       case 1:
-	 fprintf(p->file, "%08x %d\n",
-		 (unsigned int)imgop((void *)checksum_plane, mpi, 0, 0),
-		 p->frameno?imgop(diff_plane, dmpi, mpi, 0):0);
-	 break;
+         fprintf(p->file, "%08x %d\n",
+                 (unsigned int)imgop((void *)checksum_plane, mpi, 0, 0),
+                 p->frameno?imgop(diff_plane, dmpi, mpi, 0):0);
+         break;
 
       case 2:
-	 if(p->frameno/5>p->bcount)
-	    {
-	    mp_msg(MSGT_VFILTER, MSGL_ERR,
-		   "\n%s: Log file ends prematurely! "
-		   "Switching to one pass mode.\n", vf->info->name);
-	    p->pass=0;
-	    break;
-	    }
+         if(p->frameno/5>p->bcount)
+            {
+            mp_msg(MSGT_VFILTER, MSGL_ERR,
+                   "\n%s: Log file ends prematurely! "
+                   "Switching to one pass mode.\n", vf->info->name);
+            p->pass=0;
+            break;
+            }
 
-	 checksum=(unsigned int)imgop((void *)checksum_plane, mpi, 0, 0);
+         checksum=(unsigned int)imgop((void *)checksum_plane, mpi, 0, 0);
 
-	 if(checksum!=p->csdata[p->frameno])
-	    {
-	    for(f=0; f<100; f++)
-	       if(p->frameno+f<p->fcount && p->csdata[p->frameno+f]==checksum)
-		  break;
-	       else if(p->frameno-f>=0 && p->csdata[p->frameno-f]==checksum)
-		  {
-		  f=-f;
-		  break;
-		  }
+         if(checksum!=p->csdata[p->frameno])
+            {
+            for(f=0; f<100; f++)
+               if(p->frameno+f<p->fcount && p->csdata[p->frameno+f]==checksum)
+                  break;
+               else if(p->frameno-f>=0 && p->csdata[p->frameno-f]==checksum)
+                  {
+                  f=-f;
+                  break;
+                  }
 
-	    if(f<100)
-	       {
-	       mp_msg(MSGT_VFILTER, MSGL_INFO,
-		      "\n%s: Mismatch with pass-1: %+d frame(s).\n",
-		      vf->info->name, f);
+            if(f<100)
+               {
+               mp_msg(MSGT_VFILTER, MSGL_INFO,
+                      "\n%s: Mismatch with pass-1: %+d frame(s).\n",
+                      vf->info->name, f);
 
-	       p->frameno+=f;
-	       p->misscount=0;
-	       }
-	    else if(p->misscount++>=30)
-	       {
-	       mp_msg(MSGT_VFILTER, MSGL_ERR,
-		      "\n%s: Sync with pass-1 lost! "
-		      "Switching to one pass mode.\n", vf->info->name);
-	       p->pass=0;
-	       break;
-	       }
-	    }
+               p->frameno+=f;
+               p->misscount=0;
+               }
+            else if(p->misscount++>=30)
+               {
+               mp_msg(MSGT_VFILTER, MSGL_ERR,
+                      "\n%s: Sync with pass-1 lost! "
+                      "Switching to one pass mode.\n", vf->info->name);
+               p->pass=0;
+               break;
+               }
+            }
 
-	 n=(p->frameno)/5;
-	 if(n>=p->bcount) n=p->bcount-1;
+         n=(p->frameno)/5;
+         if(n>=p->bcount) n=p->bcount-1;
 
-	 newphase=p->bdata[n];
-	 break;
+         newphase=p->bdata[n];
+         break;
 
       default:
-	 if(p->frameno)
-	    {
-	    int *sump=p->sum+p->frameno%5,
-	       *histp=p->history+p->frameno%p->window;
+         if(p->frameno)
+            {
+            int *sump=p->sum+p->frameno%5,
+               *histp=p->history+p->frameno%p->window;
 
-	    *sump-=*histp;
-	    *sump+=(*histp=imgop(diff_plane, dmpi, mpi, 0));
-	    }
+            *sump-=*histp;
+            *sump+=(*histp=imgop(diff_plane, dmpi, mpi, 0));
+            }
 
-	 m=match(p, p->sum, -1, -1, &d);
+         m=match(p, p->sum, -1, -1, &d);
 
-	 if(d>=p->threshold)
-	    newphase=m;
+         if(d>=p->threshold)
+            newphase=m;
       }
 
    n=p->ocount++%5;
@@ -351,29 +351,29 @@
       {
       p->phase=newphase;
       mp_msg(MSGT_VFILTER, MSGL_STATUS,
-	     "\n%s: Telecine phase %d.\n", vf->info->name, p->phase);
+             "\n%s: Telecine phase %d.\n", vf->info->name, p->phase);
       }
 
    switch((p->frameno++-p->phase+10)%5)
       {
       case 0:
-	 imgop(copyop, dmpi, mpi, 0);
-	 return 0;
+         imgop(copyop, dmpi, mpi, 0);
+         return 0;
 
       case 4:
-	 if(p->deghost>0)
-	    {
-	    tmpi=vf_get_image(vf->next, mpi->imgfmt,
-			      MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
-			      MP_IMGFLAG_READABLE,
-			      mpi->width, mpi->height);
-	    vf_clone_mpi_attributes(tmpi, mpi);
+         if(p->deghost>0)
+            {
+            tmpi=vf_get_image(vf->next, mpi->imgfmt,
+                              MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
+                              MP_IMGFLAG_READABLE,
+                              mpi->width, mpi->height);
+            vf_clone_mpi_attributes(tmpi, mpi);
 
-	    imgop(copyop, tmpi, mpi, 0);
-	    imgop(deghost_plane, tmpi, dmpi, p->deghost);
-	    imgop(copyop, dmpi, mpi, 0);
-	    return vf_next_put_image(vf, tmpi, MP_NOPTS_VALUE);
-	    }
+            imgop(copyop, tmpi, mpi, 0);
+            imgop(deghost_plane, tmpi, dmpi, p->deghost);
+            imgop(copyop, dmpi, mpi, 0);
+            return vf_next_put_image(vf, tmpi, MP_NOPTS_VALUE);
+            }
       }
 
    imgop(copyop, dmpi, mpi, 0);
@@ -395,20 +395,20 @@
    while(fgets(lbuf, 256, p->file))
       {
       if(n>=bufsize-19)
-	 {
-	 bufsize=bufsize?bufsize*2:30000;
-	 if((bp=realloc(buf, bufsize*sizeof *buf))) buf=bp;
-	 if((cp=realloc(cbuf, bufsize*sizeof *cbuf))) cbuf=cp;
+         {
+         bufsize=bufsize?bufsize*2:30000;
+         if((bp=realloc(buf, bufsize*sizeof *buf))) buf=bp;
+         if((cp=realloc(cbuf, bufsize*sizeof *cbuf))) cbuf=cp;
 
-	 if(!bp || !cp)
-	    {
-	    mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Not enough memory.\n",
-		   vf_info_divtc.name);
-	    free(buf);
-	    free(cbuf);
-	    return 0;
-	    }
-	 }
+         if(!bp || !cp)
+            {
+            mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Not enough memory.\n",
+                   vf_info_divtc.name);
+            free(buf);
+            free(cbuf);
+            return 0;
+            }
+         }
       sscanf(lbuf, "%x %d", cbuf+n, buf+n);
       n++;
       }
@@ -416,7 +416,7 @@
    if(!n)
       {
       mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Empty 2-pass log file.\n",
-	     vf_info_divtc.name);
+             vf_info_divtc.name);
       free(buf);
       free(cbuf);
       return 0;
@@ -452,36 +452,36 @@
       double s0=0.0, s1=0.0;
 
       for(f=0; f<n; f+=5)
-	 {
-	 p->deghost=0; match(p, buf+f, -1, -1, &d); s0+=d;
-	 p->deghost=1; match(p, buf+f, -1, -1, &d); s1+=d;
-	 }
+         {
+         p->deghost=0; match(p, buf+f, -1, -1, &d); s0+=d;
+         p->deghost=1; match(p, buf+f, -1, -1, &d); s1+=d;
+         }
 
       p->deghost=s1>s0?deghost:0;
 
       mp_msg(MSGT_VFILTER, MSGL_INFO,
-	     "%s: Deghosting %-3s (relative pattern strength %+.2fdB).\n",
-	     vf_info_divtc.name,
-	     p->deghost?"ON":"OFF",
-	     10.0*log10(s1/s0));
+             "%s: Deghosting %-3s (relative pattern strength %+.2fdB).\n",
+             vf_info_divtc.name,
+             p->deghost?"ON":"OFF",
+             10.0*log10(s1/s0));
       }
 
    /* analyze the data */
 
    for(f=0; f<5; f++)
       for(sum[f]=0, n=-15; n<20; n+=5)
-	 sum[f]+=buf[n+f];
+         sum[f]+=buf[n+f];
 
    for(f=0; f<b; f++)
       {
       m=match(p, sum, -1, -1, &d);
 
       if(d>=p->threshold)
-	 pbuf[f]=m;
+         pbuf[f]=m;
 
       if(f<b-1)
-	 for(n=0; n<5; n++)
-	    sum[n]=sum[n]-buf[5*(f-3)+n]+buf[5*(f+4)+n];
+         for(n=0; n<5; n++)
+            sum[n]=sum[n]-buf[5*(f-3)+n]+buf[5*(f+4)+n];
       }
 
    /* fill in the gaps */
@@ -493,7 +493,7 @@
       {
       free(buf-15);
       mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: No telecine pattern found!\n",
-	     vf_info_divtc.name);
+             vf_info_divtc.name);
       return 0;
       }
 
@@ -511,56 +511,56 @@
       for(n=f; pbuf[n]==-1; n++);
 
       if(pbuf[f-1]==pbuf[n])
-	 {
-	 /* just a gap */
-	 while(f<n) pbuf[f++]=pbuf[n];
-	 }
+         {
+         /* just a gap */
+         while(f<n) pbuf[f++]=pbuf[n];
+         }
       else
-	 {
-	 /* phase change, reanalyze the original data in the gap with zero
-	    threshold for only the two phases that appear at the ends */
+         {
+         /* phase change, reanalyze the original data in the gap with zero
+            threshold for only the two phases that appear at the ends */
 
-	 for(i=0; i<5; i++)
-	    for(sum[i]=0, j=5*f-15; j<5*f; j+=5)
-	       sum[i]+=buf[i+j];
+         for(i=0; i<5; i++)
+            for(sum[i]=0, j=5*f-15; j<5*f; j+=5)
+               sum[i]+=buf[i+j];
 
-	 for(i=f; i<n; i++)
-	    {
-	    pbuf[i]=match(p, sum, pbuf[f-1], pbuf[n], 0);
+         for(i=f; i<n; i++)
+            {
+            pbuf[i]=match(p, sum, pbuf[f-1], pbuf[n], 0);
 
-	    for(j=0; j<5; j++)
-	       sum[j]=sum[j]-buf[5*(i-3)+j]+buf[5*(i+4)+j];
-	    }
+            for(j=0; j<5; j++)
+               sum[j]=sum[j]-buf[5*(i-3)+j]+buf[5*(i+4)+j];
+            }
 
-	 /* estimate the transition point by dividing the gap
-	    in the same proportion as the number of matches of each kind */
+         /* estimate the transition point by dividing the gap
+            in the same proportion as the number of matches of each kind */
 
-	 for(i=f, m=f; i<n; i++)
-	    if(pbuf[i]==pbuf[f-1]) m++;
+         for(i=f, m=f; i<n; i++)
+            if(pbuf[i]==pbuf[f-1]) m++;
 
-	 /* find the transition of the right direction nearest to the
-	    estimated point */
+         /* find the transition of the right direction nearest to the
+            estimated point */
 
-	 if(m>f && m<n)
-	    {
-	    for(j=m; j>f; j--)
-	       if(pbuf[j-1]==pbuf[f-1] && pbuf[j]==pbuf[n]) break;
-	    for(s=m; s<n; s++)
-	       if(pbuf[s-1]==pbuf[f-1] && pbuf[s]==pbuf[n]) break;
+         if(m>f && m<n)
+            {
+            for(j=m; j>f; j--)
+               if(pbuf[j-1]==pbuf[f-1] && pbuf[j]==pbuf[n]) break;
+            for(s=m; s<n; s++)
+               if(pbuf[s-1]==pbuf[f-1] && pbuf[s]==pbuf[n]) break;
 
-	    m=(s-m<m-j)?s:j;
-	    }
+            m=(s-m<m-j)?s:j;
+            }
 
-	 /* and rewrite the data to allow only this one transition */
+         /* and rewrite the data to allow only this one transition */
 
-	 for(i=f; i<m; i++)
-	    pbuf[i]=pbuf[f-1];
+         for(i=f; i<m; i++)
+            pbuf[i]=pbuf[f-1];
 
-	 for(; i<n; i++)
-	    pbuf[i]=pbuf[n];
+         for(; i<n; i++)
+            pbuf[i]=pbuf[n];
 
-	 f=n;
-	 }
+         f=n;
+         }
       }
 
    free(buf-15);
@@ -577,7 +577,7 @@
       case IMGFMT_411P: case IMGFMT_YUY2: case IMGFMT_IF09:
       case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_YVU9:
       case IMGFMT_IUYV: case IMGFMT_Y800: case IMGFMT_Y8:
-	 return vf_next_query_format(vf,fmt);
+         return vf_next_query_format(vf,fmt);
       }
 
    return 0;
@@ -604,7 +604,7 @@
       {
    nomem:
       mp_msg(MSGT_VFILTER, MSGL_FATAL,
-	     "%s: Not enough memory.\n", vf->info->name);
+             "%s: Not enough memory.\n", vf->info->name);
    fail:
       uninit(vf);
       free(args);
@@ -624,76 +624,76 @@
 
    if((ap=args))
       while(*ap)
-	 {
-	 q=ap;
-	 if((ap=strchr(q, ':'))) *ap++=0; else ap=q+strlen(q);
-	 if((a=strchr(q, '='))) *a++=0; else a=q+strlen(q);
+         {
+         q=ap;
+         if((ap=strchr(q, ':'))) *ap++=0; else ap=q+strlen(q);
+         if((a=strchr(q, '='))) *a++=0; else a=q+strlen(q);
 
-	 switch(*q)
-	    {
-	    case 0:                              break;
-	    case 'f': filename=a;                break;
-	    case 't': p->threshold=atof(a);      break;
-	    case 'w': p->window=5*(atoi(a)+4)/5; break;
-	    case 'd': p->deghost=atoi(a);        break;
-	    case 'p':
-	       if(q[1]=='h') p->phase=atoi(a);
-	       else p->pass=atoi(a);
-	       break;
+         switch(*q)
+            {
+            case 0:                              break;
+            case 'f': filename=a;                break;
+            case 't': p->threshold=atof(a);      break;
+            case 'w': p->window=5*(atoi(a)+4)/5; break;
+            case 'd': p->deghost=atoi(a);        break;
+            case 'p':
+               if(q[1]=='h') p->phase=atoi(a);
+               else p->pass=atoi(a);
+               break;
 
-	    case 'h':
-	       mp_msg(MSGT_VFILTER, MSGL_INFO,
-		      "\n%s options:\n\n"
-		      "pass=1|2         - Use 2-pass mode.\n"
-		      "file=filename    - Set the 2-pass log file name "
-		      "(default %s).\n"
-		      "threshold=value  - Set the pattern recognition "
-		      "sensitivity (default %g).\n"
-		      "deghost=value    - Select deghosting threshold "
-		      "(default %d).\n"
-		      "window=numframes - Set the statistics window "
-		      "for 1-pass mode (default %d).\n"
-		      "phase=0|1|2|3|4  - Set the initial phase "
-		      "for 1-pass mode (default %d).\n\n"
-		      "The option names can be abbreviated to the shortest "
-		      "unique prefix.\n\n",
-		      vf->info->name, filename, p->threshold, p->deghost,
-		      p->window, p->phase%5);
-	       break;
+            case 'h':
+               mp_msg(MSGT_VFILTER, MSGL_INFO,
+                      "\n%s options:\n\n"
+                      "pass=1|2         - Use 2-pass mode.\n"
+                      "file=filename    - Set the 2-pass log file name "
+                      "(default %s).\n"
+                      "threshold=value  - Set the pattern recognition "
+                      "sensitivity (default %g).\n"
+                      "deghost=value    - Select deghosting threshold "
+                      "(default %d).\n"
+                      "window=numframes - Set the statistics window "
+                      "for 1-pass mode (default %d).\n"
+                      "phase=0|1|2|3|4  - Set the initial phase "
+                      "for 1-pass mode (default %d).\n\n"
+                      "The option names can be abbreviated to the shortest "
+                      "unique prefix.\n\n",
+                      vf->info->name, filename, p->threshold, p->deghost,
+                      p->window, p->phase%5);
+               break;
 
-	    default:
-	       mp_msg(MSGT_VFILTER, MSGL_FATAL,
-		      "%s: Unknown argument %s.\n", vf->info->name, q);
-	       goto fail;
-	    }
-	 }
+            default:
+               mp_msg(MSGT_VFILTER, MSGL_FATAL,
+                      "%s: Unknown argument %s.\n", vf->info->name, q);
+               goto fail;
+            }
+         }
 
    switch(p->pass)
       {
       case 1:
-	 if(!(p->file=fopen(filename, "w")))
-	    {
-	    mp_msg(MSGT_VFILTER, MSGL_FATAL,
-		   "%s: Can't create file %s.\n", vf->info->name, filename);
-	    goto fail;
-	    }
+         if(!(p->file=fopen(filename, "w")))
+            {
+            mp_msg(MSGT_VFILTER, MSGL_FATAL,
+                   "%s: Can't create file %s.\n", vf->info->name, filename);
+            goto fail;
+            }
 
-	 break;
+         break;
 
       case 2:
-	 if(!(p->file=fopen(filename, "r")))
-	    {
-	    mp_msg(MSGT_VFILTER, MSGL_FATAL,
-		   "%s: Can't open file %s.\n", vf->info->name, filename);
-	    goto fail;
-	    }
+         if(!(p->file=fopen(filename, "r")))
+            {
+            mp_msg(MSGT_VFILTER, MSGL_FATAL,
+                   "%s: Can't open file %s.\n", vf->info->name, filename);
+            goto fail;
+            }
 
-	 if(!analyze(p))
-	    goto fail;
+         if(!analyze(p))
+            goto fail;
 
-	 fclose(p->file);
-	 p->file=0;
-	 break;
+         fclose(p->file);
+         p->file=0;
+         break;
       }
 
    if(p->window<5) p->window=5;
--- a/libmpcodecs/vf_down3dright.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_down3dright.c	Fri Jan 14 22:10:21 2011 +0000
@@ -32,135 +32,135 @@
 #include "libvo/fastmemcpy.h"
 
 struct vf_priv_s {
-	int skipline;
-	int scalew;
-	int scaleh;
+        int skipline;
+        int scalew;
+        int scaleh;
 };
 
 static void toright(unsigned char *dst[3], unsigned char *src[3],
-		    int dststride[3], int srcstride[3],
-		    int w, int h, struct vf_priv_s* p)
+                    int dststride[3], int srcstride[3],
+                    int w, int h, struct vf_priv_s* p)
 {
-	int k;
+        int k;
 
-	for (k = 0; k < 3; k++) {
-		unsigned char* fromL = src[k];
-		unsigned char* fromR = src[k];
-		unsigned char* to = dst[k];
-		int src = srcstride[k];
+        for (k = 0; k < 3; k++) {
+                unsigned char* fromL = src[k];
+                unsigned char* fromR = src[k];
+                unsigned char* to = dst[k];
+                int src = srcstride[k];
                 int dst = dststride[k];
-		int ss;
-		unsigned int dd;
-		int i;
+                int ss;
+                unsigned int dd;
+                int i;
 
-		if (k > 0) {
-			i = h / 4 - p->skipline / 2;
-			ss = src * (h / 4 + p->skipline / 2);
-			dd = w / 4;
-		} else {
-			i = h / 2 - p->skipline;
+                if (k > 0) {
+                        i = h / 4 - p->skipline / 2;
+                        ss = src * (h / 4 + p->skipline / 2);
+                        dd = w / 4;
+                } else {
+                        i = h / 2 - p->skipline;
                         ss = src * (h / 2 + p->skipline);
-			dd = w / 2;
-		}
-		fromR += ss;
-		for ( ; i > 0; i--) {
+                        dd = w / 2;
+                }
+                fromR += ss;
+                for ( ; i > 0; i--) {
                         int j;
-			unsigned char* t = to;
-			unsigned char* sL = fromL;
-			unsigned char* sR = fromR;
+                        unsigned char* t = to;
+                        unsigned char* sL = fromL;
+                        unsigned char* sR = fromR;
 
-			if (p->scalew == 1) {
-				for (j = dd; j > 0; j--) {
-					*t++ = (sL[0] + sL[1]) / 2;
-					sL+=2;
-				}
-				for (j = dd ; j > 0; j--) {
-					*t++ = (sR[0] + sR[1]) / 2;
-					sR+=2;
-				}
-			} else {
-				for (j = dd * 2 ; j > 0; j--)
-					*t++ = *sL++;
-				for (j = dd * 2 ; j > 0; j--)
-					*t++ = *sR++;
-			}
-			if (p->scaleh == 1) {
-				fast_memcpy(to + dst, to, dst);
+                        if (p->scalew == 1) {
+                                for (j = dd; j > 0; j--) {
+                                        *t++ = (sL[0] + sL[1]) / 2;
+                                        sL+=2;
+                                }
+                                for (j = dd ; j > 0; j--) {
+                                        *t++ = (sR[0] + sR[1]) / 2;
+                                        sR+=2;
+                                }
+                        } else {
+                                for (j = dd * 2 ; j > 0; j--)
+                                        *t++ = *sL++;
+                                for (j = dd * 2 ; j > 0; j--)
+                                        *t++ = *sR++;
+                        }
+                        if (p->scaleh == 1) {
+                                fast_memcpy(to + dst, to, dst);
                                 to += dst;
-			}
-			to += dst;
-			fromL += src;
-			fromR += src;
-		}
-		//printf("K %d  %d   %d   %d  %d \n", k, w, h,  src, dst);
-	}
+                        }
+                        to += dst;
+                        fromL += src;
+                        fromR += src;
+                }
+                //printf("K %d  %d   %d   %d  %d \n", k, w, h,  src, dst);
+        }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+        mp_image_t *dmpi;
 
-	// hope we'll get DR buffer:
-	dmpi=vf_get_image(vf->next, IMGFMT_YV12,
-			  MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
-			  (vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0,
-			  mpi->w * vf->priv->scalew,
-			  mpi->h / vf->priv->scaleh - vf->priv->skipline);
+        // hope we'll get DR buffer:
+        dmpi=vf_get_image(vf->next, IMGFMT_YV12,
+                          MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |
+                          (vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0,
+                          mpi->w * vf->priv->scalew,
+                          mpi->h / vf->priv->scaleh - vf->priv->skipline);
 
-	toright(dmpi->planes, mpi->planes, dmpi->stride,
-		mpi->stride, mpi->w, mpi->h, vf->priv);
+        toright(dmpi->planes, mpi->planes, dmpi->stride,
+                mpi->stride, mpi->w, mpi->h, vf->priv);
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 static int config(struct vf_instance *vf,
-		  int width, int height, int d_width, int d_height,
-		  unsigned int flags, unsigned int outfmt)
+                  int width, int height, int d_width, int d_height,
+                  unsigned int flags, unsigned int outfmt)
 {
-	/* FIXME - also support UYVY output? */
-	return vf_next_config(vf, width * vf->priv->scalew,
-			      height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_YV12);
+        /* FIXME - also support UYVY output? */
+        return vf_next_config(vf, width * vf->priv->scalew,
+                              height / vf->priv->scaleh - vf->priv->skipline, d_width, d_height, flags, IMGFMT_YV12);
 }
 
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - really any YUV 4:2:0 input format should work */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, IMGFMT_YV12);
-	}
-	return 0;
+        /* FIXME - really any YUV 4:2:0 input format should work */
+        switch (fmt) {
+        case IMGFMT_YV12:
+        case IMGFMT_IYUV:
+        case IMGFMT_I420:
+                return vf_next_query_format(vf, IMGFMT_YV12);
+        }
+        return 0;
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+        free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->config=config;
-	vf->query_format=query_format;
-	vf->put_image=put_image;
-	vf->uninit=uninit;
+        vf->config=config;
+        vf->query_format=query_format;
+        vf->put_image=put_image;
+        vf->uninit=uninit;
 
-	vf->priv = calloc(1, sizeof (struct vf_priv_s));
-	vf->priv->skipline = 0;
-	vf->priv->scalew = 1;
-	vf->priv->scaleh = 2;
-	if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
+        vf->priv = calloc(1, sizeof (struct vf_priv_s));
+        vf->priv->skipline = 0;
+        vf->priv->scalew = 1;
+        vf->priv->scaleh = 2;
+        if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
 
-	return 1;
+        return 1;
 }
 
 const vf_info_t vf_info_down3dright = {
-	"convert stereo movie from top-bottom to left-right field",
-	"down3dright",
-	"Zdenek Kabelac",
-	"",
-	vf_open,
-	NULL
+        "convert stereo movie from top-bottom to left-right field",
+        "down3dright",
+        "Zdenek Kabelac",
+        "",
+        vf_open,
+        NULL
 };
--- a/libmpcodecs/vf_dsize.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_dsize.c	Fri Jan 14 22:10:21 2011 +0000
@@ -29,88 +29,88 @@
 #include "vf.h"
 
 struct vf_priv_s {
-	int w, h;
-	int method; // aspect method, 0 -> downscale, 1-> upscale. +2 -> original aspect.
-	int round;
-	float aspect;
+    int w, h;
+    int method; // aspect method, 0 -> downscale, 1-> upscale. +2 -> original aspect.
+    int round;
+    float aspect;
 };
 
 static int config(struct vf_instance *vf,
-	int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt)
 {
-	if (vf->priv->aspect < 0.001) { // did the user input aspect or w,h params
-		if (vf->priv->w == 0) vf->priv->w = d_width;
-		if (vf->priv->h == 0) vf->priv->h = d_height;
-		if (vf->priv->w == -1) vf->priv->w = width;
-		if (vf->priv->h == -1) vf->priv->h = height;
-		if (vf->priv->w == -2) vf->priv->w = vf->priv->h * (double)d_width / d_height;
-		if (vf->priv->w == -3) vf->priv->w = vf->priv->h * (double)width / height;
-		if (vf->priv->h == -2) vf->priv->h = vf->priv->w * (double)d_height / d_width;
-		if (vf->priv->h == -3) vf->priv->h = vf->priv->w * (double)height / width;
-		if (vf->priv->method > -1) {
-			double aspect = (vf->priv->method & 2) ? ((double)height / width) : ((double)d_height / d_width);
-			if ((vf->priv->h > vf->priv->w * aspect) ^ (vf->priv->method & 1)) {
-				vf->priv->h = vf->priv->w * aspect;
-			} else {
-				vf->priv->w = vf->priv->h / aspect;
-			}
-		}
-		if (vf->priv->round > 1) { // round up
-			vf->priv->w += (vf->priv->round - 1 - (vf->priv->w - 1) % vf->priv->round);
-			vf->priv->h += (vf->priv->round - 1 - (vf->priv->h - 1) % vf->priv->round);
-		}
-		d_width = vf->priv->w;
-		d_height = vf->priv->h;
-	} else {
-		if (vf->priv->aspect * height > width) {
-			d_width = height * vf->priv->aspect + .5;
-			d_height = height;
-		} else {
-			d_height = width / vf->priv->aspect + .5;
-			d_width = width;
-		}
-	}
-	return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
+    if (vf->priv->aspect < 0.001) { // did the user input aspect or w,h params
+        if (vf->priv->w == 0) vf->priv->w = d_width;
+        if (vf->priv->h == 0) vf->priv->h = d_height;
+        if (vf->priv->w == -1) vf->priv->w = width;
+        if (vf->priv->h == -1) vf->priv->h = height;
+        if (vf->priv->w == -2) vf->priv->w = vf->priv->h * (double)d_width / d_height;
+        if (vf->priv->w == -3) vf->priv->w = vf->priv->h * (double)width / height;
+        if (vf->priv->h == -2) vf->priv->h = vf->priv->w * (double)d_height / d_width;
+        if (vf->priv->h == -3) vf->priv->h = vf->priv->w * (double)height / width;
+        if (vf->priv->method > -1) {
+            double aspect = (vf->priv->method & 2) ? ((double)height / width) : ((double)d_height / d_width);
+            if ((vf->priv->h > vf->priv->w * aspect) ^ (vf->priv->method & 1)) {
+                vf->priv->h = vf->priv->w * aspect;
+            } else {
+                vf->priv->w = vf->priv->h / aspect;
+            }
+        }
+        if (vf->priv->round > 1) { // round up
+            vf->priv->w += (vf->priv->round - 1 - (vf->priv->w - 1) % vf->priv->round);
+            vf->priv->h += (vf->priv->round - 1 - (vf->priv->h - 1) % vf->priv->round);
+        }
+        d_width = vf->priv->w;
+        d_height = vf->priv->h;
+    } else {
+        if (vf->priv->aspect * height > width) {
+            d_width = height * vf->priv->aspect + .5;
+            d_height = height;
+        } else {
+            d_height = width / vf->priv->aspect + .5;
+            d_width = width;
+        }
+    }
+    return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
 }
 
 static void uninit(vf_instance_t *vf) {
-	free(vf->priv);
-	vf->priv = NULL;
+    free(vf->priv);
+    vf->priv = NULL;
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->config = config;
-	vf->draw_slice = vf_next_draw_slice;
-	vf->uninit = uninit;
-	//vf->default_caps = 0;
-	vf->priv = calloc(sizeof(struct vf_priv_s), 1);
-	vf->priv->aspect = 0.;
-	vf->priv->w = -1;
-	vf->priv->h = -1;
-	vf->priv->method = -1;
-	vf->priv->round = 1;
-	if (args) {
-		if (strchr(args, '/')) {
-			int w, h;
-			sscanf(args, "%d/%d", &w, &h);
-			vf->priv->aspect = (float)w/h;
-		} else if (strchr(args, '.')) {
-			sscanf(args, "%f", &vf->priv->aspect);
-		} else {
-			sscanf(args, "%d:%d:%d:%d", &vf->priv->w, &vf->priv->h, &vf->priv->method, &vf->priv->round);
-		}
-	}
-	if ((vf->priv->aspect < 0.) || (vf->priv->w < -3) || (vf->priv->h < -3) ||
-			((vf->priv->w < -1) && (vf->priv->h < -1)) ||
-			(vf->priv->method < -1) || (vf->priv->method > 3) ||
-			(vf->priv->round < 0)) {
-		mp_msg(MSGT_VFILTER, MSGL_ERR, "[dsize] Illegal value(s): aspect: %f w: %d h: %d aspect_method: %d round: %d\n", vf->priv->aspect, vf->priv->w, vf->priv->h, vf->priv->method, vf->priv->round);
-		free(vf->priv); vf->priv = NULL;
-		return -1;
-	}
-	return 1;
+    vf->config = config;
+    vf->draw_slice = vf_next_draw_slice;
+    vf->uninit = uninit;
+    //vf->default_caps = 0;
+    vf->priv = calloc(sizeof(struct vf_priv_s), 1);
+    vf->priv->aspect = 0.;
+    vf->priv->w = -1;
+    vf->priv->h = -1;
+    vf->priv->method = -1;
+    vf->priv->round = 1;
+    if (args) {
+        if (strchr(args, '/')) {
+            int w, h;
+            sscanf(args, "%d/%d", &w, &h);
+            vf->priv->aspect = (float)w/h;
+        } else if (strchr(args, '.')) {
+            sscanf(args, "%f", &vf->priv->aspect);
+        } else {
+            sscanf(args, "%d:%d:%d:%d", &vf->priv->w, &vf->priv->h, &vf->priv->method, &vf->priv->round);
+        }
+    }
+    if ((vf->priv->aspect < 0.) || (vf->priv->w < -3) || (vf->priv->h < -3) ||
+            ((vf->priv->w < -1) && (vf->priv->h < -1)) ||
+            (vf->priv->method < -1) || (vf->priv->method > 3) ||
+            (vf->priv->round < 0)) {
+        mp_msg(MSGT_VFILTER, MSGL_ERR, "[dsize] Illegal value(s): aspect: %f w: %d h: %d aspect_method: %d round: %d\n", vf->priv->aspect, vf->priv->w, vf->priv->h, vf->priv->method, vf->priv->round);
+        free(vf->priv); vf->priv = NULL;
+        return -1;
+    }
+    return 1;
 }
 
 const vf_info_t vf_info_dsize = {
--- a/libmpcodecs/vf_eq.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_eq.c	Fri Jan 14 22:10:21 2011 +0000
@@ -35,9 +35,9 @@
 #include "m_struct.h"
 
 static struct vf_priv_s {
-	unsigned char *buf;
-	int brightness;
-	int contrast;
+        unsigned char *buf;
+        int brightness;
+        int contrast;
 } const vf_priv_dflt = {
   NULL,
   0,
@@ -46,192 +46,192 @@
 
 #if HAVE_MMX
 static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
-		    int w, int h, int brightness, int contrast)
+                    int w, int h, int brightness, int contrast)
 {
-	int i;
-	int pel;
-	int dstep = dstride-w;
-	int sstep = sstride-w;
-	short brvec[4];
-	short contvec[4];
+        int i;
+        int pel;
+        int dstep = dstride-w;
+        int sstep = sstride-w;
+        short brvec[4];
+        short contvec[4];
 
-	contrast = ((contrast+100)*256*16)/100;
-	brightness = ((brightness+100)*511)/200-128 - contrast/32;
+        contrast = ((contrast+100)*256*16)/100;
+        brightness = ((brightness+100)*511)/200-128 - contrast/32;
 
-	brvec[0] = brvec[1] = brvec[2] = brvec[3] = brightness;
-	contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
+        brvec[0] = brvec[1] = brvec[2] = brvec[3] = brightness;
+        contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
 
-	while (h--) {
-		__asm__ volatile (
-			"movq (%5), %%mm3 \n\t"
-			"movq (%6), %%mm4 \n\t"
-			"pxor %%mm0, %%mm0 \n\t"
-			"movl %4, %%eax\n\t"
-			ASMALIGN(4)
-			"1: \n\t"
-			"movq (%0), %%mm1 \n\t"
-			"movq (%0), %%mm2 \n\t"
-			"punpcklbw %%mm0, %%mm1 \n\t"
-			"punpckhbw %%mm0, %%mm2 \n\t"
-			"psllw $4, %%mm1 \n\t"
-			"psllw $4, %%mm2 \n\t"
-			"pmulhw %%mm4, %%mm1 \n\t"
-			"pmulhw %%mm4, %%mm2 \n\t"
-			"paddw %%mm3, %%mm1 \n\t"
-			"paddw %%mm3, %%mm2 \n\t"
-			"packuswb %%mm2, %%mm1 \n\t"
-			"add $8, %0 \n\t"
-			"movq %%mm1, (%1) \n\t"
-			"add $8, %1 \n\t"
-			"decl %%eax \n\t"
-			"jnz 1b \n\t"
-			: "=r" (src), "=r" (dest)
-			: "0" (src), "1" (dest), "r" (w>>3), "r" (brvec), "r" (contvec)
-			: "%eax"
-		);
+        while (h--) {
+                __asm__ volatile (
+                        "movq (%5), %%mm3 \n\t"
+                        "movq (%6), %%mm4 \n\t"
+                        "pxor %%mm0, %%mm0 \n\t"
+                        "movl %4, %%eax\n\t"
+                        ASMALIGN(4)
+                        "1: \n\t"
+                        "movq (%0), %%mm1 \n\t"
+                        "movq (%0), %%mm2 \n\t"
+                        "punpcklbw %%mm0, %%mm1 \n\t"
+                        "punpckhbw %%mm0, %%mm2 \n\t"
+                        "psllw $4, %%mm1 \n\t"
+                        "psllw $4, %%mm2 \n\t"
+                        "pmulhw %%mm4, %%mm1 \n\t"
+                        "pmulhw %%mm4, %%mm2 \n\t"
+                        "paddw %%mm3, %%mm1 \n\t"
+                        "paddw %%mm3, %%mm2 \n\t"
+                        "packuswb %%mm2, %%mm1 \n\t"
+                        "add $8, %0 \n\t"
+                        "movq %%mm1, (%1) \n\t"
+                        "add $8, %1 \n\t"
+                        "decl %%eax \n\t"
+                        "jnz 1b \n\t"
+                        : "=r" (src), "=r" (dest)
+                        : "0" (src), "1" (dest), "r" (w>>3), "r" (brvec), "r" (contvec)
+                        : "%eax"
+                );
 
-		for (i = w&7; i; i--)
-		{
-			pel = ((*src++* contrast)>>12) + brightness;
-			if(pel&768) pel = (-pel)>>31;
-			*dest++ = pel;
-		}
+                for (i = w&7; i; i--)
+                {
+                        pel = ((*src++* contrast)>>12) + brightness;
+                        if(pel&768) pel = (-pel)>>31;
+                        *dest++ = pel;
+                }
 
-		src += sstep;
-		dest += dstep;
-	}
-	__asm__ volatile ( "emms \n\t" ::: "memory" );
+                src += sstep;
+                dest += dstep;
+        }
+        __asm__ volatile ( "emms \n\t" ::: "memory" );
 }
 #endif
 
 static void process_C(unsigned char *dest, int dstride, unsigned char *src, int sstride,
-		    int w, int h, int brightness, int contrast)
+                    int w, int h, int brightness, int contrast)
 {
-	int i;
-	int pel;
-	int dstep = dstride-w;
-	int sstep = sstride-w;
+        int i;
+        int pel;
+        int dstep = dstride-w;
+        int sstep = sstride-w;
 
-	contrast = ((contrast+100)*256*256)/100;
-	brightness = ((brightness+100)*511)/200-128 - contrast/512;
+        contrast = ((contrast+100)*256*256)/100;
+        brightness = ((brightness+100)*511)/200-128 - contrast/512;
 
-	while (h--) {
-		for (i = w; i; i--)
-		{
-			pel = ((*src++* contrast)>>16) + brightness;
-			if(pel&768) pel = (-pel)>>31;
-			*dest++ = pel;
-		}
-		src += sstep;
-		dest += dstep;
-	}
+        while (h--) {
+                for (i = w; i; i--)
+                {
+                        pel = ((*src++* contrast)>>16) + brightness;
+                        if(pel&768) pel = (-pel)>>31;
+                        *dest++ = pel;
+                }
+                src += sstep;
+                dest += dstep;
+        }
 }
 
 static void (*process)(unsigned char *dest, int dstride, unsigned char *src, int sstride,
-		       int w, int h, int brightness, int contrast);
+                       int w, int h, int brightness, int contrast);
 
 /* FIXME: add packed yuv version of process */
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+        mp_image_t *dmpi;
 
-	dmpi=vf_get_image(vf->next, mpi->imgfmt,
-			  MP_IMGTYPE_EXPORT, 0,
-			  mpi->w, mpi->h);
+        dmpi=vf_get_image(vf->next, mpi->imgfmt,
+                          MP_IMGTYPE_EXPORT, 0,
+                          mpi->w, mpi->h);
 
-	dmpi->stride[0] = mpi->stride[0];
-	dmpi->planes[1] = mpi->planes[1];
-	dmpi->planes[2] = mpi->planes[2];
-	dmpi->stride[1] = mpi->stride[1];
-	dmpi->stride[2] = mpi->stride[2];
+        dmpi->stride[0] = mpi->stride[0];
+        dmpi->planes[1] = mpi->planes[1];
+        dmpi->planes[2] = mpi->planes[2];
+        dmpi->stride[1] = mpi->stride[1];
+        dmpi->stride[2] = mpi->stride[2];
 
-	if (!vf->priv->buf) vf->priv->buf = malloc(mpi->stride[0]*mpi->h);
+        if (!vf->priv->buf) vf->priv->buf = malloc(mpi->stride[0]*mpi->h);
 
-	if ((vf->priv->brightness == 0) && (vf->priv->contrast == 0))
-		dmpi->planes[0] = mpi->planes[0];
-	else {
-		dmpi->planes[0] = vf->priv->buf;
-		process(dmpi->planes[0], dmpi->stride[0],
-			mpi->planes[0], mpi->stride[0],
-			mpi->w, mpi->h, vf->priv->brightness,
-			vf->priv->contrast);
-	}
+        if ((vf->priv->brightness == 0) && (vf->priv->contrast == 0))
+                dmpi->planes[0] = mpi->planes[0];
+        else {
+                dmpi->planes[0] = vf->priv->buf;
+                process(dmpi->planes[0], dmpi->stride[0],
+                        mpi->planes[0], mpi->stride[0],
+                        mpi->w, mpi->h, vf->priv->brightness,
+                        vf->priv->contrast);
+        }
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 static int control(struct vf_instance *vf, int request, void* data)
 {
-	vf_equalizer_t *eq;
+        vf_equalizer_t *eq;
 
-	switch (request) {
-	case VFCTRL_SET_EQUALIZER:
-		eq = data;
-		if (!strcmp(eq->item,"brightness")) {
-			vf->priv->brightness = eq->value;
-			return CONTROL_TRUE;
-		}
-		else if (!strcmp(eq->item,"contrast")) {
-			vf->priv->contrast = eq->value;
-			return CONTROL_TRUE;
-		}
-		break;
-	case VFCTRL_GET_EQUALIZER:
-		eq = data;
-		if (!strcmp(eq->item,"brightness")) {
-			eq->value = vf->priv->brightness;
-			return CONTROL_TRUE;
-		}
-		else if (!strcmp(eq->item,"contrast")) {
-			eq->value = vf->priv->contrast;
-			return CONTROL_TRUE;
-		}
-		break;
-	}
-	return vf_next_control(vf, request, data);
+        switch (request) {
+        case VFCTRL_SET_EQUALIZER:
+                eq = data;
+                if (!strcmp(eq->item,"brightness")) {
+                        vf->priv->brightness = eq->value;
+                        return CONTROL_TRUE;
+                }
+                else if (!strcmp(eq->item,"contrast")) {
+                        vf->priv->contrast = eq->value;
+                        return CONTROL_TRUE;
+                }
+                break;
+        case VFCTRL_GET_EQUALIZER:
+                eq = data;
+                if (!strcmp(eq->item,"brightness")) {
+                        eq->value = vf->priv->brightness;
+                        return CONTROL_TRUE;
+                }
+                else if (!strcmp(eq->item,"contrast")) {
+                        eq->value = vf->priv->contrast;
+                        return CONTROL_TRUE;
+                }
+                break;
+        }
+        return vf_next_control(vf, request, data);
 }
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	switch (fmt) {
-	case IMGFMT_YVU9:
-	case IMGFMT_IF09:
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_CLPL:
-	case IMGFMT_Y800:
-	case IMGFMT_Y8:
-	case IMGFMT_NV12:
-	case IMGFMT_NV21:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        switch (fmt) {
+        case IMGFMT_YVU9:
+        case IMGFMT_IF09:
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_CLPL:
+        case IMGFMT_Y800:
+        case IMGFMT_Y8:
+        case IMGFMT_NV12:
+        case IMGFMT_NV21:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv->buf);
-	free(vf->priv);
+        free(vf->priv->buf);
+        free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->control=control;
-	vf->query_format=query_format;
-	vf->put_image=put_image;
-	vf->uninit=uninit;
+        vf->control=control;
+        vf->query_format=query_format;
+        vf->put_image=put_image;
+        vf->uninit=uninit;
 
-	process = process_C;
+        process = process_C;
 #if HAVE_MMX
-	if(gCpuCaps.hasMMX) process = process_MMX;
+        if(gCpuCaps.hasMMX) process = process_MMX;
 #endif
 
-	return 1;
+        return 1;
 }
 
 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
@@ -249,10 +249,10 @@
 };
 
 const vf_info_t vf_info_eq = {
-	"soft video equalizer",
-	"eq",
-	"Richard Felker",
-	"",
-	vf_open,
-	&vf_opts
+        "soft video equalizer",
+        "eq",
+        "Richard Felker",
+        "",
+        vf_open,
+        &vf_opts
 };
--- a/libmpcodecs/vf_field.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_field.c	Fri Jan 14 22:10:21 2011 +0000
@@ -34,27 +34,27 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
     return vf_next_config(vf,width,height/2,d_width,d_height,flags,outfmt);
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
     vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
-	mpi->width, mpi->height/2);
+        MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->width, mpi->height/2);
 
     // set up mpi as a double-stride image of dmpi:
     vf->dmpi->planes[0]=mpi->planes[0]+mpi->stride[0]*vf->priv->field;
     vf->dmpi->stride[0]=2*mpi->stride[0];
     if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){
         vf->dmpi->planes[1]=mpi->planes[1]+
-	    mpi->stride[1]*vf->priv->field;
-	vf->dmpi->stride[1]=2*mpi->stride[1];
+            mpi->stride[1]*vf->priv->field;
+        vf->dmpi->stride[1]=2*mpi->stride[1];
         vf->dmpi->planes[2]=mpi->planes[2]+
-	    mpi->stride[2]*vf->priv->field;
-	vf->dmpi->stride[2]=2*mpi->stride[2];
+            mpi->stride[2]*vf->priv->field;
+        vf->dmpi->stride[2]=2*mpi->stride[2];
     } else
-	vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!!
+        vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!!
 
     return vf_next_put_image(vf,vf->dmpi, pts);
 }
@@ -63,7 +63,7 @@
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+        free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
--- a/libmpcodecs/vf_fil.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_fil.c	Fri Jan 14 22:10:21 2011 +0000
@@ -37,7 +37,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
         int pixel_stride= (width+15)&~15; //FIXME this is ust a guess ... especially for non planar its somewhat bad one
 
 #if 0
@@ -65,24 +65,24 @@
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
     if(mpi->flags&MP_IMGFLAG_DIRECT){
-	// we've used DR, so we're ready...
-	return vf_next_put_image(vf,(mp_image_t*)mpi->priv, pts);
+        // we've used DR, so we're ready...
+        return vf_next_put_image(vf,(mp_image_t*)mpi->priv, pts);
     }
 
     vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
-	vf->priv->width, vf->priv->height);
+        MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
+        vf->priv->width, vf->priv->height);
 
     // set up mpi as a double-stride image of dmpi:
     vf->dmpi->planes[0]=mpi->planes[0];
     vf->dmpi->stride[0]=(mpi->stride[0]*vf->priv->stridefactor)>>1;
     if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){
         vf->dmpi->planes[1]=mpi->planes[1];
-	vf->dmpi->stride[1]=(mpi->stride[1]*vf->priv->stridefactor)>>1;
+        vf->dmpi->stride[1]=(mpi->stride[1]*vf->priv->stridefactor)>>1;
         vf->dmpi->planes[2]=mpi->planes[2];
-	vf->dmpi->stride[2]=(mpi->stride[2]*vf->priv->stridefactor)>>1;
+        vf->dmpi->stride[2]=(mpi->stride[2]*vf->priv->stridefactor)>>1;
     } else
-	vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!!
+        vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!!
 
     return vf_next_put_image(vf,vf->dmpi, pts);
 }
@@ -91,7 +91,7 @@
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+        free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
--- a/libmpcodecs/vf_filmdint.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_filmdint.c	Fri Jan 14 22:10:21 2011 +0000
@@ -106,160 +106,160 @@
 #endif
 
 #define PDIFFUB(X,Y,T) "movq "    #X "," #T "\n\t" \
-		       "psubusb " #Y "," #T "\n\t" \
-		       "psubusb " #X "," #Y "\n\t" \
-		       "paddusb " #Y "," #T "\n\t"
+                       "psubusb " #Y "," #T "\n\t" \
+                       "psubusb " #X "," #Y "\n\t" \
+                       "paddusb " #Y "," #T "\n\t"
 
 #define PDIFFUBT(X,Y,T) "movq "    #X "," #T "\n\t" \
-			"psubusb " #Y "," #T "\n\t" \
-			"psubusb " #X "," #Y "\n\t" \
-			"paddusb " #T "," #Y "\n\t"
+                        "psubusb " #Y "," #T "\n\t" \
+                        "psubusb " #X "," #Y "\n\t" \
+                        "paddusb " #T "," #Y "\n\t"
 
-#define PSUMBW(X,T,Z)	"movq " #X "," #T "\n\t" \
-			"punpcklbw " #Z "," #X "\n\t" \
-			"punpckhbw " #Z "," #T "\n\t" \
-			"paddw " #T "," #X "\n\t" \
-			"movq " #X "," #T "\n\t" \
-			"psllq $32, " #T "\n\t" \
-			"paddw " #T "," #X "\n\t" \
-			"movq " #X "," #T "\n\t" \
-			"psllq $16, " #T "\n\t" \
-			"paddw " #T "," #X "\n\t" \
-			"psrlq $48, " #X "\n\t"
+#define PSUMBW(X,T,Z)        "movq " #X "," #T "\n\t" \
+                        "punpcklbw " #Z "," #X "\n\t" \
+                        "punpckhbw " #Z "," #T "\n\t" \
+                        "paddw " #T "," #X "\n\t" \
+                        "movq " #X "," #T "\n\t" \
+                        "psllq $32, " #T "\n\t" \
+                        "paddw " #T "," #X "\n\t" \
+                        "movq " #X "," #T "\n\t" \
+                        "psllq $16, " #T "\n\t" \
+                        "paddw " #T "," #X "\n\t" \
+                        "psrlq $48, " #X "\n\t"
 
-#define PSADBW(X,Y,T,Z)	PDIFFUBT(X,Y,T) PSUMBW(Y,T,Z)
+#define PSADBW(X,Y,T,Z)        PDIFFUBT(X,Y,T) PSUMBW(Y,T,Z)
 
 #define PMAXUB(X,Y) "psubusb " #X "," #Y "\n\tpaddusb " #X "," #Y "\n\t"
 #define PMAXUW(X,Y) "psubusw " #X "," #Y "\n\tpaddusw " #X "," #Y "\n\t"
-#define PMINUBT(X,Y,T)	"movq " #Y "," #T "\n\t" \
-			"psubusb " #X "," #T "\n\t" \
-			"psubusb " #T "," #Y "\n\t"
-#define PAVGB(X,Y)	"pavgusb " #X "," #Y "\n\t"
+#define PMINUBT(X,Y,T)        "movq " #Y "," #T "\n\t" \
+                        "psubusb " #X "," #T "\n\t" \
+                        "psubusb " #T "," #Y "\n\t"
+#define PAVGB(X,Y)        "pavgusb " #X "," #Y "\n\t"
 
 static inline void
 get_metrics_c(unsigned char *a, unsigned char *b, int as, int bs, int lines,
-	      struct metrics *m)
+              struct metrics *m)
 {
     a -= as;
     b -= bs;
     do {
-	cmmx_t old_po = *(cmmx_t*)(a      );
-	cmmx_t     po = *(cmmx_t*)(b      );
-	cmmx_t      e = *(cmmx_t*)(b +   bs);
-	cmmx_t  old_o = *(cmmx_t*)(a + 2*as);
-	cmmx_t      o = *(cmmx_t*)(b + 2*bs);
-	cmmx_t     ne = *(cmmx_t*)(b + 3*bs);
-	cmmx_t old_no = *(cmmx_t*)(a + 4*as);
-	cmmx_t     no = *(cmmx_t*)(b + 4*bs);
+        cmmx_t old_po = *(cmmx_t*)(a      );
+        cmmx_t     po = *(cmmx_t*)(b      );
+        cmmx_t      e = *(cmmx_t*)(b +   bs);
+        cmmx_t  old_o = *(cmmx_t*)(a + 2*as);
+        cmmx_t      o = *(cmmx_t*)(b + 2*bs);
+        cmmx_t     ne = *(cmmx_t*)(b + 3*bs);
+        cmmx_t old_no = *(cmmx_t*)(a + 4*as);
+        cmmx_t     no = *(cmmx_t*)(b + 4*bs);
 
-	cmmx_t   qup_old_odd = p31avgb(old_o, old_po);
-	cmmx_t       qup_odd = p31avgb(    o,     po);
-	cmmx_t qdown_old_odd = p31avgb(old_o, old_no);
-	cmmx_t     qdown_odd = p31avgb(    o,     no);
+        cmmx_t   qup_old_odd = p31avgb(old_o, old_po);
+        cmmx_t       qup_odd = p31avgb(    o,     po);
+        cmmx_t qdown_old_odd = p31avgb(old_o, old_no);
+        cmmx_t     qdown_odd = p31avgb(    o,     no);
 
-	cmmx_t   qup_even = p31avgb(ne, e);
-	cmmx_t qdown_even = p31avgb(e, ne);
+        cmmx_t   qup_even = p31avgb(ne, e);
+        cmmx_t qdown_even = p31avgb(e, ne);
 
-	cmmx_t    temp_up_diff = pdiffub(qdown_even, qup_old_odd);
-	cmmx_t   noise_up_diff = pdiffub(qdown_even, qup_odd);
-	cmmx_t  temp_down_diff = pdiffub(qup_even, qdown_old_odd);
-	cmmx_t noise_down_diff = pdiffub(qup_even, qdown_odd);
+        cmmx_t    temp_up_diff = pdiffub(qdown_even, qup_old_odd);
+        cmmx_t   noise_up_diff = pdiffub(qdown_even, qup_odd);
+        cmmx_t  temp_down_diff = pdiffub(qup_even, qdown_old_odd);
+        cmmx_t noise_down_diff = pdiffub(qup_even, qdown_odd);
 
-	cmmx_t odd_diff = pdiffub(o, old_o);
-	m->odd  += psumbw(odd_diff);
-	m->even += psadbw(e, *(cmmx_t*)(a+as));
+        cmmx_t odd_diff = pdiffub(o, old_o);
+        m->odd  += psumbw(odd_diff);
+        m->even += psadbw(e, *(cmmx_t*)(a+as));
 
-	temp_up_diff  = pminub(temp_up_diff, temp_down_diff);
-	temp_up_diff  = pminub(temp_up_diff, odd_diff);
-	m->temp  += psumbw(temp_up_diff);
-	noise_up_diff = pminub(noise_up_diff, odd_diff);
-	noise_up_diff = pminub(noise_up_diff, noise_down_diff);
+        temp_up_diff  = pminub(temp_up_diff, temp_down_diff);
+        temp_up_diff  = pminub(temp_up_diff, odd_diff);
+        m->temp  += psumbw(temp_up_diff);
+        noise_up_diff = pminub(noise_up_diff, odd_diff);
+        noise_up_diff = pminub(noise_up_diff, noise_down_diff);
 
-	m->noise += psumbw(noise_up_diff);
-	a += 2*as;
-	b += 2*bs;
+        m->noise += psumbw(noise_up_diff);
+        a += 2*as;
+        b += 2*bs;
     } while (--lines);
 }
 
 static inline void
 get_metrics_fast_c(unsigned char *a, unsigned char *b, int as, int bs,
-		   int lines, struct metrics *m)
+                   int lines, struct metrics *m)
 {
     a -= as;
     b -= bs;
     do {
-	cmmx_t old_po = (*(cmmx_t*)(a       ) >> 1) & ~SIGN_BITS;
-	cmmx_t     po = (*(cmmx_t*)(b       ) >> 1) & ~SIGN_BITS;
-	cmmx_t  old_e = (*(cmmx_t*)(a +   as) >> 1) & ~SIGN_BITS;
-	cmmx_t      e = (*(cmmx_t*)(b +   bs) >> 1) & ~SIGN_BITS;
-	cmmx_t  old_o = (*(cmmx_t*)(a + 2*as) >> 1) & ~SIGN_BITS;
-	cmmx_t      o = (*(cmmx_t*)(b + 2*bs) >> 1) & ~SIGN_BITS;
-	cmmx_t     ne = (*(cmmx_t*)(b + 3*bs) >> 1) & ~SIGN_BITS;
-	cmmx_t old_no = (*(cmmx_t*)(a + 4*as) >> 1) & ~SIGN_BITS;
-	cmmx_t     no = (*(cmmx_t*)(b + 4*bs) >> 1) & ~SIGN_BITS;
+        cmmx_t old_po = (*(cmmx_t*)(a       ) >> 1) & ~SIGN_BITS;
+        cmmx_t     po = (*(cmmx_t*)(b       ) >> 1) & ~SIGN_BITS;
+        cmmx_t  old_e = (*(cmmx_t*)(a +   as) >> 1) & ~SIGN_BITS;
+        cmmx_t      e = (*(cmmx_t*)(b +   bs) >> 1) & ~SIGN_BITS;
+        cmmx_t  old_o = (*(cmmx_t*)(a + 2*as) >> 1) & ~SIGN_BITS;
+        cmmx_t      o = (*(cmmx_t*)(b + 2*bs) >> 1) & ~SIGN_BITS;
+        cmmx_t     ne = (*(cmmx_t*)(b + 3*bs) >> 1) & ~SIGN_BITS;
+        cmmx_t old_no = (*(cmmx_t*)(a + 4*as) >> 1) & ~SIGN_BITS;
+        cmmx_t     no = (*(cmmx_t*)(b + 4*bs) >> 1) & ~SIGN_BITS;
 
-	cmmx_t   qup_old_odd = p31avgb_s(old_o, old_po);
-	cmmx_t       qup_odd = p31avgb_s(    o,     po);
-	cmmx_t qdown_old_odd = p31avgb_s(old_o, old_no);
-	cmmx_t     qdown_odd = p31avgb_s(    o,     no);
+        cmmx_t   qup_old_odd = p31avgb_s(old_o, old_po);
+        cmmx_t       qup_odd = p31avgb_s(    o,     po);
+        cmmx_t qdown_old_odd = p31avgb_s(old_o, old_no);
+        cmmx_t     qdown_odd = p31avgb_s(    o,     no);
 
-	cmmx_t   qup_even = p31avgb_s(ne, e);
-	cmmx_t qdown_even = p31avgb_s(e, ne);
+        cmmx_t   qup_even = p31avgb_s(ne, e);
+        cmmx_t qdown_even = p31avgb_s(e, ne);
 
-	cmmx_t    temp_up_diff = pdiffub_s(qdown_even, qup_old_odd);
-	cmmx_t   noise_up_diff = pdiffub_s(qdown_even, qup_odd);
-	cmmx_t  temp_down_diff = pdiffub_s(qup_even, qdown_old_odd);
-	cmmx_t noise_down_diff = pdiffub_s(qup_even, qdown_odd);
+        cmmx_t    temp_up_diff = pdiffub_s(qdown_even, qup_old_odd);
+        cmmx_t   noise_up_diff = pdiffub_s(qdown_even, qup_odd);
+        cmmx_t  temp_down_diff = pdiffub_s(qup_even, qdown_old_odd);
+        cmmx_t noise_down_diff = pdiffub_s(qup_even, qdown_odd);
 
-	cmmx_t odd_diff = pdiffub_s(o, old_o);
-	m->odd  += psumbw_s(odd_diff) << 1;
-	m->even += psadbw_s(e, old_e) << 1;
+        cmmx_t odd_diff = pdiffub_s(o, old_o);
+        m->odd  += psumbw_s(odd_diff) << 1;
+        m->even += psadbw_s(e, old_e) << 1;
 
-	temp_up_diff  = pminub_s(temp_up_diff, temp_down_diff);
-	temp_up_diff  = pminub_s(temp_up_diff, odd_diff);
-	m->temp      += psumbw_s(temp_up_diff) << 1;
-	noise_up_diff = pminub_s(noise_up_diff, odd_diff);
-	noise_up_diff = pminub_s(noise_up_diff, noise_down_diff);
+        temp_up_diff  = pminub_s(temp_up_diff, temp_down_diff);
+        temp_up_diff  = pminub_s(temp_up_diff, odd_diff);
+        m->temp      += psumbw_s(temp_up_diff) << 1;
+        noise_up_diff = pminub_s(noise_up_diff, odd_diff);
+        noise_up_diff = pminub_s(noise_up_diff, noise_down_diff);
 
-	m->noise += psumbw_s(noise_up_diff) << 1;
-	a += 2*as;
-	b += 2*bs;
+        m->noise += psumbw_s(noise_up_diff) << 1;
+        a += 2*as;
+        b += 2*bs;
     } while (--lines);
 }
 
 static inline void
 get_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
-		   int lines, struct metrics *m)
+                   int lines, struct metrics *m)
 {
     a -= as;
     b -= bs;
     do {
-	cmmx_t old_po = (*(cmmx_t*)(a       )>>1) & ~SIGN_BITS;
-	cmmx_t     po = (*(cmmx_t*)(b       )>>1) & ~SIGN_BITS;
-	cmmx_t  old_e = (*(cmmx_t*)(a +   as)>>1) & ~SIGN_BITS;
-	cmmx_t      e = (*(cmmx_t*)(b +   bs)>>1) & ~SIGN_BITS;
-	cmmx_t  old_o = (*(cmmx_t*)(a + 2*as)>>1) & ~SIGN_BITS;
-	cmmx_t      o = (*(cmmx_t*)(b + 2*bs)>>1) & ~SIGN_BITS;
-	cmmx_t     ne = (*(cmmx_t*)(b + 3*bs)>>1) & ~SIGN_BITS;
+        cmmx_t old_po = (*(cmmx_t*)(a       )>>1) & ~SIGN_BITS;
+        cmmx_t     po = (*(cmmx_t*)(b       )>>1) & ~SIGN_BITS;
+        cmmx_t  old_e = (*(cmmx_t*)(a +   as)>>1) & ~SIGN_BITS;
+        cmmx_t      e = (*(cmmx_t*)(b +   bs)>>1) & ~SIGN_BITS;
+        cmmx_t  old_o = (*(cmmx_t*)(a + 2*as)>>1) & ~SIGN_BITS;
+        cmmx_t      o = (*(cmmx_t*)(b + 2*bs)>>1) & ~SIGN_BITS;
+        cmmx_t     ne = (*(cmmx_t*)(b + 3*bs)>>1) & ~SIGN_BITS;
 
-	cmmx_t  down_even = p31avgb_s(e, ne);
-	cmmx_t     up_odd = p31avgb_s(o, po);
-	cmmx_t up_old_odd = p31avgb_s(old_o, old_po);
+        cmmx_t  down_even = p31avgb_s(e, ne);
+        cmmx_t     up_odd = p31avgb_s(o, po);
+        cmmx_t up_old_odd = p31avgb_s(old_o, old_po);
 
-	cmmx_t   odd_diff = pdiffub_s(o, old_o);
-	cmmx_t  temp_diff = pdiffub_s(down_even, up_old_odd);
-	cmmx_t noise_diff = pdiffub_s(down_even, up_odd);
+        cmmx_t   odd_diff = pdiffub_s(o, old_o);
+        cmmx_t  temp_diff = pdiffub_s(down_even, up_old_odd);
+        cmmx_t noise_diff = pdiffub_s(down_even, up_odd);
 
-	m->even += psadbw_s(e, old_e) << 1;
-	m->odd  += psumbw_s(odd_diff) << 1;
+        m->even += psadbw_s(e, old_e) << 1;
+        m->odd  += psumbw_s(odd_diff) << 1;
 
-	temp_diff  = pminub_s(temp_diff, odd_diff);
-	noise_diff = pminub_s(noise_diff, odd_diff);
+        temp_diff  = pminub_s(temp_diff, odd_diff);
+        noise_diff = pminub_s(noise_diff, odd_diff);
 
-	m->noise += psumbw_s(noise_diff) << 1;
-	m->temp  += psumbw_s(temp_diff) << 1;
-	a += 2*as;
-	b += 2*bs;
+        m->noise += psumbw_s(noise_diff) << 1;
+        m->temp  += psumbw_s(temp_diff) << 1;
+        a += 2*as;
+        b += 2*bs;
     } while (--lines);
 
 }
@@ -301,28 +301,28 @@
     unsigned high_il = !n_big && !t_big && nlow_n  && nlow_t;
 
     if (low_il | high_il) {
-	s->interlaced_low  += low_il;
-	s->interlaced_high += high_il;
+        s->interlaced_low  += low_il;
+        s->interlaced_high += high_il;
     } else {
-	s->tiny.even  += ntiny_e;
-	s->tiny.odd   += ntiny_o;
-	s->tiny.noise += ntiny_n;
-	s->tiny.temp  += ntiny_t;
+        s->tiny.even  += ntiny_e;
+        s->tiny.odd   += ntiny_o;
+        s->tiny.noise += ntiny_n;
+        s->tiny.temp  += ntiny_t;
 
-	s->low .even  += nlow_e ;
-	s->low .odd   += nlow_o ;
-	s->low .noise += nlow_n ;
-	s->low .temp  += nlow_t ;
+        s->low .even  += nlow_e ;
+        s->low .odd   += nlow_o ;
+        s->low .noise += nlow_n ;
+        s->low .temp  += nlow_t ;
 
-	s->high.even  += high_e ;
-	s->high.odd   += high_o ;
-	s->high.noise += high_n ;
-	s->high.temp  += high_t ;
+        s->high.even  += high_e ;
+        s->high.odd   += high_o ;
+        s->high.noise += high_n ;
+        s->high.temp  += high_t ;
 
-	if (m->even  >=	p->sad_thres) s->sad.even  += m->even ;
-	if (m->odd   >=	p->sad_thres) s->sad.odd   += m->odd  ;
-	if (m->noise >=	p->sad_thres) s->sad.noise += m->noise;
-	if (m->temp  >=	p->sad_thres) s->sad.temp  += m->temp ;
+        if (m->even  >=        p->sad_thres) s->sad.even  += m->even ;
+        if (m->odd   >=        p->sad_thres) s->sad.odd   += m->odd  ;
+        if (m->noise >=        p->sad_thres) s->sad.noise += m->noise;
+        if (m->temp  >=        p->sad_thres) s->sad.temp  += m->temp ;
     }
     s->num_blocks++;
     s->max.even  = MAX(s->max.even , m->even );
@@ -344,39 +344,39 @@
 
 static inline struct metrics
 block_metrics_c(unsigned char *a, unsigned char *b, int as, int bs,
-		int lines, struct vf_priv_s *p, struct frame_stats *s)
+                int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
     tm.even = tm.odd = tm.noise = tm.temp = 0;
     get_metrics_c(a, b, as, bs, lines, &tm);
     if (sizeof(cmmx_t) < 8)
-	get_metrics_c(a+4, b+4, as, bs, lines, &tm);
+        get_metrics_c(a+4, b+4, as, bs, lines, &tm);
     get_block_stats(&tm, p, s);
     return tm;
 }
 
 static inline struct metrics
 block_metrics_fast_c(unsigned char *a, unsigned char *b, int as, int bs,
-		int lines, struct vf_priv_s *p, struct frame_stats *s)
+                int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
     tm.even = tm.odd = tm.noise = tm.temp = 0;
     get_metrics_fast_c(a, b, as, bs, lines, &tm);
     if (sizeof(cmmx_t) < 8)
-	get_metrics_fast_c(a+4, b+4, as, bs, lines, &tm);
+        get_metrics_fast_c(a+4, b+4, as, bs, lines, &tm);
     get_block_stats(&tm, p, s);
     return tm;
 }
 
 static inline struct metrics
 block_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
-		int lines, struct vf_priv_s *p, struct frame_stats *s)
+                int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
     tm.even = tm.odd = tm.noise = tm.temp = 0;
     get_metrics_faster_c(a, b, as, bs, lines, &tm);
     if (sizeof(cmmx_t) < 8)
-	get_metrics_faster_c(a+4, b+4, as, bs, lines, &tm);
+        get_metrics_faster_c(a+4, b+4, as, bs, lines, &tm);
     get_block_stats(&tm, p, s);
     return tm;
 }
@@ -385,68 +385,68 @@
 
 #define BLOCK_METRICS_TEMPLATE() \
     __asm__ volatile("pxor %mm7, %mm7\n\t"   /* The result is colleted in mm7 */ \
-		 "pxor %mm6, %mm6\n\t"   /* Temp to stay at 0 */	     \
-	);								     \
-    a -= as;								     \
-    b -= bs;								     \
-    do {								     \
-	__asm__ volatile(						     \
-	    "movq (%0,%2), %%mm0\n\t"					     \
-	    "movq (%1,%3), %%mm1\n\t"   /* mm1 = even */		     \
-	    PSADBW(%%mm1, %%mm0, %%mm4, %%mm6)				     \
-	    "paddusw %%mm0, %%mm7\n\t"  /* even diff */			     \
-	    "movq (%0,%2,2), %%mm0\n\t" /* mm0 = old odd */		     \
-	    "movq (%1,%3,2), %%mm2\n\t" /* mm2 = odd */			     \
-	    "movq (%0), %%mm3\n\t"					     \
-	    "psubusb %4, %%mm3\n\t"					     \
-	    PAVGB(%%mm0, %%mm3)						     \
-	    PAVGB(%%mm0, %%mm3)    /* mm3 = qup old odd */		     \
-	    "movq %%mm0, %%mm5\n\t"					     \
-	    PSADBW(%%mm2, %%mm0, %%mm4, %%mm6)				     \
-	    "psllq $16, %%mm0\n\t"					     \
-	    "paddusw %%mm0, %%mm7\n\t"					     \
-	    "movq (%1), %%mm4\n\t"					     \
-	    "lea (%0,%2,2), %0\n\t"					     \
-	    "lea (%1,%3,2), %1\n\t"					     \
-	    "psubusb %4, %%mm4\n\t"					     \
-	    PAVGB(%%mm2, %%mm4)						     \
-	    PAVGB(%%mm2, %%mm4)    /* mm4 = qup odd */			     \
-	    PDIFFUBT(%%mm5, %%mm2, %%mm0) /* mm2 =abs(oldodd-odd) */	     \
-	    "movq (%1,%3), %%mm5\n\t"					     \
-	    "psubusb %4, %%mm5\n\t"					     \
-	    PAVGB(%%mm1, %%mm5)						     \
-	    PAVGB(%%mm5, %%mm1)    /* mm1 = qdown even */		     \
-	    PAVGB((%1,%3), %%mm5)  /* mm5 = qup next even */		     \
-	    PDIFFUBT(%%mm1, %%mm3, %%mm0) /* mm3 = abs(qupoldo-qde) */	     \
-	    PDIFFUBT(%%mm1, %%mm4, %%mm0) /* mm4 = abs(qupodd-qde) */	     \
-	    PMINUBT(%%mm2, %%mm3, %%mm0)  /* limit temp to odd diff */	     \
-	    PMINUBT(%%mm2, %%mm4, %%mm0)  /* limit noise to odd diff */	     \
-	    "movq (%1,%3,2), %%mm2\n\t"					     \
-	    "psubusb %4, %%mm2\n\t"					     \
-	    PAVGB((%1), %%mm2)						     \
-	    PAVGB((%1), %%mm2)    /* mm2 = qdown odd */			     \
-	    "movq (%0,%2,2), %%mm1\n\t"					     \
-	    "psubusb %4, %%mm1\n\t"					     \
-	    PAVGB((%0), %%mm1)						     \
-	    PAVGB((%0), %%mm1)  /* mm1 = qdown old odd */		     \
-	    PDIFFUBT(%%mm5, %%mm2, %%mm0) /* mm2 = abs(qdo-qune) */	     \
-	    PDIFFUBT(%%mm5, %%mm1, %%mm0) /* mm1 = abs(qdoo-qune) */	     \
-	    PMINUBT(%%mm4, %%mm2, %%mm0)  /* current */			     \
-	    PMINUBT(%%mm3, %%mm1, %%mm0)  /* old */			     \
-	    PSUMBW(%%mm2, %%mm0, %%mm6)					     \
-	    PSUMBW(%%mm1, %%mm0, %%mm6)					     \
-	    "psllq $32, %%mm2\n\t"					     \
-	    "psllq $48, %%mm1\n\t"					     \
-	    "paddusw %%mm2, %%mm7\n\t"					     \
-	    "paddusw %%mm1, %%mm7\n\t"					     \
-	    : "=r" (a), "=r" (b)					     \
-	    : "r"((x86_reg)as), "r"((x86_reg)bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
-	    );								     \
+                 "pxor %mm6, %mm6\n\t"   /* Temp to stay at 0 */             \
+        );                                                                     \
+    a -= as;                                                                     \
+    b -= bs;                                                                     \
+    do {                                                                     \
+        __asm__ volatile(                                                     \
+            "movq (%0,%2), %%mm0\n\t"                                             \
+            "movq (%1,%3), %%mm1\n\t"   /* mm1 = even */                     \
+            PSADBW(%%mm1, %%mm0, %%mm4, %%mm6)                                     \
+            "paddusw %%mm0, %%mm7\n\t"  /* even diff */                             \
+            "movq (%0,%2,2), %%mm0\n\t" /* mm0 = old odd */                     \
+            "movq (%1,%3,2), %%mm2\n\t" /* mm2 = odd */                             \
+            "movq (%0), %%mm3\n\t"                                             \
+            "psubusb %4, %%mm3\n\t"                                             \
+            PAVGB(%%mm0, %%mm3)                                                     \
+            PAVGB(%%mm0, %%mm3)    /* mm3 = qup old odd */                     \
+            "movq %%mm0, %%mm5\n\t"                                             \
+            PSADBW(%%mm2, %%mm0, %%mm4, %%mm6)                                     \
+            "psllq $16, %%mm0\n\t"                                             \
+            "paddusw %%mm0, %%mm7\n\t"                                             \
+            "movq (%1), %%mm4\n\t"                                             \
+            "lea (%0,%2,2), %0\n\t"                                             \
+            "lea (%1,%3,2), %1\n\t"                                             \
+            "psubusb %4, %%mm4\n\t"                                             \
+            PAVGB(%%mm2, %%mm4)                                                     \
+            PAVGB(%%mm2, %%mm4)    /* mm4 = qup odd */                             \
+            PDIFFUBT(%%mm5, %%mm2, %%mm0) /* mm2 =abs(oldodd-odd) */             \
+            "movq (%1,%3), %%mm5\n\t"                                             \
+            "psubusb %4, %%mm5\n\t"                                             \
+            PAVGB(%%mm1, %%mm5)                                                     \
+            PAVGB(%%mm5, %%mm1)    /* mm1 = qdown even */                     \
+            PAVGB((%1,%3), %%mm5)  /* mm5 = qup next even */                     \
+            PDIFFUBT(%%mm1, %%mm3, %%mm0) /* mm3 = abs(qupoldo-qde) */             \
+            PDIFFUBT(%%mm1, %%mm4, %%mm0) /* mm4 = abs(qupodd-qde) */             \
+            PMINUBT(%%mm2, %%mm3, %%mm0)  /* limit temp to odd diff */             \
+            PMINUBT(%%mm2, %%mm4, %%mm0)  /* limit noise to odd diff */             \
+            "movq (%1,%3,2), %%mm2\n\t"                                             \
+            "psubusb %4, %%mm2\n\t"                                             \
+            PAVGB((%1), %%mm2)                                                     \
+            PAVGB((%1), %%mm2)    /* mm2 = qdown odd */                             \
+            "movq (%0,%2,2), %%mm1\n\t"                                             \
+            "psubusb %4, %%mm1\n\t"                                             \
+            PAVGB((%0), %%mm1)                                                     \
+            PAVGB((%0), %%mm1)  /* mm1 = qdown old odd */                     \
+            PDIFFUBT(%%mm5, %%mm2, %%mm0) /* mm2 = abs(qdo-qune) */             \
+            PDIFFUBT(%%mm5, %%mm1, %%mm0) /* mm1 = abs(qdoo-qune) */             \
+            PMINUBT(%%mm4, %%mm2, %%mm0)  /* current */                             \
+            PMINUBT(%%mm3, %%mm1, %%mm0)  /* old */                             \
+            PSUMBW(%%mm2, %%mm0, %%mm6)                                             \
+            PSUMBW(%%mm1, %%mm0, %%mm6)                                             \
+            "psllq $32, %%mm2\n\t"                                             \
+            "psllq $48, %%mm1\n\t"                                             \
+            "paddusw %%mm2, %%mm7\n\t"                                             \
+            "paddusw %%mm1, %%mm7\n\t"                                             \
+            : "=r" (a), "=r" (b)                                             \
+            : "r"((x86_reg)as), "r"((x86_reg)bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
+            );                                                                     \
     } while (--lines);
 
 static inline struct metrics
 block_metrics_3dnow(unsigned char *a, unsigned char *b, int as, int bs,
-		    int lines, struct vf_priv_s *p, struct frame_stats *s)
+                    int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
 #if !HAVE_AMD3DNOW
@@ -467,15 +467,15 @@
 #undef PMINUBT
 #undef PAVGB
 
-#define PSUMBW(X,T,Z)	"psadbw " #Z "," #X "\n\t"
+#define PSUMBW(X,T,Z)        "psadbw " #Z "," #X "\n\t"
 #define PSADBW(X,Y,T,Z) "psadbw " #X "," #Y "\n\t"
-#define PMAXUB(X,Y)	"pmaxub " #X "," #Y "\n\t"
-#define PMINUBT(X,Y,T)	"pminub " #X "," #Y "\n\t"
-#define PAVGB(X,Y)	"pavgb "  #X "," #Y "\n\t"
+#define PMAXUB(X,Y)        "pmaxub " #X "," #Y "\n\t"
+#define PMINUBT(X,Y,T)        "pminub " #X "," #Y "\n\t"
+#define PAVGB(X,Y)        "pavgb "  #X "," #Y "\n\t"
 
 static inline struct metrics
 block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
-		   int lines, struct vf_priv_s *p, struct frame_stats *s)
+                   int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
 #if !HAVE_MMX
@@ -488,115 +488,115 @@
     struct frame_stats ts = *s;
 #endif
     __asm__ volatile("prefetcht0 (%0,%2)\n\t"
-		 "prefetcht0 (%1,%3)\n\t" :
-		 : "r" (a), "r" (b),
-		 "r" (prefetch_line * as), "r" (prefetch_line * bs));
+                 "prefetcht0 (%1,%3)\n\t" :
+                 : "r" (a), "r" (b),
+                 "r" (prefetch_line * as), "r" (prefetch_line * bs));
 
     BLOCK_METRICS_TEMPLATE();
 
     s->num_blocks++;
     __asm__ volatile(
-	"movq %3, %%mm0\n\t"
-	"movq %%mm7, %%mm1\n\t"
-	"psubusw %%mm0, %%mm1\n\t"
-	"movq %%mm1, %%mm2\n\t"
-	"paddusw %%mm0, %%mm2\n\t"
-	"paddusw %%mm7, %%mm2\n\t"
-	"pshufw $0xb1, %%mm2, %%mm3\n\t"
-	"pavgw %%mm7, %%mm2\n\t"
-	"pshufw $0xb1, %%mm2, %%mm2\n\t"
-	"psubusw %%mm7, %%mm2\n\t"
-	"pcmpeqw %%mm6, %%mm2\n\t" /* 1 if >= 1.5x */
-	"psubusw %%mm7, %%mm3\n\t"
-	"pcmpeqw %%mm6, %%mm3\n\t" /* 1 if >= 2x */
-	"movq %1, %%mm4\n\t"
-	"movq %2, %%mm5\n\t"
-	"psubw %%mm2, %%mm4\n\t"
-	"psubw %%mm3, %%mm5\n\t"
-	"movq %%mm4, %1\n\t"
-	"movq %%mm5, %2\n\t"
-	"pxor %%mm4, %%mm4\n\t"
-	"pcmpeqw %%mm1, %%mm4\n\t" /* 1 if <= t */
-	"psubusw %%mm0, %%mm1\n\t"
-	"pxor %%mm5, %%mm5\n\t"
-	"pcmpeqw %%mm1, %%mm5\n\t" /* 1 if <= 2t */
-	"psubusw %%mm0, %%mm1\n\t"
-	"psubusw %%mm0, %%mm1\n\t"
-	"pcmpeqw %%mm6, %%mm1\n\t" /* 1 if <= 4t */
-	"pshufw $0xb1, %%mm2, %%mm0\n\t"
-	"por %%mm2, %%mm0\n\t"     /* 1 if not close */
-	"punpckhdq %%mm0, %%mm0\n\t"
-	"movq %%mm4, %%mm2\n\t"      /* tttt */
-	"punpckhdq %%mm5, %%mm2\n\t" /* ttll */
-	"por %%mm2, %%mm0\n\t"
-	"pcmpeqd %%mm6, %%mm0\n\t" /* close && big */
-	"psrlq $16, %%mm0\n\t"
-	"psrlw $15, %%mm0\n\t"
-	"movd %%mm0, %0\n\t"
-	: "=r" (interlaced), "=m" (s->bigger), "=m" (s->twox)
-	: "m" (p->thres)
-	);
+        "movq %3, %%mm0\n\t"
+        "movq %%mm7, %%mm1\n\t"
+        "psubusw %%mm0, %%mm1\n\t"
+        "movq %%mm1, %%mm2\n\t"
+        "paddusw %%mm0, %%mm2\n\t"
+        "paddusw %%mm7, %%mm2\n\t"
+        "pshufw $0xb1, %%mm2, %%mm3\n\t"
+        "pavgw %%mm7, %%mm2\n\t"
+        "pshufw $0xb1, %%mm2, %%mm2\n\t"
+        "psubusw %%mm7, %%mm2\n\t"
+        "pcmpeqw %%mm6, %%mm2\n\t" /* 1 if >= 1.5x */
+        "psubusw %%mm7, %%mm3\n\t"
+        "pcmpeqw %%mm6, %%mm3\n\t" /* 1 if >= 2x */
+        "movq %1, %%mm4\n\t"
+        "movq %2, %%mm5\n\t"
+        "psubw %%mm2, %%mm4\n\t"
+        "psubw %%mm3, %%mm5\n\t"
+        "movq %%mm4, %1\n\t"
+        "movq %%mm5, %2\n\t"
+        "pxor %%mm4, %%mm4\n\t"
+        "pcmpeqw %%mm1, %%mm4\n\t" /* 1 if <= t */
+        "psubusw %%mm0, %%mm1\n\t"
+        "pxor %%mm5, %%mm5\n\t"
+        "pcmpeqw %%mm1, %%mm5\n\t" /* 1 if <= 2t */
+        "psubusw %%mm0, %%mm1\n\t"
+        "psubusw %%mm0, %%mm1\n\t"
+        "pcmpeqw %%mm6, %%mm1\n\t" /* 1 if <= 4t */
+        "pshufw $0xb1, %%mm2, %%mm0\n\t"
+        "por %%mm2, %%mm0\n\t"     /* 1 if not close */
+        "punpckhdq %%mm0, %%mm0\n\t"
+        "movq %%mm4, %%mm2\n\t"      /* tttt */
+        "punpckhdq %%mm5, %%mm2\n\t" /* ttll */
+        "por %%mm2, %%mm0\n\t"
+        "pcmpeqd %%mm6, %%mm0\n\t" /* close && big */
+        "psrlq $16, %%mm0\n\t"
+        "psrlw $15, %%mm0\n\t"
+        "movd %%mm0, %0\n\t"
+        : "=r" (interlaced), "=m" (s->bigger), "=m" (s->twox)
+        : "m" (p->thres)
+        );
 
     if (interlaced) {
-	s->interlaced_high += interlaced >> 16;
-	s->interlaced_low += interlaced;
+        s->interlaced_high += interlaced >> 16;
+        s->interlaced_low += interlaced;
     } else {
-	__asm__ volatile(
-	    "pcmpeqw %%mm0, %%mm0\n\t" /* -1 */
-	    "psubw 	%%mm0, %%mm4\n\t"
-	    "psubw 	%%mm0, %%mm5\n\t"
-	    "psubw 	%%mm0, %%mm1\n\t"
-	    "paddw %0, %%mm4\n\t"
-	    "paddw %1, %%mm5\n\t"
-	    "paddw %2, %%mm1\n\t"
-	    "movq %%mm4, %0\n\t"
-	    "movq %%mm5, %1\n\t"
-	    "movq %%mm1, %2\n\t"
-	    : "=m" (s->tiny), "=m" (s->low), "=m" (s->high)
-	    );
+        __asm__ volatile(
+            "pcmpeqw %%mm0, %%mm0\n\t" /* -1 */
+            "psubw         %%mm0, %%mm4\n\t"
+            "psubw         %%mm0, %%mm5\n\t"
+            "psubw         %%mm0, %%mm1\n\t"
+            "paddw %0, %%mm4\n\t"
+            "paddw %1, %%mm5\n\t"
+            "paddw %2, %%mm1\n\t"
+            "movq %%mm4, %0\n\t"
+            "movq %%mm5, %1\n\t"
+            "movq %%mm1, %2\n\t"
+            : "=m" (s->tiny), "=m" (s->low), "=m" (s->high)
+            );
 
-	__asm__ volatile(
-	    "pshufw $0, %2, %%mm0\n\t"
-	    "psubusw %%mm7, %%mm0\n\t"
-	    "pcmpeqw %%mm6, %%mm0\n\t"   /* 0 if below sad_thres */
-	    "pand %%mm7, %%mm0\n\t"
-	    "movq %%mm0, %%mm1\n\t"
-	    "punpcklwd %%mm6, %%mm0\n\t" /* sad even, odd */
-	    "punpckhwd %%mm6, %%mm1\n\t" /* sad noise, temp */
-	    "paddd %0, %%mm0\n\t"
-	    "paddd %1, %%mm1\n\t"
-	    "movq %%mm0, %0\n\t"
-	    "movq %%mm1, %1\n\t"
-	    : "=m" (s->sad.even), "=m" (s->sad.noise)
-	    : "m" (p->sad_thres)
-	    );
+        __asm__ volatile(
+            "pshufw $0, %2, %%mm0\n\t"
+            "psubusw %%mm7, %%mm0\n\t"
+            "pcmpeqw %%mm6, %%mm0\n\t"   /* 0 if below sad_thres */
+            "pand %%mm7, %%mm0\n\t"
+            "movq %%mm0, %%mm1\n\t"
+            "punpcklwd %%mm6, %%mm0\n\t" /* sad even, odd */
+            "punpckhwd %%mm6, %%mm1\n\t" /* sad noise, temp */
+            "paddd %0, %%mm0\n\t"
+            "paddd %1, %%mm1\n\t"
+            "movq %%mm0, %0\n\t"
+            "movq %%mm1, %1\n\t"
+            : "=m" (s->sad.even), "=m" (s->sad.noise)
+            : "m" (p->sad_thres)
+            );
     }
 
     __asm__ volatile(
-	"movq %%mm7, (%1)\n\t"
-	PMAXUW((%0), %%mm7)
-	"movq %%mm7, (%0)\n\t"
-	"emms"
-	: : "r" (&s->max), "r" (&tm), "X" (s->max)
-	: "memory"
-	);
+        "movq %%mm7, (%1)\n\t"
+        PMAXUW((%0), %%mm7)
+        "movq %%mm7, (%0)\n\t"
+        "emms"
+        : : "r" (&s->max), "r" (&tm), "X" (s->max)
+        : "memory"
+        );
 #ifdef DEBUG
     if (1) {
-	struct metrics cm;
-	a -= 7*as;
-	b -= 7*bs;
-	cm = block_metrics_c(a, b, as, bs, 4, p, &ts);
-	if (!MEQ(tm, cm))
-	    mp_msg(MSGT_VFILTER, MSGL_WARN, "Bad metrics\n");
-	if (s) {
+        struct metrics cm;
+        a -= 7*as;
+        b -= 7*bs;
+        cm = block_metrics_c(a, b, as, bs, 4, p, &ts);
+        if (!MEQ(tm, cm))
+            mp_msg(MSGT_VFILTER, MSGL_WARN, "Bad metrics\n");
+        if (s) {
 #           define CHECK(X) if (!MEQ(s->X, ts.X)) \
-		mp_msg(MSGT_VFILTER, MSGL_WARN, "Bad " #X "\n");
-	    CHECK(tiny);
-	    CHECK(low);
-	    CHECK(high);
-	    CHECK(sad);
-	    CHECK(max);
-	}
+                mp_msg(MSGT_VFILTER, MSGL_WARN, "Bad " #X "\n");
+            CHECK(tiny);
+            CHECK(low);
+            CHECK(high);
+            CHECK(sad);
+            CHECK(max);
+        }
     }
 #endif
 #endif
@@ -605,7 +605,7 @@
 
 static inline int
 dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
-		    long cos, int ds, int ss, int w, int t)
+                    long cos, int ds, int ss, int w, int t)
 {
 #if !HAVE_MMX
     mp_msg(MSGT_VFILTER, MSGL_FATAL, "dint_copy_line_mmx2: internal error\n");
@@ -614,60 +614,60 @@
     unsigned long len = (w+7) >> 3;
     int ret;
     __asm__ volatile (
-	"pxor %%mm6, %%mm6 \n\t"       /* deinterlaced pixel counter */
-	"movd %0, %%mm7 \n\t"
-	"punpcklbw %%mm7, %%mm7 \n\t"
-	"punpcklwd %%mm7, %%mm7 \n\t"
-	"punpckldq %%mm7, %%mm7 \n\t"  /* mm7 = threshold */
-	: /* no output */
-	: "rm" (t)
-	);
+        "pxor %%mm6, %%mm6 \n\t"       /* deinterlaced pixel counter */
+        "movd %0, %%mm7 \n\t"
+        "punpcklbw %%mm7, %%mm7 \n\t"
+        "punpcklwd %%mm7, %%mm7 \n\t"
+        "punpckldq %%mm7, %%mm7 \n\t"  /* mm7 = threshold */
+        : /* no output */
+        : "rm" (t)
+        );
     do {
-	__asm__ volatile (
-	    "movq (%0), %%mm0\n\t"
-	    "movq (%0,%3,2), %%mm1\n\t"
-	    "movq %%mm0, (%2)\n\t"
-	    "pmaxub %%mm1, %%mm0\n\t"
-	    "pavgb (%0), %%mm1\n\t"
-	    "psubusb %%mm1, %%mm0\n\t"
-	    "paddusb %%mm7, %%mm0\n\t"  /* mm0 = max-avg+thr */
-	    "movq (%0,%1), %%mm2\n\t"
-	    "movq (%0,%5), %%mm3\n\t"
-	    "movq %%mm2, %%mm4\n\t"
-	    PDIFFUBT(%%mm1, %%mm2, %%mm5)
-	    PDIFFUBT(%%mm1, %%mm3, %%mm5)
-	    "pminub %%mm2, %%mm3\n\t"
-	    "pcmpeqb %%mm3, %%mm2\n\t"  /* b = min */
-	    "pand %%mm2, %%mm4\n\t"
-	    "pandn (%0,%5), %%mm2\n\t"
-	    "por %%mm4, %%mm2\n\t"
-	    "pminub %%mm0, %%mm3\n\t"
-	    "pcmpeqb %%mm0, %%mm3\n\t"  /* set to 1s if >= threshold */
-	    "psubb %%mm3, %%mm6\n\t"    /* count pixels above thr. */
-	    "pand %%mm3, %%mm1 \n\t"
-	    "pandn %%mm2, %%mm3 \n\t"
-	    "por %%mm3, %%mm1 \n\t"     /* avg if >= threshold */
-	    "movq %%mm1, (%2,%4) \n\t"
-	    : /* no output */
-	    : "r" (a), "r" ((x86_reg)bos), "r" ((x86_reg)dst), "r" ((x86_reg)ss), "r" ((x86_reg)ds), "r" ((x86_reg)cos)
-	    );
-	a += 8;
-	dst += 8;
+        __asm__ volatile (
+            "movq (%0), %%mm0\n\t"
+            "movq (%0,%3,2), %%mm1\n\t"
+            "movq %%mm0, (%2)\n\t"
+            "pmaxub %%mm1, %%mm0\n\t"
+            "pavgb (%0), %%mm1\n\t"
+            "psubusb %%mm1, %%mm0\n\t"
+            "paddusb %%mm7, %%mm0\n\t"  /* mm0 = max-avg+thr */
+            "movq (%0,%1), %%mm2\n\t"
+            "movq (%0,%5), %%mm3\n\t"
+            "movq %%mm2, %%mm4\n\t"
+            PDIFFUBT(%%mm1, %%mm2, %%mm5)
+            PDIFFUBT(%%mm1, %%mm3, %%mm5)
+            "pminub %%mm2, %%mm3\n\t"
+            "pcmpeqb %%mm3, %%mm2\n\t"  /* b = min */
+            "pand %%mm2, %%mm4\n\t"
+            "pandn (%0,%5), %%mm2\n\t"
+            "por %%mm4, %%mm2\n\t"
+            "pminub %%mm0, %%mm3\n\t"
+            "pcmpeqb %%mm0, %%mm3\n\t"  /* set to 1s if >= threshold */
+            "psubb %%mm3, %%mm6\n\t"    /* count pixels above thr. */
+            "pand %%mm3, %%mm1 \n\t"
+            "pandn %%mm2, %%mm3 \n\t"
+            "por %%mm3, %%mm1 \n\t"     /* avg if >= threshold */
+            "movq %%mm1, (%2,%4) \n\t"
+            : /* no output */
+            : "r" (a), "r" ((x86_reg)bos), "r" ((x86_reg)dst), "r" ((x86_reg)ss), "r" ((x86_reg)ds), "r" ((x86_reg)cos)
+            );
+        a += 8;
+        dst += 8;
     } while (--len);
 
     __asm__ volatile ("pxor %%mm7, %%mm7 \n\t"
-		  "psadbw %%mm6, %%mm7 \n\t"
-		  "movd %%mm7, %0 \n\t"
-		  "emms \n\t"
-		  : "=r" (ret)
-	);
+                  "psadbw %%mm6, %%mm7 \n\t"
+                  "movd %%mm7, %0 \n\t"
+                  "emms \n\t"
+                  : "=r" (ret)
+        );
     return ret;
 #endif
 }
 
 static inline int
 dint_copy_line(unsigned char *dst, unsigned char *a, long bos,
-	       long cos, int ds, int ss, int w, int t)
+               long cos, int ds, int ss, int w, int t)
 {
     unsigned long len = ((unsigned long)w+sizeof(cmmx_t)-1) / sizeof(cmmx_t);
     cmmx_t dint_count = 0;
@@ -675,107 +675,107 @@
     t |= t <<  8;
     thr = t | (t << 16);
     if (sizeof(cmmx_t) > 4)
-	thr |= thr << (sizeof(cmmx_t)*4);
+        thr |= thr << (sizeof(cmmx_t)*4);
     do {
-	cmmx_t e = *(cmmx_t*)a;
-	cmmx_t ne = *(cmmx_t*)(a+2*ss);
-	cmmx_t o = *(cmmx_t*)(a+bos);
-	cmmx_t oo = *(cmmx_t*)(a+cos);
-	cmmx_t maxe = pmaxub(e, ne);
-	cmmx_t avge = pavgb(e, ne);
-	cmmx_t max_diff = maxe - avge + thr; /* 0<=max-avg<128, thr<128 */
-	cmmx_t diffo  = pdiffub(avge, o);
-	cmmx_t diffoo = pdiffub(avge, oo);
-	cmmx_t diffcmp = pcmpgtub(diffo, diffoo);
-	cmmx_t bo = ((oo ^ o) & diffcmp) ^ o;
-	cmmx_t diffbo = ((diffoo ^ diffo) & diffcmp) ^ diffo;
-	cmmx_t above_thr = ~pcmpgtub(max_diff, diffbo);
-	cmmx_t bo_or_avg = ((avge ^ bo) & above_thr) ^ bo;
-	dint_count += above_thr & ONE_BYTES;
-	*(cmmx_t*)(dst) = e;
-	*(cmmx_t*)(dst+ds) = bo_or_avg;
-	a += sizeof(cmmx_t);
-	dst += sizeof(cmmx_t);
+        cmmx_t e = *(cmmx_t*)a;
+        cmmx_t ne = *(cmmx_t*)(a+2*ss);
+        cmmx_t o = *(cmmx_t*)(a+bos);
+        cmmx_t oo = *(cmmx_t*)(a+cos);
+        cmmx_t maxe = pmaxub(e, ne);
+        cmmx_t avge = pavgb(e, ne);
+        cmmx_t max_diff = maxe - avge + thr; /* 0<=max-avg<128, thr<128 */
+        cmmx_t diffo  = pdiffub(avge, o);
+        cmmx_t diffoo = pdiffub(avge, oo);
+        cmmx_t diffcmp = pcmpgtub(diffo, diffoo);
+        cmmx_t bo = ((oo ^ o) & diffcmp) ^ o;
+        cmmx_t diffbo = ((diffoo ^ diffo) & diffcmp) ^ diffo;
+        cmmx_t above_thr = ~pcmpgtub(max_diff, diffbo);
+        cmmx_t bo_or_avg = ((avge ^ bo) & above_thr) ^ bo;
+        dint_count += above_thr & ONE_BYTES;
+        *(cmmx_t*)(dst) = e;
+        *(cmmx_t*)(dst+ds) = bo_or_avg;
+        a += sizeof(cmmx_t);
+        dst += sizeof(cmmx_t);
     } while (--len);
     return psumbw(dint_count);
 }
 
 static int
 dint_copy_plane(unsigned char *d, unsigned char *a, unsigned char *b,
-		unsigned char *c, unsigned long w, unsigned long h,
-		unsigned long ds, unsigned long ss, unsigned long threshold,
-		long field, long mmx2)
+                unsigned char *c, unsigned long w, unsigned long h,
+                unsigned long ds, unsigned long ss, unsigned long threshold,
+                long field, long mmx2)
 {
     unsigned long ret = 0;
     long bos = b - a;
     long cos = c - a;
     if (field) {
-	fast_memcpy(d, b, w);
-	h--;
-	d += ds;
-	a += ss;
+        fast_memcpy(d, b, w);
+        h--;
+        d += ds;
+        a += ss;
     }
     bos += ss;
     cos += ss;
     while (h > 2) {
-	if (threshold >= 128) {
-	    fast_memcpy(d, a, w);
-	    fast_memcpy(d+ds, a+bos, w);
-	} else if (mmx2 == 1) {
-	    ret += dint_copy_line_mmx2(d, a, bos, cos, ds, ss, w, threshold);
-	} else
-	    ret += dint_copy_line(d, a, bos, cos, ds, ss, w, threshold);
-	h -= 2;
-	d += 2*ds;
-	a += 2*ss;
+        if (threshold >= 128) {
+            fast_memcpy(d, a, w);
+            fast_memcpy(d+ds, a+bos, w);
+        } else if (mmx2 == 1) {
+            ret += dint_copy_line_mmx2(d, a, bos, cos, ds, ss, w, threshold);
+        } else
+            ret += dint_copy_line(d, a, bos, cos, ds, ss, w, threshold);
+        h -= 2;
+        d += 2*ds;
+        a += 2*ss;
     }
     fast_memcpy(d, a, w);
     if (h == 2)
-	fast_memcpy(d+ds, a+bos, w);
+        fast_memcpy(d+ds, a+bos, w);
     return ret;
 }
 
 static void
 copy_merge_fields(struct vf_priv_s *p, mp_image_t *dmpi,
-		  unsigned char **old, unsigned char **new, unsigned long show)
+                  unsigned char **old, unsigned char **new, unsigned long show)
 {
     unsigned long threshold = 256;
     unsigned long field = p->swapped;
     unsigned long dint_pixels = 0;
     unsigned char **other = old;
     if (show >= 12 || !(show & 3))
-	show >>= 2, other = new, new = old;
+        show >>= 2, other = new, new = old;
     if (show <= 2) {  /* Single field: de-interlace */
-	threshold = p->dint_thres;
-	field ^= show & 1;
-	old = new;
+        threshold = p->dint_thres;
+        field ^= show & 1;
+        old = new;
     } else if (show == 3)
-	old = new;
+        old = new;
     else
-	field ^= 1;
+        field ^= 1;
     dint_pixels +=dint_copy_plane(dmpi->planes[0], old[0], new[0],
-				  other[0], p->w, p->h, dmpi->stride[0],
-				  p->stride, threshold, field, p->mmx2);
+                                  other[0], p->w, p->h, dmpi->stride[0],
+                                  p->stride, threshold, field, p->mmx2);
     if (dmpi->flags & MP_IMGFLAG_PLANAR) {
-	if (p->luma_only)
-	    old = new, other = new;
-	else
-	    threshold = threshold/2 + 1;
-	field ^= p->chroma_swapped;
-	dint_copy_plane(dmpi->planes[1], old[1], new[1],
-			other[1], p->cw, p->ch,	dmpi->stride[1],
-			p->chroma_stride, threshold, field, p->mmx2);
-	dint_copy_plane(dmpi->planes[2], old[2], new[2],
-			other[2], p->cw, p->ch, dmpi->stride[2],
-			p->chroma_stride, threshold, field, p->mmx2);
+        if (p->luma_only)
+            old = new, other = new;
+        else
+            threshold = threshold/2 + 1;
+        field ^= p->chroma_swapped;
+        dint_copy_plane(dmpi->planes[1], old[1], new[1],
+                        other[1], p->cw, p->ch,        dmpi->stride[1],
+                        p->chroma_stride, threshold, field, p->mmx2);
+        dint_copy_plane(dmpi->planes[2], old[2], new[2],
+                        other[2], p->cw, p->ch, dmpi->stride[2],
+                        p->chroma_stride, threshold, field, p->mmx2);
     }
     if (dint_pixels > 0 && p->verbose)
-	mp_msg(MSGT_VFILTER,MSGL_INFO,"Deinterlaced %lu pixels\n",dint_pixels);
+        mp_msg(MSGT_VFILTER,MSGL_INFO,"Deinterlaced %lu pixels\n",dint_pixels);
 }
 
 static void diff_planes(struct vf_priv_s *p, struct frame_stats *s,
-			unsigned char *of, unsigned char *nf,
-			int w, int h, int os, int ns, int swapped)
+                        unsigned char *of, unsigned char *nf,
+                        int w, int h, int os, int ns, int swapped)
 {
     int i, y;
     int align = -(long)nf & 7;
@@ -783,7 +783,7 @@
     nf += align;
     w -= align;
     if (swapped)
-	of -= os, nf -= ns;
+        of -= os, nf -= ns;
     i = (h*3 >> 7) & ~1;
     of += i*os + 8;
     nf += i*ns + 8;
@@ -793,65 +793,65 @@
     memset(s, 0, sizeof(*s));
 
     for (y = (h-8) >> 3; y; y--) {
-	if (p->mmx2 == 1) {
-	    for (i = 0; i < w; i += 8)
-		block_metrics_mmx2(of+i, nf+i, os, ns, 4, p, s);
-	} else if (p->mmx2 == 2) {
-	    for (i = 0; i < w; i += 8)
-		block_metrics_3dnow(of+i, nf+i, os, ns, 4, p, s);
-	} else if (p->fast > 3) {
-	    for (i = 0; i < w; i += 8)
-		block_metrics_faster_c(of+i, nf+i, os, ns, 4, p, s);
-	} else if (p->fast > 1) {
-	    for (i = 0; i < w; i += 8)
-		block_metrics_fast_c(of+i, nf+i, os, ns, 4, p, s);
-	} else {
-	    for (i = 0; i < w; i += 8)
-		block_metrics_c(of+i, nf+i, os, ns, 4, p, s);
-	}
-	of += 8*os;
-	nf += 8*ns;
+        if (p->mmx2 == 1) {
+            for (i = 0; i < w; i += 8)
+                block_metrics_mmx2(of+i, nf+i, os, ns, 4, p, s);
+        } else if (p->mmx2 == 2) {
+            for (i = 0; i < w; i += 8)
+                block_metrics_3dnow(of+i, nf+i, os, ns, 4, p, s);
+        } else if (p->fast > 3) {
+            for (i = 0; i < w; i += 8)
+                block_metrics_faster_c(of+i, nf+i, os, ns, 4, p, s);
+        } else if (p->fast > 1) {
+            for (i = 0; i < w; i += 8)
+                block_metrics_fast_c(of+i, nf+i, os, ns, 4, p, s);
+        } else {
+            for (i = 0; i < w; i += 8)
+                block_metrics_c(of+i, nf+i, os, ns, 4, p, s);
+        }
+        of += 8*os;
+        nf += 8*ns;
     }
 }
 
 #define METRICS(X) (X).even, (X).odd, (X).noise, (X).temp
 
 static void diff_fields(struct vf_priv_s *p, struct frame_stats *s,
-			unsigned char **old, unsigned char **new)
+                        unsigned char **old, unsigned char **new)
 {
     diff_planes(p, s, old[0], new[0], p->w, p->h,
-		p->stride, p->stride, p->swapped);
+                p->stride, p->stride, p->swapped);
     s->sad.even  = (s->sad.even  * 16ul) / s->num_blocks;
     s->sad.odd   = (s->sad.odd   * 16ul) / s->num_blocks;
     s->sad.noise = (s->sad.noise * 16ul) / s->num_blocks;
     s->sad.temp  = (s->sad.temp  * 16ul) / s->num_blocks;
     if (p->verbose)
-	mp_msg(MSGT_VFILTER, MSGL_INFO, "%lu%c M:%d/%d/%d/%d - %d, "
-	       "t:%d/%d/%d/%d, l:%d/%d/%d/%d, h:%d/%d/%d/%d, bg:%d/%d/%d/%d, "
-	       "2x:%d/%d/%d/%d, sad:%d/%d/%d/%d, lil:%d, hil:%d, ios:%.1f\n",
-	       p->inframes, p->chflag, METRICS(s->max), s->num_blocks,
-	       METRICS(s->tiny), METRICS(s->low), METRICS(s->high),
-	       METRICS(s->bigger), METRICS(s->twox), METRICS(s->sad),
-	       s->interlaced_low, s->interlaced_high,
-	       p->iosync / (double) p->in_inc);
+        mp_msg(MSGT_VFILTER, MSGL_INFO, "%lu%c M:%d/%d/%d/%d - %d, "
+               "t:%d/%d/%d/%d, l:%d/%d/%d/%d, h:%d/%d/%d/%d, bg:%d/%d/%d/%d, "
+               "2x:%d/%d/%d/%d, sad:%d/%d/%d/%d, lil:%d, hil:%d, ios:%.1f\n",
+               p->inframes, p->chflag, METRICS(s->max), s->num_blocks,
+               METRICS(s->tiny), METRICS(s->low), METRICS(s->high),
+               METRICS(s->bigger), METRICS(s->twox), METRICS(s->sad),
+               s->interlaced_low, s->interlaced_high,
+               p->iosync / (double) p->in_inc);
 }
 
 static const char *parse_args(struct vf_priv_s *p, const char *args)
 {
     args--;
     while (args && *++args &&
-	   (sscanf(args, "io=%lu:%lu", &p->out_dec, &p->in_inc) == 2 ||
-	    sscanf(args, "diff_thres=%hu", &p->thres.even ) == 1 ||
-	    sscanf(args, "comb_thres=%hu", &p->thres.noise) == 1 ||
-	    sscanf(args, "sad_thres=%lu",  &p->sad_thres  ) == 1 ||
-	    sscanf(args, "dint_thres=%lu", &p->dint_thres ) == 1 ||
-	    sscanf(args, "fast=%u",        &p->fast       ) == 1 ||
-	    sscanf(args, "mmx2=%lu",       &p->mmx2       ) == 1 ||
-	    sscanf(args, "luma_only=%u",   &p->luma_only  ) == 1 ||
-	    sscanf(args, "verbose=%u",     &p->verbose    ) == 1 ||
-	    sscanf(args, "crop=%lu:%lu:%lu:%lu", &p->w,
-		   &p->h, &p->crop_x, &p->crop_y) == 4))
-	args = strchr(args, '/');
+           (sscanf(args, "io=%lu:%lu", &p->out_dec, &p->in_inc) == 2 ||
+            sscanf(args, "diff_thres=%hu", &p->thres.even ) == 1 ||
+            sscanf(args, "comb_thres=%hu", &p->thres.noise) == 1 ||
+            sscanf(args, "sad_thres=%lu",  &p->sad_thres  ) == 1 ||
+            sscanf(args, "dint_thres=%lu", &p->dint_thres ) == 1 ||
+            sscanf(args, "fast=%u",        &p->fast       ) == 1 ||
+            sscanf(args, "mmx2=%lu",       &p->mmx2       ) == 1 ||
+            sscanf(args, "luma_only=%u",   &p->luma_only  ) == 1 ||
+            sscanf(args, "verbose=%u",     &p->verbose    ) == 1 ||
+            sscanf(args, "crop=%lu:%lu:%lu:%lu", &p->w,
+                   &p->h, &p->crop_x, &p->crop_y) == 4))
+        args = strchr(args, '/');
     return args;
 }
 
@@ -859,12 +859,12 @@
 {
     unsigned long t;
     if (x > y)
-	t = x, x = y, y = t;
+        t = x, x = y, y = t;
 
     while (x) {
-	t = y % x;
-	y = x;
-	x = t;
+        t = y % x;
+        y = x;
+        x = t;
     }
     return y;
 }
@@ -878,11 +878,11 @@
     p->crop_cx = p->crop_x >> mpi->chroma_x_shift;
     p->crop_cy = p->crop_y >> mpi->chroma_y_shift;
     if (mpi->flags & MP_IMGFLAG_ACCEPT_STRIDE) {
-	p->stride = (mpi->w + 15) & ~15;
-	p->chroma_stride = p->stride >> mpi->chroma_x_shift;
+        p->stride = (mpi->w + 15) & ~15;
+        p->chroma_stride = p->stride >> mpi->chroma_x_shift;
     } else {
-	p->stride = mpi->width;
-	p->chroma_stride = mpi->chroma_width;
+        p->stride = mpi->width;
+        p->chroma_stride = mpi->chroma_width;
     }
     p->cw = p->w >> mpi->chroma_x_shift;
     p->ch = p->h >> mpi->chroma_y_shift;
@@ -892,30 +892,30 @@
     p->old_planes = p->planes[0];
     plane_size = mpi->h * p->stride;
     chroma_plane_size = mpi->flags & MP_IMGFLAG_PLANAR ?
-	mpi->chroma_height * p->chroma_stride : 0;
+        mpi->chroma_height * p->chroma_stride : 0;
     p->memory_allocated =
-	malloc(NUM_STORED * (plane_size+2*chroma_plane_size) +
-	       8*p->chroma_stride + 4096);
+        malloc(NUM_STORED * (plane_size+2*chroma_plane_size) +
+               8*p->chroma_stride + 4096);
     /* align to page boundary */
     plane = p->memory_allocated + (-(long)p->memory_allocated & 4095);
     memset(plane, 0, NUM_STORED * plane_size);
     los = p->crop_x  + p->crop_y  * p->stride;
     cos = p->crop_cx + p->crop_cy * p->chroma_stride;
     for (i = 0; i != NUM_STORED; i++, plane += plane_size) {
-	p->planes[i][0] = plane;
-	p->planes[NUM_STORED + i][0] = plane + los;
+        p->planes[i][0] = plane;
+        p->planes[NUM_STORED + i][0] = plane + los;
     }
     if (mpi->flags & MP_IMGFLAG_PLANAR) {
-	p->nplanes = 3;
-	memset(plane, 0x80, NUM_STORED * 2 * chroma_plane_size);
-	for (i = 0; i != NUM_STORED; i++) {
-	    p->planes[i][1] = plane;
-	    p->planes[NUM_STORED + i][1] = plane + cos;
-	    plane += chroma_plane_size;
-	    p->planes[i][2] = plane;
-	    p->planes[NUM_STORED + i][2] = plane + cos;
-	    plane += chroma_plane_size;
-	}
+        p->nplanes = 3;
+        memset(plane, 0x80, NUM_STORED * 2 * chroma_plane_size);
+        for (i = 0; i != NUM_STORED; i++) {
+            p->planes[i][1] = plane;
+            p->planes[NUM_STORED + i][1] = plane + cos;
+            plane += chroma_plane_size;
+            p->planes[i][2] = plane;
+            p->planes[NUM_STORED + i][2] = plane + cos;
+            plane += chroma_plane_size;
+        }
     }
     p->out_dec <<= 2;
     i = gcd(p->in_inc, p->out_dec);
@@ -942,32 +942,32 @@
     if (!p->planes[0][0]) init(p, mpi);
 
     if (mpi->type == MP_IMGTYPE_TEMP ||
-	(mpi->type == MP_IMGTYPE_IPB && !(mpi->flags & MP_IMGFLAG_READABLE)))
-	planes_idx = NUM_STORED/2 + (++p->temp_idx % (NUM_STORED/2));
+        (mpi->type == MP_IMGTYPE_IPB && !(mpi->flags & MP_IMGFLAG_READABLE)))
+        planes_idx = NUM_STORED/2 + (++p->temp_idx % (NUM_STORED/2));
     else
-	planes_idx = ++p->static_idx % (NUM_STORED/2);
+        planes_idx = ++p->static_idx % (NUM_STORED/2);
     planes = p->planes[planes_idx];
     mpi->priv = p->planes[NUM_STORED + planes_idx];
     if (mpi->priv == p->old_planes) {
-	unsigned char **old_planes =
-	    p->planes[NUM_STORED + 2 + (++p->temp_idx & 1)];
-	my_memcpy_pic(old_planes[0], p->old_planes[0],
-		      p->w, p->h, p->stride, p->stride);
-	if (mpi->flags & MP_IMGFLAG_PLANAR) {
-	    my_memcpy_pic(old_planes[1], p->old_planes[1],
-			  p->cw, p->ch, p->chroma_stride, p->chroma_stride);
-	    my_memcpy_pic(old_planes[2], p->old_planes[2],
-			  p->cw, p->ch, p->chroma_stride, p->chroma_stride);
-	}
-	p->old_planes = old_planes;
-	p->num_copies++;
+        unsigned char **old_planes =
+            p->planes[NUM_STORED + 2 + (++p->temp_idx & 1)];
+        my_memcpy_pic(old_planes[0], p->old_planes[0],
+                      p->w, p->h, p->stride, p->stride);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(old_planes[1], p->old_planes[1],
+                          p->cw, p->ch, p->chroma_stride, p->chroma_stride);
+            my_memcpy_pic(old_planes[2], p->old_planes[2],
+                          p->cw, p->ch, p->chroma_stride, p->chroma_stride);
+        }
+        p->old_planes = old_planes;
+        p->num_copies++;
     }
     mpi->planes[0] = planes[0];
     mpi->stride[0] = p->stride;
     if (mpi->flags & MP_IMGFLAG_PLANAR) {
-	mpi->planes[1] = planes[1];
-	mpi->planes[2] = planes[2];
-	mpi->stride[1] = mpi->stride[2] = p->chroma_stride;
+        mpi->planes[1] = planes[1];
+        mpi->planes[2] = planes[2];
+        mpi->stride[1] = mpi->stride[2] = p->chroma_stride;
     }
     mpi->width = p->stride;
 
@@ -995,142 +995,142 @@
     unsigned long ret = 8;
 
     if (cmpe(s->sad.temp, s->sad.even, 512, 1) > 0)
-	mp_msg(MSGT_VFILTER, MSGL_WARN,
-	       "@@@@@@@@ Bottom-first field??? @@@@@@@@\n");
+        mp_msg(MSGT_VFILTER, MSGL_WARN,
+               "@@@@@@@@ Bottom-first field??? @@@@@@@@\n");
     if (s->sad.temp > 1000 && s->sad.noise > 1000)
-	return 3;
+        return 3;
     if (s->interlaced_high >= 2*n && s->sad.temp > 256 && s->sad.noise > 256)
-	return 3;
+        return 3;
     if (s->high.noise > s->num_blocks/4 && s->sad.noise > 10000 &&
-	s->sad.noise > 2*s->sad.even && s->sad.noise > 2*ps->sad.odd) {
-	// Mid-frame scene change
-	if (s->tiny.temp + s->interlaced_low  < n   ||
-	    s->low.temp  + s->interlaced_high < n/4 ||
-	    s->high.temp + s->interlaced_high < n/8 ||
-	    s->sad.temp < 160)
-	    return 1;
-	return 3;
+        s->sad.noise > 2*s->sad.even && s->sad.noise > 2*ps->sad.odd) {
+        // Mid-frame scene change
+        if (s->tiny.temp + s->interlaced_low  < n   ||
+            s->low.temp  + s->interlaced_high < n/4 ||
+            s->high.temp + s->interlaced_high < n/8 ||
+            s->sad.temp < 160)
+            return 1;
+        return 3;
     }
     if (s->high.temp > s->num_blocks/4 && s->sad.temp > 10000 &&
-	s->sad.temp > 2*ps->sad.odd && s->sad.temp > 2*ps->sad.even) {
-	// Start frame scene change
-	if (s->tiny.noise + s->interlaced_low  < n   ||
-	    s->low.noise  + s->interlaced_high < n/4 ||
-	    s->high.noise + s->interlaced_high < n/8 ||
-	    s->sad.noise < 160)
-	    return 2;
-	return 3;
+        s->sad.temp > 2*ps->sad.odd && s->sad.temp > 2*ps->sad.even) {
+        // Start frame scene change
+        if (s->tiny.noise + s->interlaced_low  < n   ||
+            s->low.noise  + s->interlaced_high < n/4 ||
+            s->high.noise + s->interlaced_high < n/8 ||
+            s->sad.noise < 160)
+            return 2;
+        return 3;
     }
     if (sad_comb_cmp == 2)
-	return 2;
+        return 2;
     if (sad_comb_cmp == -2)
-	return 1;
+        return 1;
 
     if (s->tiny.odd > 3*MAX(n,s->tiny.even) + s->interlaced_low)
-	return 1;
+        return 1;
     if (s->tiny.even > 3*MAX(n,s->tiny.odd)+s->interlaced_low &&
-	(!sad_comb_cmp || (s->low.noise <= n/4 && s->low.temp <= n/4)))
-	return 4;
+        (!sad_comb_cmp || (s->low.noise <= n/4 && s->low.temp <= n/4)))
+        return 4;
 
     if (s->sad.noise < 64 && s->sad.temp < 64 &&
-	s->low.noise <= n/2 && s->high.noise <= n/4 &&
-	s->low.temp  <= n/2 && s->high.temp  <= n/4)
-	goto still;
+        s->low.noise <= n/2 && s->high.noise <= n/4 &&
+        s->low.temp  <= n/2 && s->high.temp  <= n/4)
+        goto still;
 
     if (s->tiny.temp > 3*MAX(n,s->tiny.noise) + s->interlaced_low)
-	return 2;
+        return 2;
     if (s->tiny.noise > 3*MAX(n,s->tiny.temp) + s->interlaced_low)
-	return 1;
+        return 1;
 
     if (s->low.odd > 3*MAX(n/4,s->low.even) + s->interlaced_high)
-	return 1;
+        return 1;
     if (s->low.even > 3*MAX(n/4,s->low.odd)+s->interlaced_high &&
-	s->sad.even > 2*s->sad.odd &&
-	(!sad_comb_cmp || (s->low.noise <= n/4 && s->low.temp <= n/4)))
-	return 4;
+        s->sad.even > 2*s->sad.odd &&
+        (!sad_comb_cmp || (s->low.noise <= n/4 && s->low.temp <= n/4)))
+        return 4;
 
     if (s->low.temp > 3*MAX(n/4,s->low.noise) + s->interlaced_high)
-	return 2;
+        return 2;
     if (s->low.noise > 3*MAX(n/4,s->low.temp) + s->interlaced_high)
-	return 1;
+        return 1;
 
     if (sad_comb_cmp == 1 && s->sad.noise < 64)
-	return 2;
+        return 2;
     if (sad_comb_cmp == -1 && s->sad.temp < 64)
-	return 1;
+        return 1;
 
     if (s->tiny.odd <= n || (s->tiny.noise <= n/2 && s->tiny.temp <= n/2)) {
-	if (s->interlaced_low <= n) {
-	    if (p->num_fields == 1)
-		goto still;
-	    if (s->tiny.even <= n || ps->tiny.noise <= n/2)
-		/* Still frame */
-		goto still;
-	    if (s->bigger.even >= 2*MAX(n,s->bigger.odd) + s->interlaced_low)
-		return 4;
-	    if (s->low.even >= 2*n + s->interlaced_low)
-		return 4;
-	    goto still;
-	}
+        if (s->interlaced_low <= n) {
+            if (p->num_fields == 1)
+                goto still;
+            if (s->tiny.even <= n || ps->tiny.noise <= n/2)
+                /* Still frame */
+                goto still;
+            if (s->bigger.even >= 2*MAX(n,s->bigger.odd) + s->interlaced_low)
+                return 4;
+            if (s->low.even >= 2*n + s->interlaced_low)
+                return 4;
+            goto still;
+        }
     }
     if (s->low.odd <= n/4) {
-	if (s->interlaced_high <= n/4) {
-	    if (p->num_fields == 1)
-		goto still;
-	    if (s->low.even <= n/4)
-		/* Still frame */
-		goto still;
-	    if (s->bigger.even >= 2*MAX(n/4,s->bigger.odd)+s->interlaced_high)
-		return 4;
-	    if (s->low.even >= n/2 + s->interlaced_high)
-		return 4;
-	    goto still;
-	}
+        if (s->interlaced_high <= n/4) {
+            if (p->num_fields == 1)
+                goto still;
+            if (s->low.even <= n/4)
+                /* Still frame */
+                goto still;
+            if (s->bigger.even >= 2*MAX(n/4,s->bigger.odd)+s->interlaced_high)
+                return 4;
+            if (s->low.even >= n/2 + s->interlaced_high)
+                return 4;
+            goto still;
+        }
     }
     if (s->bigger.temp > 2*MAX(n,s->bigger.noise) + s->interlaced_low)
-	return 2;
+        return 2;
     if (s->bigger.noise > 2*MAX(n,s->bigger.temp) + s->interlaced_low)
-	return 1;
+        return 1;
     if (s->bigger.temp > 2*MAX(n,s->bigger.noise) + s->interlaced_high)
-	return 2;
+        return 2;
     if (s->bigger.noise > 2*MAX(n,s->bigger.temp) + s->interlaced_high)
-	return 1;
+        return 1;
     if (s->twox.temp > 2*MAX(n,s->twox.noise) + s->interlaced_high)
-	return 2;
+        return 2;
     if (s->twox.noise > 2*MAX(n,s->twox.temp) + s->interlaced_high)
-	return 1;
+        return 1;
     if (s->bigger.even > 2*MAX(n,s->bigger.odd) + s->interlaced_low &&
-	s->bigger.temp < n && s->bigger.noise < n)
-	return 4;
+        s->bigger.temp < n && s->bigger.noise < n)
+        return 4;
     if (s->interlaced_low > MIN(2*n, s->tiny.odd))
-	return 3;
+        return 3;
     ret = 8 + (1 << (s->sad.temp > s->sad.noise));
   still:
     if (p->num_fields == 1 && p->prev_fields == 3 && notfilm >= 0 &&
-	(s->tiny.temp <= s->tiny.noise || s->sad.temp < s->sad.noise+16))
-	return 1;
+        (s->tiny.temp <= s->tiny.noise || s->sad.temp < s->sad.noise+16))
+        return 1;
     if (p->notout < p->num_fields && p->iosync > 2*p->in_inc && notfilm < 0)
-	notfilm = 0;
+        notfilm = 0;
     if (p->num_fields < 2 ||
-	(p->num_fields == 2 && p->prev_fields == 2 && notfilm < 0))
-	return ret;
+        (p->num_fields == 2 && p->prev_fields == 2 && notfilm < 0))
+        return ret;
     if (!notfilm && (p->prev_fields&~1) == 2) {
-	if (p->prev_fields + p->num_fields == 5) {
-	    if (s->tiny.noise <= s->tiny.temp ||
-		s->low.noise == 0 || s->low.noise < s->low.temp ||
-		s->sad.noise < s->sad.temp+16)
-		return 2;
-	}
-	if (p->prev_fields + p->num_fields == 4) {
-	    if (s->tiny.temp <= s->tiny.noise ||
-		s->low.temp == 0 || s->low.temp < s->low.noise ||
-		s->sad.temp < s->sad.noise+16)
-		return 1;
-	}
+        if (p->prev_fields + p->num_fields == 5) {
+            if (s->tiny.noise <= s->tiny.temp ||
+                s->low.noise == 0 || s->low.noise < s->low.temp ||
+                s->sad.noise < s->sad.temp+16)
+                return 2;
+        }
+        if (p->prev_fields + p->num_fields == 4) {
+            if (s->tiny.temp <= s->tiny.noise ||
+                s->low.temp == 0 || s->low.temp < s->low.noise ||
+                s->sad.temp < s->sad.noise+16)
+                return 1;
+        }
     }
     if (p->num_fields > 2 &&
-	ps->sad.noise > s->sad.noise && ps->sad.noise > s->sad.temp)
-	return 4;
+        ps->sad.noise > s->sad.noise && ps->sad.noise > s->sad.temp)
+        return 4;
     return 2 >> (s->sad.noise > s->sad.temp);
 }
 
@@ -1157,41 +1157,41 @@
     old_planes = p->old_planes;
 
     if ((mpi->flags & MP_IMGFLAG_DIRECT) && mpi->priv) {
-	planes = mpi->priv;
-	mpi->priv = 0;
+        planes = mpi->priv;
+        mpi->priv = 0;
     } else {
-	planes = p->planes[2 + (++p->temp_idx & 1)];
-	my_memcpy_pic(planes[0],
-		      mpi->planes[0] + p->crop_x + p->crop_y * mpi->stride[0],
-		      p->w, p->h, p->stride, mpi->stride[0]);
-	if (mpi->flags & MP_IMGFLAG_PLANAR) {
-	    my_memcpy_pic(planes[1],
-			  mpi->planes[1] + p->crop_cx + p->crop_cy * mpi->stride[1],
-			  p->cw, p->ch, p->chroma_stride, mpi->stride[1]);
-	    my_memcpy_pic(planes[2],
-			  mpi->planes[2] + p->crop_cx + p->crop_cy * mpi->stride[2],
-			  p->cw, p->ch, p->chroma_stride, mpi->stride[2]);
-	    p->num_copies++;
-	}
+        planes = p->planes[2 + (++p->temp_idx & 1)];
+        my_memcpy_pic(planes[0],
+                      mpi->planes[0] + p->crop_x + p->crop_y * mpi->stride[0],
+                      p->w, p->h, p->stride, mpi->stride[0]);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(planes[1],
+                          mpi->planes[1] + p->crop_cx + p->crop_cy * mpi->stride[1],
+                          p->cw, p->ch, p->chroma_stride, mpi->stride[1]);
+            my_memcpy_pic(planes[2],
+                          mpi->planes[2] + p->crop_cx + p->crop_cy * mpi->stride[2],
+                          p->cw, p->ch, p->chroma_stride, mpi->stride[2]);
+            p->num_copies++;
+        }
     }
 
     p->old_planes = planes;
     p->chflag = ';';
     if (flags & MP_IMGFIELD_ORDERED) {
-	swapped = !(flags & MP_IMGFIELD_TOP_FIRST);
-	p->chflag = (flags & MP_IMGFIELD_REPEAT_FIRST ? '|' :
-		     flags & MP_IMGFIELD_TOP_FIRST ? ':' : '.');
+        swapped = !(flags & MP_IMGFIELD_TOP_FIRST);
+        p->chflag = (flags & MP_IMGFIELD_REPEAT_FIRST ? '|' :
+                     flags & MP_IMGFIELD_TOP_FIRST ? ':' : '.');
     }
     p->swapped = swapped;
 
     start_time = get_time();
     if (p->chflag == '|') {
-	*s = ppzs;
-	p->iosync += p->in_inc;
+        *s = ppzs;
+        p->iosync += p->in_inc;
     } else if ((p->fast & 1) && prev_chflag == '|')
-	*s = pprs;
+        *s = pprs;
     else
-	diff_fields(p, s, old_planes, planes);
+        diff_fields(p, s, old_planes, planes);
     diff_time = get_time();
     p->diff_time += diff_time - start_time;
     breaks = p->inframes ? find_breaks(p, s) : 2;
@@ -1203,132 +1203,132 @@
       case 8:
       case 9:
       case 10:
-	if (!keep_rate && p->notout < p->num_fields && p->iosync < 2*p->in_inc)
-	    break;
-	if (p->notout < p->num_fields)
-	    dropped_fields = -2;
+        if (!keep_rate && p->notout < p->num_fields && p->iosync < 2*p->in_inc)
+            break;
+        if (p->notout < p->num_fields)
+            dropped_fields = -2;
       case 4:
-	if (keep_rate || p->iosync >= -2*p->in_inc)
-	    show_fields = (4<<p->num_fields)-1;
-	break;
+        if (keep_rate || p->iosync >= -2*p->in_inc)
+            show_fields = (4<<p->num_fields)-1;
+        break;
       case 3:
-	if (keep_rate)
-	    show_fields = 2;
-	else if (p->iosync > 0) {
-	    if (p->notout >= p->num_fields && p->iosync > 2*p->in_inc) {
-		show_fields = 4; /* prev odd only */
-		if (p->num_fields > 1)
-		    show_fields |= 8; /* + prev even */
-	    } else {
-		show_fields = 2; /* even only */
-		if (p->notout >= p->num_fields)
-		    dropped_fields += p->num_fields;
-	    }
-	}
-	break;
+        if (keep_rate)
+            show_fields = 2;
+        else if (p->iosync > 0) {
+            if (p->notout >= p->num_fields && p->iosync > 2*p->in_inc) {
+                show_fields = 4; /* prev odd only */
+                if (p->num_fields > 1)
+                    show_fields |= 8; /* + prev even */
+            } else {
+                show_fields = 2; /* even only */
+                if (p->notout >= p->num_fields)
+                    dropped_fields += p->num_fields;
+            }
+        }
+        break;
       case 2:
-	if (p->iosync <= -3*p->in_inc) {
-	    if (p->notout >= p->num_fields)
-		dropped_fields = p->num_fields;
-	    break;
-	}
-	if (p->num_fields == 1) {
-	    int prevbreak = ps->sad.noise >= 128;
-	    if (p->iosync < 4*p->in_inc) {
-		show_fields = 3;
-		dropped_fields = prevbreak;
-	    } else {
-		show_fields = 4 | (!prevbreak << 3);
-		if (p->notout < 1 + p->prev_fields)
-		    dropped_fields = -!prevbreak;
-	    }
-	    break;
-	}
+        if (p->iosync <= -3*p->in_inc) {
+            if (p->notout >= p->num_fields)
+                dropped_fields = p->num_fields;
+            break;
+        }
+        if (p->num_fields == 1) {
+            int prevbreak = ps->sad.noise >= 128;
+            if (p->iosync < 4*p->in_inc) {
+                show_fields = 3;
+                dropped_fields = prevbreak;
+            } else {
+                show_fields = 4 | (!prevbreak << 3);
+                if (p->notout < 1 + p->prev_fields)
+                    dropped_fields = -!prevbreak;
+            }
+            break;
+        }
       default:
-	if (keep_rate)
-	    show_fields = 3 << (breaks & 1);
-	else if (p->notout >= p->num_fields &&
-	    p->iosync >= (breaks == 1 ? -p->in_inc :
-			  p->in_inc << (p->num_fields == 1))) {
-	    show_fields = (1 << (2 + p->num_fields)) - (1<<breaks);
-	} else {
-	    if (p->notout >= p->num_fields)
-		dropped_fields += p->num_fields + 2 - breaks;
-	    if (breaks == 1) {
-		if (p->iosync >= 4*p->in_inc)
-		    show_fields = 6;
-	    } else if (p->iosync > -3*p->in_inc)
-		show_fields = 3;  /* odd+even */
-	}
-	break;
+        if (keep_rate)
+            show_fields = 3 << (breaks & 1);
+        else if (p->notout >= p->num_fields &&
+            p->iosync >= (breaks == 1 ? -p->in_inc :
+                          p->in_inc << (p->num_fields == 1))) {
+            show_fields = (1 << (2 + p->num_fields)) - (1<<breaks);
+        } else {
+            if (p->notout >= p->num_fields)
+                dropped_fields += p->num_fields + 2 - breaks;
+            if (breaks == 1) {
+                if (p->iosync >= 4*p->in_inc)
+                    show_fields = 6;
+            } else if (p->iosync > -3*p->in_inc)
+                show_fields = 3;  /* odd+even */
+        }
+        break;
     }
 
     show_fields &= 15;
     prev = p->prev_fields;
     if (breaks < 8) {
-	if (p->num_fields == 1)
-	    breaks &= ~4;
-	if (breaks)
-	    p->num_breaks++;
-	if (breaks == 3)
-	    p->prev_fields = p->num_fields = 1;
-	else if (breaks) {
-	    p->prev_fields = p->num_fields + (breaks==1) - (breaks==4);
-	    p->num_fields = breaks - (breaks == 4) + (p->chflag == '|');
-	} else
-	    p->num_fields += 2;
+        if (p->num_fields == 1)
+            breaks &= ~4;
+        if (breaks)
+            p->num_breaks++;
+        if (breaks == 3)
+            p->prev_fields = p->num_fields = 1;
+        else if (breaks) {
+            p->prev_fields = p->num_fields + (breaks==1) - (breaks==4);
+            p->num_fields = breaks - (breaks == 4) + (p->chflag == '|');
+        } else
+            p->num_fields += 2;
     } else
-	p->num_fields += 2;
+        p->num_fields += 2;
 
     p->iosync += 4 * p->in_inc;
     if (p->chflag == '|')
-	p->iosync += p->in_inc;
+        p->iosync += p->in_inc;
 
     if (show_fields) {
-	p->iosync -= p->out_dec;
-	p->notout = !(show_fields & 1) + !(show_fields & 3);
-	if (((show_fields &  3) ==  3 &&
-	     (s->low.noise + s->interlaced_low < (s->num_blocks>>8) ||
-	      s->sad.noise < 160)) ||
-	    ((show_fields & 12) == 12 &&
-	     (ps->low.noise + ps->interlaced_low < (s->num_blocks>>8) ||
-	      ps->sad.noise < 160))) {
-	    p->export_count++;
-	    dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT,
-				MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE,
-				p->w, p->h);
-	    if ((show_fields & 3) != 3) planes = old_planes;
-	    dmpi->planes[0] = planes[0];
-	    dmpi->stride[0] = p->stride;
-	    dmpi->width = mpi->width;
-	    if (mpi->flags & MP_IMGFLAG_PLANAR) {
-		dmpi->planes[1] = planes[1];
-		dmpi->planes[2] = planes[2];
-		dmpi->stride[1] = p->chroma_stride;
-		dmpi->stride[2] = p->chroma_stride;
-	    }
-	} else {
-	    p->merge_count++;
-	    dmpi = vf_get_image(vf->next, mpi->imgfmt,
-				MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-				p->w, p->h);
-	    copy_merge_fields(p, dmpi, old_planes, planes, show_fields);
-	}
-	p->outframes++;
+        p->iosync -= p->out_dec;
+        p->notout = !(show_fields & 1) + !(show_fields & 3);
+        if (((show_fields &  3) ==  3 &&
+             (s->low.noise + s->interlaced_low < (s->num_blocks>>8) ||
+              s->sad.noise < 160)) ||
+            ((show_fields & 12) == 12 &&
+             (ps->low.noise + ps->interlaced_low < (s->num_blocks>>8) ||
+              ps->sad.noise < 160))) {
+            p->export_count++;
+            dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT,
+                                MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE,
+                                p->w, p->h);
+            if ((show_fields & 3) != 3) planes = old_planes;
+            dmpi->planes[0] = planes[0];
+            dmpi->stride[0] = p->stride;
+            dmpi->width = mpi->width;
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                dmpi->planes[1] = planes[1];
+                dmpi->planes[2] = planes[2];
+                dmpi->stride[1] = p->chroma_stride;
+                dmpi->stride[2] = p->chroma_stride;
+            }
+        } else {
+            p->merge_count++;
+            dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                                MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+                                p->w, p->h);
+            copy_merge_fields(p, dmpi, old_planes, planes, show_fields);
+        }
+        p->outframes++;
     } else
-	p->notout += 2;
+        p->notout += 2;
 
     if (p->verbose)
-	mp_msg(MSGT_VFILTER, MSGL_INFO, "%lu %lu: %x %c %c %lu%s%s%c%s\n",
-	       p->inframes, p->outframes,
-	       breaks, breaks<8 && breaks>0 ? (int) p->prev_fields+'0' : ' ',
-	       ITOC(show_fields),
-	       p->num_breaks, 5*p->in_inc == p->out_dec && breaks<8 &&
-	       breaks>0 && ((prev&~1)!=2 || prev+p->prev_fields!=5) ?
-	       " ######## bad telecine ########" : "",
-	       dropped_fields ? " ======== dropped ":"", ITOC(dropped_fields),
-	       !show_fields || (show_fields & (show_fields-1)) ?
-	       "" : " @@@@@@@@@@@@@@@@@");
+        mp_msg(MSGT_VFILTER, MSGL_INFO, "%lu %lu: %x %c %c %lu%s%s%c%s\n",
+               p->inframes, p->outframes,
+               breaks, breaks<8 && breaks>0 ? (int) p->prev_fields+'0' : ' ',
+               ITOC(show_fields),
+               p->num_breaks, 5*p->in_inc == p->out_dec && breaks<8 &&
+               breaks>0 && ((prev&~1)!=2 || prev+p->prev_fields!=5) ?
+               " ######## bad telecine ########" : "",
+               dropped_fields ? " ======== dropped ":"", ITOC(dropped_fields),
+               !show_fields || (show_fields & (show_fields-1)) ?
+               "" : " @@@@@@@@@@@@@@@@@");
 
     p->merge_time += get_time() - diff_time;
     return show_fields ? vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE) : 0;
@@ -1344,38 +1344,38 @@
       case IMGFMT_411P:
       case IMGFMT_422P:
       case IMGFMT_444P:
-	return vf_next_query_format(vf, fmt);
+        return vf_next_query_format(vf, fmt);
     }
     return 0;
 }
 
 static int config(struct vf_instance *vf,
-		  int width, int height, int d_width, int d_height,
-		  unsigned int flags, unsigned int outfmt)
+                  int width, int height, int d_width, int d_height,
+                  unsigned int flags, unsigned int outfmt)
 {
     unsigned long cxm = 0;
     unsigned long cym = 0;
     struct vf_priv_s *p = vf->priv;
     // rounding:
     if(!IMGFMT_IS_RGB(outfmt) && !IMGFMT_IS_BGR(outfmt)){
-	switch(outfmt){
-	  case IMGFMT_444P:
-	  case IMGFMT_Y800:
-	  case IMGFMT_Y8:
-	    break;
-	  case IMGFMT_YVU9:
-	  case IMGFMT_IF09:
-	    cym = 3;
-	  case IMGFMT_411P:
-	    cxm = 3;
-	    break;
-	  case IMGFMT_YV12:
-	  case IMGFMT_I420:
-	  case IMGFMT_IYUV:
-	    cym = 1;
-	  default:
-	    cxm = 1;
-	}
+        switch(outfmt){
+          case IMGFMT_444P:
+          case IMGFMT_Y800:
+          case IMGFMT_Y8:
+            break;
+          case IMGFMT_YVU9:
+          case IMGFMT_IF09:
+            cym = 3;
+          case IMGFMT_411P:
+            cxm = 3;
+            break;
+          case IMGFMT_YV12:
+          case IMGFMT_I420:
+          case IMGFMT_IYUV:
+            cym = 1;
+          default:
+            cxm = 1;
+        }
     }
     p->chroma_swapped = !!(p->crop_y & (cym+1));
     if (p->w) p->w += p->crop_x & cxm;
@@ -1388,8 +1388,8 @@
     if (p->crop_y + p->h > height) p->crop_y = 0;
 
     if(!opt_screen_size_x && !opt_screen_size_y){
-	d_width = d_width * p->w/width;
-	d_height = d_height * p->h/height;
+        d_width = d_width * p->w/width;
+        d_height = d_height * p->h/height;
     }
     return vf_next_config(vf, p->w, p->h, d_width, d_height, flags, outfmt);
 }
@@ -1398,8 +1398,8 @@
 {
     struct vf_priv_s *p = vf->priv;
     mp_msg(MSGT_VFILTER, MSGL_INFO, "diff_time: %.3f, merge_time: %.3f, "
-	   "export: %lu, merge: %lu, copy: %lu\n", p->diff_time, p->merge_time,
-	   p->export_count, p->merge_count, p->num_copies);
+           "export: %lu, merge: %lu, copy: %lu\n", p->diff_time, p->merge_time,
+           p->export_count, p->merge_count, p->num_copies);
     free(p->memory_allocated);
     free(p);
 }
@@ -1424,20 +1424,20 @@
     p->fast = 3;
     p->mmx2 = gCpuCaps.hasMMX2 ? 1 : gCpuCaps.has3DNow ? 2 : 0;
     if (args) {
-	const char *args_remain = parse_args(p, args);
-	if (args_remain) {
-	    mp_msg(MSGT_VFILTER, MSGL_FATAL,
-		   "filmdint: unknown suboption: %s\n", args_remain);
-	    return 0;
-	}
-	if (p->out_dec < p->in_inc) {
-	    mp_msg(MSGT_VFILTER, MSGL_FATAL,
-		   "filmdint: increasing the frame rate is not supported\n");
-	    return 0;
-	}
+        const char *args_remain = parse_args(p, args);
+        if (args_remain) {
+            mp_msg(MSGT_VFILTER, MSGL_FATAL,
+                   "filmdint: unknown suboption: %s\n", args_remain);
+            return 0;
+        }
+        if (p->out_dec < p->in_inc) {
+            mp_msg(MSGT_VFILTER, MSGL_FATAL,
+                   "filmdint: increasing the frame rate is not supported\n");
+            return 0;
+        }
     }
     if (p->mmx2 > 2)
-	p->mmx2 = 0;
+        p->mmx2 = 0;
 #if !HAVE_MMX
     p->mmx2 = 0;
 #endif
--- a/libmpcodecs/vf_framestep.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_framestep.c	Fri Jan 14 22:10:21 2011 +0000
@@ -122,10 +122,10 @@
     ++priv->frame_cur;
 
     if (skip == 0) {
-	/* Get image, export type (we don't modify tghe image) */
-	dmpi=vf_get_image(vf->next, mpi->imgfmt,
+        /* Get image, export type (we don't modify tghe image) */
+        dmpi=vf_get_image(vf->next, mpi->imgfmt,
                       MP_IMGTYPE_EXPORT, 0,
-	              mpi->w, mpi->h);
+                      mpi->w, mpi->h);
         /* Copy only the pointer ( MP_IMGTYPE_EXPORT ! ) */
         dmpi->planes[0] = mpi->planes[0];
         dmpi->planes[1] = mpi->planes[1];
@@ -155,12 +155,12 @@
 /* Main entry funct for the filter */
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
+        struct vf_priv_s *p;
 
         vf->put_image = put_image;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+        vf->uninit = uninit;
+        vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+        vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
         if (p == NULL) {
             return 0;
         }
@@ -192,7 +192,7 @@
                 }
             }
         }
-	return 1;
+        return 1;
 }
 
 const vf_info_t vf_info_framestep = {
--- a/libmpcodecs/vf_fspp.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_fspp.c	Fri Jan 14 22:10:21 2011 +0000
@@ -106,54 +106,54 @@
 //This func reads from 1 slice, 1 and clears 0 & 1
 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
 {int y, x;
-#define STORE(pos)							\
-    temp= (src[x + pos] + (d[pos]>>log2_scale))>>(6-log2_scale);	\
-    src[x + pos]=src[x + pos - 8*src_stride]=0;				\
-    if(temp & 0x100) temp= ~(temp>>31);					\
+#define STORE(pos)                                                        \
+    temp= (src[x + pos] + (d[pos]>>log2_scale))>>(6-log2_scale);        \
+    src[x + pos]=src[x + pos - 8*src_stride]=0;                                \
+    if(temp & 0x100) temp= ~(temp>>31);                                        \
     dst[x + pos]= temp;
 
     for(y=0; y<height; y++){
-	const uint8_t *d= dither[y];
-	for(x=0; x<width; x+=8){
-	    int temp;
-	    STORE(0);
-	    STORE(1);
-	    STORE(2);
-	    STORE(3);
-	    STORE(4);
-	    STORE(5);
-	    STORE(6);
-	    STORE(7);
-	}
-	src+=src_stride;
-	dst+=dst_stride;
+        const uint8_t *d= dither[y];
+        for(x=0; x<width; x+=8){
+            int temp;
+            STORE(0);
+            STORE(1);
+            STORE(2);
+            STORE(3);
+            STORE(4);
+            STORE(5);
+            STORE(6);
+            STORE(7);
+        }
+        src+=src_stride;
+        dst+=dst_stride;
     }
 }
 
 //This func reads from 2 slices, 0 & 2  and clears 2-nd
 static void store_slice2_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
 {int y, x;
-#define STORE2(pos)							\
-    temp= (src[x + pos] + src[x + pos + 16*src_stride] + (d[pos]>>log2_scale))>>(6-log2_scale);	\
-    src[x + pos + 16*src_stride]=0;					\
-    if(temp & 0x100) temp= ~(temp>>31);					\
+#define STORE2(pos)                                                        \
+    temp= (src[x + pos] + src[x + pos + 16*src_stride] + (d[pos]>>log2_scale))>>(6-log2_scale);        \
+    src[x + pos + 16*src_stride]=0;                                        \
+    if(temp & 0x100) temp= ~(temp>>31);                                        \
     dst[x + pos]= temp;
 
     for(y=0; y<height; y++){
-	const uint8_t *d= dither[y];
-	for(x=0; x<width; x+=8){
-	    int temp;
-	    STORE2(0);
-	    STORE2(1);
-	    STORE2(2);
-	    STORE2(3);
-	    STORE2(4);
-	    STORE2(5);
-	    STORE2(6);
-	    STORE2(7);
-	}
-	src+=src_stride;
-	dst+=dst_stride;
+        const uint8_t *d= dither[y];
+        for(x=0; x<width; x+=8){
+            int temp;
+            STORE2(0);
+            STORE2(1);
+            STORE2(2);
+            STORE2(3);
+            STORE2(4);
+            STORE2(5);
+            STORE2(6);
+            STORE2(7);
+        }
+        src+=src_stride;
+        dst+=dst_stride;
     }
 }
 
@@ -161,12 +161,12 @@
 {
     int a;
     for(a=0;a<64;a++)
-	((short*)p->threshold_mtx)[a]=q * ((short*)p->threshold_mtx_noq)[a];//ints faster in C
+        ((short*)p->threshold_mtx)[a]=q * ((short*)p->threshold_mtx_noq)[a];//ints faster in C
 }
 
 static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt);
 static void row_idct_c(DCTELEM* workspace,
-		       int16_t* output_adr, int output_stride, int cnt);
+                       int16_t* output_adr, int output_stride, int cnt);
 static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt);
 
 //this is rather ugly, but there is no need for function pointers
@@ -188,63 +188,63 @@
     dst_stride-=width;
     //src_stride=(src_stride-width)*2;
     __asm__ volatile(
-	"mov %5, %%"REG_d"                \n\t"
-	"mov %6, %%"REG_S"                \n\t"
-	"mov %7, %%"REG_D"                \n\t"
-	"mov %1, %%"REG_a"                \n\t"
-	"movd %%"REG_d", %%mm5             \n\t"
-	"xor $-1, %%"REG_d"              \n\t"
-	"mov %%"REG_a", %%"REG_c"             \n\t"
-	"add $7, %%"REG_d"               \n\t"
-	"neg %%"REG_a"                   \n\t"
-	"sub %0, %%"REG_c"            \n\t"
-	"add %%"REG_c", %%"REG_c"             \n\t"
-	"movd %%"REG_d", %%mm2             \n\t"
-	"mov %%"REG_c", %1       \n\t"
-	"mov %2, %%"REG_d"               \n\t"
-	"shl $4, %%"REG_a"               \n\t"
-
-	"2:                        \n\t"
-	"movq (%%"REG_d"), %%mm3           \n\t"
-	"movq %%mm3, %%mm4             \n\t"
-	"pxor %%mm7, %%mm7             \n\t"
-	"punpcklbw %%mm7, %%mm3        \n\t"
-	"punpckhbw %%mm7, %%mm4        \n\t"
-	"mov %0, %%"REG_c"            \n\t"
-	"psraw %%mm5, %%mm3            \n\t"
-	"psraw %%mm5, %%mm4            \n\t"
-	"1:                        \n\t"
-	"movq %%mm7, (%%"REG_S",%%"REG_a",)     \n\t"
-	"movq (%%"REG_S"), %%mm0           \n\t"
-	"movq 8(%%"REG_S"), %%mm1          \n\t"
-
-	"movq %%mm7, 8(%%"REG_S",%%"REG_a",)    \n\t"
-	"paddw %%mm3, %%mm0            \n\t"
-	"paddw %%mm4, %%mm1            \n\t"
-
-	"movq %%mm7, (%%"REG_S")           \n\t"
-	"psraw %%mm2, %%mm0            \n\t"
-	"psraw %%mm2, %%mm1            \n\t"
-
-	"movq %%mm7, 8(%%"REG_S")          \n\t"
-	"packuswb %%mm1, %%mm0         \n\t"
-	"add $16, %%"REG_S"              \n\t"
-
-	"movq %%mm0, (%%"REG_D")           \n\t"
-	"add $8, %%"REG_D"               \n\t"
-	"sub $8, %%"REG_c"               \n\t"
-	"jg 1b                      \n\t"
-	"add %1, %%"REG_S"       \n\t"
-	"add $8, %%"REG_d"               \n\t"
-	"add %3, %%"REG_D"       \n\t"
-	"cmp %4, %%"REG_d"           \n\t"
-	"jl 2b                      \n\t"
-
-	:
-	: "m" (width), "m" (src_stride), "erm" (od), "m" (dst_stride), "erm" (end),
-	  "m" (log2_scale), "m" (src), "m" (dst) //input
-	: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
-	);
+        "mov %5, %%"REG_d"                \n\t"
+        "mov %6, %%"REG_S"                \n\t"
+        "mov %7, %%"REG_D"                \n\t"
+        "mov %1, %%"REG_a"                \n\t"
+        "movd %%"REG_d", %%mm5             \n\t"
+        "xor $-1, %%"REG_d"              \n\t"
+        "mov %%"REG_a", %%"REG_c"             \n\t"
+        "add $7, %%"REG_d"               \n\t"
+        "neg %%"REG_a"                   \n\t"
+        "sub %0, %%"REG_c"            \n\t"
+        "add %%"REG_c", %%"REG_c"             \n\t"
+        "movd %%"REG_d", %%mm2             \n\t"
+        "mov %%"REG_c", %1       \n\t"
+        "mov %2, %%"REG_d"               \n\t"
+        "shl $4, %%"REG_a"               \n\t"
+
+        "2:                        \n\t"
+        "movq (%%"REG_d"), %%mm3           \n\t"
+        "movq %%mm3, %%mm4             \n\t"
+        "pxor %%mm7, %%mm7             \n\t"
+        "punpcklbw %%mm7, %%mm3        \n\t"
+        "punpckhbw %%mm7, %%mm4        \n\t"
+        "mov %0, %%"REG_c"            \n\t"
+        "psraw %%mm5, %%mm3            \n\t"
+        "psraw %%mm5, %%mm4            \n\t"
+        "1:                        \n\t"
+        "movq %%mm7, (%%"REG_S",%%"REG_a",)     \n\t"
+        "movq (%%"REG_S"), %%mm0           \n\t"
+        "movq 8(%%"REG_S"), %%mm1          \n\t"
+
+        "movq %%mm7, 8(%%"REG_S",%%"REG_a",)    \n\t"
+        "paddw %%mm3, %%mm0            \n\t"
+        "paddw %%mm4, %%mm1            \n\t"
+
+        "movq %%mm7, (%%"REG_S")           \n\t"
+        "psraw %%mm2, %%mm0            \n\t"
+        "psraw %%mm2, %%mm1            \n\t"
+
+        "movq %%mm7, 8(%%"REG_S")          \n\t"
+        "packuswb %%mm1, %%mm0         \n\t"
+        "add $16, %%"REG_S"              \n\t"
+
+        "movq %%mm0, (%%"REG_D")           \n\t"
+        "add $8, %%"REG_D"               \n\t"
+        "sub $8, %%"REG_c"               \n\t"
+        "jg 1b                      \n\t"
+        "add %1, %%"REG_S"       \n\t"
+        "add $8, %%"REG_d"               \n\t"
+        "add %3, %%"REG_D"       \n\t"
+        "cmp %4, %%"REG_d"           \n\t"
+        "jl 2b                      \n\t"
+
+        :
+        : "m" (width), "m" (src_stride), "erm" (od), "m" (dst_stride), "erm" (end),
+          "m" (log2_scale), "m" (src), "m" (dst) //input
+        : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
+        );
 }
 
 //This func reads from 2 slices, 0 & 2  and clears 2-nd
@@ -256,146 +256,146 @@
     dst_stride-=width;
     //src_stride=(src_stride-width)*2;
     __asm__ volatile(
-	"mov %5, %%"REG_d"                \n\t"
-	"mov %6, %%"REG_S"                \n\t"
-	"mov %7, %%"REG_D"                \n\t"
-	"mov %1, %%"REG_a"            \n\t"
-	"movd %%"REG_d", %%mm5             \n\t"
-	"xor $-1, %%"REG_d"              \n\t"
-	"mov %%"REG_a", %%"REG_c"             \n\t"
-	"add $7, %%"REG_d"               \n\t"
-	"sub %0, %%"REG_c"            \n\t"
-	"add %%"REG_c", %%"REG_c"             \n\t"
-	"movd %%"REG_d", %%mm2             \n\t"
-	"mov %%"REG_c", %1       \n\t"
-	"mov %2, %%"REG_d"               \n\t"
-	"shl $5, %%"REG_a"               \n\t"
-
-	"2:                        \n\t"
-	"movq (%%"REG_d"), %%mm3           \n\t"
-	"movq %%mm3, %%mm4             \n\t"
-	"pxor %%mm7, %%mm7             \n\t"
-	"punpcklbw %%mm7, %%mm3        \n\t"
-	"punpckhbw %%mm7, %%mm4        \n\t"
-	"mov %0, %%"REG_c"            \n\t"
-	"psraw %%mm5, %%mm3            \n\t"
-	"psraw %%mm5, %%mm4            \n\t"
-	"1:                        \n\t"
-	"movq (%%"REG_S"), %%mm0           \n\t"
-	"movq 8(%%"REG_S"), %%mm1          \n\t"
-	"paddw %%mm3, %%mm0            \n\t"
-
-	"paddw (%%"REG_S",%%"REG_a",), %%mm0    \n\t"
-	"paddw %%mm4, %%mm1            \n\t"
-	"movq 8(%%"REG_S",%%"REG_a",), %%mm6    \n\t"
-
-	"movq %%mm7, (%%"REG_S",%%"REG_a",)     \n\t"
-	"psraw %%mm2, %%mm0            \n\t"
-	"paddw %%mm6, %%mm1            \n\t"
-
-	"movq %%mm7, 8(%%"REG_S",%%"REG_a",)    \n\t"
-	"psraw %%mm2, %%mm1            \n\t"
-	"packuswb %%mm1, %%mm0         \n\t"
-
-	"movq %%mm0, (%%"REG_D")           \n\t"
-	"add $16, %%"REG_S"              \n\t"
-	"add $8, %%"REG_D"               \n\t"
-	"sub $8, %%"REG_c"               \n\t"
-	"jg 1b                      \n\t"
-	"add %1, %%"REG_S"       \n\t"
-	"add $8, %%"REG_d"               \n\t"
-	"add %3, %%"REG_D"       \n\t"
-	"cmp %4, %%"REG_d"           \n\t"
-	"jl 2b                      \n\t"
-
-	:
-	: "m" (width), "m" (src_stride), "erm" (od), "m" (dst_stride), "erm" (end),
-	  "m" (log2_scale), "m" (src), "m" (dst) //input
-	: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_D, "%"REG_S
-	);
+        "mov %5, %%"REG_d"                \n\t"
+        "mov %6, %%"REG_S"                \n\t"
+        "mov %7, %%"REG_D"                \n\t"
+        "mov %1, %%"REG_a"            \n\t"
+        "movd %%"REG_d", %%mm5             \n\t"
+        "xor $-1, %%"REG_d"              \n\t"
+        "mov %%"REG_a", %%"REG_c"             \n\t"
+        "add $7, %%"REG_d"               \n\t"
+        "sub %0, %%"REG_c"            \n\t"
+        "add %%"REG_c", %%"REG_c"             \n\t"
+        "movd %%"REG_d", %%mm2             \n\t"
+        "mov %%"REG_c", %1       \n\t"
+        "mov %2, %%"REG_d"               \n\t"
+        "shl $5, %%"REG_a"               \n\t"
+
+        "2:                        \n\t"
+        "movq (%%"REG_d"), %%mm3           \n\t"
+        "movq %%mm3, %%mm4             \n\t"
+        "pxor %%mm7, %%mm7             \n\t"
+        "punpcklbw %%mm7, %%mm3        \n\t"
+        "punpckhbw %%mm7, %%mm4        \n\t"
+        "mov %0, %%"REG_c"            \n\t"
+        "psraw %%mm5, %%mm3            \n\t"
+        "psraw %%mm5, %%mm4            \n\t"
+        "1:                        \n\t"
+        "movq (%%"REG_S"), %%mm0           \n\t"
+        "movq 8(%%"REG_S"), %%mm1          \n\t"
+        "paddw %%mm3, %%mm0            \n\t"
+
+        "paddw (%%"REG_S",%%"REG_a",), %%mm0    \n\t"
+        "paddw %%mm4, %%mm1            \n\t"
+        "movq 8(%%"REG_S",%%"REG_a",), %%mm6    \n\t"
+
+        "movq %%mm7, (%%"REG_S",%%"REG_a",)     \n\t"
+        "psraw %%mm2, %%mm0            \n\t"
+        "paddw %%mm6, %%mm1            \n\t"
+
+        "movq %%mm7, 8(%%"REG_S",%%"REG_a",)    \n\t"
+        "psraw %%mm2, %%mm1            \n\t"
+        "packuswb %%mm1, %%mm0         \n\t"
+
+        "movq %%mm0, (%%"REG_D")           \n\t"
+        "add $16, %%"REG_S"              \n\t"
+        "add $8, %%"REG_D"               \n\t"
+        "sub $8, %%"REG_c"               \n\t"
+        "jg 1b                      \n\t"
+        "add %1, %%"REG_S"       \n\t"
+        "add $8, %%"REG_d"               \n\t"
+        "add %3, %%"REG_D"       \n\t"
+        "cmp %4, %%"REG_d"           \n\t"
+        "jl 2b                      \n\t"
+
+        :
+        : "m" (width), "m" (src_stride), "erm" (od), "m" (dst_stride), "erm" (end),
+          "m" (log2_scale), "m" (src), "m" (dst) //input
+        : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_D, "%"REG_S
+        );
 }
 
 static void mul_thrmat_mmx(struct vf_priv_s *p, int q)
 {
     uint64_t *adr=&p->threshold_mtx_noq[0];
     __asm__ volatile(
-	"movd %0, %%mm7                \n\t"
-	"add $8*8*2, %%"REG_D"            \n\t"
-	"movq 0*8(%%"REG_S"), %%mm0        \n\t"
-	"punpcklwd %%mm7, %%mm7        \n\t"
-	"movq 1*8(%%"REG_S"), %%mm1        \n\t"
-	"punpckldq %%mm7, %%mm7        \n\t"
-	"pmullw %%mm7, %%mm0           \n\t"
-
-	"movq 2*8(%%"REG_S"), %%mm2        \n\t"
-	"pmullw %%mm7, %%mm1           \n\t"
-
-	"movq 3*8(%%"REG_S"), %%mm3        \n\t"
-	"pmullw %%mm7, %%mm2           \n\t"
-
-	"movq %%mm0, 0*8(%%"REG_D")        \n\t"
-	"movq 4*8(%%"REG_S"), %%mm4        \n\t"
-	"pmullw %%mm7, %%mm3           \n\t"
-
-	"movq %%mm1, 1*8(%%"REG_D")        \n\t"
-	"movq 5*8(%%"REG_S"), %%mm5        \n\t"
-	"pmullw %%mm7, %%mm4           \n\t"
-
-	"movq %%mm2, 2*8(%%"REG_D")        \n\t"
-	"movq 6*8(%%"REG_S"), %%mm6        \n\t"
-	"pmullw %%mm7, %%mm5           \n\t"
-
-	"movq %%mm3, 3*8(%%"REG_D")        \n\t"
-	"movq 7*8+0*8(%%"REG_S"), %%mm0    \n\t"
-	"pmullw %%mm7, %%mm6           \n\t"
-
-	"movq %%mm4, 4*8(%%"REG_D")        \n\t"
-	"movq 7*8+1*8(%%"REG_S"), %%mm1    \n\t"
-	"pmullw %%mm7, %%mm0           \n\t"
-
-	"movq %%mm5, 5*8(%%"REG_D")        \n\t"
-	"movq 7*8+2*8(%%"REG_S"), %%mm2    \n\t"
-	"pmullw %%mm7, %%mm1           \n\t"
-
-	"movq %%mm6, 6*8(%%"REG_D")        \n\t"
-	"movq 7*8+3*8(%%"REG_S"), %%mm3    \n\t"
-	"pmullw %%mm7, %%mm2           \n\t"
-
-	"movq %%mm0, 7*8+0*8(%%"REG_D")    \n\t"
-	"movq 7*8+4*8(%%"REG_S"), %%mm4    \n\t"
-	"pmullw %%mm7, %%mm3           \n\t"
-
-	"movq %%mm1, 7*8+1*8(%%"REG_D")    \n\t"
-	"movq 7*8+5*8(%%"REG_S"), %%mm5    \n\t"
-	"pmullw %%mm7, %%mm4           \n\t"
-
-	"movq %%mm2, 7*8+2*8(%%"REG_D")    \n\t"
-	"movq 7*8+6*8(%%"REG_S"), %%mm6    \n\t"
-	"pmullw %%mm7, %%mm5           \n\t"
-
-	"movq %%mm3, 7*8+3*8(%%"REG_D")    \n\t"
-	"movq 14*8+0*8(%%"REG_S"), %%mm0   \n\t"
-	"pmullw %%mm7, %%mm6           \n\t"
-
-	"movq %%mm4, 7*8+4*8(%%"REG_D")    \n\t"
-	"movq 14*8+1*8(%%"REG_S"), %%mm1   \n\t"
-	"pmullw %%mm7, %%mm0           \n\t"
-
-	"movq %%mm5, 7*8+5*8(%%"REG_D")    \n\t"
-	"pmullw %%mm7, %%mm1           \n\t"
-
-	"movq %%mm6, 7*8+6*8(%%"REG_D")    \n\t"
-	"movq %%mm0, 14*8+0*8(%%"REG_D")   \n\t"
-	"movq %%mm1, 14*8+1*8(%%"REG_D")   \n\t"
-
-	: "+g" (q), "+S" (adr), "+D" (adr)
-	:
-	);
+        "movd %0, %%mm7                \n\t"
+        "add $8*8*2, %%"REG_D"            \n\t"
+        "movq 0*8(%%"REG_S"), %%mm0        \n\t"
+        "punpcklwd %%mm7, %%mm7        \n\t"
+        "movq 1*8(%%"REG_S"), %%mm1        \n\t"
+        "punpckldq %%mm7, %%mm7        \n\t"
+        "pmullw %%mm7, %%mm0           \n\t"
+
+        "movq 2*8(%%"REG_S"), %%mm2        \n\t"
+        "pmullw %%mm7, %%mm1           \n\t"
+
+        "movq 3*8(%%"REG_S"), %%mm3        \n\t"
+        "pmullw %%mm7, %%mm2           \n\t"
+
+        "movq %%mm0, 0*8(%%"REG_D")        \n\t"
+        "movq 4*8(%%"REG_S"), %%mm4        \n\t"
+        "pmullw %%mm7, %%mm3           \n\t"
+
+        "movq %%mm1, 1*8(%%"REG_D")        \n\t"
+        "movq 5*8(%%"REG_S"), %%mm5        \n\t"
+        "pmullw %%mm7, %%mm4           \n\t"
+
+        "movq %%mm2, 2*8(%%"REG_D")        \n\t"
+        "movq 6*8(%%"REG_S"), %%mm6        \n\t"
+        "pmullw %%mm7, %%mm5           \n\t"
+
+        "movq %%mm3, 3*8(%%"REG_D")        \n\t"
+        "movq 7*8+0*8(%%"REG_S"), %%mm0    \n\t"
+        "pmullw %%mm7, %%mm6           \n\t"
+
+        "movq %%mm4, 4*8(%%"REG_D")        \n\t"
+        "movq 7*8+1*8(%%"REG_S"), %%mm1    \n\t"
+        "pmullw %%mm7, %%mm0           \n\t"
+
+        "movq %%mm5, 5*8(%%"REG_D")        \n\t"
+        "movq 7*8+2*8(%%"REG_S"), %%mm2    \n\t"
+        "pmullw %%mm7, %%mm1           \n\t"
+
+        "movq %%mm6, 6*8(%%"REG_D")        \n\t"
+        "movq 7*8+3*8(%%"REG_S"), %%mm3    \n\t"
+        "pmullw %%mm7, %%mm2           \n\t"
+
+        "movq %%mm0, 7*8+0*8(%%"REG_D")    \n\t"
+        "movq 7*8+4*8(%%"REG_S"), %%mm4    \n\t"
+        "pmullw %%mm7, %%mm3           \n\t"
+
+        "movq %%mm1, 7*8+1*8(%%"REG_D")    \n\t"
+        "movq 7*8+5*8(%%"REG_S"), %%mm5    \n\t"
+        "pmullw %%mm7, %%mm4           \n\t"
+
+        "movq %%mm2, 7*8+2*8(%%"REG_D")    \n\t"
+        "movq 7*8+6*8(%%"REG_S"), %%mm6    \n\t"
+        "pmullw %%mm7, %%mm5           \n\t"
+
+        "movq %%mm3, 7*8+3*8(%%"REG_D")    \n\t"
+        "movq 14*8+0*8(%%"REG_S"), %%mm0   \n\t"
+        "pmullw %%mm7, %%mm6           \n\t"
+
+        "movq %%mm4, 7*8+4*8(%%"REG_D")    \n\t"
+        "movq 14*8+1*8(%%"REG_S"), %%mm1   \n\t"
+        "pmullw %%mm7, %%mm0           \n\t"
+
+        "movq %%mm5, 7*8+5*8(%%"REG_D")    \n\t"
+        "pmullw %%mm7, %%mm1           \n\t"
+
+        "movq %%mm6, 7*8+6*8(%%"REG_D")    \n\t"
+        "movq %%mm0, 14*8+0*8(%%"REG_D")   \n\t"
+        "movq %%mm1, 14*8+1*8(%%"REG_D")   \n\t"
+
+        : "+g" (q), "+S" (adr), "+D" (adr)
+        :
+        );
 }
 
 static void column_fidct_mmx(int16_t* thr_adr,  DCTELEM *data,  DCTELEM *output,  int cnt);
 static void row_idct_mmx(DCTELEM* workspace,
-			 int16_t* output_adr,  int output_stride,  int cnt);
+                         int16_t* output_adr,  int output_stride,  int cnt);
 static void row_fdct_mmx(DCTELEM *data,  const uint8_t *pixels,  int line_size,  int cnt);
 
 #define store_slice_s store_slice_mmx
@@ -407,9 +407,9 @@
 #endif // HAVE_MMX
 
 static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src,
-		   int dst_stride, int src_stride,
-		   int width, int height,
-		   uint8_t *qp_store, int qp_stride, int is_luma)
+                   int dst_stride, int src_stride,
+                   int width, int height,
+                   uint8_t *qp_store, int qp_stride, int is_luma)
 {
     int x, x0, y, es, qy, t;
     const int stride= is_luma ? p->temp_stride : (width+16);//((width+16+15)&(~15))
@@ -438,57 +438,57 @@
     //FIXME (try edge emu)
 
     for(y=8; y<24; y++)
-	memset(p->temp+ 8 +y*stride, 0,width*sizeof(int16_t));
+        memset(p->temp+ 8 +y*stride, 0,width*sizeof(int16_t));
 
     for(y=step; y<height+8; y+=step){    //step= 1,2
-	qy=y-4;
-	if (qy>height-1) qy=height-1;
-	if (qy<0) qy=0;
-	qy=(qy>>qps)*qp_stride;
-	row_fdct_s(block, p->src + y*stride +2-(y&1), stride, 2);
-	for(x0=0; x0<width+8-8*(BLOCKSZ-1); x0+=8*(BLOCKSZ-1)){
-	    row_fdct_s(block+8*8, p->src + y*stride+8+x0 +2-(y&1), stride, 2*(BLOCKSZ-1));
-	    if(p->qp)
-		column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+0*8, block3+0*8, 8*(BLOCKSZ-1)); //yes, this is a HOTSPOT
-	    else
-		for (x=0; x<8*(BLOCKSZ-1); x+=8) {
-		    t=x+x0-2; //correct t=x+x0-2-(y&1), but its the same
-		    if (t<0) t=0;//t always < width-2
-		    t=qp_store[qy+(t>>qps)];
-		    t=norm_qscale(t, p->mpeg2);
-		    if (t!=p->prev_q) p->prev_q=t, mul_thrmat_s(p, t);
-		    column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT
-		}
-	    row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1));
-	    memmove(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling
-	    memmove(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(DCTELEM));
-	}
-	//
-	es=width+8-x0; //  8, ...
-	if (es>8)
-	    row_fdct_s(block+8*8, p->src + y*stride+8+x0 +2-(y&1), stride, (es-4)>>2);
-	column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block, block3, es&(~1));
-	row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, es>>2);
-	{const int y1=y-8+step;//l5-7  l4-6
-	    if (!(y1&7) && y1) {
-		if (y1&8) store_slice_s(dst + (y1-8)*dst_stride, p->temp+ 8 +8*stride,
-					dst_stride, stride, width, 8, 5-p->log2_count);
-		else store_slice2_s(dst + (y1-8)*dst_stride, p->temp+ 8 +0*stride,
-				    dst_stride, stride, width, 8, 5-p->log2_count);
-	    } }
+        qy=y-4;
+        if (qy>height-1) qy=height-1;
+        if (qy<0) qy=0;
+        qy=(qy>>qps)*qp_stride;
+        row_fdct_s(block, p->src + y*stride +2-(y&1), stride, 2);
+        for(x0=0; x0<width+8-8*(BLOCKSZ-1); x0+=8*(BLOCKSZ-1)){
+            row_fdct_s(block+8*8, p->src + y*stride+8+x0 +2-(y&1), stride, 2*(BLOCKSZ-1));
+            if(p->qp)
+                column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+0*8, block3+0*8, 8*(BLOCKSZ-1)); //yes, this is a HOTSPOT
+            else
+                for (x=0; x<8*(BLOCKSZ-1); x+=8) {
+                    t=x+x0-2; //correct t=x+x0-2-(y&1), but its the same
+                    if (t<0) t=0;//t always < width-2
+                    t=qp_store[qy+(t>>qps)];
+                    t=norm_qscale(t, p->mpeg2);
+                    if (t!=p->prev_q) p->prev_q=t, mul_thrmat_s(p, t);
+                    column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT
+                }
+            row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1));
+            memmove(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling
+            memmove(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(DCTELEM));
+        }
+        //
+        es=width+8-x0; //  8, ...
+        if (es>8)
+            row_fdct_s(block+8*8, p->src + y*stride+8+x0 +2-(y&1), stride, (es-4)>>2);
+        column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block, block3, es&(~1));
+        row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, es>>2);
+        {const int y1=y-8+step;//l5-7  l4-6
+            if (!(y1&7) && y1) {
+                if (y1&8) store_slice_s(dst + (y1-8)*dst_stride, p->temp+ 8 +8*stride,
+                                        dst_stride, stride, width, 8, 5-p->log2_count);
+                else store_slice2_s(dst + (y1-8)*dst_stride, p->temp+ 8 +0*stride,
+                                    dst_stride, stride, width, 8, 5-p->log2_count);
+            } }
     }
 
     if (y&7) {  // == height & 7
-	if (y&8) store_slice_s(dst + ((y-8)&~7)*dst_stride, p->temp+ 8 +8*stride,
-			       dst_stride, stride, width, y&7, 5-p->log2_count);
-	else store_slice2_s(dst + ((y-8)&~7)*dst_stride, p->temp+ 8 +0*stride,
-			    dst_stride, stride, width, y&7, 5-p->log2_count);
+        if (y&8) store_slice_s(dst + ((y-8)&~7)*dst_stride, p->temp+ 8 +8*stride,
+                               dst_stride, stride, width, y&7, 5-p->log2_count);
+        else store_slice2_s(dst + ((y-8)&~7)*dst_stride, p->temp+ 8 +0*stride,
+                            dst_stride, stride, width, y&7, 5-p->log2_count);
     }
 }
 
 static int config(struct vf_instance *vf,
-		  int width, int height, int d_width, int d_height,
-		  unsigned int flags, unsigned int outfmt)
+                  int width, int height, int d_width, int d_height,
+                  unsigned int flags, unsigned int outfmt)
 {
     int h= (height+16+15)&(~15);
 
@@ -505,7 +505,7 @@
     if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
     // ok, we can do pp in-place (or pp disabled):
     vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
-			  mpi->type, mpi->flags, mpi->width, mpi->height);
+                          mpi->type, mpi->flags, mpi->width, mpi->height);
     mpi->planes[0]=vf->dmpi->planes[0];
     mpi->stride[0]=vf->dmpi->stride[0];
     mpi->width=vf->dmpi->width;
@@ -522,14 +522,14 @@
 {
     mp_image_t *dmpi;
     if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-	// no DR, so get a new image! hope we'll get DR buffer:
-	dmpi=vf_get_image(vf->next,mpi->imgfmt,
-			  MP_IMGTYPE_TEMP,
-			  MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
-			  mpi->width,mpi->height);
-	vf_clone_mpi_attributes(dmpi, mpi);
+        // no DR, so get a new image! hope we'll get DR buffer:
+        dmpi=vf_get_image(vf->next,mpi->imgfmt,
+                          MP_IMGTYPE_TEMP,
+                          MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
+                          mpi->width,mpi->height);
+        vf_clone_mpi_attributes(dmpi, mpi);
     }else{
-	dmpi=vf->dmpi;
+        dmpi=vf->dmpi;
     }
 
     vf->priv->mpeg2= mpi->qscale_type;
@@ -545,22 +545,22 @@
         fast_memcpy(vf->priv->non_b_qp, mpi->qscale, w*h);
     }
     if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
-	char *qp_tab= vf->priv->non_b_qp;
-	if(vf->priv->bframes || !qp_tab)
-	    qp_tab= mpi->qscale;
-
-	if(qp_tab || vf->priv->qp){
-	    filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0],
-		   mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
-	    filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1],
-		   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
-	    filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2],
-		   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
-	}else{
-	    memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
-	    memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
-	    memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
-	}
+        char *qp_tab= vf->priv->non_b_qp;
+        if(vf->priv->bframes || !qp_tab)
+            qp_tab= mpi->qscale;
+
+        if(qp_tab || vf->priv->qp){
+            filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0],
+                   mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
+            filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1],
+                   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
+            filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2],
+                   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
+        }else{
+            memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
+            memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
+            memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
+        }
     }
 
 #if HAVE_MMX
@@ -605,7 +605,7 @@
     case IMGFMT_444P:
     case IMGFMT_422P:
     case IMGFMT_411P:
-	return vf_next_query_format(vf,fmt);
+        return vf_next_query_format(vf,fmt);
     }
     return 0;
 }
@@ -650,7 +650,7 @@
     if( log2c >=4 && log2c <=5 )
         vf->priv->log2_count = log2c;
     else if( log2c >= 6 )
-	vf->priv->log2_count = 5;
+        vf->priv->log2_count = 5;
 
     if(vf->priv->qp < 0)
         vf->priv->qp = 0;
@@ -662,16 +662,16 @@
     vf->priv->prev_q=0;
     //
     for(i=0;i<64;i++) //FIXME: tune custom_threshold[] and remove this !
-	custom_threshold_m[i]=(int)(custom_threshold[i]*(bias/71.)+ 0.5);
+        custom_threshold_m[i]=(int)(custom_threshold[i]*(bias/71.)+ 0.5);
     for(i=0;i<8;i++){
-	vf->priv->threshold_mtx_noq[2*i]=(uint64_t)custom_threshold_m[i*8+2]
-	    |(((uint64_t)custom_threshold_m[i*8+6])<<16)
-	    |(((uint64_t)custom_threshold_m[i*8+0])<<32)
-	    |(((uint64_t)custom_threshold_m[i*8+4])<<48);
-	vf->priv->threshold_mtx_noq[2*i+1]=(uint64_t)custom_threshold_m[i*8+5]
-	    |(((uint64_t)custom_threshold_m[i*8+3])<<16)
-	    |(((uint64_t)custom_threshold_m[i*8+1])<<32)
-	    |(((uint64_t)custom_threshold_m[i*8+7])<<48);
+        vf->priv->threshold_mtx_noq[2*i]=(uint64_t)custom_threshold_m[i*8+2]
+            |(((uint64_t)custom_threshold_m[i*8+6])<<16)
+            |(((uint64_t)custom_threshold_m[i*8+0])<<32)
+            |(((uint64_t)custom_threshold_m[i*8+4])<<48);
+        vf->priv->threshold_mtx_noq[2*i+1]=(uint64_t)custom_threshold_m[i*8+5]
+            |(((uint64_t)custom_threshold_m[i*8+3])<<16)
+            |(((uint64_t)custom_threshold_m[i*8+1])<<32)
+            |(((uint64_t)custom_threshold_m[i*8+7])<<48);
     }
 
     if (vf->priv->qp) vf->priv->prev_q=vf->priv->qp, mul_thrmat_s(vf->priv, vf->priv->qp);
@@ -761,110 +761,110 @@
     wsptr = output;
 
     for (; cnt > 0; cnt-=2) { //start positions
-	threshold=(int16_t*)thr_adr;//threshold_mtx
-	for (ctr = DCTSIZE; ctr > 0; ctr--) {
-	    // Process columns from input, add to output.
-	    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
-	    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
-
-	    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
-	    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
-
-	    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
-	    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
-
-	    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
-	    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
-	    // Even part of FDCT
-
-	    tmp10 = tmp0 + tmp3;
-	    tmp13 = tmp0 - tmp3;
-	    tmp11 = tmp1 + tmp2;
-	    tmp12 = tmp1 - tmp2;
-
-	    d0 = tmp10 + tmp11;
-	    d4 = tmp10 - tmp11;
-
-	    z1 = MULTIPLY16H((tmp12 + tmp13) <<2, FIX_0_707106781);
-	    d2 = tmp13 + z1;
-	    d6 = tmp13 - z1;
-
-	    // Even part of IDCT
-
-	    THRESHOLD(tmp0, d0, threshold[0*8]);
-	    THRESHOLD(tmp1, d2, threshold[2*8]);
-	    THRESHOLD(tmp2, d4, threshold[4*8]);
-	    THRESHOLD(tmp3, d6, threshold[6*8]);
-	    tmp0+=2;
-	    tmp10 = (tmp0 + tmp2)>>2;
-	    tmp11 = (tmp0 - tmp2)>>2;
-
-	    tmp13 = (tmp1 + tmp3)>>2; //+2 !  (psnr decides)
-	    tmp12 = MULTIPLY16H((tmp1 - tmp3), FIX_1_414213562_A) - tmp13; //<<2
-
-	    tmp0 = tmp10 + tmp13; //->temps
-	    tmp3 = tmp10 - tmp13; //->temps
-	    tmp1 = tmp11 + tmp12; //->temps
-	    tmp2 = tmp11 - tmp12; //->temps
-
-	    // Odd part of FDCT
-
-	    tmp10 = tmp4 + tmp5;
-	    tmp11 = tmp5 + tmp6;
-	    tmp12 = tmp6 + tmp7;
-
-	    z5 = MULTIPLY16H((tmp10 - tmp12)<<2, FIX_0_382683433);
-	    z2 = MULTIPLY16H(tmp10 <<2, FIX_0_541196100) + z5;
-	    z4 = MULTIPLY16H(tmp12 <<2, FIX_1_306562965) + z5;
-	    z3 = MULTIPLY16H(tmp11 <<2, FIX_0_707106781);
-
-	    z11 = tmp7 + z3;
-	    z13 = tmp7 - z3;
-
-	    d5 = z13 + z2;
-	    d3 = z13 - z2;
-	    d1 = z11 + z4;
-	    d7 = z11 - z4;
-
-	    // Odd part of IDCT
-
-	    THRESHOLD(tmp4, d1, threshold[1*8]);
-	    THRESHOLD(tmp5, d3, threshold[3*8]);
-	    THRESHOLD(tmp6, d5, threshold[5*8]);
-	    THRESHOLD(tmp7, d7, threshold[7*8]);
-
-	    //Simd version uses here a shortcut for the tmp5,tmp6,tmp7 == 0
-	    z13 = tmp6 + tmp5;
-	    z10 = (tmp6 - tmp5)<<1;
-	    z11 = tmp4 + tmp7;
-	    z12 = (tmp4 - tmp7)<<1;
-
-	    tmp7 = (z11 + z13)>>2; //+2 !
-	    tmp11 = MULTIPLY16H((z11 - z13)<<1, FIX_1_414213562);
-	    z5 =    MULTIPLY16H(z10 + z12, FIX_1_847759065);
-	    tmp10 = MULTIPLY16H(z12, FIX_1_082392200) - z5;
-	    tmp12 = MULTIPLY16H(z10, FIX_2_613125930) + z5; // - !!
-
-	    tmp6 = tmp12 - tmp7;
-	    tmp5 = tmp11 - tmp6;
-	    tmp4 = tmp10 + tmp5;
-
-	    wsptr[DCTSIZE*0]+=  (tmp0 + tmp7);
-	    wsptr[DCTSIZE*1]+=  (tmp1 + tmp6);
-	    wsptr[DCTSIZE*2]+=  (tmp2 + tmp5);
-	    wsptr[DCTSIZE*3]+=  (tmp3 - tmp4);
-	    wsptr[DCTSIZE*4]+=  (tmp3 + tmp4);
-	    wsptr[DCTSIZE*5]+=  (tmp2 - tmp5);
-	    wsptr[DCTSIZE*6]=  (tmp1 - tmp6);
-	    wsptr[DCTSIZE*7]=  (tmp0 - tmp7);
-	    //
-	    dataptr++; //next column
-	    wsptr++;
-	    threshold++;
-	}
-	dataptr+=8; //skip each second start pos
-	wsptr  +=8;
+        threshold=(int16_t*)thr_adr;//threshold_mtx
+        for (ctr = DCTSIZE; ctr > 0; ctr--) {
+            // Process columns from input, add to output.
+            tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
+            tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
+
+            tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
+            tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
+
+            tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
+            tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
+
+            tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
+            tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
+
+            // Even part of FDCT
+
+            tmp10 = tmp0 + tmp3;
+            tmp13 = tmp0 - tmp3;
+            tmp11 = tmp1 + tmp2;
+            tmp12 = tmp1 - tmp2;
+
+            d0 = tmp10 + tmp11;
+            d4 = tmp10 - tmp11;
+
+            z1 = MULTIPLY16H((tmp12 + tmp13) <<2, FIX_0_707106781);
+            d2 = tmp13 + z1;
+            d6 = tmp13 - z1;
+
+            // Even part of IDCT
+
+            THRESHOLD(tmp0, d0, threshold[0*8]);
+            THRESHOLD(tmp1, d2, threshold[2*8]);
+            THRESHOLD(tmp2, d4, threshold[4*8]);
+            THRESHOLD(tmp3, d6, threshold[6*8]);
+            tmp0+=2;
+            tmp10 = (tmp0 + tmp2)>>2;
+            tmp11 = (tmp0 - tmp2)>>2;
+
+            tmp13 = (tmp1 + tmp3)>>2; //+2 !  (psnr decides)
+            tmp12 = MULTIPLY16H((tmp1 - tmp3), FIX_1_414213562_A) - tmp13; //<<2
+
+            tmp0 = tmp10 + tmp13; //->temps
+            tmp3 = tmp10 - tmp13; //->temps
+            tmp1 = tmp11 + tmp12; //->temps
+            tmp2 = tmp11 - tmp12; //->temps
+
+            // Odd part of FDCT
+
+            tmp10 = tmp4 + tmp5;
+            tmp11 = tmp5 + tmp6;
+            tmp12 = tmp6 + tmp7;
+
+            z5 = MULTIPLY16H((tmp10 - tmp12)<<2, FIX_0_382683433);
+            z2 = MULTIPLY16H(tmp10 <<2, FIX_0_541196100) + z5;
+            z4 = MULTIPLY16H(tmp12 <<2, FIX_1_306562965) + z5;
+            z3 = MULTIPLY16H(tmp11 <<2, FIX_0_707106781);
+
+            z11 = tmp7 + z3;
+            z13 = tmp7 - z3;
+
+            d5 = z13 + z2;
+            d3 = z13 - z2;
+            d1 = z11 + z4;
+            d7 = z11 - z4;
+
+            // Odd part of IDCT
+
+            THRESHOLD(tmp4, d1, threshold[1*8]);
+            THRESHOLD(tmp5, d3, threshold[3*8]);
+            THRESHOLD(tmp6, d5, threshold[5*8]);
+            THRESHOLD(tmp7, d7, threshold[7*8]);
+
+            //Simd version uses here a shortcut for the tmp5,tmp6,tmp7 == 0
+            z13 = tmp6 + tmp5;
+            z10 = (tmp6 - tmp5)<<1;
+            z11 = tmp4 + tmp7;
+            z12 = (tmp4 - tmp7)<<1;
+
+            tmp7 = (z11 + z13)>>2; //+2 !
+            tmp11 = MULTIPLY16H((z11 - z13)<<1, FIX_1_414213562);
+            z5 =    MULTIPLY16H(z10 + z12, FIX_1_847759065);
+            tmp10 = MULTIPLY16H(z12, FIX_1_082392200) - z5;
+            tmp12 = MULTIPLY16H(z10, FIX_2_613125930) + z5; // - !!
+
+            tmp6 = tmp12 - tmp7;
+            tmp5 = tmp11 - tmp6;
+            tmp4 = tmp10 + tmp5;
+
+            wsptr[DCTSIZE*0]+=  (tmp0 + tmp7);
+            wsptr[DCTSIZE*1]+=  (tmp1 + tmp6);
+            wsptr[DCTSIZE*2]+=  (tmp2 + tmp5);
+            wsptr[DCTSIZE*3]+=  (tmp3 - tmp4);
+            wsptr[DCTSIZE*4]+=  (tmp3 + tmp4);
+            wsptr[DCTSIZE*5]+=  (tmp2 - tmp5);
+            wsptr[DCTSIZE*6]=  (tmp1 - tmp6);
+            wsptr[DCTSIZE*7]=  (tmp0 - tmp7);
+            //
+            dataptr++; //next column
+            wsptr++;
+            threshold++;
+        }
+        dataptr+=8; //skip each second start pos
+        wsptr  +=8;
     }
 }
 
@@ -874,731 +874,731 @@
 {
     uint64_t __attribute__((aligned(8))) temps[4];
     __asm__ volatile(
-	ASMALIGN(4)
-	"1:                   \n\t"
-	"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
-	//
-	"movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm7 \n\t"
-	"movq %%mm1, %%mm0             \n\t"
-
-	"paddw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm1 \n\t" //t0
-	"movq %%mm7, %%mm3             \n\t"
-
-	"paddw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm7 \n\t" //t3
-	"movq %%mm1, %%mm5             \n\t"
-
-	"movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm6 \n\t"
-	"psubw %%mm7, %%mm1            \n\t" //t13
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
-	"movq %%mm6, %%mm4             \n\t"
-
-	"paddw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm6 \n\t" //t1
-	"paddw %%mm7, %%mm5            \n\t" //t10
-
-	"paddw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t2
-	"movq %%mm6, %%mm7             \n\t"
-
-	"paddw %%mm2, %%mm6            \n\t" //t11
-	"psubw %%mm2, %%mm7            \n\t" //t12
-
-	"movq %%mm5, %%mm2             \n\t"
-	"paddw %%mm6, %%mm5            \n\t" //d0
-	// i0 t13 t12 i3 i1 d0 - d4
-	"psubw %%mm6, %%mm2            \n\t" //d4
-	"paddw %%mm1, %%mm7            \n\t"
-
-	"movq  4*16(%%"REG_d"), %%mm6      \n\t"
-	"psllw $2, %%mm7              \n\t"
-
-	"psubw 0*16(%%"REG_d"), %%mm5      \n\t"
-	"psubw %%mm6, %%mm2            \n\t"
-
-	"paddusw 0*16(%%"REG_d"), %%mm5    \n\t"
-	"paddusw %%mm6, %%mm2          \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
-	//
-	"paddw 0*16(%%"REG_d"), %%mm5      \n\t"
-	"paddw %%mm6, %%mm2            \n\t"
-
-	"psubusw 0*16(%%"REG_d"), %%mm5    \n\t"
-	"psubusw %%mm6, %%mm2          \n\t"
+        ASMALIGN(4)
+        "1:                   \n\t"
+        "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
+        //
+        "movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm7 \n\t"
+        "movq %%mm1, %%mm0             \n\t"
+
+        "paddw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm1 \n\t" //t0
+        "movq %%mm7, %%mm3             \n\t"
+
+        "paddw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm7 \n\t" //t3
+        "movq %%mm1, %%mm5             \n\t"
+
+        "movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm6 \n\t"
+        "psubw %%mm7, %%mm1            \n\t" //t13
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
+        "movq %%mm6, %%mm4             \n\t"
+
+        "paddw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm6 \n\t" //t1
+        "paddw %%mm7, %%mm5            \n\t" //t10
+
+        "paddw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t2
+        "movq %%mm6, %%mm7             \n\t"
+
+        "paddw %%mm2, %%mm6            \n\t" //t11
+        "psubw %%mm2, %%mm7            \n\t" //t12
+
+        "movq %%mm5, %%mm2             \n\t"
+        "paddw %%mm6, %%mm5            \n\t" //d0
+        // i0 t13 t12 i3 i1 d0 - d4
+        "psubw %%mm6, %%mm2            \n\t" //d4
+        "paddw %%mm1, %%mm7            \n\t"
+
+        "movq  4*16(%%"REG_d"), %%mm6      \n\t"
+        "psllw $2, %%mm7              \n\t"
+
+        "psubw 0*16(%%"REG_d"), %%mm5      \n\t"
+        "psubw %%mm6, %%mm2            \n\t"
+
+        "paddusw 0*16(%%"REG_d"), %%mm5    \n\t"
+        "paddusw %%mm6, %%mm2          \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
+        //
+        "paddw 0*16(%%"REG_d"), %%mm5      \n\t"
+        "paddw %%mm6, %%mm2            \n\t"
+
+        "psubusw 0*16(%%"REG_d"), %%mm5    \n\t"
+        "psubusw %%mm6, %%mm2          \n\t"
 
 //This func is totally compute-bound,  operates at huge speed. So,  DC shortcut
 // at this place isn't worthwhile due to BTB miss penalty (checked on Pent. 3).
 //However,  typical numbers: nondc - 29%%,  dc - 46%%,  zero - 25%%. All <> 0 case is very rare.
-	"paddw "MANGLE(MM_2)", %%mm5            \n\t"
-	"movq %%mm2, %%mm6             \n\t"
-
-	"paddw %%mm5, %%mm2            \n\t"
-	"psubw %%mm6, %%mm5            \n\t"
-
-	"movq %%mm1, %%mm6             \n\t"
-	"paddw %%mm7, %%mm1            \n\t" //d2
-
-	"psubw 2*16(%%"REG_d"), %%mm1      \n\t"
-	"psubw %%mm7, %%mm6            \n\t" //d6
-
-	"movq 6*16(%%"REG_d"), %%mm7       \n\t"
-	"psraw $2, %%mm5              \n\t"
-
-	"paddusw 2*16(%%"REG_d"), %%mm1    \n\t"
-	"psubw %%mm7, %%mm6            \n\t"
-	// t7 d2 /t11 t4 t6 - d6 /t10
-
-	"paddw 2*16(%%"REG_d"), %%mm1      \n\t"
-	"paddusw %%mm7, %%mm6          \n\t"
-
-	"psubusw 2*16(%%"REG_d"), %%mm1    \n\t"
-	"paddw %%mm7, %%mm6            \n\t"
-
-	"psubw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm3 \n\t"
-	"psubusw %%mm7, %%mm6          \n\t"
-
-	//movq [edi+"DCTSIZE_S"*2*2], mm1
-	//movq [edi+"DCTSIZE_S"*6*2], mm6
-	"movq %%mm1, %%mm7             \n\t"
-	"psraw $2, %%mm2              \n\t"
-
-	"psubw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm4 \n\t"
-	"psubw %%mm6, %%mm1            \n\t"
-
-	"psubw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm0 \n\t"
-	"paddw %%mm7, %%mm6            \n\t" //'t13
-
-	"psraw $2, %%mm6              \n\t" //paddw mm6, MM_2 !!    ---
-	"movq %%mm2, %%mm7             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm1 \n\t"
-	"paddw %%mm6, %%mm2            \n\t" //'t0
-
-	"movq %%mm2, 0*8+%3            \n\t" //!
-	"psubw %%mm6, %%mm7            \n\t" //'t3
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
-	"psubw %%mm6, %%mm1            \n\t" //'t12
-
-	"psubw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t5
-	"movq %%mm5, %%mm6             \n\t"
-
-	"movq %%mm7, 3*8+%3            \n\t"
-	"paddw %%mm2, %%mm3            \n\t" //t10
-
-	"paddw %%mm4, %%mm2            \n\t" //t11
-	"paddw %%mm0, %%mm4            \n\t" //t12
-
-	"movq %%mm3, %%mm7             \n\t"
-	"psubw %%mm4, %%mm3            \n\t"
-
-	"psllw $2, %%mm3              \n\t"
-	"psllw $2, %%mm7              \n\t" //opt for P6
-
-	"pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t"
-	"psllw $2, %%mm4              \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm7 \n\t"
-	"psllw $2, %%mm2              \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm4 \n\t"
-	"paddw %%mm1, %%mm5            \n\t" //'t1
-
-	"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm2 \n\t"
-	"psubw %%mm1, %%mm6            \n\t" //'t2
-	// t7 't12 't11 t4 t6 - 't13 't10   ---
-
-	"paddw %%mm3, %%mm7            \n\t" //z2
-
-	"movq %%mm5, 1*8+%3            \n\t"
-	"paddw %%mm3, %%mm4            \n\t" //z4
-
-	"movq 3*16(%%"REG_d"), %%mm3       \n\t"
-	"movq %%mm0, %%mm1             \n\t"
-
-	"movq %%mm6, 2*8+%3            \n\t"
-	"psubw %%mm2, %%mm1            \n\t" //z13
+        "paddw "MANGLE(MM_2)", %%mm5            \n\t"
+        "movq %%mm2, %%mm6             \n\t"
+
+        "paddw %%mm5, %%mm2            \n\t"
+        "psubw %%mm6, %%mm5            \n\t"
+
+        "movq %%mm1, %%mm6             \n\t"
+        "paddw %%mm7, %%mm1            \n\t" //d2
+
+        "psubw 2*16(%%"REG_d"), %%mm1      \n\t"
+        "psubw %%mm7, %%mm6            \n\t" //d6
+
+        "movq 6*16(%%"REG_d"), %%mm7       \n\t"
+        "psraw $2, %%mm5              \n\t"
+
+        "paddusw 2*16(%%"REG_d"), %%mm1    \n\t"
+        "psubw %%mm7, %%mm6            \n\t"
+        // t7 d2 /t11 t4 t6 - d6 /t10
+
+        "paddw 2*16(%%"REG_d"), %%mm1      \n\t"
+        "paddusw %%mm7, %%mm6          \n\t"
+
+        "psubusw 2*16(%%"REG_d"), %%mm1    \n\t"
+        "paddw %%mm7, %%mm6            \n\t"
+
+        "psubw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm3 \n\t"
+        "psubusw %%mm7, %%mm6          \n\t"
+
+        //movq [edi+"DCTSIZE_S"*2*2], mm1
+        //movq [edi+"DCTSIZE_S"*6*2], mm6
+        "movq %%mm1, %%mm7             \n\t"
+        "psraw $2, %%mm2              \n\t"
+
+        "psubw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm4 \n\t"
+        "psubw %%mm6, %%mm1            \n\t"
+
+        "psubw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm0 \n\t"
+        "paddw %%mm7, %%mm6            \n\t" //'t13
+
+        "psraw $2, %%mm6              \n\t" //paddw mm6, MM_2 !!    ---
+        "movq %%mm2, %%mm7             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm1 \n\t"
+        "paddw %%mm6, %%mm2            \n\t" //'t0
+
+        "movq %%mm2, 0*8+%3            \n\t" //!
+        "psubw %%mm6, %%mm7            \n\t" //'t3
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
+        "psubw %%mm6, %%mm1            \n\t" //'t12
+
+        "psubw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t5
+        "movq %%mm5, %%mm6             \n\t"
+
+        "movq %%mm7, 3*8+%3            \n\t"
+        "paddw %%mm2, %%mm3            \n\t" //t10
+
+        "paddw %%mm4, %%mm2            \n\t" //t11
+        "paddw %%mm0, %%mm4            \n\t" //t12
+
+        "movq %%mm3, %%mm7             \n\t"
+        "psubw %%mm4, %%mm3            \n\t"
+
+        "psllw $2, %%mm3              \n\t"
+        "psllw $2, %%mm7              \n\t" //opt for P6
+
+        "pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t"
+        "psllw $2, %%mm4              \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm7 \n\t"
+        "psllw $2, %%mm2              \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm4 \n\t"
+        "paddw %%mm1, %%mm5            \n\t" //'t1
+
+        "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm2 \n\t"
+        "psubw %%mm1, %%mm6            \n\t" //'t2
+        // t7 't12 't11 t4 t6 - 't13 't10   ---
+
+        "paddw %%mm3, %%mm7            \n\t" //z2
+
+        "movq %%mm5, 1*8+%3            \n\t"
+        "paddw %%mm3, %%mm4            \n\t" //z4
+
+        "movq 3*16(%%"REG_d"), %%mm3       \n\t"
+        "movq %%mm0, %%mm1             \n\t"
+
+        "movq %%mm6, 2*8+%3            \n\t"
+        "psubw %%mm2, %%mm1            \n\t" //z13
 
 //===
-	"paddw %%mm2, %%mm0            \n\t" //z11
-	"movq %%mm1, %%mm5             \n\t"
-
-	"movq 5*16(%%"REG_d"), %%mm2       \n\t"
-	"psubw %%mm7, %%mm1            \n\t" //d3
-
-	"paddw %%mm7, %%mm5            \n\t" //d5
-	"psubw %%mm3, %%mm1            \n\t"
-
-	"movq 1*16(%%"REG_d"), %%mm7       \n\t"
-	"psubw %%mm2, %%mm5            \n\t"
-
-	"movq %%mm0, %%mm6             \n\t"
-	"paddw %%mm4, %%mm0            \n\t" //d1
-
-	"paddusw %%mm3, %%mm1          \n\t"
-	"psubw %%mm4, %%mm6            \n\t" //d7
-
-	// d1 d3 - - - d5 d7 -
-	"movq 7*16(%%"REG_d"), %%mm4       \n\t"
-	"psubw %%mm7, %%mm0            \n\t"
-
-	"psubw %%mm4, %%mm6            \n\t"
-	"paddusw %%mm2, %%mm5          \n\t"
-
-	"paddusw %%mm4, %%mm6          \n\t"
-	"paddw %%mm3, %%mm1            \n\t"
-
-	"paddw %%mm2, %%mm5            \n\t"
-	"paddw %%mm4, %%mm6            \n\t"
-
-	"psubusw %%mm3, %%mm1          \n\t"
-	"psubusw %%mm2, %%mm5          \n\t"
-
-	"psubusw %%mm4, %%mm6          \n\t"
-	"movq %%mm1, %%mm4             \n\t"
-
-	"por %%mm5, %%mm4              \n\t"
-	"paddusw %%mm7, %%mm0          \n\t"
-
-	"por %%mm6, %%mm4              \n\t"
-	"paddw %%mm7, %%mm0            \n\t"
-
-	"packssdw %%mm4, %%mm4         \n\t"
-	"psubusw %%mm7, %%mm0          \n\t"
-
-	"movd %%mm4, %%"REG_a"             \n\t"
-	"or %%"REG_a", %%"REG_a"              \n\t"
-	"jnz 2f                 \n\t"
-	//movq [edi+"DCTSIZE_S"*3*2], mm1
-	//movq [edi+"DCTSIZE_S"*5*2], mm5
-	//movq [edi+"DCTSIZE_S"*1*2], mm0
-	//movq [edi+"DCTSIZE_S"*7*2], mm6
-	// t4 t5 - - - t6 t7 -
-	//--- t4 (mm0) may be <>0; mm1, mm5, mm6 == 0
+        "paddw %%mm2, %%mm0            \n\t" //z11
+        "movq %%mm1, %%mm5             \n\t"
+
+        "movq 5*16(%%"REG_d"), %%mm2       \n\t"
+        "psubw %%mm7, %%mm1            \n\t" //d3
+
+        "paddw %%mm7, %%mm5            \n\t" //d5
+        "psubw %%mm3, %%mm1            \n\t"
+
+        "movq 1*16(%%"REG_d"), %%mm7       \n\t"
+        "psubw %%mm2, %%mm5            \n\t"
+
+        "movq %%mm0, %%mm6             \n\t"
+        "paddw %%mm4, %%mm0            \n\t" //d1
+
+        "paddusw %%mm3, %%mm1          \n\t"
+        "psubw %%mm4, %%mm6            \n\t" //d7
+
+        // d1 d3 - - - d5 d7 -
+        "movq 7*16(%%"REG_d"), %%mm4       \n\t"
+        "psubw %%mm7, %%mm0            \n\t"
+
+        "psubw %%mm4, %%mm6            \n\t"
+        "paddusw %%mm2, %%mm5          \n\t"
+
+        "paddusw %%mm4, %%mm6          \n\t"
+        "paddw %%mm3, %%mm1            \n\t"
+
+        "paddw %%mm2, %%mm5            \n\t"
+        "paddw %%mm4, %%mm6            \n\t"
+
+        "psubusw %%mm3, %%mm1          \n\t"
+        "psubusw %%mm2, %%mm5          \n\t"
+
+        "psubusw %%mm4, %%mm6          \n\t"
+        "movq %%mm1, %%mm4             \n\t"
+
+        "por %%mm5, %%mm4              \n\t"
+        "paddusw %%mm7, %%mm0          \n\t"
+
+        "por %%mm6, %%mm4              \n\t"
+        "paddw %%mm7, %%mm0            \n\t"
+
+        "packssdw %%mm4, %%mm4         \n\t"
+        "psubusw %%mm7, %%mm0          \n\t"
+
+        "movd %%mm4, %%"REG_a"             \n\t"
+        "or %%"REG_a", %%"REG_a"              \n\t"
+        "jnz 2f                 \n\t"
+        //movq [edi+"DCTSIZE_S"*3*2], mm1
+        //movq [edi+"DCTSIZE_S"*5*2], mm5
+        //movq [edi+"DCTSIZE_S"*1*2], mm0
+        //movq [edi+"DCTSIZE_S"*7*2], mm6
+        // t4 t5 - - - t6 t7 -
+        //--- t4 (mm0) may be <>0; mm1, mm5, mm6 == 0
 //Typical numbers: nondc - 19%%,  dc - 26%%,  zero - 55%%. zero case alone isn't worthwhile
-	"movq 0*8+%3, %%mm4            \n\t"
-	"movq %%mm0, %%mm1             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_847759065)", %%mm0 \n\t" //tmp6
-	"movq %%mm1, %%mm2             \n\t"
-
-	"movq "DCTSIZE_S"*0*2(%%"REG_D"), %%mm5 \n\t"
-	"movq %%mm2, %%mm3             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_566454497)", %%mm1 \n\t" //tmp5
-	"paddw %%mm4, %%mm5            \n\t"
-
-	"movq 1*8+%3, %%mm6            \n\t"
-	//paddw mm3, MM_2
-	"psraw $2, %%mm3              \n\t" //tmp7
-
-	"pmulhw "MANGLE(MM_FIX_0_198912367)", %%mm2 \n\t" //-tmp4
-	"psubw %%mm3, %%mm4            \n\t"
-
-	"movq "DCTSIZE_S"*1*2(%%"REG_D"), %%mm7 \n\t"
-	"paddw %%mm3, %%mm5            \n\t"
-
-	"movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
-	"paddw %%mm6, %%mm7            \n\t"
-
-	"movq 2*8+%3, %%mm3            \n\t"
-	"psubw %%mm0, %%mm6            \n\t"
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_D"), %%mm4 \n\t"
-	"paddw %%mm0, %%mm7            \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
-	"paddw %%mm3, %%mm4            \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
-	"psubw %%mm1, %%mm3            \n\t"
-
-	"movq "DCTSIZE_S"*5*2(%%"REG_D"), %%mm5 \n\t"
-	"paddw %%mm1, %%mm4            \n\t"
-
-	"movq "DCTSIZE_S"*3*2(%%"REG_D"), %%mm6 \n\t"
-	"paddw %%mm3, %%mm5            \n\t"
-
-	"movq 3*8+%3, %%mm0            \n\t"
-	"add $8, %%"REG_S"               \n\t"
-
-	"movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
-	"paddw %%mm0, %%mm6            \n\t"
-
-	"movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
-	"psubw %%mm2, %%mm0            \n\t"
-
-	"movq "DCTSIZE_S"*4*2(%%"REG_D"), %%mm7 \n\t"
-	"paddw %%mm2, %%mm6            \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
-	"paddw %%mm0, %%mm7            \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
-
-	"movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
-	"add $8, %%"REG_D"               \n\t"
-	"jmp 4f                  \n\t"
-
-	"2:                    \n\t"
-	//--- non DC2
-	//psraw mm1, 2 w/o it -> offset. thr1, thr1, thr1  (actually thr1, thr1, thr1-1)
-	//psraw mm5, 2
-	//psraw mm0, 2
-	//psraw mm6, 2
-	"movq %%mm5, %%mm3             \n\t"
-	"psubw %%mm1, %%mm5            \n\t"
-
-	"psllw $1, %%mm5              \n\t" //'z10
-	"paddw %%mm1, %%mm3            \n\t" //'z13
-
-	"movq %%mm0, %%mm2             \n\t"
-	"psubw %%mm6, %%mm0            \n\t"
-
-	"movq %%mm5, %%mm1             \n\t"
-	"psllw $1, %%mm0              \n\t" //'z12
-
-	"pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm1 \n\t" //-
-	"paddw %%mm0, %%mm5            \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm5 \n\t" //'z5
-	"paddw %%mm6, %%mm2            \n\t" //'z11
-
-	"pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm0 \n\t"
-	"movq %%mm2, %%mm7             \n\t"
-
-	//---
-	"movq 0*8+%3, %%mm4            \n\t"
-	"psubw %%mm3, %%mm2            \n\t"
-
-	"psllw $1, %%mm2              \n\t"
-	"paddw %%mm3, %%mm7            \n\t" //'t7
-
-	"pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //'t11
-	"movq %%mm4, %%mm6             \n\t"
-	//paddw mm7, MM_2
-	"psraw $2, %%mm7              \n\t"
-
-	"paddw "DCTSIZE_S"*0*2(%%"REG_D"), %%mm4 \n\t"
-	"psubw %%mm7, %%mm6            \n\t"
-
-	"movq 1*8+%3, %%mm3            \n\t"
-	"paddw %%mm7, %%mm4            \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
-	"paddw %%mm5, %%mm1            \n\t" //'t12
-
-	"movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
-	"psubw %%mm7, %%mm1            \n\t" //'t6
-
-	"movq 2*8+%3, %%mm7            \n\t"
-	"psubw %%mm5, %%mm0            \n\t" //'t10
-
-	"movq 3*8+%3, %%mm6            \n\t"
-	"movq %%mm3, %%mm5             \n\t"
-
-	"paddw "DCTSIZE_S"*1*2(%%"REG_D"), %%mm3 \n\t"
-	"psubw %%mm1, %%mm5            \n\t"
-
-	"psubw %%mm1, %%mm2            \n\t" //'t5
-	"paddw %%mm1, %%mm3            \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
-	"movq %%mm7, %%mm4             \n\t"
-
-	"paddw "DCTSIZE_S"*2*2(%%"REG_D"), %%mm7 \n\t"
-	"psubw %%mm2, %%mm4            \n\t"
-
-	"paddw "DCTSIZE_S"*5*2(%%"REG_D"), %%mm4 \n\t"
-	"paddw %%mm2, %%mm7            \n\t"
-
-	"movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
-	"paddw %%mm2, %%mm0            \n\t" //'t4
-
-	// 't4 't6 't5 - - - - 't7
-	"movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
-	"movq %%mm6, %%mm1             \n\t"
-
-	"paddw "DCTSIZE_S"*4*2(%%"REG_D"), %%mm6 \n\t"
-	"psubw %%mm0, %%mm1            \n\t"
-
-	"paddw "DCTSIZE_S"*3*2(%%"REG_D"), %%mm1 \n\t"
-	"paddw %%mm0, %%mm6            \n\t"
-
-	"movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
-	"add $8, %%"REG_S"               \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
-
-	"movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
-	"add $8, %%"REG_D"               \n\t"
-
-	"4:                     \n\t"
+        "movq 0*8+%3, %%mm4            \n\t"
+        "movq %%mm0, %%mm1             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_847759065)", %%mm0 \n\t" //tmp6
+        "movq %%mm1, %%mm2             \n\t"
+
+        "movq "DCTSIZE_S"*0*2(%%"REG_D"), %%mm5 \n\t"
+        "movq %%mm2, %%mm3             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_566454497)", %%mm1 \n\t" //tmp5
+        "paddw %%mm4, %%mm5            \n\t"
+
+        "movq 1*8+%3, %%mm6            \n\t"
+        //paddw mm3, MM_2
+        "psraw $2, %%mm3              \n\t" //tmp7
+
+        "pmulhw "MANGLE(MM_FIX_0_198912367)", %%mm2 \n\t" //-tmp4
+        "psubw %%mm3, %%mm4            \n\t"
+
+        "movq "DCTSIZE_S"*1*2(%%"REG_D"), %%mm7 \n\t"
+        "paddw %%mm3, %%mm5            \n\t"
+
+        "movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
+        "paddw %%mm6, %%mm7            \n\t"
+
+        "movq 2*8+%3, %%mm3            \n\t"
+        "psubw %%mm0, %%mm6            \n\t"
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_D"), %%mm4 \n\t"
+        "paddw %%mm0, %%mm7            \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
+        "paddw %%mm3, %%mm4            \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
+        "psubw %%mm1, %%mm3            \n\t"
+
+        "movq "DCTSIZE_S"*5*2(%%"REG_D"), %%mm5 \n\t"
+        "paddw %%mm1, %%mm4            \n\t"
+
+        "movq "DCTSIZE_S"*3*2(%%"REG_D"), %%mm6 \n\t"
+        "paddw %%mm3, %%mm5            \n\t"
+
+        "movq 3*8+%3, %%mm0            \n\t"
+        "add $8, %%"REG_S"               \n\t"
+
+        "movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
+        "paddw %%mm0, %%mm6            \n\t"
+
+        "movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
+        "psubw %%mm2, %%mm0            \n\t"
+
+        "movq "DCTSIZE_S"*4*2(%%"REG_D"), %%mm7 \n\t"
+        "paddw %%mm2, %%mm6            \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
+        "paddw %%mm0, %%mm7            \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
+
+        "movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
+        "add $8, %%"REG_D"               \n\t"
+        "jmp 4f                  \n\t"
+
+        "2:                    \n\t"
+        //--- non DC2
+        //psraw mm1, 2 w/o it -> offset. thr1, thr1, thr1  (actually thr1, thr1, thr1-1)
+        //psraw mm5, 2
+        //psraw mm0, 2
+        //psraw mm6, 2
+        "movq %%mm5, %%mm3             \n\t"
+        "psubw %%mm1, %%mm5            \n\t"
+
+        "psllw $1, %%mm5              \n\t" //'z10
+        "paddw %%mm1, %%mm3            \n\t" //'z13
+
+        "movq %%mm0, %%mm2             \n\t"
+        "psubw %%mm6, %%mm0            \n\t"
+
+        "movq %%mm5, %%mm1             \n\t"
+        "psllw $1, %%mm0              \n\t" //'z12
+
+        "pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm1 \n\t" //-
+        "paddw %%mm0, %%mm5            \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm5 \n\t" //'z5
+        "paddw %%mm6, %%mm2            \n\t" //'z11
+
+        "pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm0 \n\t"
+        "movq %%mm2, %%mm7             \n\t"
+
+        //---
+        "movq 0*8+%3, %%mm4            \n\t"
+        "psubw %%mm3, %%mm2            \n\t"
+
+        "psllw $1, %%mm2              \n\t"
+        "paddw %%mm3, %%mm7            \n\t" //'t7
+
+        "pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //'t11
+        "movq %%mm4, %%mm6             \n\t"
+        //paddw mm7, MM_2
+        "psraw $2, %%mm7              \n\t"
+
+        "paddw "DCTSIZE_S"*0*2(%%"REG_D"), %%mm4 \n\t"
+        "psubw %%mm7, %%mm6            \n\t"
+
+        "movq 1*8+%3, %%mm3            \n\t"
+        "paddw %%mm7, %%mm4            \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
+        "paddw %%mm5, %%mm1            \n\t" //'t12
+
+        "movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
+        "psubw %%mm7, %%mm1            \n\t" //'t6
+
+        "movq 2*8+%3, %%mm7            \n\t"
+        "psubw %%mm5, %%mm0            \n\t" //'t10
+
+        "movq 3*8+%3, %%mm6            \n\t"
+        "movq %%mm3, %%mm5             \n\t"
+
+        "paddw "DCTSIZE_S"*1*2(%%"REG_D"), %%mm3 \n\t"
+        "psubw %%mm1, %%mm5            \n\t"
+
+        "psubw %%mm1, %%mm2            \n\t" //'t5
+        "paddw %%mm1, %%mm3            \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
+        "movq %%mm7, %%mm4             \n\t"
+
+        "paddw "DCTSIZE_S"*2*2(%%"REG_D"), %%mm7 \n\t"
+        "psubw %%mm2, %%mm4            \n\t"
+
+        "paddw "DCTSIZE_S"*5*2(%%"REG_D"), %%mm4 \n\t"
+        "paddw %%mm2, %%mm7            \n\t"
+
+        "movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
+        "paddw %%mm2, %%mm0            \n\t" //'t4
+
+        // 't4 't6 't5 - - - - 't7
+        "movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
+        "movq %%mm6, %%mm1             \n\t"
+
+        "paddw "DCTSIZE_S"*4*2(%%"REG_D"), %%mm6 \n\t"
+        "psubw %%mm0, %%mm1            \n\t"
+
+        "paddw "DCTSIZE_S"*3*2(%%"REG_D"), %%mm1 \n\t"
+        "paddw %%mm0, %%mm6            \n\t"
+
+        "movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
+        "add $8, %%"REG_S"               \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
+
+        "movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
+        "add $8, %%"REG_D"               \n\t"
+
+        "4:                     \n\t"
 //=part 2 (the same)===========================================================
-	"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
-	//
-	"movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm7 \n\t"
-	"movq %%mm1, %%mm0             \n\t"
-
-	"paddw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm1 \n\t" //t0
-	"movq %%mm7, %%mm3             \n\t"
-
-	"paddw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm7 \n\t" //t3
-	"movq %%mm1, %%mm5             \n\t"
-
-	"movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm6 \n\t"
-	"psubw %%mm7, %%mm1            \n\t" //t13
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
-	"movq %%mm6, %%mm4             \n\t"
-
-	"paddw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm6 \n\t" //t1
-	"paddw %%mm7, %%mm5            \n\t" //t10
-
-	"paddw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t2
-	"movq %%mm6, %%mm7             \n\t"
-
-	"paddw %%mm2, %%mm6            \n\t" //t11
-	"psubw %%mm2, %%mm7            \n\t" //t12
-
-	"movq %%mm5, %%mm2             \n\t"
-	"paddw %%mm6, %%mm5            \n\t" //d0
-	// i0 t13 t12 i3 i1 d0 - d4
-	"psubw %%mm6, %%mm2            \n\t" //d4
-	"paddw %%mm1, %%mm7            \n\t"
-
-	"movq  1*8+4*16(%%"REG_d"), %%mm6  \n\t"
-	"psllw $2, %%mm7              \n\t"
-
-	"psubw 1*8+0*16(%%"REG_d"), %%mm5  \n\t"
-	"psubw %%mm6, %%mm2            \n\t"
-
-	"paddusw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
-	"paddusw %%mm6, %%mm2          \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
-	//
-	"paddw 1*8+0*16(%%"REG_d"), %%mm5  \n\t"
-	"paddw %%mm6, %%mm2            \n\t"
-
-	"psubusw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
-	"psubusw %%mm6, %%mm2          \n\t"
+        "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
+        //
+        "movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm7 \n\t"
+        "movq %%mm1, %%mm0             \n\t"
+
+        "paddw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm1 \n\t" //t0
+        "movq %%mm7, %%mm3             \n\t"
+
+        "paddw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm7 \n\t" //t3
+        "movq %%mm1, %%mm5             \n\t"
+
+        "movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm6 \n\t"
+        "psubw %%mm7, %%mm1            \n\t" //t13
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
+        "movq %%mm6, %%mm4             \n\t"
+
+        "paddw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm6 \n\t" //t1
+        "paddw %%mm7, %%mm5            \n\t" //t10
+
+        "paddw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t2
+        "movq %%mm6, %%mm7             \n\t"
+
+        "paddw %%mm2, %%mm6            \n\t" //t11
+        "psubw %%mm2, %%mm7            \n\t" //t12
+
+        "movq %%mm5, %%mm2             \n\t"
+        "paddw %%mm6, %%mm5            \n\t" //d0
+        // i0 t13 t12 i3 i1 d0 - d4
+        "psubw %%mm6, %%mm2            \n\t" //d4
+        "paddw %%mm1, %%mm7            \n\t"
+
+        "movq  1*8+4*16(%%"REG_d"), %%mm6  \n\t"
+        "psllw $2, %%mm7              \n\t"
+
+        "psubw 1*8+0*16(%%"REG_d"), %%mm5  \n\t"
+        "psubw %%mm6, %%mm2            \n\t"
+
+        "paddusw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
+        "paddusw %%mm6, %%mm2          \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm7 \n\t"
+        //
+        "paddw 1*8+0*16(%%"REG_d"), %%mm5  \n\t"
+        "paddw %%mm6, %%mm2            \n\t"
+
+        "psubusw 1*8+0*16(%%"REG_d"), %%mm5 \n\t"
+        "psubusw %%mm6, %%mm2          \n\t"
 
 //This func is totally compute-bound,  operates at huge speed. So,  DC shortcut
 // at this place isn't worthwhile due to BTB miss penalty (checked on Pent. 3).
 //However,  typical numbers: nondc - 29%%,  dc - 46%%,  zero - 25%%. All <> 0 case is very rare.
-	"paddw "MANGLE(MM_2)", %%mm5            \n\t"
-	"movq %%mm2, %%mm6             \n\t"
-
-	"paddw %%mm5, %%mm2            \n\t"
-	"psubw %%mm6, %%mm5            \n\t"
-
-	"movq %%mm1, %%mm6             \n\t"
-	"paddw %%mm7, %%mm1            \n\t" //d2
-
-	"psubw 1*8+2*16(%%"REG_d"), %%mm1  \n\t"
-	"psubw %%mm7, %%mm6            \n\t" //d6
-
-	"movq 1*8+6*16(%%"REG_d"), %%mm7   \n\t"
-	"psraw $2, %%mm5              \n\t"
-
-	"paddusw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
-	"psubw %%mm7, %%mm6            \n\t"
-	// t7 d2 /t11 t4 t6 - d6 /t10
-
-	"paddw 1*8+2*16(%%"REG_d"), %%mm1  \n\t"
-	"paddusw %%mm7, %%mm6          \n\t"
-
-	"psubusw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
-	"paddw %%mm7, %%mm6            \n\t"
-
-	"psubw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm3 \n\t"
-	"psubusw %%mm7, %%mm6          \n\t"
-
-	//movq [edi+"DCTSIZE_S"*2*2], mm1
-	//movq [edi+"DCTSIZE_S"*6*2], mm6
-	"movq %%mm1, %%mm7             \n\t"
-	"psraw $2, %%mm2              \n\t"
-
-	"psubw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm4 \n\t"
-	"psubw %%mm6, %%mm1            \n\t"
-
-	"psubw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm0 \n\t"
-	"paddw %%mm7, %%mm6            \n\t" //'t13
-
-	"psraw $2, %%mm6              \n\t" //paddw mm6, MM_2 !!    ---
-	"movq %%mm2, %%mm7             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm1 \n\t"
-	"paddw %%mm6, %%mm2            \n\t" //'t0
-
-	"movq %%mm2, 0*8+%3            \n\t" //!
-	"psubw %%mm6, %%mm7            \n\t" //'t3
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
-	"psubw %%mm6, %%mm1            \n\t" //'t12
-
-	"psubw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t5
-	"movq %%mm5, %%mm6             \n\t"
-
-	"movq %%mm7, 3*8+%3            \n\t"
-	"paddw %%mm2, %%mm3            \n\t" //t10
-
-	"paddw %%mm4, %%mm2            \n\t" //t11
-	"paddw %%mm0, %%mm4            \n\t" //t12
-
-	"movq %%mm3, %%mm7             \n\t"
-	"psubw %%mm4, %%mm3            \n\t"
-
-	"psllw $2, %%mm3              \n\t"
-	"psllw $2, %%mm7              \n\t" //opt for P6
-
-	"pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t"
-	"psllw $2, %%mm4              \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm7 \n\t"
-	"psllw $2, %%mm2              \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm4 \n\t"
-	"paddw %%mm1, %%mm5            \n\t" //'t1
-
-	"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm2 \n\t"
-	"psubw %%mm1, %%mm6            \n\t" //'t2
-	// t7 't12 't11 t4 t6 - 't13 't10   ---
-
-	"paddw %%mm3, %%mm7            \n\t" //z2
-
-	"movq %%mm5, 1*8+%3            \n\t"
-	"paddw %%mm3, %%mm4            \n\t" //z4
-
-	"movq 1*8+3*16(%%"REG_d"), %%mm3   \n\t"
-	"movq %%mm0, %%mm1             \n\t"
-
-	"movq %%mm6, 2*8+%3            \n\t"
-	"psubw %%mm2, %%mm1            \n\t" //z13
+        "paddw "MANGLE(MM_2)", %%mm5            \n\t"
+        "movq %%mm2, %%mm6             \n\t"
+
+        "paddw %%mm5, %%mm2            \n\t"
+        "psubw %%mm6, %%mm5            \n\t"
+
+        "movq %%mm1, %%mm6             \n\t"
+        "paddw %%mm7, %%mm1            \n\t" //d2
+
+        "psubw 1*8+2*16(%%"REG_d"), %%mm1  \n\t"
+        "psubw %%mm7, %%mm6            \n\t" //d6
+
+        "movq 1*8+6*16(%%"REG_d"), %%mm7   \n\t"
+        "psraw $2, %%mm5              \n\t"
+
+        "paddusw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
+        "psubw %%mm7, %%mm6            \n\t"
+        // t7 d2 /t11 t4 t6 - d6 /t10
+
+        "paddw 1*8+2*16(%%"REG_d"), %%mm1  \n\t"
+        "paddusw %%mm7, %%mm6          \n\t"
+
+        "psubusw 1*8+2*16(%%"REG_d"), %%mm1 \n\t"
+        "paddw %%mm7, %%mm6            \n\t"
+
+        "psubw "DCTSIZE_S"*4*2(%%"REG_S"), %%mm3 \n\t"
+        "psubusw %%mm7, %%mm6          \n\t"
+
+        //movq [edi+"DCTSIZE_S"*2*2], mm1
+        //movq [edi+"DCTSIZE_S"*6*2], mm6
+        "movq %%mm1, %%mm7             \n\t"
+        "psraw $2, %%mm2              \n\t"
+
+        "psubw "DCTSIZE_S"*6*2(%%"REG_S"), %%mm4 \n\t"
+        "psubw %%mm6, %%mm1            \n\t"
+
+        "psubw "DCTSIZE_S"*7*2(%%"REG_S"), %%mm0 \n\t"
+        "paddw %%mm7, %%mm6            \n\t" //'t13
+
+        "psraw $2, %%mm6              \n\t" //paddw mm6, MM_2 !!    ---
+        "movq %%mm2, %%mm7             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm1 \n\t"
+        "paddw %%mm6, %%mm2            \n\t" //'t0
+
+        "movq %%mm2, 0*8+%3            \n\t" //!
+        "psubw %%mm6, %%mm7            \n\t" //'t3
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
+        "psubw %%mm6, %%mm1            \n\t" //'t12
+
+        "psubw "DCTSIZE_S"*5*2(%%"REG_S"), %%mm2 \n\t" //t5
+        "movq %%mm5, %%mm6             \n\t"
+
+        "movq %%mm7, 3*8+%3            \n\t"
+        "paddw %%mm2, %%mm3            \n\t" //t10
+
+        "paddw %%mm4, %%mm2            \n\t" //t11
+        "paddw %%mm0, %%mm4            \n\t" //t12
+
+        "movq %%mm3, %%mm7             \n\t"
+        "psubw %%mm4, %%mm3            \n\t"
+
+        "psllw $2, %%mm3              \n\t"
+        "psllw $2, %%mm7              \n\t" //opt for P6
+
+        "pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t"
+        "psllw $2, %%mm4              \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm7 \n\t"
+        "psllw $2, %%mm2              \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm4 \n\t"
+        "paddw %%mm1, %%mm5            \n\t" //'t1
+
+        "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm2 \n\t"
+        "psubw %%mm1, %%mm6            \n\t" //'t2
+        // t7 't12 't11 t4 t6 - 't13 't10   ---
+
+        "paddw %%mm3, %%mm7            \n\t" //z2
+
+        "movq %%mm5, 1*8+%3            \n\t"
+        "paddw %%mm3, %%mm4            \n\t" //z4
+
+        "movq 1*8+3*16(%%"REG_d"), %%mm3   \n\t"
+        "movq %%mm0, %%mm1             \n\t"
+
+        "movq %%mm6, 2*8+%3            \n\t"
+        "psubw %%mm2, %%mm1            \n\t" //z13
 
 //===
-	"paddw %%mm2, %%mm0            \n\t" //z11
-	"movq %%mm1, %%mm5             \n\t"
-
-	"movq 1*8+5*16(%%"REG_d"), %%mm2   \n\t"
-	"psubw %%mm7, %%mm1            \n\t" //d3
-
-	"paddw %%mm7, %%mm5            \n\t" //d5
-	"psubw %%mm3, %%mm1            \n\t"
-
-	"movq 1*8+1*16(%%"REG_d"), %%mm7   \n\t"
-	"psubw %%mm2, %%mm5            \n\t"
-
-	"movq %%mm0, %%mm6             \n\t"
-	"paddw %%mm4, %%mm0            \n\t" //d1
-
-	"paddusw %%mm3, %%mm1          \n\t"
-	"psubw %%mm4, %%mm6            \n\t" //d7
-
-	// d1 d3 - - - d5 d7 -
-	"movq 1*8+7*16(%%"REG_d"), %%mm4   \n\t"
-	"psubw %%mm7, %%mm0            \n\t"
-
-	"psubw %%mm4, %%mm6            \n\t"
-	"paddusw %%mm2, %%mm5          \n\t"
-
-	"paddusw %%mm4, %%mm6          \n\t"
-	"paddw %%mm3, %%mm1            \n\t"
-
-	"paddw %%mm2, %%mm5            \n\t"
-	"paddw %%mm4, %%mm6            \n\t"
-
-	"psubusw %%mm3, %%mm1          \n\t"
-	"psubusw %%mm2, %%mm5          \n\t"
-
-	"psubusw %%mm4, %%mm6          \n\t"
-	"movq %%mm1, %%mm4             \n\t"
-
-	"por %%mm5, %%mm4              \n\t"
-	"paddusw %%mm7, %%mm0          \n\t"
-
-	"por %%mm6, %%mm4              \n\t"
-	"paddw %%mm7, %%mm0            \n\t"
-
-	"packssdw %%mm4, %%mm4         \n\t"
-	"psubusw %%mm7, %%mm0          \n\t"
-
-	"movd %%mm4, %%"REG_a"             \n\t"
-	"or %%"REG_a", %%"REG_a"              \n\t"
-	"jnz 3f                 \n\t"
-	//movq [edi+"DCTSIZE_S"*3*2], mm1
-	//movq [edi+"DCTSIZE_S"*5*2], mm5
-	//movq [edi+"DCTSIZE_S"*1*2], mm0
-	//movq [edi+"DCTSIZE_S"*7*2], mm6
-	// t4 t5 - - - t6 t7 -
-	//--- t4 (mm0) may be <>0; mm1, mm5, mm6 == 0
+        "paddw %%mm2, %%mm0            \n\t" //z11
+        "movq %%mm1, %%mm5             \n\t"
+
+        "movq 1*8+5*16(%%"REG_d"), %%mm2   \n\t"
+        "psubw %%mm7, %%mm1            \n\t" //d3
+
+        "paddw %%mm7, %%mm5            \n\t" //d5
+        "psubw %%mm3, %%mm1            \n\t"
+
+        "movq 1*8+1*16(%%"REG_d"), %%mm7   \n\t"
+        "psubw %%mm2, %%mm5            \n\t"
+
+        "movq %%mm0, %%mm6             \n\t"
+        "paddw %%mm4, %%mm0            \n\t" //d1
+
+        "paddusw %%mm3, %%mm1          \n\t"
+        "psubw %%mm4, %%mm6            \n\t" //d7
+
+        // d1 d3 - - - d5 d7 -
+        "movq 1*8+7*16(%%"REG_d"), %%mm4   \n\t"
+        "psubw %%mm7, %%mm0            \n\t"
+
+        "psubw %%mm4, %%mm6            \n\t"
+        "paddusw %%mm2, %%mm5          \n\t"
+
+        "paddusw %%mm4, %%mm6          \n\t"
+        "paddw %%mm3, %%mm1            \n\t"
+
+        "paddw %%mm2, %%mm5            \n\t"
+        "paddw %%mm4, %%mm6            \n\t"
+
+        "psubusw %%mm3, %%mm1          \n\t"
+        "psubusw %%mm2, %%mm5          \n\t"
+
+        "psubusw %%mm4, %%mm6          \n\t"
+        "movq %%mm1, %%mm4             \n\t"
+
+        "por %%mm5, %%mm4              \n\t"
+        "paddusw %%mm7, %%mm0          \n\t"
+
+        "por %%mm6, %%mm4              \n\t"
+        "paddw %%mm7, %%mm0            \n\t"
+
+        "packssdw %%mm4, %%mm4         \n\t"
+        "psubusw %%mm7, %%mm0          \n\t"
+
+        "movd %%mm4, %%"REG_a"             \n\t"
+        "or %%"REG_a", %%"REG_a"              \n\t"
+        "jnz 3f                 \n\t"
+        //movq [edi+"DCTSIZE_S"*3*2], mm1
+        //movq [edi+"DCTSIZE_S"*5*2], mm5
+        //movq [edi+"DCTSIZE_S"*1*2], mm0
+        //movq [edi+"DCTSIZE_S"*7*2], mm6
+        // t4 t5 - - - t6 t7 -
+        //--- t4 (mm0) may be <>0; mm1, mm5, mm6 == 0
 //Typical numbers: nondc - 19%%,  dc - 26%%,  zero - 55%%. zero case alone isn't worthwhile
-	"movq 0*8+%3, %%mm4            \n\t"
-	"movq %%mm0, %%mm1             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_847759065)", %%mm0 \n\t" //tmp6
-	"movq %%mm1, %%mm2             \n\t"
-
-	"movq "DCTSIZE_S"*0*2(%%"REG_D"), %%mm5 \n\t"
-	"movq %%mm2, %%mm3             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_566454497)", %%mm1 \n\t" //tmp5
-	"paddw %%mm4, %%mm5            \n\t"
-
-	"movq 1*8+%3, %%mm6            \n\t"
-	//paddw mm3, MM_2
-	"psraw $2, %%mm3              \n\t" //tmp7
-
-	"pmulhw "MANGLE(MM_FIX_0_198912367)", %%mm2 \n\t" //-tmp4
-	"psubw %%mm3, %%mm4            \n\t"
-
-	"movq "DCTSIZE_S"*1*2(%%"REG_D"), %%mm7 \n\t"
-	"paddw %%mm3, %%mm5            \n\t"
-
-	"movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
-	"paddw %%mm6, %%mm7            \n\t"
-
-	"movq 2*8+%3, %%mm3            \n\t"
-	"psubw %%mm0, %%mm6            \n\t"
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_D"), %%mm4 \n\t"
-	"paddw %%mm0, %%mm7            \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
-	"paddw %%mm3, %%mm4            \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
-	"psubw %%mm1, %%mm3            \n\t"
-
-	"movq "DCTSIZE_S"*5*2(%%"REG_D"), %%mm5 \n\t"
-	"paddw %%mm1, %%mm4            \n\t"
-
-	"movq "DCTSIZE_S"*3*2(%%"REG_D"), %%mm6 \n\t"
-	"paddw %%mm3, %%mm5            \n\t"
-
-	"movq 3*8+%3, %%mm0            \n\t"
-	"add $24, %%"REG_S"              \n\t"
-
-	"movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
-	"paddw %%mm0, %%mm6            \n\t"
-
-	"movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
-	"psubw %%mm2, %%mm0            \n\t"
-
-	"movq "DCTSIZE_S"*4*2(%%"REG_D"), %%mm7 \n\t"
-	"paddw %%mm2, %%mm6            \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
-	"paddw %%mm0, %%mm7            \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
-
-	"movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
-	"add $24, %%"REG_D"              \n\t"
-	"sub $2, %%"REG_c"               \n\t"
-	"jnz 1b                \n\t"
-	"jmp 5f                   \n\t"
-
-	"3:                    \n\t"
-	//--- non DC2
-	//psraw mm1, 2 w/o it -> offset. thr1, thr1, thr1  (actually thr1, thr1, thr1-1)
-	//psraw mm5, 2
-	//psraw mm0, 2
-	//psraw mm6, 2
-	"movq %%mm5, %%mm3             \n\t"
-	"psubw %%mm1, %%mm5            \n\t"
-
-	"psllw $1, %%mm5              \n\t" //'z10
-	"paddw %%mm1, %%mm3            \n\t" //'z13
-
-	"movq %%mm0, %%mm2             \n\t"
-	"psubw %%mm6, %%mm0            \n\t"
-
-	"movq %%mm5, %%mm1             \n\t"
-	"psllw $1, %%mm0              \n\t" //'z12
-
-	"pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm1 \n\t" //-
-	"paddw %%mm0, %%mm5            \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm5 \n\t" //'z5
-	"paddw %%mm6, %%mm2            \n\t" //'z11
-
-	"pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm0 \n\t"
-	"movq %%mm2, %%mm7             \n\t"
-
-	//---
-	"movq 0*8+%3, %%mm4            \n\t"
-	"psubw %%mm3, %%mm2            \n\t"
-
-	"psllw $1, %%mm2              \n\t"
-	"paddw %%mm3, %%mm7            \n\t" //'t7
-
-	"pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //'t11
-	"movq %%mm4, %%mm6             \n\t"
-	//paddw mm7, MM_2
-	"psraw $2, %%mm7              \n\t"
-
-	"paddw "DCTSIZE_S"*0*2(%%"REG_D"), %%mm4 \n\t"
-	"psubw %%mm7, %%mm6            \n\t"
-
-	"movq 1*8+%3, %%mm3            \n\t"
-	"paddw %%mm7, %%mm4            \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
-	"paddw %%mm5, %%mm1            \n\t" //'t12
-
-	"movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
-	"psubw %%mm7, %%mm1            \n\t" //'t6
-
-	"movq 2*8+%3, %%mm7            \n\t"
-	"psubw %%mm5, %%mm0            \n\t" //'t10
-
-	"movq 3*8+%3, %%mm6            \n\t"
-	"movq %%mm3, %%mm5             \n\t"
-
-	"paddw "DCTSIZE_S"*1*2(%%"REG_D"), %%mm3 \n\t"
-	"psubw %%mm1, %%mm5            \n\t"
-
-	"psubw %%mm1, %%mm2            \n\t" //'t5
-	"paddw %%mm1, %%mm3            \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
-	"movq %%mm7, %%mm4             \n\t"
-
-	"paddw "DCTSIZE_S"*2*2(%%"REG_D"), %%mm7 \n\t"
-	"psubw %%mm2, %%mm4            \n\t"
-
-	"paddw "DCTSIZE_S"*5*2(%%"REG_D"), %%mm4 \n\t"
-	"paddw %%mm2, %%mm7            \n\t"
-
-	"movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
-	"paddw %%mm2, %%mm0            \n\t" //'t4
-
-	// 't4 't6 't5 - - - - 't7
-	"movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
-	"movq %%mm6, %%mm1             \n\t"
-
-	"paddw "DCTSIZE_S"*4*2(%%"REG_D"), %%mm6 \n\t"
-	"psubw %%mm0, %%mm1            \n\t"
-
-	"paddw "DCTSIZE_S"*3*2(%%"REG_D"), %%mm1 \n\t"
-	"paddw %%mm0, %%mm6            \n\t"
-
-	"movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
-	"add $24, %%"REG_S"              \n\t"
-
-	"movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
-
-	"movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
-	"add $24, %%"REG_D"              \n\t"
-	"sub $2, %%"REG_c"               \n\t"
-	"jnz 1b                \n\t"
-	"5:                      \n\t"
-
-	: "+S"(data), "+D"(output), "+c"(cnt), "=o"(temps)
-	: "d"(thr_adr)
-	: "%"REG_a
-	);
+        "movq 0*8+%3, %%mm4            \n\t"
+        "movq %%mm0, %%mm1             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_847759065)", %%mm0 \n\t" //tmp6
+        "movq %%mm1, %%mm2             \n\t"
+
+        "movq "DCTSIZE_S"*0*2(%%"REG_D"), %%mm5 \n\t"
+        "movq %%mm2, %%mm3             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_566454497)", %%mm1 \n\t" //tmp5
+        "paddw %%mm4, %%mm5            \n\t"
+
+        "movq 1*8+%3, %%mm6            \n\t"
+        //paddw mm3, MM_2
+        "psraw $2, %%mm3              \n\t" //tmp7
+
+        "pmulhw "MANGLE(MM_FIX_0_198912367)", %%mm2 \n\t" //-tmp4
+        "psubw %%mm3, %%mm4            \n\t"
+
+        "movq "DCTSIZE_S"*1*2(%%"REG_D"), %%mm7 \n\t"
+        "paddw %%mm3, %%mm5            \n\t"
+
+        "movq %%mm4, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
+        "paddw %%mm6, %%mm7            \n\t"
+
+        "movq 2*8+%3, %%mm3            \n\t"
+        "psubw %%mm0, %%mm6            \n\t"
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_D"), %%mm4 \n\t"
+        "paddw %%mm0, %%mm7            \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
+        "paddw %%mm3, %%mm4            \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
+        "psubw %%mm1, %%mm3            \n\t"
+
+        "movq "DCTSIZE_S"*5*2(%%"REG_D"), %%mm5 \n\t"
+        "paddw %%mm1, %%mm4            \n\t"
+
+        "movq "DCTSIZE_S"*3*2(%%"REG_D"), %%mm6 \n\t"
+        "paddw %%mm3, %%mm5            \n\t"
+
+        "movq 3*8+%3, %%mm0            \n\t"
+        "add $24, %%"REG_S"              \n\t"
+
+        "movq %%mm7, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
+        "paddw %%mm0, %%mm6            \n\t"
+
+        "movq %%mm4, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
+        "psubw %%mm2, %%mm0            \n\t"
+
+        "movq "DCTSIZE_S"*4*2(%%"REG_D"), %%mm7 \n\t"
+        "paddw %%mm2, %%mm6            \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
+        "paddw %%mm0, %%mm7            \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
+
+        "movq %%mm7, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
+        "add $24, %%"REG_D"              \n\t"
+        "sub $2, %%"REG_c"               \n\t"
+        "jnz 1b                \n\t"
+        "jmp 5f                   \n\t"
+
+        "3:                    \n\t"
+        //--- non DC2
+        //psraw mm1, 2 w/o it -> offset. thr1, thr1, thr1  (actually thr1, thr1, thr1-1)
+        //psraw mm5, 2
+        //psraw mm0, 2
+        //psraw mm6, 2
+        "movq %%mm5, %%mm3             \n\t"
+        "psubw %%mm1, %%mm5            \n\t"
+
+        "psllw $1, %%mm5              \n\t" //'z10
+        "paddw %%mm1, %%mm3            \n\t" //'z13
+
+        "movq %%mm0, %%mm2             \n\t"
+        "psubw %%mm6, %%mm0            \n\t"
+
+        "movq %%mm5, %%mm1             \n\t"
+        "psllw $1, %%mm0              \n\t" //'z12
+
+        "pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm1 \n\t" //-
+        "paddw %%mm0, %%mm5            \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm5 \n\t" //'z5
+        "paddw %%mm6, %%mm2            \n\t" //'z11
+
+        "pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm0 \n\t"
+        "movq %%mm2, %%mm7             \n\t"
+
+        //---
+        "movq 0*8+%3, %%mm4            \n\t"
+        "psubw %%mm3, %%mm2            \n\t"
+
+        "psllw $1, %%mm2              \n\t"
+        "paddw %%mm3, %%mm7            \n\t" //'t7
+
+        "pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //'t11
+        "movq %%mm4, %%mm6             \n\t"
+        //paddw mm7, MM_2
+        "psraw $2, %%mm7              \n\t"
+
+        "paddw "DCTSIZE_S"*0*2(%%"REG_D"), %%mm4 \n\t"
+        "psubw %%mm7, %%mm6            \n\t"
+
+        "movq 1*8+%3, %%mm3            \n\t"
+        "paddw %%mm7, %%mm4            \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*7*2(%%"REG_D") \n\t"
+        "paddw %%mm5, %%mm1            \n\t" //'t12
+
+        "movq %%mm4, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
+        "psubw %%mm7, %%mm1            \n\t" //'t6
+
+        "movq 2*8+%3, %%mm7            \n\t"
+        "psubw %%mm5, %%mm0            \n\t" //'t10
+
+        "movq 3*8+%3, %%mm6            \n\t"
+        "movq %%mm3, %%mm5             \n\t"
+
+        "paddw "DCTSIZE_S"*1*2(%%"REG_D"), %%mm3 \n\t"
+        "psubw %%mm1, %%mm5            \n\t"
+
+        "psubw %%mm1, %%mm2            \n\t" //'t5
+        "paddw %%mm1, %%mm3            \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*6*2(%%"REG_D") \n\t"
+        "movq %%mm7, %%mm4             \n\t"
+
+        "paddw "DCTSIZE_S"*2*2(%%"REG_D"), %%mm7 \n\t"
+        "psubw %%mm2, %%mm4            \n\t"
+
+        "paddw "DCTSIZE_S"*5*2(%%"REG_D"), %%mm4 \n\t"
+        "paddw %%mm2, %%mm7            \n\t"
+
+        "movq %%mm3, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
+        "paddw %%mm2, %%mm0            \n\t" //'t4
+
+        // 't4 't6 't5 - - - - 't7
+        "movq %%mm7, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
+        "movq %%mm6, %%mm1             \n\t"
+
+        "paddw "DCTSIZE_S"*4*2(%%"REG_D"), %%mm6 \n\t"
+        "psubw %%mm0, %%mm1            \n\t"
+
+        "paddw "DCTSIZE_S"*3*2(%%"REG_D"), %%mm1 \n\t"
+        "paddw %%mm0, %%mm6            \n\t"
+
+        "movq %%mm4, "DCTSIZE_S"*5*2(%%"REG_D") \n\t"
+        "add $24, %%"REG_S"              \n\t"
+
+        "movq %%mm6, "DCTSIZE_S"*4*2(%%"REG_D") \n\t"
+
+        "movq %%mm1, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
+        "add $24, %%"REG_D"              \n\t"
+        "sub $2, %%"REG_c"               \n\t"
+        "jnz 1b                \n\t"
+        "5:                      \n\t"
+
+        : "+S"(data), "+D"(output), "+c"(cnt), "=o"(temps)
+        : "d"(thr_adr)
+        : "%"REG_a
+        );
 }
 
 #endif // HAVE_MMX
@@ -1606,7 +1606,7 @@
 #if !HAVE_MMX
 
 static void row_idct_c(DCTELEM* workspace,
-		       int16_t* output_adr, int output_stride, int cnt)
+                       int16_t* output_adr, int output_stride, int cnt)
 {
     int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
     int_simd16_t tmp10, tmp11, tmp12, tmp13;
@@ -1618,256 +1618,256 @@
     wsptr = workspace;
     outptr = output_adr;
     for (; cnt > 0; cnt--) {
-	// Even part
-	//Simd version reads 4x4 block and transposes it
-	tmp10 = ( wsptr[2] +  wsptr[3]);
-	tmp11 = ( wsptr[2] -  wsptr[3]);
-
-	tmp13 = ( wsptr[0] +  wsptr[1]);
-	tmp12 = (MULTIPLY16H( wsptr[0] - wsptr[1], FIX_1_414213562_A)<<2) - tmp13;//this shift order to avoid overflow
-
-	tmp0 = tmp10 + tmp13; //->temps
-	tmp3 = tmp10 - tmp13; //->temps
-	tmp1 = tmp11 + tmp12;
-	tmp2 = tmp11 - tmp12;
-
-	// Odd part
-	//Also transpose, with previous:
-	// ---- ----      ||||
-	// ---- ---- idct ||||
-	// ---- ---- ---> ||||
-	// ---- ----      ||||
-	z13 = wsptr[4] + wsptr[5];
-	z10 = wsptr[4] - wsptr[5];
-	z11 = wsptr[6] + wsptr[7];
-	z12 = wsptr[6] - wsptr[7];
-
-	tmp7 = z11 + z13;
-	tmp11 = MULTIPLY16H(z11 - z13, FIX_1_414213562);
-
-	z5 =    MULTIPLY16H(z10 + z12, FIX_1_847759065);
-	tmp10 = MULTIPLY16H(z12, FIX_1_082392200) - z5;
-	tmp12 = MULTIPLY16H(z10, FIX_2_613125930) + z5; // - FIX_
-
-	tmp6 = (tmp12<<3) - tmp7;
-	tmp5 = (tmp11<<3) - tmp6;
-	tmp4 = (tmp10<<3) + tmp5;
-
-	// Final output stage: descale and write column
-	outptr[0*output_stride]+= DESCALE(tmp0 + tmp7, 3);
-	outptr[1*output_stride]+= DESCALE(tmp1 + tmp6, 3);
-	outptr[2*output_stride]+= DESCALE(tmp2 + tmp5, 3);
-	outptr[3*output_stride]+= DESCALE(tmp3 - tmp4, 3);
-	outptr[4*output_stride]+= DESCALE(tmp3 + tmp4, 3);
-	outptr[5*output_stride]+= DESCALE(tmp2 - tmp5, 3);
-	outptr[6*output_stride]+= DESCALE(tmp1 - tmp6, 3); //no += ?
-	outptr[7*output_stride]+= DESCALE(tmp0 - tmp7, 3); //no += ?
-	outptr++;
-
-	wsptr += DCTSIZE;       // advance pointer to next row
+        // Even part
+        //Simd version reads 4x4 block and transposes it
+        tmp10 = ( wsptr[2] +  wsptr[3]);
+        tmp11 = ( wsptr[2] -  wsptr[3]);
+
+        tmp13 = ( wsptr[0] +  wsptr[1]);
+        tmp12 = (MULTIPLY16H( wsptr[0] - wsptr[1], FIX_1_414213562_A)<<2) - tmp13;//this shift order to avoid overflow
+
+        tmp0 = tmp10 + tmp13; //->temps
+        tmp3 = tmp10 - tmp13; //->temps
+        tmp1 = tmp11 + tmp12;
+        tmp2 = tmp11 - tmp12;
+
+        // Odd part
+        //Also transpose, with previous:
+        // ---- ----      ||||
+        // ---- ---- idct ||||
+        // ---- ---- ---> ||||
+        // ---- ----      ||||
+        z13 = wsptr[4] + wsptr[5];
+        z10 = wsptr[4] - wsptr[5];
+        z11 = wsptr[6] + wsptr[7];
+        z12 = wsptr[6] - wsptr[7];
+
+        tmp7 = z11 + z13;
+        tmp11 = MULTIPLY16H(z11 - z13, FIX_1_414213562);
+
+        z5 =    MULTIPLY16H(z10 + z12, FIX_1_847759065);
+        tmp10 = MULTIPLY16H(z12, FIX_1_082392200) - z5;
+        tmp12 = MULTIPLY16H(z10, FIX_2_613125930) + z5; // - FIX_
+
+        tmp6 = (tmp12<<3) - tmp7;
+        tmp5 = (tmp11<<3) - tmp6;
+        tmp4 = (tmp10<<3) + tmp5;
+
+        // Final output stage: descale and write column
+        outptr[0*output_stride]+= DESCALE(tmp0 + tmp7, 3);
+        outptr[1*output_stride]+= DESCALE(tmp1 + tmp6, 3);
+        outptr[2*output_stride]+= DESCALE(tmp2 + tmp5, 3);
+        outptr[3*output_stride]+= DESCALE(tmp3 - tmp4, 3);
+        outptr[4*output_stride]+= DESCALE(tmp3 + tmp4, 3);
+        outptr[5*output_stride]+= DESCALE(tmp2 - tmp5, 3);
+        outptr[6*output_stride]+= DESCALE(tmp1 - tmp6, 3); //no += ?
+        outptr[7*output_stride]+= DESCALE(tmp0 - tmp7, 3); //no += ?
+        outptr++;
+
+        wsptr += DCTSIZE;       // advance pointer to next row
     }
 }
 
 #else /* HAVE_MMX */
 
 static void row_idct_mmx (DCTELEM* workspace,
-			  int16_t* output_adr,  int output_stride,  int cnt)
+                          int16_t* output_adr,  int output_stride,  int cnt)
 {
     uint64_t __attribute__((aligned(8))) temps[4];
     __asm__ volatile(
-	"lea (%%"REG_a",%%"REG_a",2), %%"REG_d"    \n\t"
-	"1:                     \n\t"
-	"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t"
-	//
-
-	"movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm1 \n\t"
-	"movq %%mm0, %%mm4             \n\t"
-
-	"movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
-	"punpcklwd %%mm1, %%mm0        \n\t"
-
-	"movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm3 \n\t"
-	"punpckhwd %%mm1, %%mm4        \n\t"
-
-	//transpose 4x4
-	"movq %%mm2, %%mm7             \n\t"
-	"punpcklwd %%mm3, %%mm2        \n\t"
-
-	"movq %%mm0, %%mm6             \n\t"
-	"punpckldq %%mm2, %%mm0        \n\t" //0
-
-	"punpckhdq %%mm2, %%mm6        \n\t" //1
-	"movq %%mm0, %%mm5             \n\t"
-
-	"punpckhwd %%mm3, %%mm7        \n\t"
-	"psubw %%mm6, %%mm0            \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm0 \n\t"
-	"movq %%mm4, %%mm2             \n\t"
-
-	"punpckldq %%mm7, %%mm4        \n\t" //2
-	"paddw %%mm6, %%mm5            \n\t"
-
-	"punpckhdq %%mm7, %%mm2        \n\t" //3
-	"movq %%mm4, %%mm1             \n\t"
-
-	"psllw $2, %%mm0              \n\t"
-	"paddw %%mm2, %%mm4            \n\t" //t10
-
-	"movq "DCTSIZE_S"*0*2+"DCTSIZE_S"(%%"REG_S"), %%mm3 \n\t"
-	"psubw %%mm2, %%mm1            \n\t" //t11
-
-	"movq "DCTSIZE_S"*1*2+"DCTSIZE_S"(%%"REG_S"), %%mm2 \n\t"
-	"psubw %%mm5, %%mm0            \n\t"
-
-	"movq %%mm4, %%mm6             \n\t"
-	"paddw %%mm5, %%mm4            \n\t" //t0
-
-	"psubw %%mm5, %%mm6            \n\t" //t3
-	"movq %%mm1, %%mm7             \n\t"
-
-	"movq "DCTSIZE_S"*2*2+"DCTSIZE_S"(%%"REG_S"), %%mm5 \n\t"
-	"paddw %%mm0, %%mm1            \n\t" //t1
-
-	"movq %%mm4, 0*8+%3            \n\t" //t0
-	"movq %%mm3, %%mm4             \n\t"
-
-	"movq %%mm6, 1*8+%3            \n\t" //t3
-	"punpcklwd %%mm2, %%mm3        \n\t"
-
-	//transpose 4x4
-	"movq "DCTSIZE_S"*3*2+"DCTSIZE_S"(%%"REG_S"), %%mm6 \n\t"
-	"punpckhwd %%mm2, %%mm4        \n\t"
-
-	"movq %%mm5, %%mm2             \n\t"
-	"punpcklwd %%mm6, %%mm5        \n\t"
-
-	"psubw %%mm0, %%mm7            \n\t" //t2
-	"punpckhwd %%mm6, %%mm2        \n\t"
-
-	"movq %%mm3, %%mm0             \n\t"
-	"punpckldq %%mm5, %%mm3        \n\t" //4
-
-	"punpckhdq %%mm5, %%mm0        \n\t" //5
-	"movq %%mm4, %%mm5             \n\t"
-
-	//
-	"movq %%mm3, %%mm6             \n\t"
-	"punpckldq %%mm2, %%mm4        \n\t" //6
-
-	"psubw %%mm0, %%mm3            \n\t" //z10
-	"punpckhdq %%mm2, %%mm5        \n\t" //7
-
-	"paddw %%mm0, %%mm6            \n\t" //z13
-	"movq %%mm4, %%mm2             \n\t"
-
-	"movq %%mm3, %%mm0             \n\t"
-	"psubw %%mm5, %%mm4            \n\t" //z12
-
-	"pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm0 \n\t" //-
-	"paddw %%mm4, %%mm3            \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm3 \n\t" //z5
-	"paddw %%mm5, %%mm2            \n\t" //z11  >
-
-	"pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm4 \n\t"
-	"movq %%mm2, %%mm5             \n\t"
-
-	"psubw %%mm6, %%mm2            \n\t"
-	"paddw %%mm6, %%mm5            \n\t" //t7
-
-	"pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //t11
-	"paddw %%mm3, %%mm0            \n\t" //t12
-
-	"psllw $3, %%mm0              \n\t"
-	"psubw %%mm3, %%mm4            \n\t" //t10
-
-	"movq 0*8+%3, %%mm6            \n\t"
-	"movq %%mm1, %%mm3             \n\t"
-
-	"psllw $3, %%mm4              \n\t"
-	"psubw %%mm5, %%mm0            \n\t" //t6
-
-	"psllw $3, %%mm2              \n\t"
-	"paddw %%mm0, %%mm1            \n\t" //d1
-
-	"psubw %%mm0, %%mm2            \n\t" //t5
-	"psubw %%mm0, %%mm3            \n\t" //d6
-
-	"paddw %%mm2, %%mm4            \n\t" //t4
-	"movq %%mm7, %%mm0             \n\t"
-
-	"paddw %%mm2, %%mm7            \n\t" //d2
-	"psubw %%mm2, %%mm0            \n\t" //d5
-
-	"movq "MANGLE(MM_DESCALE_RND)", %%mm2   \n\t" //4
-	"psubw %%mm5, %%mm6            \n\t" //d7
-
-	"paddw 0*8+%3, %%mm5           \n\t" //d0
-	"paddw %%mm2, %%mm1            \n\t"
-
-	"paddw %%mm2, %%mm5            \n\t"
-	"psraw $3, %%mm1              \n\t"
-
-	"paddw %%mm2, %%mm7            \n\t"
-	"psraw $3, %%mm5              \n\t"
-
-	"paddw (%%"REG_D"), %%mm5          \n\t"
-	"psraw $3, %%mm7              \n\t"
-
-	"paddw (%%"REG_D",%%"REG_a",), %%mm1    \n\t"
-	"paddw %%mm2, %%mm0            \n\t"
-
-	"paddw (%%"REG_D",%%"REG_a",2), %%mm7   \n\t"
-	"paddw %%mm2, %%mm3            \n\t"
-
-	"movq %%mm5, (%%"REG_D")           \n\t"
-	"paddw %%mm2, %%mm6            \n\t"
-
-	"movq %%mm1, (%%"REG_D",%%"REG_a",)     \n\t"
-	"psraw $3, %%mm0              \n\t"
-
-	"movq %%mm7, (%%"REG_D",%%"REG_a",2)    \n\t"
-	"add %%"REG_d", %%"REG_D"             \n\t" //3*ls
-
-	"movq 1*8+%3, %%mm5           \n\t" //t3
-	"psraw $3, %%mm3              \n\t"
-
-	"paddw (%%"REG_D",%%"REG_a",2), %%mm0   \n\t"
-	"psubw %%mm4, %%mm5            \n\t" //d3
-
-	"paddw (%%"REG_D",%%"REG_d",), %%mm3    \n\t"
-	"psraw $3, %%mm6              \n\t"
-
-	"paddw 1*8+%3, %%mm4           \n\t" //d4
-	"paddw %%mm2, %%mm5            \n\t"
-
-	"paddw (%%"REG_D",%%"REG_a",4), %%mm6   \n\t"
-	"paddw %%mm2, %%mm4            \n\t"
-
-	"movq %%mm0, (%%"REG_D",%%"REG_a",2)    \n\t"
-	"psraw $3, %%mm5              \n\t"
-
-	"paddw (%%"REG_D"), %%mm5          \n\t"
-	"psraw $3, %%mm4              \n\t"
-
-	"paddw (%%"REG_D",%%"REG_a",), %%mm4    \n\t"
-	"add $"DCTSIZE_S"*2*4, %%"REG_S"      \n\t" //4 rows
-
-	"movq %%mm3, (%%"REG_D",%%"REG_d",)     \n\t"
-	"movq %%mm6, (%%"REG_D",%%"REG_a",4)    \n\t"
-	"movq %%mm5, (%%"REG_D")           \n\t"
-	"movq %%mm4, (%%"REG_D",%%"REG_a",)     \n\t"
-
-	"sub %%"REG_d", %%"REG_D"             \n\t"
-	"add $8, %%"REG_D"               \n\t"
-	"dec %%"REG_c"                   \n\t"
-	"jnz 1b                  \n\t"
-
-	: "+S"(workspace), "+D"(output_adr), "+c"(cnt), "=o"(temps)
-	: "a"(output_stride*sizeof(short))
-	: "%"REG_d
-	);
+        "lea (%%"REG_a",%%"REG_a",2), %%"REG_d"    \n\t"
+        "1:                     \n\t"
+        "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t"
+        //
+
+        "movq "DCTSIZE_S"*1*2(%%"REG_S"), %%mm1 \n\t"
+        "movq %%mm0, %%mm4             \n\t"
+
+        "movq "DCTSIZE_S"*2*2(%%"REG_S"), %%mm2 \n\t"
+        "punpcklwd %%mm1, %%mm0        \n\t"
+
+        "movq "DCTSIZE_S"*3*2(%%"REG_S"), %%mm3 \n\t"
+        "punpckhwd %%mm1, %%mm4        \n\t"
+
+        //transpose 4x4
+        "movq %%mm2, %%mm7             \n\t"
+        "punpcklwd %%mm3, %%mm2        \n\t"
+
+        "movq %%mm0, %%mm6             \n\t"
+        "punpckldq %%mm2, %%mm0        \n\t" //0
+
+        "punpckhdq %%mm2, %%mm6        \n\t" //1
+        "movq %%mm0, %%mm5             \n\t"
+
+        "punpckhwd %%mm3, %%mm7        \n\t"
+        "psubw %%mm6, %%mm0            \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_414213562_A)", %%mm0 \n\t"
+        "movq %%mm4, %%mm2             \n\t"
+
+        "punpckldq %%mm7, %%mm4        \n\t" //2
+        "paddw %%mm6, %%mm5            \n\t"
+
+        "punpckhdq %%mm7, %%mm2        \n\t" //3
+        "movq %%mm4, %%mm1             \n\t"
+
+        "psllw $2, %%mm0              \n\t"
+        "paddw %%mm2, %%mm4            \n\t" //t10
+
+        "movq "DCTSIZE_S"*0*2+"DCTSIZE_S"(%%"REG_S"), %%mm3 \n\t"
+        "psubw %%mm2, %%mm1            \n\t" //t11
+
+        "movq "DCTSIZE_S"*1*2+"DCTSIZE_S"(%%"REG_S"), %%mm2 \n\t"
+        "psubw %%mm5, %%mm0            \n\t"
+
+        "movq %%mm4, %%mm6             \n\t"
+        "paddw %%mm5, %%mm4            \n\t" //t0
+
+        "psubw %%mm5, %%mm6            \n\t" //t3
+        "movq %%mm1, %%mm7             \n\t"
+
+        "movq "DCTSIZE_S"*2*2+"DCTSIZE_S"(%%"REG_S"), %%mm5 \n\t"
+        "paddw %%mm0, %%mm1            \n\t" //t1
+
+        "movq %%mm4, 0*8+%3            \n\t" //t0
+        "movq %%mm3, %%mm4             \n\t"
+
+        "movq %%mm6, 1*8+%3            \n\t" //t3
+        "punpcklwd %%mm2, %%mm3        \n\t"
+
+        //transpose 4x4
+        "movq "DCTSIZE_S"*3*2+"DCTSIZE_S"(%%"REG_S"), %%mm6 \n\t"
+        "punpckhwd %%mm2, %%mm4        \n\t"
+
+        "movq %%mm5, %%mm2             \n\t"
+        "punpcklwd %%mm6, %%mm5        \n\t"
+
+        "psubw %%mm0, %%mm7            \n\t" //t2
+        "punpckhwd %%mm6, %%mm2        \n\t"
+
+        "movq %%mm3, %%mm0             \n\t"
+        "punpckldq %%mm5, %%mm3        \n\t" //4
+
+        "punpckhdq %%mm5, %%mm0        \n\t" //5
+        "movq %%mm4, %%mm5             \n\t"
+
+        //
+        "movq %%mm3, %%mm6             \n\t"
+        "punpckldq %%mm2, %%mm4        \n\t" //6
+
+        "psubw %%mm0, %%mm3            \n\t" //z10
+        "punpckhdq %%mm2, %%mm5        \n\t" //7
+
+        "paddw %%mm0, %%mm6            \n\t" //z13
+        "movq %%mm4, %%mm2             \n\t"
+
+        "movq %%mm3, %%mm0             \n\t"
+        "psubw %%mm5, %%mm4            \n\t" //z12
+
+        "pmulhw "MANGLE(MM_FIX_2_613125930)", %%mm0 \n\t" //-
+        "paddw %%mm4, %%mm3            \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_847759065)", %%mm3 \n\t" //z5
+        "paddw %%mm5, %%mm2            \n\t" //z11  >
+
+        "pmulhw "MANGLE(MM_FIX_1_082392200)", %%mm4 \n\t"
+        "movq %%mm2, %%mm5             \n\t"
+
+        "psubw %%mm6, %%mm2            \n\t"
+        "paddw %%mm6, %%mm5            \n\t" //t7
+
+        "pmulhw "MANGLE(MM_FIX_1_414213562)", %%mm2 \n\t" //t11
+        "paddw %%mm3, %%mm0            \n\t" //t12
+
+        "psllw $3, %%mm0              \n\t"
+        "psubw %%mm3, %%mm4            \n\t" //t10
+
+        "movq 0*8+%3, %%mm6            \n\t"
+        "movq %%mm1, %%mm3             \n\t"
+
+        "psllw $3, %%mm4              \n\t"
+        "psubw %%mm5, %%mm0            \n\t" //t6
+
+        "psllw $3, %%mm2              \n\t"
+        "paddw %%mm0, %%mm1            \n\t" //d1
+
+        "psubw %%mm0, %%mm2            \n\t" //t5
+        "psubw %%mm0, %%mm3            \n\t" //d6
+
+        "paddw %%mm2, %%mm4            \n\t" //t4
+        "movq %%mm7, %%mm0             \n\t"
+
+        "paddw %%mm2, %%mm7            \n\t" //d2
+        "psubw %%mm2, %%mm0            \n\t" //d5
+
+        "movq "MANGLE(MM_DESCALE_RND)", %%mm2   \n\t" //4
+        "psubw %%mm5, %%mm6            \n\t" //d7
+
+        "paddw 0*8+%3, %%mm5           \n\t" //d0
+        "paddw %%mm2, %%mm1            \n\t"
+
+        "paddw %%mm2, %%mm5            \n\t"
+        "psraw $3, %%mm1              \n\t"
+
+        "paddw %%mm2, %%mm7            \n\t"
+        "psraw $3, %%mm5              \n\t"
+
+        "paddw (%%"REG_D"), %%mm5          \n\t"
+        "psraw $3, %%mm7              \n\t"
+
+        "paddw (%%"REG_D",%%"REG_a",), %%mm1    \n\t"
+        "paddw %%mm2, %%mm0            \n\t"
+
+        "paddw (%%"REG_D",%%"REG_a",2), %%mm7   \n\t"
+        "paddw %%mm2, %%mm3            \n\t"
+
+        "movq %%mm5, (%%"REG_D")           \n\t"
+        "paddw %%mm2, %%mm6            \n\t"
+
+        "movq %%mm1, (%%"REG_D",%%"REG_a",)     \n\t"
+        "psraw $3, %%mm0              \n\t"
+
+        "movq %%mm7, (%%"REG_D",%%"REG_a",2)    \n\t"
+        "add %%"REG_d", %%"REG_D"             \n\t" //3*ls
+
+        "movq 1*8+%3, %%mm5           \n\t" //t3
+        "psraw $3, %%mm3              \n\t"
+
+        "paddw (%%"REG_D",%%"REG_a",2), %%mm0   \n\t"
+        "psubw %%mm4, %%mm5            \n\t" //d3
+
+        "paddw (%%"REG_D",%%"REG_d",), %%mm3    \n\t"
+        "psraw $3, %%mm6              \n\t"
+
+        "paddw 1*8+%3, %%mm4           \n\t" //d4
+        "paddw %%mm2, %%mm5            \n\t"
+
+        "paddw (%%"REG_D",%%"REG_a",4), %%mm6   \n\t"
+        "paddw %%mm2, %%mm4            \n\t"
+
+        "movq %%mm0, (%%"REG_D",%%"REG_a",2)    \n\t"
+        "psraw $3, %%mm5              \n\t"
+
+        "paddw (%%"REG_D"), %%mm5          \n\t"
+        "psraw $3, %%mm4              \n\t"
+
+        "paddw (%%"REG_D",%%"REG_a",), %%mm4    \n\t"
+        "add $"DCTSIZE_S"*2*4, %%"REG_S"      \n\t" //4 rows
+
+        "movq %%mm3, (%%"REG_D",%%"REG_d",)     \n\t"
+        "movq %%mm6, (%%"REG_D",%%"REG_a",4)    \n\t"
+        "movq %%mm5, (%%"REG_D")           \n\t"
+        "movq %%mm4, (%%"REG_D",%%"REG_a",)     \n\t"
+
+        "sub %%"REG_d", %%"REG_D"             \n\t"
+        "add $8, %%"REG_D"               \n\t"
+        "dec %%"REG_c"                   \n\t"
+        "jnz 1b                  \n\t"
+
+        : "+S"(workspace), "+D"(output_adr), "+c"(cnt), "=o"(temps)
+        : "a"(output_stride*sizeof(short))
+        : "%"REG_d
+        );
 }
 
 #endif // HAVE_MMX
@@ -1886,52 +1886,52 @@
 
     dataptr = data;
     for (; cnt > 0; cnt--) {
-	tmp0 = pixels[line_size*0] + pixels[line_size*7];
-	tmp7 = pixels[line_size*0] - pixels[line_size*7];
-	tmp1 = pixels[line_size*1] + pixels[line_size*6];
-	tmp6 = pixels[line_size*1] - pixels[line_size*6];
-	tmp2 = pixels[line_size*2] + pixels[line_size*5];
-	tmp5 = pixels[line_size*2] - pixels[line_size*5];
-	tmp3 = pixels[line_size*3] + pixels[line_size*4];
-	tmp4 = pixels[line_size*3] - pixels[line_size*4];
-
-	// Even part
-
-	tmp10 = tmp0 + tmp3;
-	tmp13 = tmp0 - tmp3;
-	tmp11 = tmp1 + tmp2;
-	tmp12 = tmp1 - tmp2;
-	//Even columns are written first, this leads to different order of columns
-	//in column_fidct(), but they are processed independently, so all ok.
-	//Later in the row_idct() columns readed at the same order.
-	dataptr[2] = tmp10 + tmp11;
-	dataptr[3] = tmp10 - tmp11;
-
-	z1 = MULTIPLY16H((tmp12 + tmp13)<<2, FIX_0_707106781);
-	dataptr[0] = tmp13 + z1;
-	dataptr[1] = tmp13 - z1;
-
-	// Odd part
-
-	tmp10 = (tmp4 + tmp5) <<2;
-	tmp11 = (tmp5 + tmp6) <<2;
-	tmp12 = (tmp6 + tmp7) <<2;
-
-	z5 = MULTIPLY16H(tmp10 - tmp12, FIX_0_382683433);
-	z2 = MULTIPLY16H(tmp10, FIX_0_541196100) + z5;
-	z4 = MULTIPLY16H(tmp12, FIX_1_306562965) + z5;
-	z3 = MULTIPLY16H(tmp11, FIX_0_707106781);
-
-	z11 = tmp7 + z3;
-	z13 = tmp7 - z3;
-
-	dataptr[4] = z13 + z2;
-	dataptr[5] = z13 - z2;
-	dataptr[6] = z11 + z4;
-	dataptr[7] = z11 - z4;
-
-	pixels++;               // advance pointer to next column
-	dataptr += DCTSIZE;
+        tmp0 = pixels[line_size*0] + pixels[line_size*7];
+        tmp7 = pixels[line_size*0] - pixels[line_size*7];
+        tmp1 = pixels[line_size*1] + pixels[line_size*6];
+        tmp6 = pixels[line_size*1] - pixels[line_size*6];
+        tmp2 = pixels[line_size*2] + pixels[line_size*5];
+        tmp5 = pixels[line_size*2] - pixels[line_size*5];
+        tmp3 = pixels[line_size*3] + pixels[line_size*4];
+        tmp4 = pixels[line_size*3] - pixels[line_size*4];
+
+        // Even part
+
+        tmp10 = tmp0 + tmp3;
+        tmp13 = tmp0 - tmp3;
+        tmp11 = tmp1 + tmp2;
+        tmp12 = tmp1 - tmp2;
+        //Even columns are written first, this leads to different order of columns
+        //in column_fidct(), but they are processed independently, so all ok.
+        //Later in the row_idct() columns readed at the same order.
+        dataptr[2] = tmp10 + tmp11;
+        dataptr[3] = tmp10 - tmp11;
+
+        z1 = MULTIPLY16H((tmp12 + tmp13)<<2, FIX_0_707106781);
+        dataptr[0] = tmp13 + z1;
+        dataptr[1] = tmp13 - z1;
+
+        // Odd part
+
+        tmp10 = (tmp4 + tmp5) <<2;
+        tmp11 = (tmp5 + tmp6) <<2;
+        tmp12 = (tmp6 + tmp7) <<2;
+
+        z5 = MULTIPLY16H(tmp10 - tmp12, FIX_0_382683433);
+        z2 = MULTIPLY16H(tmp10, FIX_0_541196100) + z5;
+        z4 = MULTIPLY16H(tmp12, FIX_1_306562965) + z5;
+        z3 = MULTIPLY16H(tmp11, FIX_0_707106781);
+
+        z11 = tmp7 + z3;
+        z13 = tmp7 - z3;
+
+        dataptr[4] = z13 + z2;
+        dataptr[5] = z13 - z2;
+        dataptr[6] = z11 + z4;
+        dataptr[7] = z11 - z4;
+
+        pixels++;               // advance pointer to next column
+        dataptr += DCTSIZE;
     }
 }
 
@@ -1941,177 +1941,177 @@
 {
     uint64_t __attribute__((aligned(8))) temps[4];
     __asm__ volatile(
-	"lea (%%"REG_a",%%"REG_a",2), %%"REG_d"    \n\t"
-	"6:                     \n\t"
-	"movd (%%"REG_S"), %%mm0           \n\t"
-	"pxor %%mm7, %%mm7             \n\t"
-
-	"movd (%%"REG_S",%%"REG_a",), %%mm1     \n\t"
-	"punpcklbw %%mm7, %%mm0        \n\t"
-
-	"movd (%%"REG_S",%%"REG_a",2), %%mm2    \n\t"
-	"punpcklbw %%mm7, %%mm1        \n\t"
-
-	"punpcklbw %%mm7, %%mm2        \n\t"
-	"add %%"REG_d", %%"REG_S"             \n\t"
-
-	"movq %%mm0, %%mm5             \n\t"
-	//
-
-	"movd (%%"REG_S",%%"REG_a",4), %%mm3    \n\t" //7  ;prefetch!
-	"movq %%mm1, %%mm6             \n\t"
-
-	"movd (%%"REG_S",%%"REG_d",), %%mm4     \n\t" //6
-	"punpcklbw %%mm7, %%mm3        \n\t"
-
-	"psubw %%mm3, %%mm5            \n\t"
-	"punpcklbw %%mm7, %%mm4        \n\t"
-
-	"paddw %%mm3, %%mm0            \n\t"
-	"psubw %%mm4, %%mm6            \n\t"
-
-	"movd (%%"REG_S",%%"REG_a",2), %%mm3    \n\t" //5
-	"paddw %%mm4, %%mm1            \n\t"
-
-	"movq %%mm5, 0*8+%3            \n\t" //t7
-	"punpcklbw %%mm7, %%mm3        \n\t"
-
-	"movq %%mm6, 1*8+%3            \n\t" //t6
-	"movq %%mm2, %%mm4             \n\t"
-
-	"movd (%%"REG_S"), %%mm5           \n\t" //3
-	"paddw %%mm3, %%mm2            \n\t"
-
-	"movd (%%"REG_S",%%"REG_a",), %%mm6     \n\t" //4
-	"punpcklbw %%mm7, %%mm5        \n\t"
-
-	"psubw %%mm3, %%mm4            \n\t"
-	"punpcklbw %%mm7, %%mm6        \n\t"
-
-	"movq %%mm5, %%mm3             \n\t"
-	"paddw %%mm6, %%mm5            \n\t" //t3
-
-	"psubw %%mm6, %%mm3            \n\t" //t4  ; t0 t1 t2 t4 t5 t3 - -
-	"movq %%mm0, %%mm6             \n\t"
-
-	"movq %%mm1, %%mm7             \n\t"
-	"psubw %%mm5, %%mm0            \n\t" //t13
-
-	"psubw %%mm2, %%mm1            \n\t"
-	"paddw %%mm2, %%mm7            \n\t" //t11
-
-	"paddw %%mm0, %%mm1            \n\t"
-	"movq %%mm7, %%mm2             \n\t"
-
-	"psllw $2, %%mm1              \n\t"
-	"paddw %%mm5, %%mm6            \n\t" //t10
-
-	"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm1 \n\t"
-	"paddw %%mm6, %%mm7            \n\t" //d2
-
-	"psubw %%mm2, %%mm6            \n\t" //d3
-	"movq %%mm0, %%mm5             \n\t"
-
-	//transpose 4x4
-	"movq %%mm7, %%mm2             \n\t"
-	"punpcklwd %%mm6, %%mm7        \n\t"
-
-	"paddw %%mm1, %%mm0            \n\t" //d0
-	"punpckhwd %%mm6, %%mm2        \n\t"
-
-	"psubw %%mm1, %%mm5            \n\t" //d1
-	"movq %%mm0, %%mm6             \n\t"
-
-	"movq 1*8+%3, %%mm1            \n\t"
-	"punpcklwd %%mm5, %%mm0        \n\t"
-
-	"punpckhwd %%mm5, %%mm6        \n\t"
-	"movq %%mm0, %%mm5             \n\t"
-
-	"punpckldq %%mm7, %%mm0        \n\t" //0
-	"paddw %%mm4, %%mm3            \n\t"
-
-	"punpckhdq %%mm7, %%mm5        \n\t" //1
-	"movq %%mm6, %%mm7             \n\t"
-
-	"movq %%mm0, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
-	"punpckldq %%mm2, %%mm6        \n\t" //2
-
-	"movq %%mm5, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
-	"punpckhdq %%mm2, %%mm7        \n\t" //3
-
-	"movq %%mm6, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
-	"paddw %%mm1, %%mm4            \n\t"
-
-	"movq %%mm7, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
-	"psllw $2, %%mm3              \n\t" //t10
-
-	"movq 0*8+%3, %%mm2           \n\t"
-	"psllw $2, %%mm4              \n\t" //t11
-
-	"pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm4 \n\t" //z3
-	"paddw %%mm2, %%mm1            \n\t"
-
-	"psllw $2, %%mm1              \n\t" //t12
-	"movq %%mm3, %%mm0             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm0 \n\t"
-	"psubw %%mm1, %%mm3            \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t" //z5
-	"movq %%mm2, %%mm5             \n\t"
-
-	"pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm1 \n\t"
-	"psubw %%mm4, %%mm2            \n\t" //z13
-
-	"paddw %%mm4, %%mm5            \n\t" //z11
-	"movq %%mm2, %%mm6             \n\t"
-
-	"paddw %%mm3, %%mm0            \n\t" //z2
-	"movq %%mm5, %%mm7             \n\t"
-
-	"paddw %%mm0, %%mm2            \n\t" //d4
-	"psubw %%mm0, %%mm6            \n\t" //d5
-
-	"movq %%mm2, %%mm4             \n\t"
-	"paddw %%mm3, %%mm1            \n\t" //z4
-
-	//transpose 4x4
-	"punpcklwd %%mm6, %%mm2        \n\t"
-	"paddw %%mm1, %%mm5            \n\t" //d6
-
-	"punpckhwd %%mm6, %%mm4        \n\t"
-	"psubw %%mm1, %%mm7            \n\t" //d7
-
-	"movq %%mm5, %%mm6             \n\t"
-	"punpcklwd %%mm7, %%mm5        \n\t"
-
-	"punpckhwd %%mm7, %%mm6        \n\t"
-	"movq %%mm2, %%mm7             \n\t"
-
-	"punpckldq %%mm5, %%mm2        \n\t" //4
-	"sub %%"REG_d", %%"REG_S"             \n\t"
-
-	"punpckhdq %%mm5, %%mm7        \n\t" //5
-	"movq %%mm4, %%mm5             \n\t"
-
-	"movq %%mm2, "DCTSIZE_S"*0*2+"DCTSIZE_S"(%%"REG_D") \n\t"
-	"punpckldq %%mm6, %%mm4        \n\t" //6
-
-	"movq %%mm7, "DCTSIZE_S"*1*2+"DCTSIZE_S"(%%"REG_D") \n\t"
-	"punpckhdq %%mm6, %%mm5        \n\t" //7
-
-	"movq %%mm4, "DCTSIZE_S"*2*2+"DCTSIZE_S"(%%"REG_D") \n\t"
-	"add $4, %%"REG_S"               \n\t"
-
-	"movq %%mm5, "DCTSIZE_S"*3*2+"DCTSIZE_S"(%%"REG_D") \n\t"
-	"add $"DCTSIZE_S"*2*4, %%"REG_D"      \n\t" //4 rows
-	"dec %%"REG_c"                   \n\t"
-	"jnz 6b                  \n\t"
-
-	: "+S"(pixels), "+D"(data), "+c"(cnt), "=o"(temps)
-	: "a"(line_size)
-	: "%"REG_d);
+        "lea (%%"REG_a",%%"REG_a",2), %%"REG_d"    \n\t"
+        "6:                     \n\t"
+        "movd (%%"REG_S"), %%mm0           \n\t"
+        "pxor %%mm7, %%mm7             \n\t"
+
+        "movd (%%"REG_S",%%"REG_a",), %%mm1     \n\t"
+        "punpcklbw %%mm7, %%mm0        \n\t"
+
+        "movd (%%"REG_S",%%"REG_a",2), %%mm2    \n\t"
+        "punpcklbw %%mm7, %%mm1        \n\t"
+
+        "punpcklbw %%mm7, %%mm2        \n\t"
+        "add %%"REG_d", %%"REG_S"             \n\t"
+
+        "movq %%mm0, %%mm5             \n\t"
+        //
+
+        "movd (%%"REG_S",%%"REG_a",4), %%mm3    \n\t" //7  ;prefetch!
+        "movq %%mm1, %%mm6             \n\t"
+
+        "movd (%%"REG_S",%%"REG_d",), %%mm4     \n\t" //6
+        "punpcklbw %%mm7, %%mm3        \n\t"
+
+        "psubw %%mm3, %%mm5            \n\t"
+        "punpcklbw %%mm7, %%mm4        \n\t"
+
+        "paddw %%mm3, %%mm0            \n\t"
+        "psubw %%mm4, %%mm6            \n\t"
+
+        "movd (%%"REG_S",%%"REG_a",2), %%mm3    \n\t" //5
+        "paddw %%mm4, %%mm1            \n\t"
+
+        "movq %%mm5, 0*8+%3            \n\t" //t7
+        "punpcklbw %%mm7, %%mm3        \n\t"
+
+        "movq %%mm6, 1*8+%3            \n\t" //t6
+        "movq %%mm2, %%mm4             \n\t"
+
+        "movd (%%"REG_S"), %%mm5           \n\t" //3
+        "paddw %%mm3, %%mm2            \n\t"
+
+        "movd (%%"REG_S",%%"REG_a",), %%mm6     \n\t" //4
+        "punpcklbw %%mm7, %%mm5        \n\t"
+
+        "psubw %%mm3, %%mm4            \n\t"
+        "punpcklbw %%mm7, %%mm6        \n\t"
+
+        "movq %%mm5, %%mm3             \n\t"
+        "paddw %%mm6, %%mm5            \n\t" //t3
+
+        "psubw %%mm6, %%mm3            \n\t" //t4  ; t0 t1 t2 t4 t5 t3 - -
+        "movq %%mm0, %%mm6             \n\t"
+
+        "movq %%mm1, %%mm7             \n\t"
+        "psubw %%mm5, %%mm0            \n\t" //t13
+
+        "psubw %%mm2, %%mm1            \n\t"
+        "paddw %%mm2, %%mm7            \n\t" //t11
+
+        "paddw %%mm0, %%mm1            \n\t"
+        "movq %%mm7, %%mm2             \n\t"
+
+        "psllw $2, %%mm1              \n\t"
+        "paddw %%mm5, %%mm6            \n\t" //t10
+
+        "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm1 \n\t"
+        "paddw %%mm6, %%mm7            \n\t" //d2
+
+        "psubw %%mm2, %%mm6            \n\t" //d3
+        "movq %%mm0, %%mm5             \n\t"
+
+        //transpose 4x4
+        "movq %%mm7, %%mm2             \n\t"
+        "punpcklwd %%mm6, %%mm7        \n\t"
+
+        "paddw %%mm1, %%mm0            \n\t" //d0
+        "punpckhwd %%mm6, %%mm2        \n\t"
+
+        "psubw %%mm1, %%mm5            \n\t" //d1
+        "movq %%mm0, %%mm6             \n\t"
+
+        "movq 1*8+%3, %%mm1            \n\t"
+        "punpcklwd %%mm5, %%mm0        \n\t"
+
+        "punpckhwd %%mm5, %%mm6        \n\t"
+        "movq %%mm0, %%mm5             \n\t"
+
+        "punpckldq %%mm7, %%mm0        \n\t" //0
+        "paddw %%mm4, %%mm3            \n\t"
+
+        "punpckhdq %%mm7, %%mm5        \n\t" //1
+        "movq %%mm6, %%mm7             \n\t"
+
+        "movq %%mm0, "DCTSIZE_S"*0*2(%%"REG_D") \n\t"
+        "punpckldq %%mm2, %%mm6        \n\t" //2
+
+        "movq %%mm5, "DCTSIZE_S"*1*2(%%"REG_D") \n\t"
+        "punpckhdq %%mm2, %%mm7        \n\t" //3
+
+        "movq %%mm6, "DCTSIZE_S"*2*2(%%"REG_D") \n\t"
+        "paddw %%mm1, %%mm4            \n\t"
+
+        "movq %%mm7, "DCTSIZE_S"*3*2(%%"REG_D") \n\t"
+        "psllw $2, %%mm3              \n\t" //t10
+
+        "movq 0*8+%3, %%mm2           \n\t"
+        "psllw $2, %%mm4              \n\t" //t11
+
+        "pmulhw "MANGLE(MM_FIX_0_707106781)", %%mm4 \n\t" //z3
+        "paddw %%mm2, %%mm1            \n\t"
+
+        "psllw $2, %%mm1              \n\t" //t12
+        "movq %%mm3, %%mm0             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_541196100)", %%mm0 \n\t"
+        "psubw %%mm1, %%mm3            \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_0_382683433)", %%mm3 \n\t" //z5
+        "movq %%mm2, %%mm5             \n\t"
+
+        "pmulhw "MANGLE(MM_FIX_1_306562965)", %%mm1 \n\t"
+        "psubw %%mm4, %%mm2            \n\t" //z13
+
+        "paddw %%mm4, %%mm5            \n\t" //z11
+        "movq %%mm2, %%mm6             \n\t"
+
+        "paddw %%mm3, %%mm0            \n\t" //z2
+        "movq %%mm5, %%mm7             \n\t"
+
+        "paddw %%mm0, %%mm2            \n\t" //d4
+        "psubw %%mm0, %%mm6            \n\t" //d5
+
+        "movq %%mm2, %%mm4             \n\t"
+        "paddw %%mm3, %%mm1            \n\t" //z4
+
+        //transpose 4x4
+        "punpcklwd %%mm6, %%mm2        \n\t"
+        "paddw %%mm1, %%mm5            \n\t" //d6
+
+        "punpckhwd %%mm6, %%mm4        \n\t"
+        "psubw %%mm1, %%mm7            \n\t" //d7
+
+        "movq %%mm5, %%mm6             \n\t"
+        "punpcklwd %%mm7, %%mm5        \n\t"
+
+        "punpckhwd %%mm7, %%mm6        \n\t"
+        "movq %%mm2, %%mm7             \n\t"
+
+        "punpckldq %%mm5, %%mm2        \n\t" //4
+        "sub %%"REG_d", %%"REG_S"             \n\t"
+
+        "punpckhdq %%mm5, %%mm7        \n\t" //5
+        "movq %%mm4, %%mm5             \n\t"
+
+        "movq %%mm2, "DCTSIZE_S"*0*2+"DCTSIZE_S"(%%"REG_D") \n\t"
+        "punpckldq %%mm6, %%mm4        \n\t" //6
+
+        "movq %%mm7, "DCTSIZE_S"*1*2+"DCTSIZE_S"(%%"REG_D") \n\t"
+        "punpckhdq %%mm6, %%mm5        \n\t" //7
+
+        "movq %%mm4, "DCTSIZE_S"*2*2+"DCTSIZE_S"(%%"REG_D") \n\t"
+        "add $4, %%"REG_S"               \n\t"
+
+        "movq %%mm5, "DCTSIZE_S"*3*2+"DCTSIZE_S"(%%"REG_D") \n\t"
+        "add $"DCTSIZE_S"*2*4, %%"REG_D"      \n\t" //4 rows
+        "dec %%"REG_c"                   \n\t"
+        "jnz 6b                  \n\t"
+
+        : "+S"(pixels), "+D"(data), "+c"(cnt), "=o"(temps)
+        : "a"(line_size)
+        : "%"REG_d);
 }
 
 #endif // HAVE_MMX
--- a/libmpcodecs/vf_harddup.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_harddup.c	Fri Jan 14 22:10:21 2011 +0000
@@ -28,58 +28,58 @@
 #include "vf.h"
 
 struct vf_priv_s {
-	mp_image_t *last_mpi;
+    mp_image_t *last_mpi;
 };
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+    mp_image_t *dmpi;
 
-	vf->priv->last_mpi = mpi;
+    vf->priv->last_mpi = mpi;
 
-	dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);
+    dmpi = vf_get_image(vf->next, mpi->imgfmt,
+        MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);
 
-	dmpi->planes[0] = mpi->planes[0];
-	dmpi->stride[0] = mpi->stride[0];
-	if (dmpi->flags&MP_IMGFLAG_PLANAR) {
-		dmpi->planes[1] = mpi->planes[1];
-		dmpi->stride[1] = mpi->stride[1];
-		dmpi->planes[2] = mpi->planes[2];
-		dmpi->stride[2] = mpi->stride[2];
-	}
+    dmpi->planes[0] = mpi->planes[0];
+    dmpi->stride[0] = mpi->stride[0];
+    if (dmpi->flags&MP_IMGFLAG_PLANAR) {
+        dmpi->planes[1] = mpi->planes[1];
+        dmpi->stride[1] = mpi->stride[1];
+        dmpi->planes[2] = mpi->planes[2];
+        dmpi->stride[2] = mpi->stride[2];
+    }
 
-	return vf_next_put_image(vf, dmpi, pts);
+    return vf_next_put_image(vf, dmpi, pts);
 }
 
 static int control(struct vf_instance *vf, int request, void* data)
 {
-	switch (request) {
-	case VFCTRL_DUPLICATE_FRAME:
-		if (!vf->priv->last_mpi) break;
-		// This is a huge hack. We assume nothing
-		// has been called earlier in the filter chain
-		// since the last put_image. This is reasonable
-		// because we're handling a duplicate frame!
-		if (put_image(vf, vf->priv->last_mpi, MP_NOPTS_VALUE))
-			return CONTROL_TRUE;
-		break;
-	}
-	return vf_next_control(vf, request, data);
+    switch (request) {
+    case VFCTRL_DUPLICATE_FRAME:
+        if (!vf->priv->last_mpi) break;
+        // This is a huge hack. We assume nothing
+        // has been called earlier in the filter chain
+        // since the last put_image. This is reasonable
+        // because we're handling a duplicate frame!
+        if (put_image(vf, vf->priv->last_mpi, MP_NOPTS_VALUE))
+            return CONTROL_TRUE;
+        break;
+    }
+    return vf_next_control(vf, request, data);
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->put_image = put_image;
-	vf->control = control;
-	vf->uninit = uninit;
-	vf->priv = calloc(1, sizeof(struct vf_priv_s));
-	return 1;
+    vf->put_image = put_image;
+    vf->control = control;
+    vf->uninit = uninit;
+    vf->priv = calloc(1, sizeof(struct vf_priv_s));
+    return 1;
 }
 
 const vf_info_t vf_info_harddup = {
--- a/libmpcodecs/vf_hqdn3d.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_hqdn3d.c	Fri Jan 14 22:10:21 2011 +0000
@@ -38,7 +38,7 @@
 struct vf_priv_s {
         int Coefs[4][512*16];
         unsigned int *Line;
-	unsigned short *Frame[3];
+        unsigned short *Frame[3];
 };
 
 
@@ -46,25 +46,25 @@
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv->Line);
-	free(vf->priv->Frame[0]);
-	free(vf->priv->Frame[1]);
-	free(vf->priv->Frame[2]);
+        free(vf->priv->Line);
+        free(vf->priv->Frame[0]);
+        free(vf->priv->Frame[1]);
+        free(vf->priv->Frame[2]);
 
-	vf->priv->Line     = NULL;
-	vf->priv->Frame[0] = NULL;
-	vf->priv->Frame[1] = NULL;
-	vf->priv->Frame[2] = NULL;
+        vf->priv->Line     = NULL;
+        vf->priv->Frame[0] = NULL;
+        vf->priv->Frame[1] = NULL;
+        vf->priv->Frame[2] = NULL;
 }
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
-	uninit(vf);
+        uninit(vf);
         vf->priv->Line = malloc(width*sizeof(int));
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static inline unsigned int LowPassMul(unsigned int PrevMul, unsigned int CurrMul, int* Coef){
@@ -119,8 +119,8 @@
     }
 
     for (Y = 1; Y < H; Y++){
-	unsigned int PixelAnt;
-	sLineOffs += sStride, dLineOffs += dStride;
+        unsigned int PixelAnt;
+        sLineOffs += sStride, dLineOffs += dStride;
         /* First pixel on each line doesn't have previous pixel */
         PixelAnt = Frame[sLineOffs]<<16;
         PixelDst = LineAnt[0] = LowPassMul(LineAnt[0], PixelAnt, Vertical);
@@ -139,7 +139,7 @@
 static void deNoise(unsigned char *Frame,        // mpi->planes[x]
                     unsigned char *FrameDest,    // dmpi->planes[x]
                     unsigned int *LineAnt,      // vf->priv->Line (width bytes)
-		    unsigned short **FrameAntPtr,
+                    unsigned short **FrameAntPtr,
                     int W, int H, int sStride, int dStride,
                     int *Horizontal, int *Vertical, int *Temporal)
 {
@@ -150,12 +150,12 @@
     unsigned short* FrameAnt=(*FrameAntPtr);
 
     if(!FrameAnt){
-	(*FrameAntPtr)=FrameAnt=malloc(W*H*sizeof(unsigned short));
-	for (Y = 0; Y < H; Y++){
-	    unsigned short* dst=&FrameAnt[Y*W];
-	    unsigned char* src=Frame+Y*sStride;
-	    for (X = 0; X < W; X++) dst[X]=src[X]<<8;
-	}
+        (*FrameAntPtr)=FrameAnt=malloc(W*H*sizeof(unsigned short));
+        for (Y = 0; Y < H; Y++){
+            unsigned short* dst=&FrameAnt[Y*W];
+            unsigned char* src=Frame+Y*sStride;
+            for (X = 0; X < W; X++) dst[X]=src[X]<<8;
+        }
     }
 
     if(!Horizontal[0] && !Vertical[0]){
@@ -185,13 +185,13 @@
     }
 
     for (Y = 1; Y < H; Y++){
-	unsigned int PixelAnt;
-	unsigned short* LinePrev=&FrameAnt[Y*W];
-	sLineOffs += sStride, dLineOffs += dStride;
+        unsigned int PixelAnt;
+        unsigned short* LinePrev=&FrameAnt[Y*W];
+        sLineOffs += sStride, dLineOffs += dStride;
         /* First pixel on each line doesn't have previous pixel */
         PixelAnt = Frame[sLineOffs]<<16;
         LineAnt[0] = LowPassMul(LineAnt[0], PixelAnt, Vertical);
-	PixelDst = LowPassMul(LinePrev[0]<<8, LineAnt[0], Temporal);
+        PixelDst = LowPassMul(LinePrev[0]<<8, LineAnt[0], Temporal);
         LinePrev[0] = ((PixelDst+0x1000007F)>>8);
         FrameDest[dLineOffs]= ((PixelDst+0x10007FFF)>>16);
 
@@ -200,7 +200,7 @@
             /* The rest are normal */
             PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs+X]<<16, Horizontal);
             LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical);
-	    PixelDst = LowPassMul(LinePrev[X]<<8, LineAnt[X], Temporal);
+            PixelDst = LowPassMul(LinePrev[X]<<8, LineAnt[X], Temporal);
             LinePrev[X] = ((PixelDst+0x1000007F)>>8);
             FrameDest[dLineOffs+X]= ((PixelDst+0x10007FFF)>>16);
         }
@@ -209,53 +209,53 @@
 
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
+        int cw= mpi->w >> mpi->chroma_x_shift;
+        int ch= mpi->h >> mpi->chroma_y_shift;
         int W = mpi->w, H = mpi->h;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+                MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
                 mpi->w,mpi->h);
 
-	if(!dmpi) return 0;
+        if(!dmpi) return 0;
 
         deNoise(mpi->planes[0], dmpi->planes[0],
-		vf->priv->Line, &vf->priv->Frame[0], W, H,
+                vf->priv->Line, &vf->priv->Frame[0], W, H,
                 mpi->stride[0], dmpi->stride[0],
                 vf->priv->Coefs[0],
                 vf->priv->Coefs[0],
                 vf->priv->Coefs[1]);
         deNoise(mpi->planes[1], dmpi->planes[1],
-		vf->priv->Line, &vf->priv->Frame[1], cw, ch,
+                vf->priv->Line, &vf->priv->Frame[1], cw, ch,
                 mpi->stride[1], dmpi->stride[1],
                 vf->priv->Coefs[2],
                 vf->priv->Coefs[2],
                 vf->priv->Coefs[3]);
         deNoise(mpi->planes[2], dmpi->planes[2],
-		vf->priv->Line, &vf->priv->Frame[2], cw, ch,
+                vf->priv->Line, &vf->priv->Frame[2], cw, ch,
                 mpi->stride[2], dmpi->stride[2],
                 vf->priv->Coefs[2],
                 vf->priv->Coefs[2],
                 vf->priv->Coefs[3]);
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
         switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        {
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_YVU9:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 
@@ -283,11 +283,11 @@
         double LumSpac, LumTmp, ChromSpac, ChromTmp;
         double Param1, Param2, Param3, Param4;
 
-	vf->config=config;
-	vf->put_image=put_image;
+        vf->config=config;
+        vf->put_image=put_image;
         vf->query_format=query_format;
         vf->uninit=uninit;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
+        vf->priv=malloc(sizeof(struct vf_priv_s));
         memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
         if (args)
@@ -358,7 +358,7 @@
         PrecalcCoefs(vf->priv->Coefs[2], ChromSpac);
         PrecalcCoefs(vf->priv->Coefs[3], ChromTmp);
 
-	return 1;
+        return 1;
 }
 
 const vf_info_t vf_info_hqdn3d = {
--- a/libmpcodecs/vf_hue.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_hue.c	Fri Jan 14 22:10:21 2011 +0000
@@ -36,9 +36,9 @@
 #include "m_struct.h"
 
 static struct vf_priv_s {
-	uint8_t *buf[2];
-	float hue;
-	float saturation;
+        uint8_t *buf[2];
+        float hue;
+        float saturation;
 } const vf_priv_dflt = {
   {NULL, NULL},
   0.0,
@@ -46,134 +46,134 @@
 };
 
 static void process_C(uint8_t *udst, uint8_t *vdst, uint8_t *usrc, uint8_t *vsrc, int dststride, int srcstride,
-		    int w, int h, float hue, float sat)
+                    int w, int h, float hue, float sat)
 {
-	int i;
-	const int s= rint(sin(hue) * (1<<16) * sat);
-	const int c= rint(cos(hue) * (1<<16) * sat);
+        int i;
+        const int s= rint(sin(hue) * (1<<16) * sat);
+        const int c= rint(cos(hue) * (1<<16) * sat);
 
-	while (h--) {
-		for (i = 0; i<w; i++)
-		{
-			const int u= usrc[i] - 128;
-			const int v= vsrc[i] - 128;
-			int new_u= (c*u - s*v + (1<<15) + (128<<16))>>16;
-			int new_v= (s*u + c*v + (1<<15) + (128<<16))>>16;
-			if(new_u & 768) new_u= (-new_u)>>31;
-			if(new_v & 768) new_v= (-new_v)>>31;
-			udst[i]= new_u;
-			vdst[i]= new_v;
-		}
-		usrc += srcstride;
-		vsrc += srcstride;
-		udst += dststride;
-		vdst += dststride;
-	}
+        while (h--) {
+                for (i = 0; i<w; i++)
+                {
+                        const int u= usrc[i] - 128;
+                        const int v= vsrc[i] - 128;
+                        int new_u= (c*u - s*v + (1<<15) + (128<<16))>>16;
+                        int new_v= (s*u + c*v + (1<<15) + (128<<16))>>16;
+                        if(new_u & 768) new_u= (-new_u)>>31;
+                        if(new_v & 768) new_v= (-new_v)>>31;
+                        udst[i]= new_u;
+                        vdst[i]= new_v;
+                }
+                usrc += srcstride;
+                vsrc += srcstride;
+                udst += dststride;
+                vdst += dststride;
+        }
 }
 
 static void (*process)(uint8_t *udst, uint8_t *vdst, uint8_t *usrc, uint8_t *vsrc, int dststride, int srcstride,
-		    int w, int h, float hue, float sat);
+                    int w, int h, float hue, float sat);
 
 /* FIXME: add packed yuv version of process */
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+        mp_image_t *dmpi;
 
-	dmpi=vf_get_image(vf->next, mpi->imgfmt,
-			  MP_IMGTYPE_EXPORT, 0,
-			  mpi->w, mpi->h);
+        dmpi=vf_get_image(vf->next, mpi->imgfmt,
+                          MP_IMGTYPE_EXPORT, 0,
+                          mpi->w, mpi->h);
 
-	dmpi->planes[0] = mpi->planes[0];
-	dmpi->stride[0] = mpi->stride[0];
-	dmpi->stride[1] = mpi->stride[1];
-	dmpi->stride[2] = mpi->stride[2];
+        dmpi->planes[0] = mpi->planes[0];
+        dmpi->stride[0] = mpi->stride[0];
+        dmpi->stride[1] = mpi->stride[1];
+        dmpi->stride[2] = mpi->stride[2];
 
-	if (!vf->priv->buf[0]){
-		vf->priv->buf[0] = malloc(mpi->stride[1]*mpi->h >> mpi->chroma_y_shift);
-		vf->priv->buf[1] = malloc(mpi->stride[2]*mpi->h >> mpi->chroma_y_shift);
-	}
+        if (!vf->priv->buf[0]){
+                vf->priv->buf[0] = malloc(mpi->stride[1]*mpi->h >> mpi->chroma_y_shift);
+                vf->priv->buf[1] = malloc(mpi->stride[2]*mpi->h >> mpi->chroma_y_shift);
+        }
 
-	if (vf->priv->hue == 0 && vf->priv->saturation == 1){
-		dmpi->planes[1] = mpi->planes[1];
-		dmpi->planes[2] = mpi->planes[2];
-	}else {
-		dmpi->planes[1] = vf->priv->buf[0];
-		dmpi->planes[2] = vf->priv->buf[1];
-		process(dmpi->planes[1], dmpi->planes[2],
-			mpi->planes[1], mpi->planes[2],
-			dmpi->stride[1],mpi->stride[1],
-			mpi->w>> mpi->chroma_x_shift, mpi->h>> mpi->chroma_y_shift,
-			vf->priv->hue, vf->priv->saturation);
-	}
+        if (vf->priv->hue == 0 && vf->priv->saturation == 1){
+                dmpi->planes[1] = mpi->planes[1];
+                dmpi->planes[2] = mpi->planes[2];
+        }else {
+                dmpi->planes[1] = vf->priv->buf[0];
+                dmpi->planes[2] = vf->priv->buf[1];
+                process(dmpi->planes[1], dmpi->planes[2],
+                        mpi->planes[1], mpi->planes[2],
+                        dmpi->stride[1],mpi->stride[1],
+                        mpi->w>> mpi->chroma_x_shift, mpi->h>> mpi->chroma_y_shift,
+                        vf->priv->hue, vf->priv->saturation);
+        }
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 static int control(struct vf_instance *vf, int request, void* data)
 {
-	vf_equalizer_t *eq;
+        vf_equalizer_t *eq;
 
-	switch (request) {
-	case VFCTRL_SET_EQUALIZER:
-		eq = data;
-		if (!strcmp(eq->item,"hue")) {
-			vf->priv->hue = eq->value * M_PI / 100;
-			return CONTROL_TRUE;
-		} else if (!strcmp(eq->item,"saturation")) {
-			vf->priv->saturation = (eq->value + 100)/100.0;
-			return CONTROL_TRUE;
-		}
-		break;
-	case VFCTRL_GET_EQUALIZER:
-		eq = data;
-		if (!strcmp(eq->item,"hue")) {
-			eq->value = rint(vf->priv->hue *100 / M_PI);
-			return CONTROL_TRUE;
-		}else if (!strcmp(eq->item,"saturation")) {
-			eq->value = rint(vf->priv->saturation*100 - 100);
-			return CONTROL_TRUE;
-		}
-		break;
-	}
-	return vf_next_control(vf, request, data);
+        switch (request) {
+        case VFCTRL_SET_EQUALIZER:
+                eq = data;
+                if (!strcmp(eq->item,"hue")) {
+                        vf->priv->hue = eq->value * M_PI / 100;
+                        return CONTROL_TRUE;
+                } else if (!strcmp(eq->item,"saturation")) {
+                        vf->priv->saturation = (eq->value + 100)/100.0;
+                        return CONTROL_TRUE;
+                }
+                break;
+        case VFCTRL_GET_EQUALIZER:
+                eq = data;
+                if (!strcmp(eq->item,"hue")) {
+                        eq->value = rint(vf->priv->hue *100 / M_PI);
+                        return CONTROL_TRUE;
+                }else if (!strcmp(eq->item,"saturation")) {
+                        eq->value = rint(vf->priv->saturation*100 - 100);
+                        return CONTROL_TRUE;
+                }
+                break;
+        }
+        return vf_next_control(vf, request, data);
 }
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	switch (fmt) {
-	case IMGFMT_YVU9:
-	case IMGFMT_IF09:
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_CLPL:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        switch (fmt) {
+        case IMGFMT_YVU9:
+        case IMGFMT_IF09:
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_CLPL:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv->buf[0]);
-	free(vf->priv->buf[1]);
-	free(vf->priv);
+        free(vf->priv->buf[0]);
+        free(vf->priv->buf[1]);
+        free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->control=control;
-	vf->query_format=query_format;
-	vf->put_image=put_image;
-	vf->uninit=uninit;
+        vf->control=control;
+        vf->query_format=query_format;
+        vf->put_image=put_image;
+        vf->uninit=uninit;
 
         vf->priv->hue *= M_PI / 180.0;
 
-	process = process_C;
-	return 1;
+        process = process_C;
+        return 1;
 }
 
 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
@@ -191,10 +191,10 @@
 };
 
 const vf_info_t vf_info_hue = {
-	"hue changer",
-	"hue",
-	"Michael Niedermayer",
-	"",
-	vf_open,
-	&vf_opts
+        "hue changer",
+        "hue",
+        "Michael Niedermayer",
+        "",
+        vf_open,
+        &vf_opts
 };
--- a/libmpcodecs/vf_il.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_il.c	Fri Jan 14 22:10:21 2011 +0000
@@ -34,106 +34,106 @@
 //===========================================================================//
 
 typedef struct FilterParam{
-	int interleave;
-	int swap;
+    int interleave;
+    int swap;
 }FilterParam;
 
 struct vf_priv_s {
-	FilterParam lumaParam;
-	FilterParam chromaParam;
+    FilterParam lumaParam;
+    FilterParam chromaParam;
 };
 
 /***************************************************************************/
 
 static void interleave(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int interleave, int swap){
-	const int a= swap;
-	const int b= 1-a;
-	const int m= h>>1;
-	int y;
+    const int a= swap;
+    const int b= 1-a;
+    const int m= h>>1;
+    int y;
 
-	switch(interleave){
-	case -1:
-		for(y=0; y < m; y++){
-			fast_memcpy(dst + dstStride* y     , src + srcStride*(y*2 + a), w);
-			fast_memcpy(dst + dstStride*(y + m), src + srcStride*(y*2 + b), w);
-		}
-		break;
-	case 0:
-		for(y=0; y < m; y++){
-			fast_memcpy(dst + dstStride* y*2   , src + srcStride*(y*2 + a), w);
-			fast_memcpy(dst + dstStride*(y*2+1), src + srcStride*(y*2 + b), w);
-		}
-		break;
-	case 1:
-		for(y=0; y < m; y++){
-			fast_memcpy(dst + dstStride*(y*2+a), src + srcStride* y     , w);
-			fast_memcpy(dst + dstStride*(y*2+b), src + srcStride*(y + m), w);
-		}
-		break;
-	}
+    switch(interleave){
+    case -1:
+        for(y=0; y < m; y++){
+            fast_memcpy(dst + dstStride* y     , src + srcStride*(y*2 + a), w);
+            fast_memcpy(dst + dstStride*(y + m), src + srcStride*(y*2 + b), w);
+        }
+        break;
+    case 0:
+        for(y=0; y < m; y++){
+            fast_memcpy(dst + dstStride* y*2   , src + srcStride*(y*2 + a), w);
+            fast_memcpy(dst + dstStride*(y*2+1), src + srcStride*(y*2 + b), w);
+        }
+        break;
+    case 1:
+        for(y=0; y < m; y++){
+            fast_memcpy(dst + dstStride*(y*2+a), src + srcStride* y     , w);
+            fast_memcpy(dst + dstStride*(y*2+b), src + srcStride*(y + m), w);
+        }
+        break;
+    }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int w;
-	FilterParam *luma  = &vf->priv->lumaParam;
-	FilterParam *chroma= &vf->priv->chromaParam;
+    int w;
+    FilterParam *luma  = &vf->priv->lumaParam;
+    FilterParam *chroma= &vf->priv->chromaParam;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->w,mpi->h);
+    mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w,mpi->h);
 
-	if(mpi->flags&MP_IMGFLAG_PLANAR)
-		w= mpi->w;
-	else
-		w= mpi->w * mpi->bpp/8;
+    if(mpi->flags&MP_IMGFLAG_PLANAR)
+        w= mpi->w;
+    else
+        w= mpi->w * mpi->bpp/8;
 
-	interleave(dmpi->planes[0], mpi->planes[0],
-		w, mpi->h, dmpi->stride[0], mpi->stride[0], luma->interleave, luma->swap);
+    interleave(dmpi->planes[0], mpi->planes[0],
+        w, mpi->h, dmpi->stride[0], mpi->stride[0], luma->interleave, luma->swap);
 
-	if(mpi->flags&MP_IMGFLAG_PLANAR){
-		int cw= mpi->w >> mpi->chroma_x_shift;
-		int ch= mpi->h >> mpi->chroma_y_shift;
+    if(mpi->flags&MP_IMGFLAG_PLANAR){
+        int cw= mpi->w >> mpi->chroma_x_shift;
+        int ch= mpi->h >> mpi->chroma_y_shift;
 
-		interleave(dmpi->planes[1], mpi->planes[1], cw,ch,
-			dmpi->stride[1], mpi->stride[1], chroma->interleave, luma->swap);
-		interleave(dmpi->planes[2], mpi->planes[2], cw,ch,
-			dmpi->stride[2], mpi->stride[2], chroma->interleave, luma->swap);
-	}
+        interleave(dmpi->planes[1], mpi->planes[1], cw,ch,
+            dmpi->stride[1], mpi->stride[1], chroma->interleave, luma->swap);
+        interleave(dmpi->planes[2], mpi->planes[2], cw,ch,
+            dmpi->stride[2], mpi->stride[2], chroma->interleave, luma->swap);
+    }
 
-	return vf_next_put_image(vf,dmpi, pts);
+    return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static void parse(FilterParam *fp, char* args){
-	char *pos;
-	char *max= strchr(args, ':');
+    char *pos;
+    char *max= strchr(args, ':');
 
-	if(!max) max= args + strlen(args);
+    if(!max) max= args + strlen(args);
 
-	pos= strchr(args, 's');
-	if(pos && pos<max) fp->swap=1;
-	pos= strchr(args, 'i');
-	if(pos && pos<max) fp->interleave=1;
-	pos= strchr(args, 'd');
-	if(pos && pos<max) fp->interleave=-1;
+    pos= strchr(args, 's');
+    if(pos && pos<max) fp->swap=1;
+    pos= strchr(args, 'i');
+    if(pos && pos<max) fp->interleave=1;
+    pos= strchr(args, 'd');
+    if(pos && pos<max) fp->interleave=-1;
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
 
-	vf->put_image=put_image;
-//	vf->get_image=get_image;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
-	memset(vf->priv, 0, sizeof(struct vf_priv_s));
+    vf->put_image=put_image;
+//    vf->get_image=get_image;
+    vf->priv=malloc(sizeof(struct vf_priv_s));
+    memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
-	if(args)
-	{
-		char *arg2= strchr(args,':');
-		if(arg2) parse(&vf->priv->chromaParam, arg2+1);
-		parse(&vf->priv->lumaParam, args);
-	}
+    if(args)
+    {
+        char *arg2= strchr(args,':');
+        if(arg2) parse(&vf->priv->chromaParam, arg2+1);
+        parse(&vf->priv->lumaParam, args);
+    }
 
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_il = {
--- a/libmpcodecs/vf_ilpack.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_ilpack.c	Fri Jan 14 22:10:21 2011 +0000
@@ -30,301 +30,301 @@
 #include "vf.h"
 
 typedef void (pack_func_t)(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w, int us, int vs);
+    unsigned char *u, unsigned char *v, int w, int us, int vs);
 
 struct vf_priv_s {
-	int mode;
-	pack_func_t *pack[2];
+    int mode;
+    pack_func_t *pack[2];
 };
 
 static void pack_nn_C(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w)
+    unsigned char *u, unsigned char *v, int w)
 {
-	int j;
-	for (j = w/2; j; j--) {
-		*dst++ = *y++;
-		*dst++ = *u++;
-		*dst++ = *y++;
-		*dst++ = *v++;
-	}
+    int j;
+    for (j = w/2; j; j--) {
+        *dst++ = *y++;
+        *dst++ = *u++;
+        *dst++ = *y++;
+        *dst++ = *v++;
+    }
 }
 
 static void pack_li_0_C(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w, int us, int vs)
+    unsigned char *u, unsigned char *v, int w, int us, int vs)
 {
-	int j;
-	for (j = w/2; j; j--) {
-		*dst++ = *y++;
-		*dst++ = (u[us+us] + 7*u[0])>>3;
-		*dst++ = *y++;
-		*dst++ = (v[vs+vs] + 7*v[0])>>3;
-		u++; v++;
-	}
+    int j;
+    for (j = w/2; j; j--) {
+        *dst++ = *y++;
+        *dst++ = (u[us+us] + 7*u[0])>>3;
+        *dst++ = *y++;
+        *dst++ = (v[vs+vs] + 7*v[0])>>3;
+        u++; v++;
+    }
 }
 
 static void pack_li_1_C(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w, int us, int vs)
+    unsigned char *u, unsigned char *v, int w, int us, int vs)
 {
-	int j;
-	for (j = w/2; j; j--) {
-		*dst++ = *y++;
-		*dst++ = (3*u[us+us] + 5*u[0])>>3;
-		*dst++ = *y++;
-		*dst++ = (3*v[vs+vs] + 5*v[0])>>3;
-		u++; v++;
-	}
+    int j;
+    for (j = w/2; j; j--) {
+        *dst++ = *y++;
+        *dst++ = (3*u[us+us] + 5*u[0])>>3;
+        *dst++ = *y++;
+        *dst++ = (3*v[vs+vs] + 5*v[0])>>3;
+        u++; v++;
+    }
 }
 
 #if HAVE_MMX
 static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w)
+    unsigned char *u, unsigned char *v, int w)
 {
-	__asm__ volatile (""
-		ASMALIGN(4)
-		"1: \n\t"
-		"movq (%0), %%mm1 \n\t"
-		"movq (%0), %%mm2 \n\t"
-		"movq (%1), %%mm4 \n\t"
-		"movq (%2), %%mm6 \n\t"
-		"punpcklbw %%mm6, %%mm4 \n\t"
-		"punpcklbw %%mm4, %%mm1 \n\t"
-		"punpckhbw %%mm4, %%mm2 \n\t"
+    __asm__ volatile (""
+        ASMALIGN(4)
+        "1: \n\t"
+        "movq (%0), %%mm1 \n\t"
+        "movq (%0), %%mm2 \n\t"
+        "movq (%1), %%mm4 \n\t"
+        "movq (%2), %%mm6 \n\t"
+        "punpcklbw %%mm6, %%mm4 \n\t"
+        "punpcklbw %%mm4, %%mm1 \n\t"
+        "punpckhbw %%mm4, %%mm2 \n\t"
 
-		"add $8, %0 \n\t"
-		"add $4, %1 \n\t"
-		"add $4, %2 \n\t"
-		"movq %%mm1, (%3) \n\t"
-		"movq %%mm2, 8(%3) \n\t"
-		"add $16, %3 \n\t"
-		"decl %4 \n\t"
-		"jnz 1b \n\t"
-		"emms \n\t"
-		:
-		: "r" (y), "r" (u), "r" (v), "r" (dst), "r" (w/8)
-		: "memory"
-		);
-	pack_nn_C(dst, y, u, v, (w&7));
+        "add $8, %0 \n\t"
+        "add $4, %1 \n\t"
+        "add $4, %2 \n\t"
+        "movq %%mm1, (%3) \n\t"
+        "movq %%mm2, 8(%3) \n\t"
+        "add $16, %3 \n\t"
+        "decl %4 \n\t"
+        "jnz 1b \n\t"
+        "emms \n\t"
+        :
+        : "r" (y), "r" (u), "r" (v), "r" (dst), "r" (w/8)
+        : "memory"
+        );
+    pack_nn_C(dst, y, u, v, (w&7));
 }
 
 #if HAVE_EBX_AVAILABLE
 static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w, int us, int vs)
+    unsigned char *u, unsigned char *v, int w, int us, int vs)
 {
-	__asm__ volatile (""
-		"push %%"REG_BP" \n\t"
+    __asm__ volatile (""
+        "push %%"REG_BP" \n\t"
 #if ARCH_X86_64
-		"mov %6, %%"REG_BP" \n\t"
+        "mov %6, %%"REG_BP" \n\t"
 #else
-		"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
-		"movl (%%"REG_d"), %%"REG_d" \n\t"
+        "movl 4(%%"REG_d"), %%"REG_BP" \n\t"
+        "movl (%%"REG_d"), %%"REG_d" \n\t"
 #endif
-		"pxor %%mm0, %%mm0 \n\t"
+        "pxor %%mm0, %%mm0 \n\t"
 
-		ASMALIGN(4)
-		".Lli0: \n\t"
-		"movq (%%"REG_S"), %%mm1 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
+        ASMALIGN(4)
+        ".Lli0: \n\t"
+        "movq (%%"REG_S"), %%mm1 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
 
-		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
-		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
-		"punpcklbw %%mm0, %%mm4 \n\t"
-		"punpcklbw %%mm0, %%mm6 \n\t"
-		"movq (%%"REG_a"), %%mm3 \n\t"
-		"movq (%%"REG_b"), %%mm5 \n\t"
-		"punpcklbw %%mm0, %%mm3 \n\t"
-		"punpcklbw %%mm0, %%mm5 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"psrlw $3, %%mm4 \n\t"
-		"psrlw $3, %%mm6 \n\t"
-		"packuswb %%mm4, %%mm4 \n\t"
-		"packuswb %%mm6, %%mm6 \n\t"
-		"punpcklbw %%mm6, %%mm4 \n\t"
-		"punpcklbw %%mm4, %%mm1 \n\t"
-		"punpckhbw %%mm4, %%mm2 \n\t"
+        "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+        "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
+        "punpcklbw %%mm0, %%mm4 \n\t"
+        "punpcklbw %%mm0, %%mm6 \n\t"
+        "movq (%%"REG_a"), %%mm3 \n\t"
+        "movq (%%"REG_b"), %%mm5 \n\t"
+        "punpcklbw %%mm0, %%mm3 \n\t"
+        "punpcklbw %%mm0, %%mm5 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "psrlw $3, %%mm4 \n\t"
+        "psrlw $3, %%mm6 \n\t"
+        "packuswb %%mm4, %%mm4 \n\t"
+        "packuswb %%mm6, %%mm6 \n\t"
+        "punpcklbw %%mm6, %%mm4 \n\t"
+        "punpcklbw %%mm4, %%mm1 \n\t"
+        "punpckhbw %%mm4, %%mm2 \n\t"
 
-		"movq %%mm1, (%%"REG_D") \n\t"
-		"movq %%mm2, 8(%%"REG_D") \n\t"
+        "movq %%mm1, (%%"REG_D") \n\t"
+        "movq %%mm2, 8(%%"REG_D") \n\t"
 
-		"movq 8(%%"REG_S"), %%mm1 \n\t"
-		"movq 8(%%"REG_S"), %%mm2 \n\t"
+        "movq 8(%%"REG_S"), %%mm1 \n\t"
+        "movq 8(%%"REG_S"), %%mm2 \n\t"
 
-		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
-		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
-		"punpckhbw %%mm0, %%mm4 \n\t"
-		"punpckhbw %%mm0, %%mm6 \n\t"
-		"movq (%%"REG_a"), %%mm3 \n\t"
-		"movq (%%"REG_b"), %%mm5 \n\t"
-		"punpckhbw %%mm0, %%mm3 \n\t"
-		"punpckhbw %%mm0, %%mm5 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"psrlw $3, %%mm4 \n\t"
-		"psrlw $3, %%mm6 \n\t"
-		"packuswb %%mm4, %%mm4 \n\t"
-		"packuswb %%mm6, %%mm6 \n\t"
-		"punpcklbw %%mm6, %%mm4 \n\t"
-		"punpcklbw %%mm4, %%mm1 \n\t"
-		"punpckhbw %%mm4, %%mm2 \n\t"
+        "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+        "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
+        "punpckhbw %%mm0, %%mm4 \n\t"
+        "punpckhbw %%mm0, %%mm6 \n\t"
+        "movq (%%"REG_a"), %%mm3 \n\t"
+        "movq (%%"REG_b"), %%mm5 \n\t"
+        "punpckhbw %%mm0, %%mm3 \n\t"
+        "punpckhbw %%mm0, %%mm5 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "psrlw $3, %%mm4 \n\t"
+        "psrlw $3, %%mm6 \n\t"
+        "packuswb %%mm4, %%mm4 \n\t"
+        "packuswb %%mm6, %%mm6 \n\t"
+        "punpcklbw %%mm6, %%mm4 \n\t"
+        "punpcklbw %%mm4, %%mm1 \n\t"
+        "punpckhbw %%mm4, %%mm2 \n\t"
 
-		"add $16, %%"REG_S" \n\t"
-		"add $8, %%"REG_a" \n\t"
-		"add $8, %%"REG_b" \n\t"
+        "add $16, %%"REG_S" \n\t"
+        "add $8, %%"REG_a" \n\t"
+        "add $8, %%"REG_b" \n\t"
 
-		"movq %%mm1, 16(%%"REG_D") \n\t"
-		"movq %%mm2, 24(%%"REG_D") \n\t"
-		"add $32, %%"REG_D" \n\t"
+        "movq %%mm1, 16(%%"REG_D") \n\t"
+        "movq %%mm2, 24(%%"REG_D") \n\t"
+        "add $32, %%"REG_D" \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz .Lli0 \n\t"
-		"emms \n\t"
-		"pop %%"REG_BP" \n\t"
-		:
-		: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
+        "decl %%ecx \n\t"
+        "jnz .Lli0 \n\t"
+        "emms \n\t"
+        "pop %%"REG_BP" \n\t"
+        :
+        : "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
 #if ARCH_X86_64
-		"d" ((x86_reg)us), "r" ((x86_reg)vs)
+        "d" ((x86_reg)us), "r" ((x86_reg)vs)
 #else
-		"d" (&us)
+        "d" (&us)
 #endif
-		: "memory"
-		);
-	pack_li_0_C(dst, y, u, v, (w&15), us, vs);
+        : "memory"
+        );
+    pack_li_0_C(dst, y, u, v, (w&15), us, vs);
 }
 
 static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
-	unsigned char *u, unsigned char *v, int w, int us, int vs)
+    unsigned char *u, unsigned char *v, int w, int us, int vs)
 {
-	__asm__ volatile (""
-		"push %%"REG_BP" \n\t"
+    __asm__ volatile (""
+        "push %%"REG_BP" \n\t"
 #if ARCH_X86_64
-		"mov %6, %%"REG_BP" \n\t"
+        "mov %6, %%"REG_BP" \n\t"
 #else
-		"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
-		"movl (%%"REG_d"), %%"REG_d" \n\t"
+        "movl 4(%%"REG_d"), %%"REG_BP" \n\t"
+        "movl (%%"REG_d"), %%"REG_d" \n\t"
 #endif
-		"pxor %%mm0, %%mm0 \n\t"
+        "pxor %%mm0, %%mm0 \n\t"
 
-		ASMALIGN(4)
-		".Lli1: \n\t"
-		"movq (%%"REG_S"), %%mm1 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
+        ASMALIGN(4)
+        ".Lli1: \n\t"
+        "movq (%%"REG_S"), %%mm1 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
 
-		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
-		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
-		"punpcklbw %%mm0, %%mm4 \n\t"
-		"punpcklbw %%mm0, %%mm6 \n\t"
-		"movq (%%"REG_a"), %%mm3 \n\t"
-		"movq (%%"REG_b"), %%mm5 \n\t"
-		"punpcklbw %%mm0, %%mm3 \n\t"
-		"punpcklbw %%mm0, %%mm5 \n\t"
-		"movq %%mm4, %%mm7 \n\t"
-		"paddw %%mm4, %%mm4 \n\t"
-		"paddw %%mm7, %%mm4 \n\t"
-		"movq %%mm6, %%mm7 \n\t"
-		"paddw %%mm6, %%mm6 \n\t"
-		"paddw %%mm7, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"psrlw $3, %%mm4 \n\t"
-		"psrlw $3, %%mm6 \n\t"
-		"packuswb %%mm4, %%mm4 \n\t"
-		"packuswb %%mm6, %%mm6 \n\t"
-		"punpcklbw %%mm6, %%mm4 \n\t"
-		"punpcklbw %%mm4, %%mm1 \n\t"
-		"punpckhbw %%mm4, %%mm2 \n\t"
+        "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+        "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
+        "punpcklbw %%mm0, %%mm4 \n\t"
+        "punpcklbw %%mm0, %%mm6 \n\t"
+        "movq (%%"REG_a"), %%mm3 \n\t"
+        "movq (%%"REG_b"), %%mm5 \n\t"
+        "punpcklbw %%mm0, %%mm3 \n\t"
+        "punpcklbw %%mm0, %%mm5 \n\t"
+        "movq %%mm4, %%mm7 \n\t"
+        "paddw %%mm4, %%mm4 \n\t"
+        "paddw %%mm7, %%mm4 \n\t"
+        "movq %%mm6, %%mm7 \n\t"
+        "paddw %%mm6, %%mm6 \n\t"
+        "paddw %%mm7, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "psrlw $3, %%mm4 \n\t"
+        "psrlw $3, %%mm6 \n\t"
+        "packuswb %%mm4, %%mm4 \n\t"
+        "packuswb %%mm6, %%mm6 \n\t"
+        "punpcklbw %%mm6, %%mm4 \n\t"
+        "punpcklbw %%mm4, %%mm1 \n\t"
+        "punpckhbw %%mm4, %%mm2 \n\t"
 
-		"movq %%mm1, (%%"REG_D") \n\t"
-		"movq %%mm2, 8(%%"REG_D") \n\t"
+        "movq %%mm1, (%%"REG_D") \n\t"
+        "movq %%mm2, 8(%%"REG_D") \n\t"
 
-		"movq 8(%%"REG_S"), %%mm1 \n\t"
-		"movq 8(%%"REG_S"), %%mm2 \n\t"
+        "movq 8(%%"REG_S"), %%mm1 \n\t"
+        "movq 8(%%"REG_S"), %%mm2 \n\t"
 
-		"movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
-		"movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
-		"punpckhbw %%mm0, %%mm4 \n\t"
-		"punpckhbw %%mm0, %%mm6 \n\t"
-		"movq (%%"REG_a"), %%mm3 \n\t"
-		"movq (%%"REG_b"), %%mm5 \n\t"
-		"punpckhbw %%mm0, %%mm3 \n\t"
-		"punpckhbw %%mm0, %%mm5 \n\t"
-		"movq %%mm4, %%mm7 \n\t"
-		"paddw %%mm4, %%mm4 \n\t"
-		"paddw %%mm7, %%mm4 \n\t"
-		"movq %%mm6, %%mm7 \n\t"
-		"paddw %%mm6, %%mm6 \n\t"
-		"paddw %%mm7, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
-		"paddw %%mm5, %%mm6 \n\t"
-		"psrlw $3, %%mm4 \n\t"
-		"psrlw $3, %%mm6 \n\t"
-		"packuswb %%mm4, %%mm4 \n\t"
-		"packuswb %%mm6, %%mm6 \n\t"
-		"punpcklbw %%mm6, %%mm4 \n\t"
-		"punpcklbw %%mm4, %%mm1 \n\t"
-		"punpckhbw %%mm4, %%mm2 \n\t"
+        "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t"
+        "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t"
+        "punpckhbw %%mm0, %%mm4 \n\t"
+        "punpckhbw %%mm0, %%mm6 \n\t"
+        "movq (%%"REG_a"), %%mm3 \n\t"
+        "movq (%%"REG_b"), %%mm5 \n\t"
+        "punpckhbw %%mm0, %%mm3 \n\t"
+        "punpckhbw %%mm0, %%mm5 \n\t"
+        "movq %%mm4, %%mm7 \n\t"
+        "paddw %%mm4, %%mm4 \n\t"
+        "paddw %%mm7, %%mm4 \n\t"
+        "movq %%mm6, %%mm7 \n\t"
+        "paddw %%mm6, %%mm6 \n\t"
+        "paddw %%mm7, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
+        "paddw %%mm5, %%mm6 \n\t"
+        "psrlw $3, %%mm4 \n\t"
+        "psrlw $3, %%mm6 \n\t"
+        "packuswb %%mm4, %%mm4 \n\t"
+        "packuswb %%mm6, %%mm6 \n\t"
+        "punpcklbw %%mm6, %%mm4 \n\t"
+        "punpcklbw %%mm4, %%mm1 \n\t"
+        "punpckhbw %%mm4, %%mm2 \n\t"
 
-		"add $16, %%"REG_S" \n\t"
-		"add $8, %%"REG_a" \n\t"
-		"add $8, %%"REG_b" \n\t"
+        "add $16, %%"REG_S" \n\t"
+        "add $8, %%"REG_a" \n\t"
+        "add $8, %%"REG_b" \n\t"
 
-		"movq %%mm1, 16(%%"REG_D") \n\t"
-		"movq %%mm2, 24(%%"REG_D") \n\t"
-		"add $32, %%"REG_D" \n\t"
+        "movq %%mm1, 16(%%"REG_D") \n\t"
+        "movq %%mm2, 24(%%"REG_D") \n\t"
+        "add $32, %%"REG_D" \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz .Lli1 \n\t"
-		"emms \n\t"
-		"pop %%"REG_BP" \n\t"
-		:
-		: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
+        "decl %%ecx \n\t"
+        "jnz .Lli1 \n\t"
+        "emms \n\t"
+        "pop %%"REG_BP" \n\t"
+        :
+        : "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
 #if ARCH_X86_64
-		"d" ((x86_reg)us), "r" ((x86_reg)vs)
+        "d" ((x86_reg)us), "r" ((x86_reg)vs)
 #else
-		"d" (&us)
+        "d" (&us)
 #endif
-		: "memory"
-		);
-	pack_li_1_C(dst, y, u, v, (w&15), us, vs);
+        : "memory"
+        );
+    pack_li_1_C(dst, y, u, v, (w&15), us, vs);
 }
 #endif /* HAVE_EBX_AVAILABLE */
 #endif
@@ -334,120 +334,120 @@
 static pack_func_t *pack_li_1;
 
 static void ilpack(unsigned char *dst, unsigned char *src[3],
-	int dststride, int srcstride[3], int w, int h, pack_func_t *pack[2])
+    int dststride, int srcstride[3], int w, int h, pack_func_t *pack[2])
 {
-	int i;
-	unsigned char *y, *u, *v;
-	int ys = srcstride[0], us = srcstride[1], vs = srcstride[2];
-	int a, b;
+    int i;
+    unsigned char *y, *u, *v;
+    int ys = srcstride[0], us = srcstride[1], vs = srcstride[2];
+    int a, b;
 
-	y = src[0];
-	u = src[1];
-	v = src[2];
+    y = src[0];
+    u = src[1];
+    v = src[2];
 
-	pack_nn(dst, y, u, v, w, 0, 0);
-	y += ys; dst += dststride;
-	pack_nn(dst, y, u+us, v+vs, w, 0, 0);
-	y += ys; dst += dststride;
-	for (i=2; i<h-2; i++) {
-		a = (i&2) ? 1 : -1;
-		b = (i&1) ^ ((i&2)>>1);
-		pack[b](dst, y, u, v, w, us*a, vs*a);
-		y += ys;
-		if ((i&3) == 1) {
-			u -= us;
-			v -= vs;
-		} else {
-			u += us;
-			v += vs;
-		}
-		dst += dststride;
-	}
-	pack_nn(dst, y, u, v, w, 0, 0);
-	y += ys; dst += dststride; u += us; v += vs;
-	pack_nn(dst, y, u, v, w, 0, 0);
+    pack_nn(dst, y, u, v, w, 0, 0);
+    y += ys; dst += dststride;
+    pack_nn(dst, y, u+us, v+vs, w, 0, 0);
+    y += ys; dst += dststride;
+    for (i=2; i<h-2; i++) {
+        a = (i&2) ? 1 : -1;
+        b = (i&1) ^ ((i&2)>>1);
+        pack[b](dst, y, u, v, w, us*a, vs*a);
+        y += ys;
+        if ((i&3) == 1) {
+            u -= us;
+            v -= vs;
+        } else {
+            u += us;
+            v += vs;
+        }
+        dst += dststride;
+    }
+    pack_nn(dst, y, u, v, w, 0, 0);
+    y += ys; dst += dststride; u += us; v += vs;
+    pack_nn(dst, y, u, v, w, 0, 0);
 }
 
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+    mp_image_t *dmpi;
 
-	// hope we'll get DR buffer:
-	dmpi=vf_get_image(vf->next, IMGFMT_YUY2,
-			  MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-			  mpi->w, mpi->h);
+    // hope we'll get DR buffer:
+    dmpi=vf_get_image(vf->next, IMGFMT_YUY2,
+              MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+              mpi->w, mpi->h);
 
-	ilpack(dmpi->planes[0], mpi->planes, dmpi->stride[0], mpi->stride, mpi->w, mpi->h, vf->priv->pack);
+    ilpack(dmpi->planes[0], mpi->planes, dmpi->stride[0], mpi->stride, mpi->w, mpi->h, vf->priv->pack);
 
-	return vf_next_put_image(vf,dmpi, pts);
+    return vf_next_put_image(vf,dmpi, pts);
 }
 
 static int config(struct vf_instance *vf,
-		  int width, int height, int d_width, int d_height,
-		  unsigned int flags, unsigned int outfmt)
+          int width, int height, int d_width, int d_height,
+          unsigned int flags, unsigned int outfmt)
 {
-	/* FIXME - also support UYVY output? */
-	return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUY2);
+    /* FIXME - also support UYVY output? */
+    return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUY2);
 }
 
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - really any YUV 4:2:0 input format should work */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf,IMGFMT_YUY2);
-	}
-	return 0;
+    /* FIXME - really any YUV 4:2:0 input format should work */
+    switch (fmt) {
+    case IMGFMT_YV12:
+    case IMGFMT_IYUV:
+    case IMGFMT_I420:
+        return vf_next_query_format(vf,IMGFMT_YUY2);
+    }
+    return 0;
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->config=config;
-	vf->query_format=query_format;
-	vf->put_image=put_image;
-	vf->priv = calloc(1, sizeof(struct vf_priv_s));
-	vf->priv->mode = 1;
-	if (args) sscanf(args, "%d", &vf->priv->mode);
+    vf->config=config;
+    vf->query_format=query_format;
+    vf->put_image=put_image;
+    vf->priv = calloc(1, sizeof(struct vf_priv_s));
+    vf->priv->mode = 1;
+    if (args) sscanf(args, "%d", &vf->priv->mode);
 
-	pack_nn = (pack_func_t *)pack_nn_C;
-	pack_li_0 = pack_li_0_C;
-	pack_li_1 = pack_li_1_C;
+    pack_nn = (pack_func_t *)pack_nn_C;
+    pack_li_0 = pack_li_0_C;
+    pack_li_1 = pack_li_1_C;
 #if HAVE_MMX
-	if(gCpuCaps.hasMMX) {
-		pack_nn = (pack_func_t *)pack_nn_MMX;
+    if(gCpuCaps.hasMMX) {
+        pack_nn = (pack_func_t *)pack_nn_MMX;
 #if HAVE_EBX_AVAILABLE
-		pack_li_0 = pack_li_0_MMX;
-		pack_li_1 = pack_li_1_MMX;
+        pack_li_0 = pack_li_0_MMX;
+        pack_li_1 = pack_li_1_MMX;
 #endif
-	}
+    }
 #endif
 
-	switch(vf->priv->mode) {
-	case 0:
-		vf->priv->pack[0] = vf->priv->pack[1] = pack_nn;
-		break;
-	default:
-		mp_msg(MSGT_VFILTER, MSGL_WARN,
-			"ilpack: unknown mode %d (fallback to linear)\n",
-			vf->priv->mode);
-	case 1:
-		vf->priv->pack[0] = pack_li_0;
-		vf->priv->pack[1] = pack_li_1;
-		break;
-	}
+    switch(vf->priv->mode) {
+    case 0:
+        vf->priv->pack[0] = vf->priv->pack[1] = pack_nn;
+        break;
+    default:
+        mp_msg(MSGT_VFILTER, MSGL_WARN,
+            "ilpack: unknown mode %d (fallback to linear)\n",
+            vf->priv->mode);
+    case 1:
+        vf->priv->pack[0] = pack_li_0;
+        vf->priv->pack[1] = pack_li_1;
+        break;
+    }
 
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_ilpack = {
-	"4:2:0 planar -> 4:2:2 packed reinterlacer",
-	"ilpack",
-	"Richard Felker",
-	"",
-	vf_open,
-	NULL
+    "4:2:0 planar -> 4:2:2 packed reinterlacer",
+    "ilpack",
+    "Richard Felker",
+    "",
+    vf_open,
+    NULL
 };
--- a/libmpcodecs/vf_ivtc.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_ivtc.c	Fri Jan 14 22:10:21 2011 +0000
@@ -32,211 +32,211 @@
 
 
 struct metrics {
-	/* difference: total, even lines, odd lines */
-	int d, e, o;
-	/* noise: temporal, spacial (current), spacial (past) */
-	int t, s, p;
+    /* difference: total, even lines, odd lines */
+    int d, e, o;
+    /* noise: temporal, spacial (current), spacial (past) */
+    int t, s, p;
 };
 
 struct frameinfo {
-	/* peak, relative, mean */
-	struct metrics p, r, m;
+    /* peak, relative, mean */
+    struct metrics p, r, m;
 };
 
 struct vf_priv_s {
-	struct frameinfo fi[2];
-	mp_image_t *dmpi;
-	int first;
-	int drop, lastdrop, dropnext;
-	int inframes, outframes;
+    struct frameinfo fi[2];
+    mp_image_t *dmpi;
+    int first;
+    int drop, lastdrop, dropnext;
+    int inframes, outframes;
 };
 
 enum {
-	F_DROP,
-	F_MERGE,
-	F_NEXT,
-	F_SHOW
+    F_DROP,
+    F_MERGE,
+    F_NEXT,
+    F_SHOW
 };
 
 #if HAVE_MMX && HAVE_EBX_AVAILABLE
 static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
 {
-	int i;
-	short out[24]; // output buffer for the partial metrics from the mmx code
+    int i;
+    short out[24]; // output buffer for the partial metrics from the mmx code
 
-	__asm__ (
-		"movl $4, %%ecx \n\t"
-		"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
-		"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
-		"pxor %%mm7, %%mm7 \n\t" // all zeros
+    __asm__ (
+        "movl $4, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
+        "pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
+        "pxor %%mm7, %%mm7 \n\t" // all zeros
 
-		ASMALIGN(4)
-		"1: \n\t"
+        ASMALIGN(4)
+        "1: \n\t"
 
-		// Even difference
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"movq (%%"REG_D"), %%mm1 \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"psubusb %%mm1, %%mm2 \n\t"
-		"psubusb %%mm0, %%mm1 \n\t"
-		"movq %%mm2, %%mm0 \n\t"
-		"movq %%mm1, %%mm3 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm0, %%mm4 \n\t"
-		"paddw %%mm1, %%mm4 \n\t"
-		"paddw %%mm2, %%mm4 \n\t"
-		"paddw %%mm3, %%mm4 \n\t"
+        // Even difference
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "psubusb %%mm1, %%mm2 \n\t"
+        "psubusb %%mm0, %%mm1 \n\t"
+        "movq %%mm2, %%mm0 \n\t"
+        "movq %%mm1, %%mm3 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm0, %%mm4 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm2, %%mm4 \n\t"
+        "paddw %%mm3, %%mm4 \n\t"
 
-		// Odd difference
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S"), %%mm2 \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"movq (%%"REG_D"), %%mm1 \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"psubusb %%mm1, %%mm2 \n\t"
-		"psubusb %%mm0, %%mm1 \n\t"
-		"movq %%mm2, %%mm0 \n\t"
-		"movq %%mm1, %%mm3 \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm0, %%mm5 \n\t"
-		"paddw %%mm1, %%mm5 \n\t"
-		"paddw %%mm2, %%mm5 \n\t"
-		"paddw %%mm3, %%mm5 \n\t"
+        // Odd difference
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S"), %%mm2 \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm1 \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "psubusb %%mm1, %%mm2 \n\t"
+        "psubusb %%mm0, %%mm1 \n\t"
+        "movq %%mm2, %%mm0 \n\t"
+        "movq %%mm1, %%mm3 \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm0, %%mm5 \n\t"
+        "paddw %%mm1, %%mm5 \n\t"
+        "paddw %%mm2, %%mm5 \n\t"
+        "paddw %%mm3, %%mm5 \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz 1b \n\t"
-		"movq %%mm4, (%%"REG_d") \n\t"
-		"movq %%mm5, 8(%%"REG_d") \n\t"
-		:
-		: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
-		: "memory"
-		);
-	m->e = out[0]+out[1]+out[2]+out[3];
-	m->o = out[4]+out[5]+out[6]+out[7];
-	m->d = m->e + m->o;
+        "decl %%ecx \n\t"
+        "jnz 1b \n\t"
+        "movq %%mm4, (%%"REG_d") \n\t"
+        "movq %%mm5, 8(%%"REG_d") \n\t"
+        :
+        : "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
+        : "memory"
+        );
+    m->e = out[0]+out[1]+out[2]+out[3];
+    m->o = out[4]+out[5]+out[6]+out[7];
+    m->d = m->e + m->o;
 
-	__asm__ (
-		// First loop to measure first four columns
-		"movl $4, %%ecx \n\t"
-		"pxor %%mm4, %%mm4 \n\t" // Past spacial noise
-		"pxor %%mm5, %%mm5 \n\t" // Temporal noise
-		"pxor %%mm6, %%mm6 \n\t" // Current spacial noise
+    __asm__ (
+        // First loop to measure first four columns
+        "movl $4, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t" // Past spacial noise
+        "pxor %%mm5, %%mm5 \n\t" // Temporal noise
+        "pxor %%mm6, %%mm6 \n\t" // Current spacial noise
 
-		ASMALIGN(4)
-		"2: \n\t"
+        ASMALIGN(4)
+        "2: \n\t"
 
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"movq (%%"REG_D"), %%mm2 \n\t"
-		"movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"punpcklbw %%mm7, %%mm0 \n\t"
-		"punpcklbw %%mm7, %%mm1 \n\t"
-		"punpcklbw %%mm7, %%mm2 \n\t"
-		"punpcklbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm1, %%mm4 \n\t"
-		"paddw %%mm1, %%mm5 \n\t"
-		"paddw %%mm3, %%mm6 \n\t"
-		"psubw %%mm0, %%mm4 \n\t"
-		"psubw %%mm2, %%mm5 \n\t"
-		"psubw %%mm2, %%mm6 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm2 \n\t"
+        "movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "punpcklbw %%mm7, %%mm0 \n\t"
+        "punpcklbw %%mm7, %%mm1 \n\t"
+        "punpcklbw %%mm7, %%mm2 \n\t"
+        "punpcklbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm1, %%mm5 \n\t"
+        "paddw %%mm3, %%mm6 \n\t"
+        "psubw %%mm0, %%mm4 \n\t"
+        "psubw %%mm2, %%mm5 \n\t"
+        "psubw %%mm2, %%mm6 \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz 2b \n\t"
+        "decl %%ecx \n\t"
+        "jnz 2b \n\t"
 
-		"movq %%mm0, %%mm1 \n\t"
-		"movq %%mm0, %%mm2 \n\t"
-		"movq %%mm0, %%mm3 \n\t"
-		"pcmpgtw %%mm4, %%mm1 \n\t"
-		"pcmpgtw %%mm5, %%mm2 \n\t"
-		"pcmpgtw %%mm6, %%mm3 \n\t"
-		"pxor %%mm1, %%mm4 \n\t"
-		"pxor %%mm2, %%mm5 \n\t"
-		"pxor %%mm3, %%mm6 \n\t"
-		"psubw %%mm1, %%mm4 \n\t"
-		"psubw %%mm2, %%mm5 \n\t"
-		"psubw %%mm3, %%mm6 \n\t"
-		"movq %%mm4, (%%"REG_d") \n\t"
-		"movq %%mm5, 16(%%"REG_d") \n\t"
-		"movq %%mm6, 32(%%"REG_d") \n\t"
+        "movq %%mm0, %%mm1 \n\t"
+        "movq %%mm0, %%mm2 \n\t"
+        "movq %%mm0, %%mm3 \n\t"
+        "pcmpgtw %%mm4, %%mm1 \n\t"
+        "pcmpgtw %%mm5, %%mm2 \n\t"
+        "pcmpgtw %%mm6, %%mm3 \n\t"
+        "pxor %%mm1, %%mm4 \n\t"
+        "pxor %%mm2, %%mm5 \n\t"
+        "pxor %%mm3, %%mm6 \n\t"
+        "psubw %%mm1, %%mm4 \n\t"
+        "psubw %%mm2, %%mm5 \n\t"
+        "psubw %%mm3, %%mm6 \n\t"
+        "movq %%mm4, (%%"REG_d") \n\t"
+        "movq %%mm5, 16(%%"REG_d") \n\t"
+        "movq %%mm6, 32(%%"REG_d") \n\t"
 
-		"mov %%"REG_a", %%"REG_c" \n\t"
-		"shl $3, %%"REG_c" \n\t"
-		"sub %%"REG_c", %%"REG_S" \n\t"
-		"mov %%"REG_b", %%"REG_c" \n\t"
-		"shl $3, %%"REG_c" \n\t"
-		"sub %%"REG_c", %%"REG_D" \n\t"
+        "mov %%"REG_a", %%"REG_c" \n\t"
+        "shl $3, %%"REG_c" \n\t"
+        "sub %%"REG_c", %%"REG_S" \n\t"
+        "mov %%"REG_b", %%"REG_c" \n\t"
+        "shl $3, %%"REG_c" \n\t"
+        "sub %%"REG_c", %%"REG_D" \n\t"
 
-		// Second loop for the last four columns
-		"movl $4, %%ecx \n\t"
-		"pxor %%mm4, %%mm4 \n\t"
-		"pxor %%mm5, %%mm5 \n\t"
-		"pxor %%mm6, %%mm6 \n\t"
+        // Second loop for the last four columns
+        "movl $4, %%ecx \n\t"
+        "pxor %%mm4, %%mm4 \n\t"
+        "pxor %%mm5, %%mm5 \n\t"
+        "pxor %%mm6, %%mm6 \n\t"
 
-		ASMALIGN(4)
-		"3: \n\t"
+        ASMALIGN(4)
+        "3: \n\t"
 
-		"movq (%%"REG_S"), %%mm0 \n\t"
-		"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"add %%"REG_a", %%"REG_S" \n\t"
-		"movq (%%"REG_D"), %%mm2 \n\t"
-		"movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"add %%"REG_b", %%"REG_D" \n\t"
-		"punpckhbw %%mm7, %%mm0 \n\t"
-		"punpckhbw %%mm7, %%mm1 \n\t"
-		"punpckhbw %%mm7, %%mm2 \n\t"
-		"punpckhbw %%mm7, %%mm3 \n\t"
-		"paddw %%mm1, %%mm4 \n\t"
-		"paddw %%mm1, %%mm5 \n\t"
-		"paddw %%mm3, %%mm6 \n\t"
-		"psubw %%mm0, %%mm4 \n\t"
-		"psubw %%mm2, %%mm5 \n\t"
-		"psubw %%mm2, %%mm6 \n\t"
+        "movq (%%"REG_S"), %%mm0 \n\t"
+        "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "add %%"REG_a", %%"REG_S" \n\t"
+        "movq (%%"REG_D"), %%mm2 \n\t"
+        "movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "add %%"REG_b", %%"REG_D" \n\t"
+        "punpckhbw %%mm7, %%mm0 \n\t"
+        "punpckhbw %%mm7, %%mm1 \n\t"
+        "punpckhbw %%mm7, %%mm2 \n\t"
+        "punpckhbw %%mm7, %%mm3 \n\t"
+        "paddw %%mm1, %%mm4 \n\t"
+        "paddw %%mm1, %%mm5 \n\t"
+        "paddw %%mm3, %%mm6 \n\t"
+        "psubw %%mm0, %%mm4 \n\t"
+        "psubw %%mm2, %%mm5 \n\t"
+        "psubw %%mm2, %%mm6 \n\t"
 
-		"decl %%ecx \n\t"
-		"jnz 3b \n\t"
+        "decl %%ecx \n\t"
+        "jnz 3b \n\t"
 
-		"movq %%mm0, %%mm1 \n\t"
-		"movq %%mm0, %%mm2 \n\t"
-		"movq %%mm0, %%mm3 \n\t"
-		"pcmpgtw %%mm4, %%mm1 \n\t"
-		"pcmpgtw %%mm5, %%mm2 \n\t"
-		"pcmpgtw %%mm6, %%mm3 \n\t"
-		"pxor %%mm1, %%mm4 \n\t"
-		"pxor %%mm2, %%mm5 \n\t"
-		"pxor %%mm3, %%mm6 \n\t"
-		"psubw %%mm1, %%mm4 \n\t"
-		"psubw %%mm2, %%mm5 \n\t"
-		"psubw %%mm3, %%mm6 \n\t"
-		"movq %%mm4, 8(%%"REG_d") \n\t"
-		"movq %%mm5, 24(%%"REG_d") \n\t"
-		"movq %%mm6, 40(%%"REG_d") \n\t"
+        "movq %%mm0, %%mm1 \n\t"
+        "movq %%mm0, %%mm2 \n\t"
+        "movq %%mm0, %%mm3 \n\t"
+        "pcmpgtw %%mm4, %%mm1 \n\t"
+        "pcmpgtw %%mm5, %%mm2 \n\t"
+        "pcmpgtw %%mm6, %%mm3 \n\t"
+        "pxor %%mm1, %%mm4 \n\t"
+        "pxor %%mm2, %%mm5 \n\t"
+        "pxor %%mm3, %%mm6 \n\t"
+        "psubw %%mm1, %%mm4 \n\t"
+        "psubw %%mm2, %%mm5 \n\t"
+        "psubw %%mm3, %%mm6 \n\t"
+        "movq %%mm4, 8(%%"REG_d") \n\t"
+        "movq %%mm5, 24(%%"REG_d") \n\t"
+        "movq %%mm6, 40(%%"REG_d") \n\t"
 
-		"emms \n\t"
-		:
-		: "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
-		: "memory"
-		);
-	m->p = m->t = m->s = 0;
-	for (i=0; i<8; i++) {
-		m->p += out[i];
-		m->t += out[8+i];
-		m->s += out[16+i];
-	}
-	//printf("e=%d o=%d d=%d p=%d t=%d s=%d\n", m->e, m->o, m->d, m->p, m->t, m->s);
+        "emms \n\t"
+        :
+        : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
+        : "memory"
+        );
+    m->p = m->t = m->s = 0;
+    for (i=0; i<8; i++) {
+        m->p += out[i];
+        m->t += out[8+i];
+        m->s += out[16+i];
+    }
+    //printf("e=%d o=%d d=%d p=%d t=%d s=%d\n", m->e, m->o, m->d, m->p, m->t, m->s);
 }
 #endif
 
@@ -251,29 +251,29 @@
 
 static void block_diffs_C(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
 {
-	int x, y, e=0, o=0, s=0, p=0, t=0;
-	unsigned char *oldp, *newp;
-	m->s = m->p = m->t = 0;
-	for (x = 8; x; x--) {
-		oldp = old++;
-		newp = new++;
-		s = p = t = 0;
-		for (y = 4; y; y--) {
-			e += MAG(newp[0]-oldp[0]);
-			o += MAG(newp[ns]-oldp[os]);
-			s += newp[ns]-newp[0];
-			p += oldp[os]-oldp[0];
-			t += oldp[os]-newp[0];
-			oldp += os<<1;
-			newp += ns<<1;
-		}
-		m->s += MAG(s);
-		m->p += MAG(p);
-		m->t += MAG(t);
-	}
-	m->e = e;
-	m->o = o;
-	m->d = e+o;
+    int x, y, e=0, o=0, s=0, p=0, t=0;
+    unsigned char *oldp, *newp;
+    m->s = m->p = m->t = 0;
+    for (x = 8; x; x--) {
+        oldp = old++;
+        newp = new++;
+        s = p = t = 0;
+        for (y = 4; y; y--) {
+            e += MAG(newp[0]-oldp[0]);
+            o += MAG(newp[ns]-oldp[os]);
+            s += newp[ns]-newp[0];
+            p += oldp[os]-oldp[0];
+            t += oldp[os]-newp[0];
+            oldp += os<<1;
+            newp += ns<<1;
+        }
+        m->s += MAG(s);
+        m->p += MAG(p);
+        m->t += MAG(t);
+    }
+    m->e = e;
+    m->o = o;
+    m->d = e+o;
 }
 
 static void (*block_diffs)(struct metrics *, unsigned char *, unsigned char *, int, int);
@@ -281,263 +281,263 @@
 #define MAXUP(a,b) ((a) = ((a)>(b)) ? (a) : (b))
 
 static void diff_planes(struct frameinfo *fi,
-	unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
+    unsigned char *old, unsigned char *new, int w, int h, int os, int ns)
 {
-	int x, y;
-	struct metrics l;
-	struct metrics *peak=&fi->p, *rel=&fi->r, *mean=&fi->m;
-	memset(peak, 0, sizeof(struct metrics));
-	memset(rel, 0, sizeof(struct metrics));
-	memset(mean, 0, sizeof(struct metrics));
-	for (y = 0; y < h-7; y += 8) {
-		for (x = 8; x < w-8-7; x += 8) {
-			block_diffs(&l, old+x+y*os, new+x+y*ns, os, ns);
-			mean->d += l.d;
-			mean->e += l.e;
-			mean->o += l.o;
-			mean->s += l.s;
-			mean->p += l.p;
-			mean->t += l.t;
-			MAXUP(peak->d, l.d);
-			MAXUP(peak->e, l.e);
-			MAXUP(peak->o, l.o);
-			MAXUP(peak->s, l.s);
-			MAXUP(peak->p, l.p);
-			MAXUP(peak->t, l.t);
-			MAXUP(rel->e, l.e-l.o);
-			MAXUP(rel->o, l.o-l.e);
-			MAXUP(rel->s, l.s-l.t);
-			MAXUP(rel->p, l.p-l.t);
-			MAXUP(rel->t, l.t-l.p);
-			MAXUP(rel->d, l.t-l.s); /* hack */
-		}
-	}
-	x = (w/8-2)*(h/8);
-	mean->d /= x;
-	mean->e /= x;
-	mean->o /= x;
-	mean->s /= x;
-	mean->p /= x;
-	mean->t /= x;
+    int x, y;
+    struct metrics l;
+    struct metrics *peak=&fi->p, *rel=&fi->r, *mean=&fi->m;
+    memset(peak, 0, sizeof(struct metrics));
+    memset(rel, 0, sizeof(struct metrics));
+    memset(mean, 0, sizeof(struct metrics));
+    for (y = 0; y < h-7; y += 8) {
+        for (x = 8; x < w-8-7; x += 8) {
+            block_diffs(&l, old+x+y*os, new+x+y*ns, os, ns);
+            mean->d += l.d;
+            mean->e += l.e;
+            mean->o += l.o;
+            mean->s += l.s;
+            mean->p += l.p;
+            mean->t += l.t;
+            MAXUP(peak->d, l.d);
+            MAXUP(peak->e, l.e);
+            MAXUP(peak->o, l.o);
+            MAXUP(peak->s, l.s);
+            MAXUP(peak->p, l.p);
+            MAXUP(peak->t, l.t);
+            MAXUP(rel->e, l.e-l.o);
+            MAXUP(rel->o, l.o-l.e);
+            MAXUP(rel->s, l.s-l.t);
+            MAXUP(rel->p, l.p-l.t);
+            MAXUP(rel->t, l.t-l.p);
+            MAXUP(rel->d, l.t-l.s); /* hack */
+        }
+    }
+    x = (w/8-2)*(h/8);
+    mean->d /= x;
+    mean->e /= x;
+    mean->o /= x;
+    mean->s /= x;
+    mean->p /= x;
+    mean->t /= x;
 }
 
 static void diff_fields(struct frameinfo *fi, mp_image_t *old, mp_image_t *new)
 {
-	diff_planes(fi, old->planes[0], new->planes[0],
-		new->w, new->h, old->stride[0], new->stride[0]);
+    diff_planes(fi, old->planes[0], new->planes[0],
+        new->w, new->h, old->stride[0], new->stride[0]);
 }
 
 static void stats(struct frameinfo *f)
 {
-	mp_msg(MSGT_VFILTER, MSGL_V, "       pd=%d re=%d ro=%d rp=%d rt=%d rs=%d rd=%d pp=%d pt=%d ps=%d\r",
-		f->p.d, f->r.e, f->r.o, f->r.p, f->r.t, f->r.s, f->r.d, f->p.p, f->p.t, f->p.s);
+    mp_msg(MSGT_VFILTER, MSGL_V, "       pd=%d re=%d ro=%d rp=%d rt=%d rs=%d rd=%d pp=%d pt=%d ps=%d\r",
+        f->p.d, f->r.e, f->r.o, f->r.p, f->r.t, f->r.s, f->r.d, f->p.p, f->p.t, f->p.s);
 }
 
 static int foo(struct vf_priv_s *p, mp_image_t *new, mp_image_t *cur)
 {
-	struct frameinfo *f = p->fi;
+    struct frameinfo *f = p->fi;
 
-	f[0] = f[1];
-	diff_fields(&f[1], cur, new);
-	stats(&f[1]);
+    f[0] = f[1];
+    diff_fields(&f[1], cur, new);
+    stats(&f[1]);
 
-	// Immediately drop this frame if it's already been used.
-	if (p->dropnext) {
-		p->dropnext = 0;
-		return F_DROP;
-	}
+    // Immediately drop this frame if it's already been used.
+    if (p->dropnext) {
+        p->dropnext = 0;
+        return F_DROP;
+    }
 
-	// Sometimes a pulldown frame comes all by itself, so both
-	// its top and bottom field are duplicates from the adjacent
-	// two frames. We can just drop such a frame, but we
-	// immediately show the next frame instead to keep the frame
-	// drops evenly spaced during normal 3:2 pulldown sequences.
-	if ((3*f[1].r.o < f[1].r.e) && (f[1].r.s < f[1].r.d)) {
-		p->dropnext = 1;
-		return F_NEXT;
-	}
+    // Sometimes a pulldown frame comes all by itself, so both
+    // its top and bottom field are duplicates from the adjacent
+    // two frames. We can just drop such a frame, but we
+    // immediately show the next frame instead to keep the frame
+    // drops evenly spaced during normal 3:2 pulldown sequences.
+    if ((3*f[1].r.o < f[1].r.e) && (f[1].r.s < f[1].r.d)) {
+        p->dropnext = 1;
+        return F_NEXT;
+    }
 
-	// If none of these conditions hold, we will consider the frame
-	// progressive and just show it as-is.
-	if (!(  (3*f[0].r.e < f[0].r.o) ||
-		((2*f[0].r.d < f[0].r.s) && (f[0].r.s > 1200)) ||
-		((2*f[1].r.t < f[1].r.p) && (f[1].r.p > 1200))  ))
-		return F_SHOW;
+    // If none of these conditions hold, we will consider the frame
+    // progressive and just show it as-is.
+    if (!(  (3*f[0].r.e < f[0].r.o) ||
+        ((2*f[0].r.d < f[0].r.s) && (f[0].r.s > 1200)) ||
+        ((2*f[1].r.t < f[1].r.p) && (f[1].r.p > 1200))  ))
+        return F_SHOW;
 
-	// Otherwise, we have to decide whether to merge or drop.
-	// If the noise metric only increases minimally, we're off
-	// to a good start...
-	if (((2*f[1].r.t < 3*f[1].r.p) && (f[1].r.t < 3600)) ||
-		(f[1].r.t < 900) || (f[1].r.d < 900)) {
-		// ...and if noise decreases or the duplicate even field
-		// is detected, we go ahead with the merge.
-		if ((3*f[0].r.e < f[0].r.o) || (2*f[1].r.t < f[1].r.p)) {
-			p->dropnext = 1;
-			return F_MERGE;
-		}
-	}
-	return F_DROP;
+    // Otherwise, we have to decide whether to merge or drop.
+    // If the noise metric only increases minimally, we're off
+    // to a good start...
+    if (((2*f[1].r.t < 3*f[1].r.p) && (f[1].r.t < 3600)) ||
+        (f[1].r.t < 900) || (f[1].r.d < 900)) {
+        // ...and if noise decreases or the duplicate even field
+        // is detected, we go ahead with the merge.
+        if ((3*f[0].r.e < f[0].r.o) || (2*f[1].r.t < f[1].r.p)) {
+            p->dropnext = 1;
+            return F_MERGE;
+        }
+    }
+    return F_DROP;
 }
 
 
 
 static void copy_image(mp_image_t *dmpi, mp_image_t *mpi, int field)
 {
-	switch (field) {
-	case 0:
-		my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		break;
-	case 1:
-		my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
-			mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
-				mpi->planes[1]+mpi->stride[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
-				mpi->planes[2]+mpi->stride[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		break;
-	case 2:
-		memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
-			dmpi->stride[0], mpi->stride[0]);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			memcpy_pic(dmpi->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height,
-				dmpi->stride[1], mpi->stride[1]);
-			memcpy_pic(dmpi->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height,
-				dmpi->stride[2], mpi->stride[2]);
-		}
-		break;
-	}
+    switch (field) {
+    case 0:
+        my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
+            dmpi->stride[0]*2, mpi->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, mpi->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, mpi->stride[2]*2);
+        }
+        break;
+    case 1:
+        my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
+            mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
+            dmpi->stride[0]*2, mpi->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
+                mpi->planes[1]+mpi->stride[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, mpi->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
+                mpi->planes[2]+mpi->stride[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, mpi->stride[2]*2);
+        }
+        break;
+    case 2:
+        memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
+            dmpi->stride[0], mpi->stride[0]);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                mpi->chroma_width, mpi->chroma_height,
+                dmpi->stride[1], mpi->stride[1]);
+            memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                mpi->chroma_width, mpi->chroma_height,
+                dmpi->stride[2], mpi->stride[2]);
+        }
+        break;
+    }
 }
 
 static int do_put_image(struct vf_instance *vf, mp_image_t *dmpi)
 {
-	struct vf_priv_s *p = vf->priv;
-	int dropflag=0;
+    struct vf_priv_s *p = vf->priv;
+    int dropflag=0;
 
-	if (!p->dropnext) switch (p->drop) {
-	case 0:
-		dropflag = 0;
-		break;
-	case 1:
-		dropflag = (++p->lastdrop >= 5);
-		break;
-	case 2:
-		dropflag = (++p->lastdrop >= 5) && (4*p->inframes <= 5*p->outframes);
-		break;
-	}
+    if (!p->dropnext) switch (p->drop) {
+    case 0:
+        dropflag = 0;
+        break;
+    case 1:
+        dropflag = (++p->lastdrop >= 5);
+        break;
+    case 2:
+        dropflag = (++p->lastdrop >= 5) && (4*p->inframes <= 5*p->outframes);
+        break;
+    }
 
-	if (dropflag) {
-		//mp_msg(MSGT_VFILTER, MSGL_V, "drop! [%d/%d=%g]\n",
-		//	p->outframes, p->inframes, (float)p->outframes/p->inframes);
-		mp_msg(MSGT_VFILTER, MSGL_V, "!");
-		p->lastdrop = 0;
-		return 0;
-	}
+    if (dropflag) {
+        //mp_msg(MSGT_VFILTER, MSGL_V, "drop! [%d/%d=%g]\n",
+        //    p->outframes, p->inframes, (float)p->outframes/p->inframes);
+        mp_msg(MSGT_VFILTER, MSGL_V, "!");
+        p->lastdrop = 0;
+        return 0;
+    }
 
-	p->outframes++;
-	return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+    p->outframes++;
+    return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	int ret=0;
-	struct vf_priv_s *p = vf->priv;
+    int ret=0;
+    struct vf_priv_s *p = vf->priv;
 
-	p->inframes++;
+    p->inframes++;
 
-	if (p->first) { /* hack */
-		p->first = 0;
-		return 1;
-	}
+    if (p->first) { /* hack */
+        p->first = 0;
+        return 1;
+    }
 
-	if (!p->dmpi) p->dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-		MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
-		mpi->width, mpi->height);
-	/* FIXME -- not correct, off by one frame! */
-	p->dmpi->qscale = mpi->qscale;
-	p->dmpi->qstride = mpi->qstride;
-	p->dmpi->qscale_type = mpi->qscale_type;
+    if (!p->dmpi) p->dmpi = vf_get_image(vf->next, mpi->imgfmt,
+        MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+        MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
+        mpi->width, mpi->height);
+    /* FIXME -- not correct, off by one frame! */
+    p->dmpi->qscale = mpi->qscale;
+    p->dmpi->qstride = mpi->qstride;
+    p->dmpi->qscale_type = mpi->qscale_type;
 
-	switch (foo(p, mpi, p->dmpi)) {
-	case F_DROP:
-		copy_image(p->dmpi, mpi, 2);
-		ret = 0;
-		p->lastdrop = 0;
-		mp_msg(MSGT_VFILTER, MSGL_V, "DROP\n");
-		break;
-	case F_MERGE:
-		copy_image(p->dmpi, mpi, 0);
-		ret = do_put_image(vf, p->dmpi);
-		copy_image(p->dmpi, mpi, 1);
-		mp_msg(MSGT_VFILTER, MSGL_V, "MERGE\n");
-		p->dmpi = NULL;
-		break;
-	case F_NEXT:
-		copy_image(p->dmpi, mpi, 2);
-		ret = do_put_image(vf, p->dmpi);
-		mp_msg(MSGT_VFILTER, MSGL_V, "NEXT\n");
-		p->dmpi = NULL;
-		break;
-	case F_SHOW:
-		ret = do_put_image(vf, p->dmpi);
-		copy_image(p->dmpi, mpi, 2);
-		mp_msg(MSGT_VFILTER, MSGL_V, "OK\n");
-		p->dmpi = NULL;
-		break;
-	}
-	return ret;
+    switch (foo(p, mpi, p->dmpi)) {
+    case F_DROP:
+        copy_image(p->dmpi, mpi, 2);
+        ret = 0;
+        p->lastdrop = 0;
+        mp_msg(MSGT_VFILTER, MSGL_V, "DROP\n");
+        break;
+    case F_MERGE:
+        copy_image(p->dmpi, mpi, 0);
+        ret = do_put_image(vf, p->dmpi);
+        copy_image(p->dmpi, mpi, 1);
+        mp_msg(MSGT_VFILTER, MSGL_V, "MERGE\n");
+        p->dmpi = NULL;
+        break;
+    case F_NEXT:
+        copy_image(p->dmpi, mpi, 2);
+        ret = do_put_image(vf, p->dmpi);
+        mp_msg(MSGT_VFILTER, MSGL_V, "NEXT\n");
+        p->dmpi = NULL;
+        break;
+    case F_SHOW:
+        ret = do_put_image(vf, p->dmpi);
+        copy_image(p->dmpi, mpi, 2);
+        mp_msg(MSGT_VFILTER, MSGL_V, "OK\n");
+        p->dmpi = NULL;
+        break;
+    }
+    return ret;
 }
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    switch (fmt) {
+    case IMGFMT_YV12:
+    case IMGFMT_IYUV:
+    case IMGFMT_I420:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
-	vf->put_image = put_image;
-	vf->query_format = query_format;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
-	p->drop = 0;
-	p->first = 1;
-	if (args) sscanf(args, "%d", &p->drop);
-	block_diffs = block_diffs_C;
+    struct vf_priv_s *p;
+    vf->put_image = put_image;
+    vf->query_format = query_format;
+    vf->uninit = uninit;
+    vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+    vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+    p->drop = 0;
+    p->first = 1;
+    if (args) sscanf(args, "%d", &p->drop);
+    block_diffs = block_diffs_C;
 #if HAVE_MMX && HAVE_EBX_AVAILABLE
-	if(gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
+    if(gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
 #endif
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_ivtc = {
--- a/libmpcodecs/vf_kerndeint.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_kerndeint.c	Fri Jan 14 22:10:21 2011 +0000
@@ -34,13 +34,13 @@
 //===========================================================================//
 
 struct vf_priv_s {
-	int	frame;
-	int	map;
-	int	order;
-	int	thresh;
-	int	sharp;
-	int	twoway;
-	int	do_deinterlace;
+    int    frame;
+    int    map;
+    int    order;
+    int    thresh;
+    int    sharp;
+    int    twoway;
+    int    do_deinterlace;
 };
 
 
@@ -48,26 +48,26 @@
 
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt){
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static inline int IsRGB(mp_image_t *mpi)
 {
-	return mpi->imgfmt == IMGFMT_RGB;
+    return mpi->imgfmt == IMGFMT_RGB;
 }
 
 static inline int IsYUY2(mp_image_t *mpi)
 {
-	return mpi->imgfmt == IMGFMT_YUY2;
+    return mpi->imgfmt == IMGFMT_YUY2;
 }
 
 #define PLANAR_Y 0
@@ -75,262 +75,262 @@
 #define PLANAR_V 2
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
-        int W = mpi->w, H = mpi->h;
-	const unsigned char *prvp, *prvpp, *prvpn, *prvpnn, *prvppp, *prvp4p, *prvp4n;
-	const unsigned char *srcp_saved;
-	const unsigned char *srcp, *srcpp, *srcpn, *srcpnn, *srcppp, *srcp3p, *srcp3n, *srcp4p, *srcp4n;
-	unsigned char *dstp, *dstp_saved;
-	int src_pitch;
-	int psrc_pitch;
-	int dst_pitch;
-	int x, y, z;
-	int n = vf->priv->frame++;
-	int val, hi, lo, w, h;
-	double valf;
-	int plane;
-	int threshold = vf->priv->thresh;
-	int order = vf->priv->order;
-	int map = vf->priv->map;
-	int sharp = vf->priv->sharp;
-	int twoway = vf->priv->twoway;
-	mp_image_t *dmpi, *pmpi;
+    int cw= mpi->w >> mpi->chroma_x_shift;
+    int ch= mpi->h >> mpi->chroma_y_shift;
+    int W = mpi->w, H = mpi->h;
+    const unsigned char *prvp, *prvpp, *prvpn, *prvpnn, *prvppp, *prvp4p, *prvp4n;
+    const unsigned char *srcp_saved;
+    const unsigned char *srcp, *srcpp, *srcpn, *srcpnn, *srcppp, *srcp3p, *srcp3n, *srcp4p, *srcp4n;
+    unsigned char *dstp, *dstp_saved;
+    int src_pitch;
+    int psrc_pitch;
+    int dst_pitch;
+    int x, y, z;
+    int n = vf->priv->frame++;
+    int val, hi, lo, w, h;
+    double valf;
+    int plane;
+    int threshold = vf->priv->thresh;
+    int order = vf->priv->order;
+    int map = vf->priv->map;
+    int sharp = vf->priv->sharp;
+    int twoway = vf->priv->twoway;
+    mp_image_t *dmpi, *pmpi;
 
-	if(!vf->priv->do_deinterlace)
-		return vf_next_put_image(vf, mpi, pts);
+    if(!vf->priv->do_deinterlace)
+        return vf_next_put_image(vf, mpi, pts);
 
-	dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->w,mpi->h);
-	pmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->w,mpi->h);
-	if(!dmpi) return 0;
+    dmpi=vf_get_image(vf->next,mpi->imgfmt,
+        MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w,mpi->h);
+    pmpi=vf_get_image(vf->next,mpi->imgfmt,
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w,mpi->h);
+    if(!dmpi) return 0;
 
-	for (z=0; z<mpi->num_planes; z++) {
-		if (z == 0) plane = PLANAR_Y;
-		else if (z == 1) plane = PLANAR_U;
-		else plane = PLANAR_V;
+    for (z=0; z<mpi->num_planes; z++) {
+        if (z == 0) plane = PLANAR_Y;
+        else if (z == 1) plane = PLANAR_U;
+        else plane = PLANAR_V;
 
-		h = plane == PLANAR_Y ? H : ch;
-		w = plane == PLANAR_Y ? W : cw;
+        h = plane == PLANAR_Y ? H : ch;
+        w = plane == PLANAR_Y ? W : cw;
 
-		srcp = srcp_saved = mpi->planes[z];
-		src_pitch = mpi->stride[z];
-		psrc_pitch = pmpi->stride[z];
-		dstp = dstp_saved = dmpi->planes[z];
-		dst_pitch = dmpi->stride[z];
-		srcp = srcp_saved + (1-order) * src_pitch;
-		dstp = dstp_saved + (1-order) * dst_pitch;
+        srcp = srcp_saved = mpi->planes[z];
+        src_pitch = mpi->stride[z];
+        psrc_pitch = pmpi->stride[z];
+        dstp = dstp_saved = dmpi->planes[z];
+        dst_pitch = dmpi->stride[z];
+        srcp = srcp_saved + (1-order) * src_pitch;
+        dstp = dstp_saved + (1-order) * dst_pitch;
 
-		for (y=0; y<h; y+=2) {
-			fast_memcpy(dstp, srcp, w);
-			srcp += 2*src_pitch;
-			dstp += 2*dst_pitch;
-		}
+        for (y=0; y<h; y+=2) {
+            fast_memcpy(dstp, srcp, w);
+            srcp += 2*src_pitch;
+            dstp += 2*dst_pitch;
+        }
 
-		// Copy through the lines that will be missed below.
-		fast_memcpy(dstp_saved + order*dst_pitch, srcp_saved + (1-order)*src_pitch, w);
-		fast_memcpy(dstp_saved + (2+order)*dst_pitch, srcp_saved + (3-order)*src_pitch, w);
-		fast_memcpy(dstp_saved + (h-2+order)*dst_pitch, srcp_saved + (h-1-order)*src_pitch, w);
-		fast_memcpy(dstp_saved + (h-4+order)*dst_pitch, srcp_saved + (h-3-order)*src_pitch, w);
-		/* For the other field choose adaptively between using the previous field
-		   or the interpolant from the current field. */
+        // Copy through the lines that will be missed below.
+        fast_memcpy(dstp_saved + order*dst_pitch, srcp_saved + (1-order)*src_pitch, w);
+        fast_memcpy(dstp_saved + (2+order)*dst_pitch, srcp_saved + (3-order)*src_pitch, w);
+        fast_memcpy(dstp_saved + (h-2+order)*dst_pitch, srcp_saved + (h-1-order)*src_pitch, w);
+        fast_memcpy(dstp_saved + (h-4+order)*dst_pitch, srcp_saved + (h-3-order)*src_pitch, w);
+        /* For the other field choose adaptively between using the previous field
+           or the interpolant from the current field. */
 
-		prvp = pmpi->planes[z] + 5*psrc_pitch - (1-order)*psrc_pitch;
-		prvpp = prvp - psrc_pitch;
-		prvppp = prvp - 2*psrc_pitch;
-		prvp4p = prvp - 4*psrc_pitch;
-		prvpn = prvp + psrc_pitch;
-		prvpnn = prvp + 2*psrc_pitch;
-		prvp4n = prvp + 4*psrc_pitch;
-		srcp = srcp_saved + 5*src_pitch - (1-order)*src_pitch;
-		srcpp = srcp - src_pitch;
-		srcppp = srcp - 2*src_pitch;
-		srcp3p = srcp - 3*src_pitch;
-		srcp4p = srcp - 4*src_pitch;
-		srcpn = srcp + src_pitch;
-		srcpnn = srcp + 2*src_pitch;
-		srcp3n = srcp + 3*src_pitch;
-		srcp4n = srcp + 4*src_pitch;
-		dstp =  dstp_saved  + 5*dst_pitch - (1-order)*dst_pitch;
-		for (y = 5 - (1-order); y <= h - 5 - (1-order); y+=2)
-		{
-			for (x = 0; x < w; x++)
-			{
-				if ((threshold == 0) || (n == 0) ||
-					(abs((int)prvp[x] - (int)srcp[x]) > threshold) ||
-					(abs((int)prvpp[x] - (int)srcpp[x]) > threshold) ||
-					(abs((int)prvpn[x] - (int)srcpn[x]) > threshold))
-				{
-					if (map == 1)
-					{
-						int g = x & ~3;
-						if (IsRGB(mpi) == 1)
-						{
-							dstp[g++] = 255;
-							dstp[g++] = 255;
-							dstp[g++] = 255;
-							dstp[g] = 255;
-							x = g;
-						}
-						else if (IsYUY2(mpi) == 1)
-						{
-							dstp[g++] = 235;
-							dstp[g++] = 128;
-							dstp[g++] = 235;
-							dstp[g] = 128;
-							x = g;
-						}
-						else
-						{
-							if (plane == PLANAR_Y) dstp[x] = 235;
-							else dstp[x] = 128;
-						}
-					}
-					else
-					{
-						if (IsRGB(mpi))
-						{
-							hi = 255;
-							lo = 0;
-						}
-						else if (IsYUY2(mpi))
-						{
-							hi = (x & 1) ? 240 : 235;
-							lo = 16;
-						}
-						else
-						{
-							hi = (plane == PLANAR_Y) ? 235 : 240;
-							lo = 16;
-						}
+        prvp = pmpi->planes[z] + 5*psrc_pitch - (1-order)*psrc_pitch;
+        prvpp = prvp - psrc_pitch;
+        prvppp = prvp - 2*psrc_pitch;
+        prvp4p = prvp - 4*psrc_pitch;
+        prvpn = prvp + psrc_pitch;
+        prvpnn = prvp + 2*psrc_pitch;
+        prvp4n = prvp + 4*psrc_pitch;
+        srcp = srcp_saved + 5*src_pitch - (1-order)*src_pitch;
+        srcpp = srcp - src_pitch;
+        srcppp = srcp - 2*src_pitch;
+        srcp3p = srcp - 3*src_pitch;
+        srcp4p = srcp - 4*src_pitch;
+        srcpn = srcp + src_pitch;
+        srcpnn = srcp + 2*src_pitch;
+        srcp3n = srcp + 3*src_pitch;
+        srcp4n = srcp + 4*src_pitch;
+        dstp =  dstp_saved  + 5*dst_pitch - (1-order)*dst_pitch;
+        for (y = 5 - (1-order); y <= h - 5 - (1-order); y+=2)
+        {
+            for (x = 0; x < w; x++)
+            {
+                if ((threshold == 0) || (n == 0) ||
+                    (abs((int)prvp[x] - (int)srcp[x]) > threshold) ||
+                    (abs((int)prvpp[x] - (int)srcpp[x]) > threshold) ||
+                    (abs((int)prvpn[x] - (int)srcpn[x]) > threshold))
+                {
+                    if (map == 1)
+                    {
+                        int g = x & ~3;
+                        if (IsRGB(mpi) == 1)
+                        {
+                            dstp[g++] = 255;
+                            dstp[g++] = 255;
+                            dstp[g++] = 255;
+                            dstp[g] = 255;
+                            x = g;
+                        }
+                        else if (IsYUY2(mpi) == 1)
+                        {
+                            dstp[g++] = 235;
+                            dstp[g++] = 128;
+                            dstp[g++] = 235;
+                            dstp[g] = 128;
+                            x = g;
+                        }
+                        else
+                        {
+                            if (plane == PLANAR_Y) dstp[x] = 235;
+                            else dstp[x] = 128;
+                        }
+                    }
+                    else
+                    {
+                        if (IsRGB(mpi))
+                        {
+                            hi = 255;
+                            lo = 0;
+                        }
+                        else if (IsYUY2(mpi))
+                        {
+                            hi = (x & 1) ? 240 : 235;
+                            lo = 16;
+                        }
+                        else
+                        {
+                            hi = (plane == PLANAR_Y) ? 235 : 240;
+                            lo = 16;
+                        }
 
-						if (sharp == 1)
-						{
-							if (twoway == 1)
-								valf = + 0.526*((int)srcpp[x] + (int)srcpn[x])
-								   + 0.170*((int)srcp[x] + (int)prvp[x])
-								   - 0.116*((int)srcppp[x] + (int)srcpnn[x] + (int)prvppp[x] + (int)prvpnn[x])
-					 			   - 0.026*((int)srcp3p[x] + (int)srcp3n[x])
-								   + 0.031*((int)srcp4p[x] + (int)srcp4n[x] + (int)prvp4p[x] + (int)prvp4n[x]);
-							else
-								valf = + 0.526*((int)srcpp[x] + (int)srcpn[x])
-								   + 0.170*((int)prvp[x])
-								   - 0.116*((int)prvppp[x] + (int)prvpnn[x])
-					 			   - 0.026*((int)srcp3p[x] + (int)srcp3n[x])
-								   + 0.031*((int)prvp4p[x] + (int)prvp4p[x]);
-							if (valf > hi) valf = hi;
-							else if (valf < lo) valf = lo;
-							dstp[x] = (int) valf;
-						}
-						else
-						{
-							if (twoway == 1)
-								val = (8*((int)srcpp[x] + (int)srcpn[x]) + 2*((int)srcp[x] + (int)prvp[x]) -
-									(int)(srcppp[x]) - (int)(srcpnn[x]) -
-									(int)(prvppp[x]) - (int)(prvpnn[x])) >> 4;
-							else
-								val = (8*((int)srcpp[x] + (int)srcpn[x]) + 2*((int)prvp[x]) -
-									(int)(prvppp[x]) - (int)(prvpnn[x])) >> 4;
-							if (val > hi) val = hi;
-							else if (val < lo) val = lo;
-							dstp[x] = (int) val;
-						}
-					}
-				}
-				else
-				{
-					dstp[x] = srcp[x];
-				}
-			}
-			prvp  += 2*psrc_pitch;
-			prvpp  += 2*psrc_pitch;
-			prvppp  += 2*psrc_pitch;
-			prvpn  += 2*psrc_pitch;
-			prvpnn  += 2*psrc_pitch;
-			prvp4p  += 2*psrc_pitch;
-			prvp4n  += 2*psrc_pitch;
-			srcp  += 2*src_pitch;
-			srcpp += 2*src_pitch;
-			srcppp += 2*src_pitch;
-			srcp3p += 2*src_pitch;
-			srcp4p += 2*src_pitch;
-			srcpn += 2*src_pitch;
-			srcpnn += 2*src_pitch;
-			srcp3n += 2*src_pitch;
-			srcp4n += 2*src_pitch;
-			dstp  += 2*dst_pitch;
-		}
+                        if (sharp == 1)
+                        {
+                            if (twoway == 1)
+                                valf = + 0.526*((int)srcpp[x] + (int)srcpn[x])
+                                   + 0.170*((int)srcp[x] + (int)prvp[x])
+                                   - 0.116*((int)srcppp[x] + (int)srcpnn[x] + (int)prvppp[x] + (int)prvpnn[x])
+                                   - 0.026*((int)srcp3p[x] + (int)srcp3n[x])
+                                   + 0.031*((int)srcp4p[x] + (int)srcp4n[x] + (int)prvp4p[x] + (int)prvp4n[x]);
+                            else
+                                valf = + 0.526*((int)srcpp[x] + (int)srcpn[x])
+                                   + 0.170*((int)prvp[x])
+                                   - 0.116*((int)prvppp[x] + (int)prvpnn[x])
+                                   - 0.026*((int)srcp3p[x] + (int)srcp3n[x])
+                                   + 0.031*((int)prvp4p[x] + (int)prvp4p[x]);
+                            if (valf > hi) valf = hi;
+                            else if (valf < lo) valf = lo;
+                            dstp[x] = (int) valf;
+                        }
+                        else
+                        {
+                            if (twoway == 1)
+                                val = (8*((int)srcpp[x] + (int)srcpn[x]) + 2*((int)srcp[x] + (int)prvp[x]) -
+                                    (int)(srcppp[x]) - (int)(srcpnn[x]) -
+                                    (int)(prvppp[x]) - (int)(prvpnn[x])) >> 4;
+                            else
+                                val = (8*((int)srcpp[x] + (int)srcpn[x]) + 2*((int)prvp[x]) -
+                                    (int)(prvppp[x]) - (int)(prvpnn[x])) >> 4;
+                            if (val > hi) val = hi;
+                            else if (val < lo) val = lo;
+                            dstp[x] = (int) val;
+                        }
+                    }
+                }
+                else
+                {
+                    dstp[x] = srcp[x];
+                }
+            }
+            prvp  += 2*psrc_pitch;
+            prvpp  += 2*psrc_pitch;
+            prvppp  += 2*psrc_pitch;
+            prvpn  += 2*psrc_pitch;
+            prvpnn  += 2*psrc_pitch;
+            prvp4p  += 2*psrc_pitch;
+            prvp4n  += 2*psrc_pitch;
+            srcp  += 2*src_pitch;
+            srcpp += 2*src_pitch;
+            srcppp += 2*src_pitch;
+            srcp3p += 2*src_pitch;
+            srcp4p += 2*src_pitch;
+            srcpn += 2*src_pitch;
+            srcpnn += 2*src_pitch;
+            srcp3n += 2*src_pitch;
+            srcp4n += 2*src_pitch;
+            dstp  += 2*dst_pitch;
+        }
 
-		srcp = mpi->planes[z];
-		dstp = pmpi->planes[z];
-		for (y=0; y<h; y++) {
-			fast_memcpy(dstp, srcp, w);
-			srcp += src_pitch;
-			dstp += psrc_pitch;
-		}
-	}
+        srcp = mpi->planes[z];
+        dstp = pmpi->planes[z];
+        for (y=0; y<h; y++) {
+            fast_memcpy(dstp, srcp, w);
+            srcp += src_pitch;
+            dstp += psrc_pitch;
+        }
+    }
 
-	return vf_next_put_image(vf,dmpi, pts);
+    return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
         switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_RGB:
-	case IMGFMT_YUY2:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    {
+    case IMGFMT_YV12:
+    case IMGFMT_RGB:
+    case IMGFMT_YUY2:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int control(struct vf_instance *vf, int request, void* data){
-	switch (request)
-	{
-	case VFCTRL_GET_DEINTERLACE:
-		*(int*)data = vf->priv->do_deinterlace;
-		return CONTROL_OK;
-	case VFCTRL_SET_DEINTERLACE:
-		vf->priv->do_deinterlace = *(int*)data;
-		return CONTROL_OK;
-	}
-	return vf_next_control (vf, request, data);
+    switch (request)
+    {
+    case VFCTRL_GET_DEINTERLACE:
+        *(int*)data = vf->priv->do_deinterlace;
+        return CONTROL_OK;
+    case VFCTRL_SET_DEINTERLACE:
+        vf->priv->do_deinterlace = *(int*)data;
+        return CONTROL_OK;
+    }
+    return vf_next_control (vf, request, data);
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
 
-	vf->control=control;
-	vf->config=config;
-	vf->put_image=put_image;
+    vf->control=control;
+    vf->config=config;
+    vf->put_image=put_image;
         vf->query_format=query_format;
         vf->uninit=uninit;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
+    vf->priv=malloc(sizeof(struct vf_priv_s));
         memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
-	vf->priv->frame = 0;
+    vf->priv->frame = 0;
 
-	vf->priv->map = 0;
-	vf->priv->order = 0;
-	vf->priv->thresh = 10;
-	vf->priv->sharp = 0;
-	vf->priv->twoway = 0;
-	vf->priv->do_deinterlace=1;
+    vf->priv->map = 0;
+    vf->priv->order = 0;
+    vf->priv->thresh = 10;
+    vf->priv->sharp = 0;
+    vf->priv->twoway = 0;
+    vf->priv->do_deinterlace=1;
 
         if (args)
         {
             sscanf(args, "%d:%d:%d:%d:%d",
-		&vf->priv->thresh, &vf->priv->map,
-		&vf->priv->order, &vf->priv->sharp,
-		&vf->priv->twoway);
+        &vf->priv->thresh, &vf->priv->map,
+        &vf->priv->order, &vf->priv->sharp,
+        &vf->priv->twoway);
         }
-	if (vf->priv->order > 1) vf->priv->order = 1;
+    if (vf->priv->order > 1) vf->priv->order = 1;
 
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_kerndeint = {
--- a/libmpcodecs/vf_mcdeint.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_mcdeint.c	Fri Jan 14 22:10:21 2011 +0000
@@ -181,7 +181,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
         int i;
         AVCodec *enc= avcodec_find_encoder(CODEC_ID_SNOW);
 
@@ -233,7 +233,7 @@
         vf->priv->outbuf_size= width*height*10;
         vf->priv->outbuf= malloc(vf->priv->outbuf_size);
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void get_image(struct vf_instance *vf, mp_image_t *mpi){
@@ -248,8 +248,8 @@
     if(mpi->flags&MP_IMGFLAG_PLANAR){
         mpi->planes[1]=vf->dmpi->planes[1];
         mpi->planes[2]=vf->dmpi->planes[2];
-	mpi->stride[1]=vf->dmpi->stride[1];
-	mpi->stride[2]=vf->dmpi->stride[2];
+        mpi->stride[1]=vf->dmpi->stride[1];
+        mpi->stride[2]=vf->dmpi->stride[2];
     }
     mpi->flags|=MP_IMGFLAG_DIRECT;
 }
@@ -297,12 +297,12 @@
 //===========================================================================//
 static int query_format(struct vf_instance *vf, unsigned int fmt){
     switch(fmt){
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_Y800:
-	case IMGFMT_Y8:
-	    return vf_next_query_format(vf,fmt);
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_Y800:
+        case IMGFMT_Y8:
+            return vf_next_query_format(vf,fmt);
     }
     return 0;
 }
--- a/libmpcodecs/vf_mirror.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_mirror.c	Fri Jan 14 22:10:21 2011 +0000
@@ -32,52 +32,52 @@
 static void mirror(unsigned char* dst,unsigned char* src,int dststride,int srcstride,int w,int h,int bpp,unsigned int fmt){
     int y;
     for(y=0;y<h;y++){
-	int x;
-	switch(bpp){
-	case 1:
-	    for(x=0;x<w;x++) dst[x]=src[w-x-1];
-	    break;
-	case 2:
-	    switch(fmt){
-	    case IMGFMT_UYVY: {
-		// packed YUV is tricky. U,V are 32bpp while Y is 16bpp:
-		int w2=w>>1;
-		for(x=0;x<w2;x++){
-		    // TODO: optimize this...
-		    dst[x*4+0]=src[0+(w2-x-1)*4];
-		    dst[x*4+1]=src[3+(w2-x-1)*4];
-		    dst[x*4+2]=src[2+(w2-x-1)*4];
-		    dst[x*4+3]=src[1+(w2-x-1)*4];
-		}
-		break; }
-	    case IMGFMT_YUY2:
-	    case IMGFMT_YVYU: {
-		// packed YUV is tricky. U,V are 32bpp while Y is 16bpp:
-		int w2=w>>1;
-		for(x=0;x<w2;x++){
-		    // TODO: optimize this...
-		    dst[x*4+0]=src[2+(w2-x-1)*4];
-		    dst[x*4+1]=src[1+(w2-x-1)*4];
-		    dst[x*4+2]=src[0+(w2-x-1)*4];
-		    dst[x*4+3]=src[3+(w2-x-1)*4];
-		}
-		break; }
-	    default:
-		for(x=0;x<w;x++) *((short*)(dst+x*2))=*((short*)(src+(w-x-1)*2));
-	    }
-	    break;
-	case 3:
-	    for(x=0;x<w;x++){
-		dst[x*3+0]=src[0+(w-x-1)*3];
-		dst[x*3+1]=src[1+(w-x-1)*3];
-		dst[x*3+2]=src[2+(w-x-1)*3];
-	    }
-	    break;
-	case 4:
-	    for(x=0;x<w;x++) *((int*)(dst+x*4))=*((int*)(src+(w-x-1)*4));
-	}
-	src+=srcstride;
-	dst+=dststride;
+        int x;
+        switch(bpp){
+        case 1:
+            for(x=0;x<w;x++) dst[x]=src[w-x-1];
+            break;
+        case 2:
+            switch(fmt){
+            case IMGFMT_UYVY: {
+                // packed YUV is tricky. U,V are 32bpp while Y is 16bpp:
+                int w2=w>>1;
+                for(x=0;x<w2;x++){
+                    // TODO: optimize this...
+                    dst[x*4+0]=src[0+(w2-x-1)*4];
+                    dst[x*4+1]=src[3+(w2-x-1)*4];
+                    dst[x*4+2]=src[2+(w2-x-1)*4];
+                    dst[x*4+3]=src[1+(w2-x-1)*4];
+                }
+                break; }
+            case IMGFMT_YUY2:
+            case IMGFMT_YVYU: {
+                // packed YUV is tricky. U,V are 32bpp while Y is 16bpp:
+                int w2=w>>1;
+                for(x=0;x<w2;x++){
+                    // TODO: optimize this...
+                    dst[x*4+0]=src[2+(w2-x-1)*4];
+                    dst[x*4+1]=src[1+(w2-x-1)*4];
+                    dst[x*4+2]=src[0+(w2-x-1)*4];
+                    dst[x*4+3]=src[3+(w2-x-1)*4];
+                }
+                break; }
+            default:
+                for(x=0;x<w;x++) *((short*)(dst+x*2))=*((short*)(src+(w-x-1)*2));
+            }
+            break;
+        case 3:
+            for(x=0;x<w;x++){
+                dst[x*3+0]=src[0+(w-x-1)*3];
+                dst[x*3+1]=src[1+(w-x-1)*3];
+                dst[x*3+2]=src[2+(w-x-1)*3];
+            }
+            break;
+        case 4:
+            for(x=0;x<w;x++) *((int*)(dst+x*4))=*((int*)(src+(w-x-1)*4));
+        }
+        src+=srcstride;
+        dst+=dststride;
     }
 }
 
@@ -88,24 +88,24 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	mpi->w, mpi->h);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w, mpi->h);
 
     if(mpi->flags&MP_IMGFLAG_PLANAR){
-	       mirror(dmpi->planes[0],mpi->planes[0],
-	       dmpi->stride[0],mpi->stride[0],
-	       dmpi->w,dmpi->h,1,mpi->imgfmt);
-	       mirror(dmpi->planes[1],mpi->planes[1],
-	       dmpi->stride[1],mpi->stride[1],
-	       dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,mpi->imgfmt);
-	       mirror(dmpi->planes[2],mpi->planes[2],
-	       dmpi->stride[2],mpi->stride[2],
-	       dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,mpi->imgfmt);
+               mirror(dmpi->planes[0],mpi->planes[0],
+               dmpi->stride[0],mpi->stride[0],
+               dmpi->w,dmpi->h,1,mpi->imgfmt);
+               mirror(dmpi->planes[1],mpi->planes[1],
+               dmpi->stride[1],mpi->stride[1],
+               dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,mpi->imgfmt);
+               mirror(dmpi->planes[2],mpi->planes[2],
+               dmpi->stride[2],mpi->stride[2],
+               dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,mpi->imgfmt);
     } else {
-	mirror(dmpi->planes[0],mpi->planes[0],
-	       dmpi->stride[0],mpi->stride[0],
-	       dmpi->w,dmpi->h,dmpi->bpp>>3,mpi->imgfmt);
-	dmpi->planes[1]=mpi->planes[1]; // passthrough rgb8 palette
+        mirror(dmpi->planes[0],mpi->planes[0],
+               dmpi->stride[0],mpi->stride[0],
+               dmpi->w,dmpi->h,dmpi->bpp>>3,mpi->imgfmt);
+        dmpi->planes[1]=mpi->planes[1]; // passthrough rgb8 palette
     }
 
     return vf_next_put_image(vf,dmpi, pts);
--- a/libmpcodecs/vf_noise.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_noise.c	Fri Jan 14 22:10:21 2011 +0000
@@ -51,21 +51,21 @@
 static void (*lineNoiseAvg)(uint8_t *dst, uint8_t *src, int len, int8_t **shift)= lineNoiseAvg_C;
 
 typedef struct FilterParam{
-	int strength;
-	int uniform;
-	int temporal;
-	int quality;
+        int strength;
+        int uniform;
+        int temporal;
+        int quality;
         int averaged;
         int pattern;
         int shiftptr;
-	int8_t *noise;
-	int8_t *prev_shift[MAX_RES][3];
+        int8_t *noise;
+        int8_t *prev_shift[MAX_RES][3];
 }FilterParam;
 
 struct vf_priv_s {
-	FilterParam lumaParam;
-	FilterParam chromaParam;
-	unsigned int outfmt;
+        FilterParam lumaParam;
+        FilterParam chromaParam;
+        unsigned int outfmt;
 };
 
 static int nonTempRandShift_init;
@@ -77,247 +77,247 @@
 
 #define RAND_N(range) ((int) ((double)range*rand()/(RAND_MAX+1.0)))
 static int8_t *initNoise(FilterParam *fp){
-	int strength= fp->strength;
-	int uniform= fp->uniform;
-	int averaged= fp->averaged;
-	int pattern= fp->pattern;
-	int8_t *noise= av_malloc(MAX_NOISE*sizeof(int8_t));
-	int i, j;
+        int strength= fp->strength;
+        int uniform= fp->uniform;
+        int averaged= fp->averaged;
+        int pattern= fp->pattern;
+        int8_t *noise= av_malloc(MAX_NOISE*sizeof(int8_t));
+        int i, j;
 
-	srand(123457);
+        srand(123457);
 
-	for(i=0,j=0; i<MAX_NOISE; i++,j++)
-	{
-		if(uniform) {
-			if (averaged) {
-		    		if (pattern) {
-					noise[i]= (RAND_N(strength) - strength/2)/6
-						+patt[j%4]*strength*0.25/3;
-				} else {
-					noise[i]= (RAND_N(strength) - strength/2)/3;
-		    		}
-			} else {
-		    		if (pattern) {
-				    noise[i]= (RAND_N(strength) - strength/2)/2
-					    + patt[j%4]*strength*0.25;
-				} else {
-					noise[i]= RAND_N(strength) - strength/2;
-		    		}
-			}
-	    	} else {
-			double x1, x2, w, y1;
-			do {
-				x1 = 2.0 * rand()/(float)RAND_MAX - 1.0;
-				x2 = 2.0 * rand()/(float)RAND_MAX - 1.0;
-				w = x1 * x1 + x2 * x2;
-			} while ( w >= 1.0 );
+        for(i=0,j=0; i<MAX_NOISE; i++,j++)
+        {
+                if(uniform) {
+                        if (averaged) {
+                                    if (pattern) {
+                                        noise[i]= (RAND_N(strength) - strength/2)/6
+                                                +patt[j%4]*strength*0.25/3;
+                                } else {
+                                        noise[i]= (RAND_N(strength) - strength/2)/3;
+                                    }
+                        } else {
+                                    if (pattern) {
+                                    noise[i]= (RAND_N(strength) - strength/2)/2
+                                            + patt[j%4]*strength*0.25;
+                                } else {
+                                        noise[i]= RAND_N(strength) - strength/2;
+                                    }
+                        }
+                    } else {
+                        double x1, x2, w, y1;
+                        do {
+                                x1 = 2.0 * rand()/(float)RAND_MAX - 1.0;
+                                x2 = 2.0 * rand()/(float)RAND_MAX - 1.0;
+                                w = x1 * x1 + x2 * x2;
+                        } while ( w >= 1.0 );
 
-			w = sqrt( (-2.0 * log( w ) ) / w );
-			y1= x1 * w;
-			y1*= strength / sqrt(3.0);
-			if (pattern) {
-			    y1 /= 2;
-			    y1 += patt[j%4]*strength*0.35;
-			}
-			if     (y1<-128) y1=-128;
-			else if(y1> 127) y1= 127;
-			if (averaged) y1 /= 3.0;
-			noise[i]= (int)y1;
-		}
-		if (RAND_N(6) == 0) j--;
-	}
+                        w = sqrt( (-2.0 * log( w ) ) / w );
+                        y1= x1 * w;
+                        y1*= strength / sqrt(3.0);
+                        if (pattern) {
+                            y1 /= 2;
+                            y1 += patt[j%4]*strength*0.35;
+                        }
+                        if     (y1<-128) y1=-128;
+                        else if(y1> 127) y1= 127;
+                        if (averaged) y1 /= 3.0;
+                        noise[i]= (int)y1;
+                }
+                if (RAND_N(6) == 0) j--;
+        }
 
 
-	for (i = 0; i < MAX_RES; i++)
-	    for (j = 0; j < 3; j++)
-		fp->prev_shift[i][j] = noise + (rand()&(MAX_SHIFT-1));
+        for (i = 0; i < MAX_RES; i++)
+            for (j = 0; j < 3; j++)
+                fp->prev_shift[i][j] = noise + (rand()&(MAX_SHIFT-1));
 
-	if(!nonTempRandShift_init){
-		for(i=0; i<MAX_RES; i++){
-			nonTempRandShift[i]= rand()&(MAX_SHIFT-1);
-		}
-		nonTempRandShift_init = 1;
-	}
+        if(!nonTempRandShift_init){
+                for(i=0; i<MAX_RES; i++){
+                        nonTempRandShift[i]= rand()&(MAX_SHIFT-1);
+                }
+                nonTempRandShift_init = 1;
+        }
 
-	fp->noise= noise;
-	fp->shiftptr= 0;
-	return noise;
+        fp->noise= noise;
+        fp->shiftptr= 0;
+        return noise;
 }
 
 /***************************************************************************/
 
 #if HAVE_MMX
 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
-	x86_reg mmx_len= len&(~7);
-	noise+=shift;
+        x86_reg mmx_len= len&(~7);
+        noise+=shift;
 
-	__asm__ volatile(
-		"mov %3, %%"REG_a"		\n\t"
-		"pcmpeqb %%mm7, %%mm7		\n\t"
-		"psllw $15, %%mm7		\n\t"
-		"packsswb %%mm7, %%mm7		\n\t"
-		ASMALIGN(4)
-		"1:				\n\t"
-		"movq (%0, %%"REG_a"), %%mm0	\n\t"
-		"movq (%1, %%"REG_a"), %%mm1	\n\t"
-		"pxor %%mm7, %%mm0		\n\t"
-		"paddsb %%mm1, %%mm0		\n\t"
-		"pxor %%mm7, %%mm0		\n\t"
-		"movq %%mm0, (%2, %%"REG_a")	\n\t"
-		"add $8, %%"REG_a"		\n\t"
-		" js 1b				\n\t"
-		:: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
-		: "%"REG_a
-	);
-	if(mmx_len!=len)
-		lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
+        __asm__ volatile(
+                "mov %3, %%"REG_a"                \n\t"
+                "pcmpeqb %%mm7, %%mm7                \n\t"
+                "psllw $15, %%mm7                \n\t"
+                "packsswb %%mm7, %%mm7                \n\t"
+                ASMALIGN(4)
+                "1:                                \n\t"
+                "movq (%0, %%"REG_a"), %%mm0        \n\t"
+                "movq (%1, %%"REG_a"), %%mm1        \n\t"
+                "pxor %%mm7, %%mm0                \n\t"
+                "paddsb %%mm1, %%mm0                \n\t"
+                "pxor %%mm7, %%mm0                \n\t"
+                "movq %%mm0, (%2, %%"REG_a")        \n\t"
+                "add $8, %%"REG_a"                \n\t"
+                " js 1b                                \n\t"
+                :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
+                : "%"REG_a
+        );
+        if(mmx_len!=len)
+                lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
 }
 #endif
 
 //duplicate of previous except movntq
 #if HAVE_MMX2
 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
-	x86_reg mmx_len= len&(~7);
-	noise+=shift;
+        x86_reg mmx_len= len&(~7);
+        noise+=shift;
 
-	__asm__ volatile(
-		"mov %3, %%"REG_a"		\n\t"
-		"pcmpeqb %%mm7, %%mm7		\n\t"
-		"psllw $15, %%mm7		\n\t"
-		"packsswb %%mm7, %%mm7		\n\t"
-		ASMALIGN(4)
-		"1:				\n\t"
-		"movq (%0, %%"REG_a"), %%mm0	\n\t"
-		"movq (%1, %%"REG_a"), %%mm1	\n\t"
-		"pxor %%mm7, %%mm0		\n\t"
-		"paddsb %%mm1, %%mm0		\n\t"
-		"pxor %%mm7, %%mm0		\n\t"
-		"movntq %%mm0, (%2, %%"REG_a")	\n\t"
-		"add $8, %%"REG_a"		\n\t"
-		" js 1b				\n\t"
-		:: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
-		: "%"REG_a
-	);
-	if(mmx_len!=len)
-		lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
+        __asm__ volatile(
+                "mov %3, %%"REG_a"                \n\t"
+                "pcmpeqb %%mm7, %%mm7                \n\t"
+                "psllw $15, %%mm7                \n\t"
+                "packsswb %%mm7, %%mm7                \n\t"
+                ASMALIGN(4)
+                "1:                                \n\t"
+                "movq (%0, %%"REG_a"), %%mm0        \n\t"
+                "movq (%1, %%"REG_a"), %%mm1        \n\t"
+                "pxor %%mm7, %%mm0                \n\t"
+                "paddsb %%mm1, %%mm0                \n\t"
+                "pxor %%mm7, %%mm0                \n\t"
+                "movntq %%mm0, (%2, %%"REG_a")        \n\t"
+                "add $8, %%"REG_a"                \n\t"
+                " js 1b                                \n\t"
+                :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
+                : "%"REG_a
+        );
+        if(mmx_len!=len)
+                lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
 }
 #endif
 
 static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
-	int i;
-	noise+= shift;
-	for(i=0; i<len; i++)
-	{
-		int v= src[i]+ noise[i];
-		if(v>255) 	dst[i]=255; //FIXME optimize
-		else if(v<0) 	dst[i]=0;
-		else		dst[i]=v;
-	}
+        int i;
+        noise+= shift;
+        for(i=0; i<len; i++)
+        {
+                int v= src[i]+ noise[i];
+                if(v>255)         dst[i]=255; //FIXME optimize
+                else if(v<0)         dst[i]=0;
+                else                dst[i]=v;
+        }
 }
 
 /***************************************************************************/
 
 #if HAVE_MMX
 static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
-	x86_reg mmx_len= len&(~7);
+        x86_reg mmx_len= len&(~7);
 
-	__asm__ volatile(
-		"mov %5, %%"REG_a"		\n\t"
-		ASMALIGN(4)
-		"1:				\n\t"
-		"movq (%1, %%"REG_a"), %%mm1	\n\t"
-		"movq (%0, %%"REG_a"), %%mm0	\n\t"
-		"paddb (%2, %%"REG_a"), %%mm1	\n\t"
-		"paddb (%3, %%"REG_a"), %%mm1	\n\t"
-		"movq %%mm0, %%mm2		\n\t"
-		"movq %%mm1, %%mm3		\n\t"
-		"punpcklbw %%mm0, %%mm0		\n\t"
-		"punpckhbw %%mm2, %%mm2		\n\t"
-		"punpcklbw %%mm1, %%mm1		\n\t"
-		"punpckhbw %%mm3, %%mm3		\n\t"
-		"pmulhw %%mm0, %%mm1		\n\t"
-		"pmulhw %%mm2, %%mm3		\n\t"
-		"paddw %%mm1, %%mm1		\n\t"
-		"paddw %%mm3, %%mm3		\n\t"
-		"paddw %%mm0, %%mm1		\n\t"
-		"paddw %%mm2, %%mm3		\n\t"
-		"psrlw $8, %%mm1		\n\t"
-		"psrlw $8, %%mm3		\n\t"
-                "packuswb %%mm3, %%mm1		\n\t"
-		"movq %%mm1, (%4, %%"REG_a")	\n\t"
-		"add $8, %%"REG_a"		\n\t"
-		" js 1b				\n\t"
-		:: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len),
+        __asm__ volatile(
+                "mov %5, %%"REG_a"                \n\t"
+                ASMALIGN(4)
+                "1:                                \n\t"
+                "movq (%1, %%"REG_a"), %%mm1        \n\t"
+                "movq (%0, %%"REG_a"), %%mm0        \n\t"
+                "paddb (%2, %%"REG_a"), %%mm1        \n\t"
+                "paddb (%3, %%"REG_a"), %%mm1        \n\t"
+                "movq %%mm0, %%mm2                \n\t"
+                "movq %%mm1, %%mm3                \n\t"
+                "punpcklbw %%mm0, %%mm0                \n\t"
+                "punpckhbw %%mm2, %%mm2                \n\t"
+                "punpcklbw %%mm1, %%mm1                \n\t"
+                "punpckhbw %%mm3, %%mm3                \n\t"
+                "pmulhw %%mm0, %%mm1                \n\t"
+                "pmulhw %%mm2, %%mm3                \n\t"
+                "paddw %%mm1, %%mm1                \n\t"
+                "paddw %%mm3, %%mm3                \n\t"
+                "paddw %%mm0, %%mm1                \n\t"
+                "paddw %%mm2, %%mm3                \n\t"
+                "psrlw $8, %%mm1                \n\t"
+                "psrlw $8, %%mm3                \n\t"
+                "packuswb %%mm3, %%mm1                \n\t"
+                "movq %%mm1, (%4, %%"REG_a")        \n\t"
+                "add $8, %%"REG_a"                \n\t"
+                " js 1b                                \n\t"
+                :: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len),
                    "r" (dst+mmx_len), "g" (-mmx_len)
-		: "%"REG_a
-	);
+                : "%"REG_a
+        );
 
-	if(mmx_len!=len){
-		int8_t *shift2[3]={shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len};
-		lineNoiseAvg_C(dst+mmx_len, src+mmx_len, len-mmx_len, shift2);
-	}
+        if(mmx_len!=len){
+                int8_t *shift2[3]={shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len};
+                lineNoiseAvg_C(dst+mmx_len, src+mmx_len, len-mmx_len, shift2);
+        }
 }
 #endif
 
 static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
-	int i;
+        int i;
         int8_t *src2= (int8_t*)src;
 
-	for(i=0; i<len; i++)
-	{
-	    const int n= shift[0][i] + shift[1][i] + shift[2][i];
-	    dst[i]= src2[i]+((n*src2[i])>>7);
-	}
+        for(i=0; i<len; i++)
+        {
+            const int n= shift[0][i] + shift[1][i] + shift[2][i];
+            dst[i]= src2[i]+((n*src2[i])>>7);
+        }
 }
 
 /***************************************************************************/
 
 static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){
-	int8_t *noise= fp->noise;
-	int y;
-	int shift=0;
+        int8_t *noise= fp->noise;
+        int y;
+        int shift=0;
 
-	if(!noise)
-	{
-		if(src==dst) return;
+        if(!noise)
+        {
+                if(src==dst) return;
 
-		if(dstStride==srcStride) fast_memcpy(dst, src, srcStride*height);
-		else
-		{
-			for(y=0; y<height; y++)
-			{
-				fast_memcpy(dst, src, width);
-				dst+= dstStride;
-				src+= srcStride;
-			}
-		}
-		return;
-	}
+                if(dstStride==srcStride) fast_memcpy(dst, src, srcStride*height);
+                else
+                {
+                        for(y=0; y<height; y++)
+                        {
+                                fast_memcpy(dst, src, width);
+                                dst+= dstStride;
+                                src+= srcStride;
+                        }
+                }
+                return;
+        }
 
-	for(y=0; y<height; y++)
-	{
-		if(fp->temporal)	shift=  rand()&(MAX_SHIFT  -1);
-		else			shift= nonTempRandShift[y];
+        for(y=0; y<height; y++)
+        {
+                if(fp->temporal)        shift=  rand()&(MAX_SHIFT  -1);
+                else                        shift= nonTempRandShift[y];
 
-		if(fp->quality==0) shift&= ~7;
-		if (fp->averaged) {
-		    lineNoiseAvg(dst, src, width, fp->prev_shift[y]);
-		    fp->prev_shift[y][fp->shiftptr] = noise + shift;
-		} else {
-		    lineNoise(dst, src, noise, width, shift);
-		}
-		dst+= dstStride;
-		src+= srcStride;
-	}
-	fp->shiftptr++;
-	if (fp->shiftptr == 3) fp->shiftptr = 0;
+                if(fp->quality==0) shift&= ~7;
+                if (fp->averaged) {
+                    lineNoiseAvg(dst, src, width, fp->prev_shift[y]);
+                    fp->prev_shift[y][fp->shiftptr] = noise + shift;
+                } else {
+                    lineNoise(dst, src, noise, width, shift);
+                }
+                dst+= dstStride;
+                src+= srcStride;
+        }
+        fp->shiftptr++;
+        if (fp->shiftptr == 3) fp->shiftptr = 0;
 }
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void get_image(struct vf_instance *vf, mp_image_t *mpi){
@@ -332,89 +332,89 @@
     if(mpi->flags&MP_IMGFLAG_PLANAR){
         mpi->planes[1]=vf->dmpi->planes[1];
         mpi->planes[2]=vf->dmpi->planes[2];
-	mpi->stride[1]=vf->dmpi->stride[1];
-	mpi->stride[2]=vf->dmpi->stride[2];
+        mpi->stride[1]=vf->dmpi->stride[1];
+        mpi->stride[2]=vf->dmpi->stride[2];
     }
     mpi->flags|=MP_IMGFLAG_DIRECT;
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	mp_image_t *dmpi;
+        mp_image_t *dmpi;
 
-	if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-		// no DR, so get a new image! hope we'll get DR buffer:
-		vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->w,mpi->h);
+        if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
+                // no DR, so get a new image! hope we'll get DR buffer:
+                vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
+                MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+                mpi->w,mpi->h);
 //printf("nodr\n");
-	}
+        }
 //else printf("dr\n");
-	dmpi= vf->dmpi;
+        dmpi= vf->dmpi;
 
-	noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam);
-	noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
-	noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
+        noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam);
+        noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
+        noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
 
         vf_clone_mpi_attributes(dmpi, mpi);
 
 #if HAVE_MMX
-	if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
+        if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
 #if HAVE_MMX2
-	if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
+        if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 static void uninit(struct vf_instance *vf){
-	if(!vf->priv) return;
+        if(!vf->priv) return;
 
-	av_free(vf->priv->chromaParam.noise);
-	vf->priv->chromaParam.noise= NULL;
+        av_free(vf->priv->chromaParam.noise);
+        vf->priv->chromaParam.noise= NULL;
 
-	av_free(vf->priv->lumaParam.noise);
-	vf->priv->lumaParam.noise= NULL;
+        av_free(vf->priv->lumaParam.noise);
+        vf->priv->lumaParam.noise= NULL;
 
-	free(vf->priv);
-	vf->priv=NULL;
+        free(vf->priv);
+        vf->priv=NULL;
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
-	switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-		return vf_next_query_format(vf,vf->priv->outfmt);
-	}
-	return 0;
+        switch(fmt)
+        {
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+                return vf_next_query_format(vf,vf->priv->outfmt);
+        }
+        return 0;
 }
 
 static void parse(FilterParam *fp, char* args){
-	char *pos;
-	char *max= strchr(args, ':');
+        char *pos;
+        char *max= strchr(args, ':');
 
-	if(!max) max= args + strlen(args);
+        if(!max) max= args + strlen(args);
 
-	fp->strength= atoi(args);
-	pos= strchr(args, 'u');
-	if(pos && pos<max) fp->uniform=1;
-	pos= strchr(args, 't');
-	if(pos && pos<max) fp->temporal=1;
-	pos= strchr(args, 'h');
-	if(pos && pos<max) fp->quality=1;
-	pos= strchr(args, 'p');
-	if(pos && pos<max) fp->pattern=1;
-	pos= strchr(args, 'a');
-	if(pos && pos<max) {
-	    fp->temporal=1;
-	    fp->averaged=1;
-	}
+        fp->strength= atoi(args);
+        pos= strchr(args, 'u');
+        if(pos && pos<max) fp->uniform=1;
+        pos= strchr(args, 't');
+        if(pos && pos<max) fp->temporal=1;
+        pos= strchr(args, 'h');
+        if(pos && pos<max) fp->quality=1;
+        pos= strchr(args, 'p');
+        if(pos && pos<max) fp->pattern=1;
+        pos= strchr(args, 'a');
+        if(pos && pos<max) {
+            fp->temporal=1;
+            fp->averaged=1;
+        }
 
-	if(fp->strength) initNoise(fp);
+        if(fp->strength) initNoise(fp);
 }
 
 static const unsigned int fmt_list[]={
@@ -434,16 +434,16 @@
     memset(vf->priv, 0, sizeof(struct vf_priv_s));
     if(args)
     {
-	char *arg2= strchr(args,':');
-	if(arg2) parse(&vf->priv->chromaParam, arg2+1);
-	parse(&vf->priv->lumaParam, args);
+        char *arg2= strchr(args,':');
+        if(arg2) parse(&vf->priv->chromaParam, arg2+1);
+        parse(&vf->priv->lumaParam, args);
     }
 
     // check csp:
     vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
     if(!vf->priv->outfmt)
     {
-	uninit(vf);
+        uninit(vf);
         return 0; // no csp match :(
     }
 
--- a/libmpcodecs/vf_palette.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_palette.c	Fri Jan 14 22:10:21 2011 +0000
@@ -80,11 +80,11 @@
     else if(fmt==IMGFMT_RGB8) p=rgb_list;
     else return 0;
     while(*p){
-	ret=vf->next->query_format(vf->next,*p);
-	mp_msg(MSGT_VFILTER,MSGL_DBG2,"[%s] query(%s) -> %d\n",vf->info->name,vo_format_name(*p),ret&3);
-	if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=*p; break;} // no conversion -> bingo!
-	if(ret&VFCAP_CSP_SUPPORTED && !best) best=*p; // best with conversion
-	++p;
+        ret=vf->next->query_format(vf->next,*p);
+        mp_msg(MSGT_VFILTER,MSGL_DBG2,"[%s] query(%s) -> %d\n",vf->info->name,vo_format_name(*p),ret&3);
+        if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=*p; break;} // no conversion -> bingo!
+        if(ret&VFCAP_CSP_SUPPORTED && !best) best=*p; // best with conversion
+        ++p;
     }
     return best;
 }
@@ -98,14 +98,14 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
     if (!vf->priv->fmt)
-	vf->priv->fmt=find_best(vf,outfmt);
+        vf->priv->fmt=find_best(vf,outfmt);
     if(!vf->priv->fmt){
-	// no matching fmt, so force one...
-	if(outfmt==IMGFMT_RGB8) vf->priv->fmt=IMGFMT_RGB32;
-	else if(outfmt==IMGFMT_BGR8) vf->priv->fmt=IMGFMT_BGR32;
-	else return 0;
+        // no matching fmt, so force one...
+        if(outfmt==IMGFMT_RGB8) vf->priv->fmt=IMGFMT_RGB32;
+        else if(outfmt==IMGFMT_BGR8) vf->priv->fmt=IMGFMT_BGR32;
+        else return 0;
     }
     return vf_next_config(vf,width,height,d_width,d_height,flags,vf->priv->fmt);
 }
@@ -116,68 +116,68 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,vf->priv->fmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	mpi->w, mpi->h);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w, mpi->h);
 
     if (!mpi->planes[1])
     {
-	if(!vf->priv->pal_msg){
-	    mp_msg(MSGT_VFILTER,MSGL_V,"[%s] no palette given, assuming builtin grayscale one\n",vf->info->name);
-	    vf->priv->pal_msg=1;
-	}
-	mpi->planes[1] = (unsigned char*)gray_pal;
+        if(!vf->priv->pal_msg){
+            mp_msg(MSGT_VFILTER,MSGL_V,"[%s] no palette given, assuming builtin grayscale one\n",vf->info->name);
+            vf->priv->pal_msg=1;
+        }
+        mpi->planes[1] = (unsigned char*)gray_pal;
     }
 
     if(mpi->w==mpi->stride[0] && dmpi->w*(dmpi->bpp>>3)==dmpi->stride[0]){
-	// no stride conversion needed
-	switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
-	case 15:
-	case 16:
-	    if (IMGFMT_IS_BGR(dmpi->imgfmt))
-		palette8tobgr16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
-	    else
-		palette8torgb16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
-	    break;
-	case 24:
-	    if (IMGFMT_IS_BGR(dmpi->imgfmt))
-		sws_convertPalette8ToPacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
-	    else
-		sws_convertPalette8ToPacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
-	    break;
-	case 32:
-	    if (IMGFMT_IS_BGR(dmpi->imgfmt))
-		sws_convertPalette8ToPacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
-	    else
-		sws_convertPalette8ToPacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
-	    break;
-	}
+        // no stride conversion needed
+        switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
+        case 15:
+        case 16:
+            if (IMGFMT_IS_BGR(dmpi->imgfmt))
+                palette8tobgr16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+            else
+                palette8torgb16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+            break;
+        case 24:
+            if (IMGFMT_IS_BGR(dmpi->imgfmt))
+                sws_convertPalette8ToPacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+            else
+                sws_convertPalette8ToPacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+            break;
+        case 32:
+            if (IMGFMT_IS_BGR(dmpi->imgfmt))
+                sws_convertPalette8ToPacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+            else
+                sws_convertPalette8ToPacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+            break;
+        }
     } else {
-	int y;
-	for(y=0;y<mpi->h;y++){
-	    unsigned char* src=mpi->planes[0]+y*mpi->stride[0];
-	    unsigned char* dst=dmpi->planes[0]+y*dmpi->stride[0];
-	    switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
-	    case 15:
-	    case 16:
-		if (IMGFMT_IS_BGR(dmpi->imgfmt))
-		    palette8tobgr16(src,dst,mpi->w,mpi->planes[1]);
-		else
-		    palette8torgb16(src,dst,mpi->w,mpi->planes[1]);
-		break;
-	    case 24:
-		if (IMGFMT_IS_BGR(dmpi->imgfmt))
-		    sws_convertPalette8ToPacked24(src,dst,mpi->w,mpi->planes[1]);
-		else
-		    sws_convertPalette8ToPacked24(src,dst,mpi->w,mpi->planes[1]);
-		break;
-	    case 32:
-		if (IMGFMT_IS_BGR(dmpi->imgfmt))
-		    sws_convertPalette8ToPacked32(src,dst,mpi->w,mpi->planes[1]);
-		else
-		    sws_convertPalette8ToPacked32(src,dst,mpi->w,mpi->planes[1]);
-		break;
-	    }
-	}
+        int y;
+        for(y=0;y<mpi->h;y++){
+            unsigned char* src=mpi->planes[0]+y*mpi->stride[0];
+            unsigned char* dst=dmpi->planes[0]+y*dmpi->stride[0];
+            switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){
+            case 15:
+            case 16:
+                if (IMGFMT_IS_BGR(dmpi->imgfmt))
+                    palette8tobgr16(src,dst,mpi->w,mpi->planes[1]);
+                else
+                    palette8torgb16(src,dst,mpi->w,mpi->planes[1]);
+                break;
+            case 24:
+                if (IMGFMT_IS_BGR(dmpi->imgfmt))
+                    sws_convertPalette8ToPacked24(src,dst,mpi->w,mpi->planes[1]);
+                else
+                    sws_convertPalette8ToPacked24(src,dst,mpi->w,mpi->planes[1]);
+                break;
+            case 32:
+                if (IMGFMT_IS_BGR(dmpi->imgfmt))
+                    sws_convertPalette8ToPacked32(src,dst,mpi->w,mpi->planes[1]);
+                else
+                    sws_convertPalette8ToPacked32(src,dst,mpi->w,mpi->planes[1]);
+                break;
+            }
+        }
     }
     mpi->planes[1] = old_palette;
 
@@ -207,18 +207,18 @@
     for(i=0;i<256;i++) gray_pal[i]=0x01010101*i;
     if (args)
     {
-	if (!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
-	if (!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
-	if (!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
-	if (!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
-	if (!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
-	if (!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
-	if (!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
-	if (!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
-	{
-	    mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);
-	    return 0;
-	}
+        if (!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
+        if (!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
+        if (!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
+        if (!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
+        if (!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
+        if (!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
+        if (!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
+        if (!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
+        {
+            mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);
+            return 0;
+        }
     }
     return 1;
 }
--- a/libmpcodecs/vf_perspective.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_perspective.c	Fri Jan 14 22:10:21 2011 +0000
@@ -43,292 +43,292 @@
 //===========================================================================//
 
 struct vf_priv_s {
-	double ref[4][2];
-	int32_t coeff[1<<SUB_PIXEL_BITS][4];
-	int32_t (*pv)[2];
-	int pvStride;
-	int cubic;
+    double ref[4][2];
+    int32_t coeff[1<<SUB_PIXEL_BITS][4];
+    int32_t (*pv)[2];
+    int pvStride;
+    int cubic;
 };
 
 
 /***************************************************************************/
 
 static void initPv(struct vf_priv_s *priv, int W, int H){
-	double a,b,c,d,e,f,g,h,D;
-	double (*ref)[2]= priv->ref;
-	int x,y;
+    double a,b,c,d,e,f,g,h,D;
+    double (*ref)[2]= priv->ref;
+    int x,y;
 
-	g= (  (ref[0][0] - ref[1][0] - ref[2][0] + ref[3][0])*(ref[2][1] - ref[3][1])
-	    - (ref[0][1] - ref[1][1] - ref[2][1] + ref[3][1])*(ref[2][0] - ref[3][0]))*H;
-	h= (  (ref[0][1] - ref[1][1] - ref[2][1] + ref[3][1])*(ref[1][0] - ref[3][0])
-	    - (ref[0][0] - ref[1][0] - ref[2][0] + ref[3][0])*(ref[1][1] - ref[3][1]))*W;
-	D=   (ref[1][0] - ref[3][0])*(ref[2][1] - ref[3][1])
-	   - (ref[2][0] - ref[3][0])*(ref[1][1] - ref[3][1]);
+    g= (  (ref[0][0] - ref[1][0] - ref[2][0] + ref[3][0])*(ref[2][1] - ref[3][1])
+        - (ref[0][1] - ref[1][1] - ref[2][1] + ref[3][1])*(ref[2][0] - ref[3][0]))*H;
+    h= (  (ref[0][1] - ref[1][1] - ref[2][1] + ref[3][1])*(ref[1][0] - ref[3][0])
+        - (ref[0][0] - ref[1][0] - ref[2][0] + ref[3][0])*(ref[1][1] - ref[3][1]))*W;
+    D=   (ref[1][0] - ref[3][0])*(ref[2][1] - ref[3][1])
+       - (ref[2][0] - ref[3][0])*(ref[1][1] - ref[3][1]);
 
-	a= D*(ref[1][0] - ref[0][0])*H + g*ref[1][0];
-	b= D*(ref[2][0] - ref[0][0])*W + h*ref[2][0];
-	c= D*ref[0][0]*W*H;
-	d= D*(ref[1][1] - ref[0][1])*H + g*ref[1][1];
-	e= D*(ref[2][1] - ref[0][1])*W + h*ref[2][1];
-	f= D*ref[0][1]*W*H;
+    a= D*(ref[1][0] - ref[0][0])*H + g*ref[1][0];
+    b= D*(ref[2][0] - ref[0][0])*W + h*ref[2][0];
+    c= D*ref[0][0]*W*H;
+    d= D*(ref[1][1] - ref[0][1])*H + g*ref[1][1];
+    e= D*(ref[2][1] - ref[0][1])*W + h*ref[2][1];
+    f= D*ref[0][1]*W*H;
 
-	for(y=0; y<H; y++){
-		for(x=0; x<W; x++){
-			int u, v;
+    for(y=0; y<H; y++){
+        for(x=0; x<W; x++){
+            int u, v;
 
-			u= (int)floor( SUB_PIXELS*(a*x + b*y + c)/(g*x + h*y + D*W*H) + 0.5);
-			v= (int)floor( SUB_PIXELS*(d*x + e*y + f)/(g*x + h*y + D*W*H) + 0.5);
+            u= (int)floor( SUB_PIXELS*(a*x + b*y + c)/(g*x + h*y + D*W*H) + 0.5);
+            v= (int)floor( SUB_PIXELS*(d*x + e*y + f)/(g*x + h*y + D*W*H) + 0.5);
 
-			priv->pv[x + y*W][0]= u;
-			priv->pv[x + y*W][1]= v;
-		}
-	}
+            priv->pv[x + y*W][0]= u;
+            priv->pv[x + y*W][1]= v;
+        }
+    }
 }
 
 static double getCoeff(double d){
-	double A= -0.60;
-	double coeff;
+    double A= -0.60;
+    double coeff;
 
-	d= fabs(d);
+    d= fabs(d);
 
-	// Equation is from VirtualDub
-	if(d<1.0)
-		coeff = (1.0 - (A+3.0)*d*d + (A+2.0)*d*d*d);
-	else if(d<2.0)
-		coeff = (-4.0*A + 8.0*A*d - 5.0*A*d*d + A*d*d*d);
-	else
-		coeff=0.0;
+    // Equation is from VirtualDub
+    if(d<1.0)
+        coeff = (1.0 - (A+3.0)*d*d + (A+2.0)*d*d*d);
+    else if(d<2.0)
+        coeff = (-4.0*A + 8.0*A*d - 5.0*A*d*d + A*d*d*d);
+    else
+        coeff=0.0;
 
-	return coeff;
+    return coeff;
 }
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
-	int i, j;
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt){
+    int i, j;
 
-	vf->priv->pvStride= width;
-	vf->priv->pv= (void*)memalign(8, width*height*2*sizeof(int32_t));
-	initPv(vf->priv, width, height);
+    vf->priv->pvStride= width;
+    vf->priv->pv= (void*)memalign(8, width*height*2*sizeof(int32_t));
+    initPv(vf->priv, width, height);
 
-	for(i=0; i<SUB_PIXELS; i++){
-		double d= i/(double)SUB_PIXELS;
-		double temp[4];
-		double sum=0;
+    for(i=0; i<SUB_PIXELS; i++){
+        double d= i/(double)SUB_PIXELS;
+        double temp[4];
+        double sum=0;
 
-		for(j=0; j<4; j++)
-			temp[j]= getCoeff(j - d - 1);
+        for(j=0; j<4; j++)
+            temp[j]= getCoeff(j - d - 1);
 
-		for(j=0; j<4; j++)
-			sum+= temp[j];
+        for(j=0; j<4; j++)
+            sum+= temp[j];
 
-		for(j=0; j<4; j++)
-			vf->priv->coeff[i][j]= (int)floor((1<<COEFF_BITS)*temp[j]/sum + 0.5);
-	}
+        for(j=0; j<4; j++)
+            vf->priv->coeff[i][j]= (int)floor((1<<COEFF_BITS)*temp[j]/sum + 0.5);
+    }
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void uninit(struct vf_instance *vf){
-	if(!vf->priv) return;
+    if(!vf->priv) return;
 
-	free(vf->priv->pv);
-	vf->priv->pv= NULL;
+    free(vf->priv->pv);
+    vf->priv->pv= NULL;
 
-	free(vf->priv);
-	vf->priv=NULL;
+    free(vf->priv);
+    vf->priv=NULL;
 }
 
 static inline void resampleCubic(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, struct vf_priv_s *privParam, int xShift, int yShift){
-	int x, y;
-	struct vf_priv_s priv= *privParam;
+    int x, y;
+    struct vf_priv_s priv= *privParam;
 
-	for(y=0; y<h; y++){
-		for(x=0; x<w; x++){
-			int u, v, subU, subV, sum, sx, sy;
+    for(y=0; y<h; y++){
+        for(x=0; x<w; x++){
+            int u, v, subU, subV, sum, sx, sy;
 
-			sx= x << xShift;
-			sy= y << yShift;
-			u= priv.pv[sx + sy*priv.pvStride][0]>>xShift;
-			v= priv.pv[sx + sy*priv.pvStride][1]>>yShift;
-			subU= u & (SUB_PIXELS-1);
-			subV= v & (SUB_PIXELS-1);
-			u >>= SUB_PIXEL_BITS;
-			v >>= SUB_PIXEL_BITS;
+            sx= x << xShift;
+            sy= y << yShift;
+            u= priv.pv[sx + sy*priv.pvStride][0]>>xShift;
+            v= priv.pv[sx + sy*priv.pvStride][1]>>yShift;
+            subU= u & (SUB_PIXELS-1);
+            subV= v & (SUB_PIXELS-1);
+            u >>= SUB_PIXEL_BITS;
+            v >>= SUB_PIXEL_BITS;
 
-			if(u>0 && v>0 && u<w-2 && v<h-2){
-				const int index= u + v*srcStride;
-				const int a= priv.coeff[subU][0];
-				const int b= priv.coeff[subU][1];
-				const int c= priv.coeff[subU][2];
-				const int d= priv.coeff[subU][3];
+            if(u>0 && v>0 && u<w-2 && v<h-2){
+                const int index= u + v*srcStride;
+                const int a= priv.coeff[subU][0];
+                const int b= priv.coeff[subU][1];
+                const int c= priv.coeff[subU][2];
+                const int d= priv.coeff[subU][3];
 
-				sum=
-				 priv.coeff[subV][0]*(  a*src[index - 1 - srcStride] + b*src[index - 0 - srcStride]
-				                      + c*src[index + 1 - srcStride] + d*src[index + 2 - srcStride])
-				+priv.coeff[subV][1]*(  a*src[index - 1            ] + b*src[index - 0            ]
-				                      + c*src[index + 1            ] + d*src[index + 2            ])
-				+priv.coeff[subV][2]*(  a*src[index - 1 + srcStride] + b*src[index - 0 + srcStride]
-				                      + c*src[index + 1 + srcStride] + d*src[index + 2 + srcStride])
-				+priv.coeff[subV][3]*(  a*src[index - 1+2*srcStride] + b*src[index - 0+2*srcStride]
-				                      + c*src[index + 1+2*srcStride] + d*src[index + 2+2*srcStride]);
-			}else{
-				int dx, dy;
-				sum=0;
+                sum=
+                 priv.coeff[subV][0]*(  a*src[index - 1 - srcStride] + b*src[index - 0 - srcStride]
+                                      + c*src[index + 1 - srcStride] + d*src[index + 2 - srcStride])
+                +priv.coeff[subV][1]*(  a*src[index - 1            ] + b*src[index - 0            ]
+                                      + c*src[index + 1            ] + d*src[index + 2            ])
+                +priv.coeff[subV][2]*(  a*src[index - 1 + srcStride] + b*src[index - 0 + srcStride]
+                                      + c*src[index + 1 + srcStride] + d*src[index + 2 + srcStride])
+                +priv.coeff[subV][3]*(  a*src[index - 1+2*srcStride] + b*src[index - 0+2*srcStride]
+                                      + c*src[index + 1+2*srcStride] + d*src[index + 2+2*srcStride]);
+            }else{
+                int dx, dy;
+                sum=0;
 
-				for(dy=0; dy<4; dy++){
-					int iy= v + dy - 1;
-					if     (iy< 0) iy=0;
-					else if(iy>=h) iy=h-1;
-					for(dx=0; dx<4; dx++){
-						int ix= u + dx - 1;
-						if     (ix< 0) ix=0;
-						else if(ix>=w) ix=w-1;
+                for(dy=0; dy<4; dy++){
+                    int iy= v + dy - 1;
+                    if     (iy< 0) iy=0;
+                    else if(iy>=h) iy=h-1;
+                    for(dx=0; dx<4; dx++){
+                        int ix= u + dx - 1;
+                        if     (ix< 0) ix=0;
+                        else if(ix>=w) ix=w-1;
 
-						sum+=  priv.coeff[subU][dx]*priv.coeff[subV][dy]
-						      *src[ ix + iy*srcStride];
-					}
-				}
-			}
-			sum= (sum + (1<<(COEFF_BITS*2-1)) ) >> (COEFF_BITS*2);
-			if(sum&~255){
-				if(sum<0) sum=0;
-				else      sum=255;
-			}
-			dst[ x + y*dstStride]= sum;
-		}
-	}
+                        sum+=  priv.coeff[subU][dx]*priv.coeff[subV][dy]
+                              *src[ ix + iy*srcStride];
+                    }
+                }
+            }
+            sum= (sum + (1<<(COEFF_BITS*2-1)) ) >> (COEFF_BITS*2);
+            if(sum&~255){
+                if(sum<0) sum=0;
+                else      sum=255;
+            }
+            dst[ x + y*dstStride]= sum;
+        }
+    }
 }
 
 static inline void resampleLinear(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride,
-				  struct vf_priv_s *privParam, int xShift, int yShift){
-	int x, y;
-	struct vf_priv_s priv= *privParam;
+                  struct vf_priv_s *privParam, int xShift, int yShift){
+    int x, y;
+    struct vf_priv_s priv= *privParam;
 
-	for(y=0; y<h; y++){
-		for(x=0; x<w; x++){
-			int u, v, subU, subV, sum, sx, sy, index, subUI, subVI;
+    for(y=0; y<h; y++){
+        for(x=0; x<w; x++){
+            int u, v, subU, subV, sum, sx, sy, index, subUI, subVI;
 
-			sx= x << xShift;
-			sy= y << yShift;
-			u= priv.pv[sx + sy*priv.pvStride][0]>>xShift;
-			v= priv.pv[sx + sy*priv.pvStride][1]>>yShift;
-			subU= u & (SUB_PIXELS-1);
-			subV= v & (SUB_PIXELS-1);
-			u >>= SUB_PIXEL_BITS;
-			v >>= SUB_PIXEL_BITS;
-			index= u + v*srcStride;
-			subUI= SUB_PIXELS - subU;
-			subVI= SUB_PIXELS - subV;
+            sx= x << xShift;
+            sy= y << yShift;
+            u= priv.pv[sx + sy*priv.pvStride][0]>>xShift;
+            v= priv.pv[sx + sy*priv.pvStride][1]>>yShift;
+            subU= u & (SUB_PIXELS-1);
+            subV= v & (SUB_PIXELS-1);
+            u >>= SUB_PIXEL_BITS;
+            v >>= SUB_PIXEL_BITS;
+            index= u + v*srcStride;
+            subUI= SUB_PIXELS - subU;
+            subVI= SUB_PIXELS - subV;
 
-			if((unsigned)u < (unsigned)(w - 1)){
-				if((unsigned)v < (unsigned)(h - 1)){
-					sum= subVI*(subUI*src[index          ] + subU*src[index          +1])
-					    +subV *(subUI*src[index+srcStride] + subU*src[index+srcStride+1]);
-					sum= (sum + (1<<(SUB_PIXEL_BITS*2-1)) ) >> (SUB_PIXEL_BITS*2);
-				}else{
-					if(v<0) v= 0;
-					else    v= h-1;
-					index= u + v*srcStride;
-					sum= subUI*src[index] + subU*src[index+1];
-					sum= (sum + (1<<(SUB_PIXEL_BITS-1)) ) >> SUB_PIXEL_BITS;
-				}
-			}else{
-				if((unsigned)v < (unsigned)(h - 1)){
-					if(u<0) u= 0;
-					else    u= w-1;
-					index= u + v*srcStride;
-					sum= subVI*src[index] + subV*src[index+srcStride];
-					sum= (sum + (1<<(SUB_PIXEL_BITS-1)) ) >> SUB_PIXEL_BITS;
-				}else{
-					if(u<0) u= 0;
-					else    u= w-1;
-					if(v<0) v= 0;
-					else    v= h-1;
-					index= u + v*srcStride;
-					sum= src[index];
-				}
-			}
-			if(sum&~255){
-				if(sum<0) sum=0;
-				else      sum=255;
-			}
-			dst[ x + y*dstStride]= sum;
-		}
-	}
+            if((unsigned)u < (unsigned)(w - 1)){
+                if((unsigned)v < (unsigned)(h - 1)){
+                    sum= subVI*(subUI*src[index          ] + subU*src[index          +1])
+                        +subV *(subUI*src[index+srcStride] + subU*src[index+srcStride+1]);
+                    sum= (sum + (1<<(SUB_PIXEL_BITS*2-1)) ) >> (SUB_PIXEL_BITS*2);
+                }else{
+                    if(v<0) v= 0;
+                    else    v= h-1;
+                    index= u + v*srcStride;
+                    sum= subUI*src[index] + subU*src[index+1];
+                    sum= (sum + (1<<(SUB_PIXEL_BITS-1)) ) >> SUB_PIXEL_BITS;
+                }
+            }else{
+                if((unsigned)v < (unsigned)(h - 1)){
+                    if(u<0) u= 0;
+                    else    u= w-1;
+                    index= u + v*srcStride;
+                    sum= subVI*src[index] + subV*src[index+srcStride];
+                    sum= (sum + (1<<(SUB_PIXEL_BITS-1)) ) >> SUB_PIXEL_BITS;
+                }else{
+                    if(u<0) u= 0;
+                    else    u= w-1;
+                    if(v<0) v= 0;
+                    else    v= h-1;
+                    index= u + v*srcStride;
+                    sum= src[index];
+                }
+            }
+            if(sum&~255){
+                if(sum<0) sum=0;
+                else      sum=255;
+            }
+            dst[ x + y*dstStride]= sum;
+        }
+    }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
+    int cw= mpi->w >> mpi->chroma_x_shift;
+    int ch= mpi->h >> mpi->chroma_y_shift;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->w,mpi->h);
+    mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w,mpi->h);
 
-	assert(mpi->flags&MP_IMGFLAG_PLANAR);
+    assert(mpi->flags&MP_IMGFLAG_PLANAR);
 
-	if(vf->priv->cubic){
-		resampleCubic(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0],
-				vf->priv, 0, 0);
-		resampleCubic(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1],
-				vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
-		resampleCubic(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2],
-				vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
-	}else{
-		resampleLinear(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0],
-				vf->priv, 0, 0);
-		resampleLinear(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1],
-				vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
-		resampleLinear(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2],
-				vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
-	}
+    if(vf->priv->cubic){
+        resampleCubic(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0],
+                vf->priv, 0, 0);
+        resampleCubic(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1],
+                vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
+        resampleCubic(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2],
+                vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
+    }else{
+        resampleLinear(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0],
+                vf->priv, 0, 0);
+        resampleLinear(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1],
+                vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
+        resampleLinear(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2],
+                vf->priv, mpi->chroma_x_shift, mpi->chroma_y_shift);
+    }
 
-	return vf_next_put_image(vf,dmpi, pts);
+    return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
-	switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    switch(fmt)
+    {
+    case IMGFMT_YV12:
+    case IMGFMT_I420:
+    case IMGFMT_IYUV:
+    case IMGFMT_YVU9:
+    case IMGFMT_444P:
+    case IMGFMT_422P:
+    case IMGFMT_411P:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
-	int e;
+    int e;
 
-	vf->config=config;
-	vf->put_image=put_image;
-//	vf->get_image=get_image;
-	vf->query_format=query_format;
-	vf->uninit=uninit;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
-	memset(vf->priv, 0, sizeof(struct vf_priv_s));
+    vf->config=config;
+    vf->put_image=put_image;
+//  vf->get_image=get_image;
+    vf->query_format=query_format;
+    vf->uninit=uninit;
+    vf->priv=malloc(sizeof(struct vf_priv_s));
+    memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
-	if(args==NULL) return 0;
+    if(args==NULL) return 0;
 
-	e=sscanf(args, "%lf:%lf:%lf:%lf:%lf:%lf:%lf:%lf:%d",
-		&vf->priv->ref[0][0], &vf->priv->ref[0][1],
-		&vf->priv->ref[1][0], &vf->priv->ref[1][1],
-		&vf->priv->ref[2][0], &vf->priv->ref[2][1],
-		&vf->priv->ref[3][0], &vf->priv->ref[3][1],
-		&vf->priv->cubic
-		);
+    e=sscanf(args, "%lf:%lf:%lf:%lf:%lf:%lf:%lf:%lf:%d",
+        &vf->priv->ref[0][0], &vf->priv->ref[0][1],
+        &vf->priv->ref[1][0], &vf->priv->ref[1][1],
+        &vf->priv->ref[2][0], &vf->priv->ref[2][1],
+        &vf->priv->ref[3][0], &vf->priv->ref[3][1],
+        &vf->priv->cubic
+        );
 
-	if(e!=9)
-		return 0;
+    if(e!=9)
+        return 0;
 
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_perspective = {
--- a/libmpcodecs/vf_phase.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_phase.c	Fri Jan 14 22:10:21 2011 +0000
@@ -31,8 +31,8 @@
 #include "libvo/fastmemcpy.h"
 
 enum mode { PROGRESSIVE, TOP_FIRST, BOTTOM_FIRST,
-	    TOP_FIRST_ANALYZE, BOTTOM_FIRST_ANALYZE,
-	    ANALYZE, FULL_ANALYZE, AUTO, AUTO_ANALYZE };
+            TOP_FIRST_ANALYZE, BOTTOM_FIRST_ANALYZE,
+            ANALYZE, FULL_ANALYZE, AUTO, AUTO_ANALYZE };
 
 #define fixed_mode(p) ((p)<=BOTTOM_FIRST)
 
@@ -49,8 +49,8 @@
  */
 
 static void do_plane(unsigned char *to, unsigned char *from,
-		     int w, int h, int ts, int fs,
-		     unsigned char **bufp, enum mode mode)
+                     int w, int h, int ts, int fs,
+                     unsigned char **bufp, enum mode mode)
    {
    unsigned char *buf, *end;
    int top;
@@ -85,8 +85,8 @@
  */
 
 static enum mode analyze_plane(unsigned char *old, unsigned char *new,
-			       int w, int h, int os, int ns, enum mode mode,
-			       int verbose, int fields)
+                               int w, int h, int os, int ns, enum mode mode,
+                               int verbose, int fields)
    {
    double bdiff, pdiff, tdiff, scale;
    int bdif, tdif, pdif;
@@ -95,10 +95,10 @@
 
    if(mode==AUTO)
       mode=fields&MP_IMGFIELD_ORDERED?fields&MP_IMGFIELD_TOP_FIRST?
-	 TOP_FIRST:BOTTOM_FIRST:PROGRESSIVE;
+         TOP_FIRST:BOTTOM_FIRST:PROGRESSIVE;
    else if(mode==AUTO_ANALYZE)
       mode=fields&MP_IMGFIELD_ORDERED?fields&MP_IMGFIELD_TOP_FIRST?
-	 TOP_FIRST_ANALYZE:BOTTOM_FIRST_ANALYZE:FULL_ANALYZE;
+         TOP_FIRST_ANALYZE:BOTTOM_FIRST_ANALYZE:FULL_ANALYZE;
 
    if(fixed_mode(mode))
       bdiff=pdiff=tdiff=65536.0;
@@ -107,62 +107,62 @@
       bdiff=pdiff=tdiff=0.0;
 
       for(end=new+(h-2)*ns, new+=ns, old+=os, top=0;
-	  new<end; new+=ns-w, old+=os-w, top^=1)
-	 {
-	 pdif=tdif=bdif=0;
+          new<end; new+=ns-w, old+=os-w, top^=1)
+         {
+         pdif=tdif=bdif=0;
 
-	 switch(mode)
-	    {
-	    case TOP_FIRST_ANALYZE:
-	       if(top)
-		  for(rend=new+w; new<rend; new++, old++)
-		     pdif+=diff(new, ns, new, ns),
-		     tdif+=diff(new, ns, old, os);
-	       else
-		  for(rend=new+w; new<rend; new++, old++)
-		     pdif+=diff(new, ns, new, ns),
-		     tdif+=diff(old, os, new, ns);
-	       break;
+         switch(mode)
+            {
+            case TOP_FIRST_ANALYZE:
+               if(top)
+                  for(rend=new+w; new<rend; new++, old++)
+                     pdif+=diff(new, ns, new, ns),
+                     tdif+=diff(new, ns, old, os);
+               else
+                  for(rend=new+w; new<rend; new++, old++)
+                     pdif+=diff(new, ns, new, ns),
+                     tdif+=diff(old, os, new, ns);
+               break;
 
-	    case BOTTOM_FIRST_ANALYZE:
-	       if(top)
-		  for(rend=new+w; new<rend; new++, old++)
-		     pdif+=diff(new, ns, new, ns),
-		     bdif+=diff(old, os, new, ns);
-	       else
-		  for(rend=new+w; new<rend; new++, old++)
-		     pdif+=diff(new, ns, new, ns),
-		     bdif+=diff(new, ns, old, os);
-	       break;
+            case BOTTOM_FIRST_ANALYZE:
+               if(top)
+                  for(rend=new+w; new<rend; new++, old++)
+                     pdif+=diff(new, ns, new, ns),
+                     bdif+=diff(old, os, new, ns);
+               else
+                  for(rend=new+w; new<rend; new++, old++)
+                     pdif+=diff(new, ns, new, ns),
+                     bdif+=diff(new, ns, old, os);
+               break;
 
-	    case ANALYZE:
-	       if(top)
-		  for(rend=new+w; new<rend; new++, old++)
-		     tdif+=diff(new, ns, old, os),
-		     bdif+=diff(old, os, new, ns);
-	       else
-		  for(rend=new+w; new<rend; new++, old++)
-		     bdif+=diff(new, ns, old, os),
+            case ANALYZE:
+               if(top)
+                  for(rend=new+w; new<rend; new++, old++)
+                     tdif+=diff(new, ns, old, os),
+                     bdif+=diff(old, os, new, ns);
+               else
+                  for(rend=new+w; new<rend; new++, old++)
+                     bdif+=diff(new, ns, old, os),
                      tdif+=diff(old, os, new, ns);
-	       break;
+               break;
 
-	    default: /* FULL_ANALYZE */
-	       if(top)
-		  for(rend=new+w; new<rend; new++, old++)
-		     pdif+=diff(new, ns, new, ns),
-		     tdif+=diff(new, ns, old, os),
-		     bdif+=diff(old, os, new, ns);
-	       else
-		  for(rend=new+w; new<rend; new++, old++)
-		     pdif+=diff(new, ns, new, ns),
-		     bdif+=diff(new, ns, old, os),
-		     tdif+=diff(old, os, new, ns);
-	    }
+            default: /* FULL_ANALYZE */
+               if(top)
+                  for(rend=new+w; new<rend; new++, old++)
+                     pdif+=diff(new, ns, new, ns),
+                     tdif+=diff(new, ns, old, os),
+                     bdif+=diff(old, os, new, ns);
+               else
+                  for(rend=new+w; new<rend; new++, old++)
+                     pdif+=diff(new, ns, new, ns),
+                     bdif+=diff(new, ns, old, os),
+                     tdif+=diff(old, os, new, ns);
+            }
 
-	 pdiff+=(double)pdif;
-	 tdiff+=(double)tdif;
-	 bdiff+=(double)bdif;
-	 }
+         pdiff+=(double)pdif;
+         tdiff+=(double)tdif;
+         bdiff+=(double)bdif;
+         }
 
       scale=1.0/(w*(h-3))/25.0;
       pdiff*=scale;
@@ -170,18 +170,18 @@
       bdiff*=scale;
 
       if(mode==TOP_FIRST_ANALYZE)
-	 bdiff=65536.0;
+         bdiff=65536.0;
       else if(mode==BOTTOM_FIRST_ANALYZE)
-	 tdiff=65536.0;
+         tdiff=65536.0;
       else if(mode==ANALYZE)
-	 pdiff=65536.0;
+         pdiff=65536.0;
 
       if(bdiff<pdiff && bdiff<tdiff)
-	 mode=BOTTOM_FIRST;
+         mode=BOTTOM_FIRST;
       else if(tdiff<pdiff && tdiff<bdiff)
-	 mode=TOP_FIRST;
+         mode=TOP_FIRST;
       else
-	 mode=PROGRESSIVE;
+         mode=PROGRESSIVE;
       }
 
    if( mp_msg_test(MSGT_VFILTER,MSGL_V) )
@@ -203,8 +203,8 @@
    enum mode mode;
 
    if(!(dmpi=vf_get_image(vf->next, mpi->imgfmt,
-			  MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-			  mpi->w, mpi->h)))
+                          MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+                          mpi->w, mpi->h)))
       return 0;
 
    w=dmpi->w;
@@ -217,24 +217,24 @@
       mode=PROGRESSIVE;
    else
       mode=analyze_plane(vf->priv->buf[0], mpi->planes[0],
-			 w, dmpi->h, w, mpi->stride[0], mode,
-			 vf->priv->verbose, mpi->fields);
+                         w, dmpi->h, w, mpi->stride[0], mode,
+                         vf->priv->verbose, mpi->fields);
 
    do_plane(dmpi->planes[0], mpi->planes[0],
-	    w, dmpi->h,
-	    dmpi->stride[0], mpi->stride[0],
-	    &vf->priv->buf[0], mode);
+            w, dmpi->h,
+            dmpi->stride[0], mpi->stride[0],
+            &vf->priv->buf[0], mode);
 
    if(dmpi->flags&MP_IMGFLAG_PLANAR)
       {
       do_plane(dmpi->planes[1], mpi->planes[1],
-	       dmpi->chroma_width, dmpi->chroma_height,
-	       dmpi->stride[1], mpi->stride[1],
-	       &vf->priv->buf[1], mode);
+               dmpi->chroma_width, dmpi->chroma_height,
+               dmpi->stride[1], mpi->stride[1],
+               &vf->priv->buf[1], mode);
       do_plane(dmpi->planes[2], mpi->planes[2],
-	       dmpi->chroma_width, dmpi->chroma_height,
-	       dmpi->stride[2], mpi->stride[2],
-	       &vf->priv->buf[2], mode);
+               dmpi->chroma_width, dmpi->chroma_height,
+               dmpi->stride[2], mpi->stride[2],
+               &vf->priv->buf[2], mode);
       }
 
    return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
@@ -266,23 +266,23 @@
    while(args && *args)
       {
       switch(*args)
-	 {
-	 case 't': vf->priv->mode=TOP_FIRST;            break;
-	 case 'a': vf->priv->mode=AUTO;                 break;
-	 case 'b': vf->priv->mode=BOTTOM_FIRST;         break;
-	 case 'u': vf->priv->mode=ANALYZE;              break;
-	 case 'T': vf->priv->mode=TOP_FIRST_ANALYZE;    break;
-	 case 'A': vf->priv->mode=AUTO_ANALYZE;         break;
-	 case 'B': vf->priv->mode=BOTTOM_FIRST_ANALYZE; break;
-	 case 'U': vf->priv->mode=FULL_ANALYZE;         break;
-	 case 'p': vf->priv->mode=PROGRESSIVE;          break;
-	 case 'v': vf->priv->verbose=1;                 break;
-	 case ':': break;
+         {
+         case 't': vf->priv->mode=TOP_FIRST;            break;
+         case 'a': vf->priv->mode=AUTO;                 break;
+         case 'b': vf->priv->mode=BOTTOM_FIRST;         break;
+         case 'u': vf->priv->mode=ANALYZE;              break;
+         case 'T': vf->priv->mode=TOP_FIRST_ANALYZE;    break;
+         case 'A': vf->priv->mode=AUTO_ANALYZE;         break;
+         case 'B': vf->priv->mode=BOTTOM_FIRST_ANALYZE; break;
+         case 'U': vf->priv->mode=FULL_ANALYZE;         break;
+         case 'p': vf->priv->mode=PROGRESSIVE;          break;
+         case 'v': vf->priv->verbose=1;                 break;
+         case ':': break;
 
-	 default:
-	    uninit(vf);
-	    return 0; /* bad args */
-	 }
+         default:
+            uninit(vf);
+            return 0; /* bad args */
+         }
 
       if( (args=strchr(args, ':')) ) args++;
       }
--- a/libmpcodecs/vf_pp7.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_pp7.c	Fri Jan 14 22:10:21 2011 +0000
@@ -458,10 +458,10 @@
     init_thres2();
 
     switch(vf->priv->mode){
-	case 0: requantize= hardthresh_c; break;
-	case 1: requantize= softthresh_c; break;
+        case 0: requantize= hardthresh_c; break;
+        case 1: requantize= softthresh_c; break;
         default:
-	case 2: requantize= mediumthresh_c; break;
+        case 2: requantize= mediumthresh_c; break;
     }
 
 #if HAVE_MMX
@@ -471,10 +471,10 @@
 #endif
 #if 0
     if(gCpuCaps.hasMMX){
-	switch(vf->priv->mode){
-	    case 0: requantize= hardthresh_mmx; break;
-	    case 1: requantize= softthresh_mmx; break;
-	}
+        switch(vf->priv->mode){
+            case 0: requantize= hardthresh_mmx; break;
+            case 1: requantize= softthresh_mmx; break;
+        }
     }
 #endif
 
--- a/libmpcodecs/vf_pullup.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_pullup.c	Fri Jan 14 22:10:21 2011 +0000
@@ -36,272 +36,272 @@
 #define MAX(a,b) ((a)>(b)?(a):(b))
 
 struct vf_priv_s {
-	struct pullup_context *ctx;
-	int init;
-	int fakecount;
-	char *qbuf;
+    struct pullup_context *ctx;
+    int init;
+    int fakecount;
+    char *qbuf;
 };
 
 static void init_pullup(struct vf_instance *vf, mp_image_t *mpi)
 {
-	struct pullup_context *c = vf->priv->ctx;
+    struct pullup_context *c = vf->priv->ctx;
 
-	if (mpi->flags & MP_IMGFLAG_PLANAR) {
-		c->format = PULLUP_FMT_Y;
-		c->nplanes = 4;
-		pullup_preinit_context(c);
-		c->bpp[0] = c->bpp[1] = c->bpp[2] = 8;
-		c->w[0] = mpi->w;
-		c->h[0] = mpi->h;
-		c->w[1] = c->w[2] = mpi->chroma_width;
-		c->h[1] = c->h[2] = mpi->chroma_height;
-		c->w[3] = ((mpi->w+15)/16) * ((mpi->h+15)/16);
-		c->h[3] = 2;
-		c->stride[0] = mpi->width;
-		c->stride[1] = c->stride[2] = mpi->chroma_width;
-		c->stride[3] = c->w[3];
-		c->background[1] = c->background[2] = 128;
-	}
+    if (mpi->flags & MP_IMGFLAG_PLANAR) {
+        c->format = PULLUP_FMT_Y;
+        c->nplanes = 4;
+        pullup_preinit_context(c);
+        c->bpp[0] = c->bpp[1] = c->bpp[2] = 8;
+        c->w[0] = mpi->w;
+        c->h[0] = mpi->h;
+        c->w[1] = c->w[2] = mpi->chroma_width;
+        c->h[1] = c->h[2] = mpi->chroma_height;
+        c->w[3] = ((mpi->w+15)/16) * ((mpi->h+15)/16);
+        c->h[3] = 2;
+        c->stride[0] = mpi->width;
+        c->stride[1] = c->stride[2] = mpi->chroma_width;
+        c->stride[3] = c->w[3];
+        c->background[1] = c->background[2] = 128;
+    }
 
-	if (gCpuCaps.hasMMX) c->cpu |= PULLUP_CPU_MMX;
-	if (gCpuCaps.hasMMX2) c->cpu |= PULLUP_CPU_MMX2;
-	if (gCpuCaps.has3DNow) c->cpu |= PULLUP_CPU_3DNOW;
-	if (gCpuCaps.has3DNowExt) c->cpu |= PULLUP_CPU_3DNOWEXT;
-	if (gCpuCaps.hasSSE) c->cpu |= PULLUP_CPU_SSE;
-	if (gCpuCaps.hasSSE2) c->cpu |= PULLUP_CPU_SSE2;
+    if (gCpuCaps.hasMMX) c->cpu |= PULLUP_CPU_MMX;
+    if (gCpuCaps.hasMMX2) c->cpu |= PULLUP_CPU_MMX2;
+    if (gCpuCaps.has3DNow) c->cpu |= PULLUP_CPU_3DNOW;
+    if (gCpuCaps.has3DNowExt) c->cpu |= PULLUP_CPU_3DNOWEXT;
+    if (gCpuCaps.hasSSE) c->cpu |= PULLUP_CPU_SSE;
+    if (gCpuCaps.hasSSE2) c->cpu |= PULLUP_CPU_SSE2;
 
-	pullup_init_context(c);
+    pullup_init_context(c);
 
-	vf->priv->init = 1;
-	vf->priv->qbuf = malloc(c->w[3]);
+    vf->priv->init = 1;
+    vf->priv->qbuf = malloc(c->w[3]);
 }
 
 
 #if 0
 static void get_image(struct vf_instance *vf, mp_image_t *mpi)
 {
-	struct pullup_context *c = vf->priv->ctx;
-	struct pullup_buffer *b;
+    struct pullup_context *c = vf->priv->ctx;
+    struct pullup_buffer *b;
 
-	if (mpi->type == MP_IMGTYPE_STATIC) return;
+    if (mpi->type == MP_IMGTYPE_STATIC) return;
 
-	if (!vf->priv->init) init_pullup(vf, mpi);
+    if (!vf->priv->init) init_pullup(vf, mpi);
 
-	b = pullup_get_buffer(c, 2);
-	if (!b) return; /* shouldn't happen... */
+    b = pullup_get_buffer(c, 2);
+    if (!b) return; /* shouldn't happen... */
 
-	mpi->priv = b;
+    mpi->priv = b;
 
-	mpi->planes[0] = b->planes[0];
-	mpi->planes[1] = b->planes[1];
-	mpi->planes[2] = b->planes[2];
-	mpi->stride[0] = c->stride[0];
-	mpi->stride[1] = c->stride[1];
-	mpi->stride[2] = c->stride[2];
+    mpi->planes[0] = b->planes[0];
+    mpi->planes[1] = b->planes[1];
+    mpi->planes[2] = b->planes[2];
+    mpi->stride[0] = c->stride[0];
+    mpi->stride[1] = c->stride[1];
+    mpi->stride[2] = c->stride[2];
 
-	mpi->flags |= MP_IMGFLAG_DIRECT;
-	mpi->flags &= ~MP_IMGFLAG_DRAW_CALLBACK;
+    mpi->flags |= MP_IMGFLAG_DIRECT;
+    mpi->flags &= ~MP_IMGFLAG_DRAW_CALLBACK;
 }
 #endif
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	struct pullup_context *c = vf->priv->ctx;
-	struct pullup_buffer *b;
-	struct pullup_frame *f;
-	mp_image_t *dmpi;
-	int ret;
-	int p;
-	int i;
+    struct pullup_context *c = vf->priv->ctx;
+    struct pullup_buffer *b;
+    struct pullup_frame *f;
+    mp_image_t *dmpi;
+    int ret;
+    int p;
+    int i;
 
-	if (!vf->priv->init) init_pullup(vf, mpi);
+    if (!vf->priv->init) init_pullup(vf, mpi);
 
-	if (mpi->flags & MP_IMGFLAG_DIRECT) {
-		b = mpi->priv;
-		mpi->priv = 0;
-	} else {
-		b = pullup_get_buffer(c, 2);
-		if (!b) {
-			mp_msg(MSGT_VFILTER,MSGL_ERR,"Could not get buffer from pullup!\n");
-			f = pullup_get_frame(c);
-			pullup_release_frame(f);
-			return 0;
-		}
-		memcpy_pic(b->planes[0], mpi->planes[0], mpi->w, mpi->h,
-			c->stride[0], mpi->stride[0]);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			memcpy_pic(b->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height,
-				c->stride[1], mpi->stride[1]);
-			memcpy_pic(b->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height,
-				c->stride[2], mpi->stride[2]);
-		}
-	}
-	if (mpi->qscale) {
-		fast_memcpy(b->planes[3], mpi->qscale, c->w[3]);
-		fast_memcpy(b->planes[3]+c->w[3], mpi->qscale, c->w[3]);
-	}
+    if (mpi->flags & MP_IMGFLAG_DIRECT) {
+        b = mpi->priv;
+        mpi->priv = 0;
+    } else {
+        b = pullup_get_buffer(c, 2);
+        if (!b) {
+            mp_msg(MSGT_VFILTER,MSGL_ERR,"Could not get buffer from pullup!\n");
+            f = pullup_get_frame(c);
+            pullup_release_frame(f);
+            return 0;
+        }
+        memcpy_pic(b->planes[0], mpi->planes[0], mpi->w, mpi->h,
+            c->stride[0], mpi->stride[0]);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            memcpy_pic(b->planes[1], mpi->planes[1],
+                mpi->chroma_width, mpi->chroma_height,
+                c->stride[1], mpi->stride[1]);
+            memcpy_pic(b->planes[2], mpi->planes[2],
+                mpi->chroma_width, mpi->chroma_height,
+                c->stride[2], mpi->stride[2]);
+        }
+    }
+    if (mpi->qscale) {
+        fast_memcpy(b->planes[3], mpi->qscale, c->w[3]);
+        fast_memcpy(b->planes[3]+c->w[3], mpi->qscale, c->w[3]);
+    }
 
-	p = mpi->fields & MP_IMGFIELD_TOP_FIRST ? 0 :
-		(mpi->fields & MP_IMGFIELD_ORDERED ? 1 : 0);
-	pullup_submit_field(c, b, p);
-	pullup_submit_field(c, b, p^1);
-	if (mpi->fields & MP_IMGFIELD_REPEAT_FIRST)
-		pullup_submit_field(c, b, p);
+    p = mpi->fields & MP_IMGFIELD_TOP_FIRST ? 0 :
+        (mpi->fields & MP_IMGFIELD_ORDERED ? 1 : 0);
+    pullup_submit_field(c, b, p);
+    pullup_submit_field(c, b, p^1);
+    if (mpi->fields & MP_IMGFIELD_REPEAT_FIRST)
+        pullup_submit_field(c, b, p);
 
-	pullup_release_buffer(b, 2);
+    pullup_release_buffer(b, 2);
 
-	f = pullup_get_frame(c);
+    f = pullup_get_frame(c);
 
-	/* Fake yes for first few frames (buffer depth) to keep from
-	 * breaking A/V sync with G1's bad architecture... */
-	if (!f) return vf->priv->fakecount ? (--vf->priv->fakecount,1) : 0;
+    /* Fake yes for first few frames (buffer depth) to keep from
+     * breaking A/V sync with G1's bad architecture... */
+    if (!f) return vf->priv->fakecount ? (--vf->priv->fakecount,1) : 0;
 
-	if (f->length < 2) {
-		pullup_release_frame(f);
-		f = pullup_get_frame(c);
-		if (!f) return 0;
-		if (f->length < 2) {
-			pullup_release_frame(f);
-			if (!(mpi->fields & MP_IMGFIELD_REPEAT_FIRST))
-				return 0;
-			f = pullup_get_frame(c);
-			if (!f) return 0;
-			if (f->length < 2) {
-				pullup_release_frame(f);
-				return 0;
-			}
-		}
-	}
+    if (f->length < 2) {
+        pullup_release_frame(f);
+        f = pullup_get_frame(c);
+        if (!f) return 0;
+        if (f->length < 2) {
+            pullup_release_frame(f);
+            if (!(mpi->fields & MP_IMGFIELD_REPEAT_FIRST))
+                return 0;
+            f = pullup_get_frame(c);
+            if (!f) return 0;
+            if (f->length < 2) {
+                pullup_release_frame(f);
+                return 0;
+            }
+        }
+    }
 
 #if 0
-	/* Average qscale tables from both frames. */
-	if (mpi->qscale) {
-		for (i=0; i<c->w[3]; i++) {
-			vf->priv->qbuf[i] = (f->ofields[0]->planes[3][i]
-				+ f->ofields[1]->planes[3][i+c->w[3]])>>1;
-		}
-	}
+    /* Average qscale tables from both frames. */
+    if (mpi->qscale) {
+        for (i=0; i<c->w[3]; i++) {
+            vf->priv->qbuf[i] = (f->ofields[0]->planes[3][i]
+                + f->ofields[1]->planes[3][i+c->w[3]])>>1;
+        }
+    }
 #else
-	/* Take worst of qscale tables from both frames. */
-	if (mpi->qscale) {
-		for (i=0; i<c->w[3]; i++) {
-			vf->priv->qbuf[i] = MAX(f->ofields[0]->planes[3][i], f->ofields[1]->planes[3][i+c->w[3]]);
-		}
-	}
+    /* Take worst of qscale tables from both frames. */
+    if (mpi->qscale) {
+        for (i=0; i<c->w[3]; i++) {
+            vf->priv->qbuf[i] = MAX(f->ofields[0]->planes[3][i], f->ofields[1]->planes[3][i+c->w[3]]);
+        }
+    }
 #endif
 
-	/* If the frame isn't already exportable... */
-	while (!f->buffer) {
-		dmpi = vf_get_image(vf->next, mpi->imgfmt,
-			MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-			mpi->width, mpi->height);
-		/* FIXME: Is it ok to discard dmpi if it's not direct? */
-		if (!(dmpi->flags & MP_IMGFLAG_DIRECT)) {
-			pullup_pack_frame(c, f);
-			break;
-		}
-		/* Direct render fields into output buffer */
-		my_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
-			mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
-		my_memcpy_pic(dmpi->planes[0] + dmpi->stride[0],
-			f->ofields[1]->planes[0] + c->stride[0],
-			mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1], f->ofields[0]->planes[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, c->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[1] + dmpi->stride[1],
-				f->ofields[1]->planes[1] + c->stride[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, c->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2], f->ofields[0]->planes[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, c->stride[2]*2);
-			my_memcpy_pic(dmpi->planes[2] + dmpi->stride[2],
-				f->ofields[1]->planes[2] + c->stride[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, c->stride[2]*2);
-		}
-		pullup_release_frame(f);
-		if (mpi->qscale) {
-			dmpi->qscale = vf->priv->qbuf;
-			dmpi->qstride = mpi->qstride;
-			dmpi->qscale_type = mpi->qscale_type;
-		}
-		return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-	}
-	dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->width, mpi->height);
+    /* If the frame isn't already exportable... */
+    while (!f->buffer) {
+        dmpi = vf_get_image(vf->next, mpi->imgfmt,
+            MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+            mpi->width, mpi->height);
+        /* FIXME: Is it ok to discard dmpi if it's not direct? */
+        if (!(dmpi->flags & MP_IMGFLAG_DIRECT)) {
+            pullup_pack_frame(c, f);
+            break;
+        }
+        /* Direct render fields into output buffer */
+        my_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
+            mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
+        my_memcpy_pic(dmpi->planes[0] + dmpi->stride[0],
+            f->ofields[1]->planes[0] + c->stride[0],
+            mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1], f->ofields[0]->planes[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, c->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[1] + dmpi->stride[1],
+                f->ofields[1]->planes[1] + c->stride[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, c->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2], f->ofields[0]->planes[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, c->stride[2]*2);
+            my_memcpy_pic(dmpi->planes[2] + dmpi->stride[2],
+                f->ofields[1]->planes[2] + c->stride[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, c->stride[2]*2);
+        }
+        pullup_release_frame(f);
+        if (mpi->qscale) {
+            dmpi->qscale = vf->priv->qbuf;
+            dmpi->qstride = mpi->qstride;
+            dmpi->qscale_type = mpi->qscale_type;
+        }
+        return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+    }
+    dmpi = vf_get_image(vf->next, mpi->imgfmt,
+        MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->width, mpi->height);
 
-	dmpi->planes[0] = f->buffer->planes[0];
-	dmpi->planes[1] = f->buffer->planes[1];
-	dmpi->planes[2] = f->buffer->planes[2];
+    dmpi->planes[0] = f->buffer->planes[0];
+    dmpi->planes[1] = f->buffer->planes[1];
+    dmpi->planes[2] = f->buffer->planes[2];
 
-	dmpi->stride[0] = c->stride[0];
-	dmpi->stride[1] = c->stride[1];
-	dmpi->stride[2] = c->stride[2];
+    dmpi->stride[0] = c->stride[0];
+    dmpi->stride[1] = c->stride[1];
+    dmpi->stride[2] = c->stride[2];
 
-	if (mpi->qscale) {
-		dmpi->qscale = vf->priv->qbuf;
-		dmpi->qstride = mpi->qstride;
-		dmpi->qscale_type = mpi->qscale_type;
-	}
-	ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-	pullup_release_frame(f);
-	return ret;
+    if (mpi->qscale) {
+        dmpi->qscale = vf->priv->qbuf;
+        dmpi->qstride = mpi->qstride;
+        dmpi->qscale_type = mpi->qscale_type;
+    }
+    ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+    pullup_release_frame(f);
+    return ret;
 }
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - support more formats */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    /* FIXME - support more formats */
+    switch (fmt) {
+    case IMGFMT_YV12:
+    case IMGFMT_IYUV:
+    case IMGFMT_I420:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt)
 {
-	if (height&3) return 0;
-	return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
+    if (height&3) return 0;
+    return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	pullup_free_context(vf->priv->ctx);
-	free(vf->priv);
+    pullup_free_context(vf->priv->ctx);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
-	struct pullup_context *c;
-	//vf->get_image = get_image;
-	vf->put_image = put_image;
-	vf->config = config;
-	vf->query_format = query_format;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
-	p->ctx = c = pullup_alloc_context();
-	p->fakecount = 1;
-	c->verbose = verbose>0;
-	c->junk_left = c->junk_right = 1;
-	c->junk_top = c->junk_bottom = 4;
-	c->strict_breaks = 0;
-	c->metric_plane = 0;
-	if (args) {
-		sscanf(args, "%d:%d:%d:%d:%d:%d", &c->junk_left, &c->junk_right, &c->junk_top, &c->junk_bottom, &c->strict_breaks, &c->metric_plane);
-	}
-	return 1;
+    struct vf_priv_s *p;
+    struct pullup_context *c;
+    //vf->get_image = get_image;
+    vf->put_image = put_image;
+    vf->config = config;
+    vf->query_format = query_format;
+    vf->uninit = uninit;
+    vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+    vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+    p->ctx = c = pullup_alloc_context();
+    p->fakecount = 1;
+    c->verbose = verbose>0;
+    c->junk_left = c->junk_right = 1;
+    c->junk_top = c->junk_bottom = 4;
+    c->strict_breaks = 0;
+    c->metric_plane = 0;
+    if (args) {
+        sscanf(args, "%d:%d:%d:%d:%d:%d", &c->junk_left, &c->junk_right, &c->junk_top, &c->junk_bottom, &c->strict_breaks, &c->metric_plane);
+    }
+    return 1;
 }
 
 const vf_info_t vf_info_pullup = {
--- a/libmpcodecs/vf_qp.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_qp.c	Fri Jan 14 22:10:21 2011 +0000
@@ -36,19 +36,19 @@
 
 
 struct vf_priv_s {
-	char eq[200];
-	int8_t *qp;
-	int8_t lut[257];
-	int qp_stride;
+        char eq[200];
+        int8_t *qp;
+        int8_t lut[257];
+        int qp_stride;
 };
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
-	int h= (height+15)>>4;
+        unsigned int flags, unsigned int outfmt){
+        int h= (height+15)>>4;
         int i;
 
-	vf->priv->qp_stride= (width+15)>>4;
+        vf->priv->qp_stride= (width+15)>>4;
         vf->priv->qp= av_malloc(vf->priv->qp_stride*h*sizeof(int8_t));
 
         for(i=-129; i<128; i++){
@@ -67,7 +67,7 @@
                 NULL
             };
             double temp_val;
-	    int res;
+            int res;
 
             res= av_parse_and_eval_expr(&temp_val, vf->priv->eq, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, NULL);
 
@@ -78,7 +78,7 @@
             vf->priv->lut[i+129]= lrintf(temp_val);
         }
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void get_image(struct vf_instance *vf, mp_image_t *mpi){
@@ -92,32 +92,32 @@
     if(mpi->flags&MP_IMGFLAG_PLANAR){
         mpi->planes[1]=vf->dmpi->planes[1];
         mpi->planes[2]=vf->dmpi->planes[2];
-	mpi->stride[1]=vf->dmpi->stride[1];
-	mpi->stride[2]=vf->dmpi->stride[2];
+        mpi->stride[1]=vf->dmpi->stride[1];
+        mpi->stride[2]=vf->dmpi->stride[2];
     }
     mpi->flags|=MP_IMGFLAG_DIRECT;
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	mp_image_t *dmpi;
+        mp_image_t *dmpi;
         int x,y;
 
-	if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-		// no DR, so get a new image! hope we'll get DR buffer:
-		vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
-		mpi->w,mpi->h);
-	}
+        if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
+                // no DR, so get a new image! hope we'll get DR buffer:
+                vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
+                MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
+                mpi->w,mpi->h);
+        }
 
-	dmpi= vf->dmpi;
+        dmpi= vf->dmpi;
 
-	if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-		memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
-    		if(mpi->flags&MP_IMGFLAG_PLANAR){
-		    memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
-		    memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
-		}
-	}
+        if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
+                memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
+                    if(mpi->flags&MP_IMGFLAG_PLANAR){
+                    memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
+                    memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
+                }
+        }
         vf_clone_mpi_attributes(dmpi, mpi);
 
         dmpi->qscale = vf->priv->qp;
@@ -138,17 +138,17 @@
             }
         }
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 static void uninit(struct vf_instance *vf){
-	if(!vf->priv) return;
+        if(!vf->priv) return;
 
-	av_free(vf->priv->qp);
-	vf->priv->qp= NULL;
+        av_free(vf->priv->qp);
+        vf->priv->qp= NULL;
 
-	av_free(vf->priv);
-	vf->priv=NULL;
+        av_free(vf->priv);
+        vf->priv=NULL;
 }
 
 //===========================================================================//
--- a/libmpcodecs/vf_rectangle.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_rectangle.c	Fri Jan 14 22:10:21 2011 +0000
@@ -36,17 +36,17 @@
        unsigned int flags, unsigned int outfmt)
 {
     if (vf->priv->w < 0 || width < vf->priv->w)
-	vf->priv->w = width;
+        vf->priv->w = width;
     if (vf->priv->h < 0 || height < vf->priv->h)
-	vf->priv->h = height;
+        vf->priv->h = height;
     if (vf->priv->x < 0)
-	vf->priv->x = (width - vf->priv->w) / 2;
+        vf->priv->x = (width - vf->priv->w) / 2;
     if (vf->priv->y < 0)
-	vf->priv->y = (height - vf->priv->h) / 2;
+        vf->priv->y = (height - vf->priv->h) / 2;
     if (vf->priv->w + vf->priv->x > width
-	|| vf->priv->h + vf->priv->y > height) {
-	mp_msg(MSGT_VFILTER,MSGL_WARN,"rectangle: bad position/width/height - rectangle area is out of the original!\n");
-	return 0;
+        || vf->priv->h + vf->priv->y > height) {
+        mp_msg(MSGT_VFILTER,MSGL_WARN,"rectangle: bad position/width/height - rectangle area is out of the original!\n");
+        return 0;
     }
     return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
 }
@@ -57,27 +57,27 @@
     const int *const tmp = data;
     switch(request){
     case VFCTRL_CHANGE_RECTANGLE:
-	switch (tmp[0]){
-	case 0:
-	    vf->priv->w += tmp[1];
-	    return 1;
-	    break;
-	case 1:
-	    vf->priv->h += tmp[1];
-	    return 1;
-	    break;
-	case 2:
-	    vf->priv->x += tmp[1];
-	    return 1;
-	    break;
-	case 3:
-	    vf->priv->y += tmp[1];
-	    return 1;
-	    break;
-	default:
-	    mp_msg(MSGT_VFILTER,MSGL_FATAL,"Unknown param %d \n", tmp[0]);
-	    return 0;
-	}
+        switch (tmp[0]){
+        case 0:
+            vf->priv->w += tmp[1];
+            return 1;
+            break;
+        case 1:
+            vf->priv->h += tmp[1];
+            return 1;
+            break;
+        case 2:
+            vf->priv->x += tmp[1];
+            return 1;
+            break;
+        case 3:
+            vf->priv->y += tmp[1];
+            return 1;
+            break;
+        default:
+            mp_msg(MSGT_VFILTER,MSGL_FATAL,"Unknown param %d \n", tmp[0]);
+            return 0;
+        }
     }
     return vf_next_control(vf, request, data);
     return 0;
@@ -88,18 +88,18 @@
     unsigned int bpp = mpi->bpp / 8;
     int x, y, w, h;
     dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP,
-			MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
-			mpi->w, mpi->h);
+                        MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
+                        mpi->w, mpi->h);
 
     memcpy_pic(dmpi->planes[0],mpi->planes[0],mpi->w*bpp, mpi->h,
-	       dmpi->stride[0],mpi->stride[0]);
+               dmpi->stride[0],mpi->stride[0]);
     if(mpi->flags&MP_IMGFLAG_PLANAR && mpi->flags&MP_IMGFLAG_YUV){
-	memcpy_pic(dmpi->planes[1],mpi->planes[1],
-		   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
-	           dmpi->stride[1],mpi->stride[1]);
-	memcpy_pic(dmpi->planes[2],mpi->planes[2],
-		   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
-	           dmpi->stride[2],mpi->stride[2]);
+        memcpy_pic(dmpi->planes[1],mpi->planes[1],
+                   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
+                   dmpi->stride[1],mpi->stride[1]);
+        memcpy_pic(dmpi->planes[2],mpi->planes[2],
+                   mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
+                   dmpi->stride[2],mpi->stride[2]);
     }
 
     /* Draw the rectangle */
@@ -121,36 +121,36 @@
     h = FFMAX(h, 0);
 
     if (0 <= vf->priv->y && vf->priv->y <= dmpi->height) {
-	unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + x * bpp;
-	unsigned int count = w * bpp;
-	while (count--)
-	    p[count] = 0xff - p[count];
+        unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + x * bpp;
+        unsigned int count = w * bpp;
+        while (count--)
+            p[count] = 0xff - p[count];
     }
     if (h != 1 && vf->priv->y + vf->priv->h - 1 <= mpi->height) {
-	unsigned char *p = dmpi->planes[0] + (vf->priv->y + vf->priv->h - 1) * dmpi->stride[0] + x * bpp;
-	unsigned int count = w * bpp;
-	while (count--)
-	    p[count] = 0xff - p[count];
+        unsigned char *p = dmpi->planes[0] + (vf->priv->y + vf->priv->h - 1) * dmpi->stride[0] + x * bpp;
+        unsigned int count = w * bpp;
+        while (count--)
+            p[count] = 0xff - p[count];
     }
     if (0 <= vf->priv->x  && vf->priv->x <= dmpi->width) {
-	unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + x * bpp;
-	unsigned int count = h;
-	while (count--) {
-	    unsigned int i = bpp;
-	    while (i--)
-		p[i] = 0xff - p[i];
-	    p += dmpi->stride[0];
-	}
+        unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + x * bpp;
+        unsigned int count = h;
+        while (count--) {
+            unsigned int i = bpp;
+            while (i--)
+                p[i] = 0xff - p[i];
+            p += dmpi->stride[0];
+        }
     }
     if (w != 1 && vf->priv->x + vf->priv->w - 1 <= mpi->width) {
-	unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + (vf->priv->x + vf->priv->w - 1) * bpp;
-	unsigned int count = h;
-	while (count--) {
-	    unsigned int i = bpp;
-	    while (i--)
-		p[i] = 0xff - p[i];
-	    p += dmpi->stride[0];
-	}
+        unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + (vf->priv->x + vf->priv->w - 1) * bpp;
+        unsigned int count = h;
+        while (count--) {
+            unsigned int i = bpp;
+            while (i--)
+                p[i] = 0xff - p[i];
+            p += dmpi->stride[0];
+        }
     }
     return vf_next_put_image(vf, dmpi, pts);
 }
@@ -166,8 +166,8 @@
     vf->priv->w = -1;
     vf->priv->h = -1;
     if (args)
-	sscanf(args, "%d:%d:%d:%d",
-	       &vf->priv->w, &vf->priv->h, &vf->priv->x, &vf->priv->y);
+        sscanf(args, "%d:%d:%d:%d",
+               &vf->priv->w, &vf->priv->h, &vf->priv->x, &vf->priv->y);
     return 1;
 }
 
--- a/libmpcodecs/vf_remove_logo.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_remove_logo.c	Fri Jan 14 22:10:21 2011 +0000
@@ -768,8 +768,8 @@
     mp_image_t *dmpi;
 
     dmpi=vf_get_image(vf->next,vf->priv->fmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	mpi->w, mpi->h);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w, mpi->h);
 
     /* Check to make sure that the filter image and the video stream are the same size. */
     if (vf->priv->filter->width != mpi->w || vf->priv->filter->height != mpi->h)
@@ -799,8 +799,8 @@
           break;
 
     default:
-	mp_msg(MSGT_VFILTER,MSGL_ERR,"Unhandled format: 0x%X\n",dmpi->imgfmt);
-	return 0;
+        mp_msg(MSGT_VFILTER,MSGL_ERR,"Unhandled format: 0x%X\n",dmpi->imgfmt);
+        return 0;
     }
 
     return vf_next_put_image(vf,dmpi, pts);
--- a/libmpcodecs/vf_rgbtest.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_rgbtest.c	Fri Jan 14 22:10:21 2011 +0000
@@ -49,7 +49,7 @@
     case IMGFMT_BGR24:
     case IMGFMT_BGRA:
     case IMGFMT_ABGR:
-	return outfmt;
+        return outfmt;
     }
     return 0;
 }
@@ -105,7 +105,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
     if (vf->priv->w > 0) { d_width  = width  = vf->priv->w; }
     if (vf->priv->h > 0) { d_height = height = vf->priv->h; }
     vf->priv->fmt=getfmt(outfmt);
@@ -121,8 +121,8 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,vf->priv->fmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	w, h);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        w, h);
 
      for(y=0; y<h; y++){
          for(x=0; x<w; x++){
--- a/libmpcodecs/vf_rotate.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_rotate.c	Fri Jan 14 22:10:21 2011 +0000
@@ -35,34 +35,34 @@
 static void rotate(unsigned char* dst,unsigned char* src,int dststride,int srcstride,int w,int h,int bpp,int dir){
     int y;
     if(dir&1){
-	src+=srcstride*(w-1);
-	srcstride*=-1;
+        src+=srcstride*(w-1);
+        srcstride*=-1;
     }
     if(dir&2){
-	dst+=dststride*(h-1);
-	dststride*=-1;
+        dst+=dststride*(h-1);
+        dststride*=-1;
     }
 
     for(y=0;y<h;y++){
-	int x;
-	switch(bpp){
-	case 1:
-	    for(x=0;x<w;x++) dst[x]=src[y+x*srcstride];
-	    break;
-	case 2:
-	    for(x=0;x<w;x++) *((short*)(dst+x*2))=*((short*)(src+y*2+x*srcstride));
-	    break;
-	case 3:
-	    for(x=0;x<w;x++){
-		dst[x*3+0]=src[0+y*3+x*srcstride];
-		dst[x*3+1]=src[1+y*3+x*srcstride];
-		dst[x*3+2]=src[2+y*3+x*srcstride];
-	    }
-	    break;
-	case 4:
-	    for(x=0;x<w;x++) *((int*)(dst+x*4))=*((int*)(src+y*4+x*srcstride));
-	}
-	dst+=dststride;
+        int x;
+        switch(bpp){
+        case 1:
+            for(x=0;x<w;x++) dst[x]=src[y+x*srcstride];
+            break;
+        case 2:
+            for(x=0;x<w;x++) *((short*)(dst+x*2))=*((short*)(src+y*2+x*srcstride));
+            break;
+        case 3:
+            for(x=0;x<w;x++){
+                dst[x*3+0]=src[0+y*3+x*srcstride];
+                dst[x*3+1]=src[1+y*3+x*srcstride];
+                dst[x*3+2]=src[2+y*3+x*srcstride];
+            }
+            break;
+        case 4:
+            for(x=0;x<w;x++) *((int*)(dst+x*4))=*((int*)(src+y*4+x*srcstride));
+        }
+        dst+=dststride;
     }
 }
 
@@ -70,16 +70,16 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
     if (vf->priv->direction & 4) {
-	if (width<height) vf->priv->direction&=3;
+        if (width<height) vf->priv->direction&=3;
     }
     if (vf->priv->direction & 4){
-	vf->put_image=vf_next_put_image; // passthru mode!
-	if (vf->next->draw_slice) vf->draw_slice=vf_next_draw_slice;
+        vf->put_image=vf_next_put_image; // passthru mode!
+        if (vf->next->draw_slice) vf->draw_slice=vf_next_draw_slice;
 /* FIXME: this should be in an other procedure in vf.c; that should always check
      whether the filter after the passthrough one still (not)supports slices */
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
     }
     return vf_next_config(vf,height,width,d_height,d_width,flags,outfmt);
 }
@@ -89,24 +89,24 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	mpi->h, mpi->w);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->h, mpi->w);
 
     if(mpi->flags&MP_IMGFLAG_PLANAR){
-	rotate(dmpi->planes[0],mpi->planes[0],
-	       dmpi->stride[0],mpi->stride[0],
-	       dmpi->w,dmpi->h,1,vf->priv->direction);
-	rotate(dmpi->planes[1],mpi->planes[1],
-	       dmpi->stride[1],mpi->stride[1],
-	       dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,vf->priv->direction);
-	rotate(dmpi->planes[2],mpi->planes[2],
-	       dmpi->stride[2],mpi->stride[2],
-	       dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,vf->priv->direction);
+        rotate(dmpi->planes[0],mpi->planes[0],
+               dmpi->stride[0],mpi->stride[0],
+               dmpi->w,dmpi->h,1,vf->priv->direction);
+        rotate(dmpi->planes[1],mpi->planes[1],
+               dmpi->stride[1],mpi->stride[1],
+               dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,vf->priv->direction);
+        rotate(dmpi->planes[2],mpi->planes[2],
+               dmpi->stride[2],mpi->stride[2],
+               dmpi->w>>mpi->chroma_x_shift,dmpi->h>>mpi->chroma_y_shift,1,vf->priv->direction);
     } else {
-	rotate(dmpi->planes[0],mpi->planes[0],
-	       dmpi->stride[0],mpi->stride[0],
-	       dmpi->w,dmpi->h,dmpi->bpp>>3,vf->priv->direction);
-	dmpi->planes[1] = mpi->planes[1]; // passthrough rgb8 palette
+        rotate(dmpi->planes[0],mpi->planes[0],
+               dmpi->stride[0],mpi->stride[0],
+               dmpi->w,dmpi->h,dmpi->bpp>>3,vf->priv->direction);
+        dmpi->planes[1] = mpi->planes[1]; // passthrough rgb8 palette
     }
 
     return vf_next_put_image(vf,dmpi, pts);
@@ -118,15 +118,15 @@
     if(IMGFMT_IS_RGB(fmt) || IMGFMT_IS_BGR(fmt)) return vf_next_query_format(vf, fmt);
     // we can support only symmetric (chroma_x_shift==chroma_y_shift) YUV formats:
     switch(fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-//	case IMGFMT_IF09:
-	case IMGFMT_Y8:
-	case IMGFMT_Y800:
-	case IMGFMT_444P:
-	    return vf_next_query_format(vf, fmt);
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_YVU9:
+//        case IMGFMT_IF09:
+        case IMGFMT_Y8:
+        case IMGFMT_Y800:
+        case IMGFMT_444P:
+            return vf_next_query_format(vf, fmt);
     }
     return 0;
 }
--- a/libmpcodecs/vf_sab.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_sab.c	Fri Jan 14 22:10:21 2011 +0000
@@ -42,22 +42,22 @@
 //===========================================================================//
 
 typedef struct FilterParam{
-	float radius;
-	float preFilterRadius;
-	float strength;
-	float quality;
-	struct SwsContext *preFilterContext;
-	uint8_t *preFilterBuf;
-	int preFilterStride;
-	int distWidth;
-	int distStride;
-	int *distCoeff;
-	int colorDiffCoeff[512];
+    float radius;
+    float preFilterRadius;
+    float strength;
+    float quality;
+    struct SwsContext *preFilterContext;
+    uint8_t *preFilterBuf;
+    int preFilterStride;
+    int distWidth;
+    int distStride;
+    int *distCoeff;
+    int colorDiffCoeff[512];
 }FilterParam;
 
 struct vf_priv_s {
-	FilterParam luma;
-	FilterParam chroma;
+    FilterParam luma;
+    FilterParam chroma;
 };
 
 
@@ -65,248 +65,248 @@
 
 //FIXME stupid code duplication
 static void getSubSampleFactors(int *h, int *v, int format){
-	switch(format){
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-		*h=1;
-		*v=1;
-		break;
-	case IMGFMT_YVU9:
-		*h=2;
-		*v=2;
-		break;
-	case IMGFMT_444P:
-		*h=0;
-		*v=0;
-		break;
-	case IMGFMT_422P:
-		*h=1;
-		*v=0;
-		break;
-	case IMGFMT_411P:
-		*h=2;
-		*v=0;
-		break;
-	}
+    switch(format){
+    case IMGFMT_YV12:
+    case IMGFMT_I420:
+        *h=1;
+        *v=1;
+        break;
+    case IMGFMT_YVU9:
+        *h=2;
+        *v=2;
+        break;
+    case IMGFMT_444P:
+        *h=0;
+        *v=0;
+        break;
+    case IMGFMT_422P:
+        *h=1;
+        *v=0;
+        break;
+    case IMGFMT_411P:
+        *h=2;
+        *v=0;
+        break;
+    }
 }
 
 static int allocStuff(FilterParam *f, int width, int height){
-	int stride= (width+7)&~7;
-	SwsVector *vec;
-	SwsFilter swsF;
-	int i,x,y;
-	f->preFilterBuf= (uint8_t*)memalign(8, stride*height);
-	f->preFilterStride= stride;
+    int stride= (width+7)&~7;
+    SwsVector *vec;
+    SwsFilter swsF;
+    int i,x,y;
+    f->preFilterBuf= (uint8_t*)memalign(8, stride*height);
+    f->preFilterStride= stride;
 
-	vec = sws_getGaussianVec(f->preFilterRadius, f->quality);
-	swsF.lumH= swsF.lumV= vec;
-	swsF.chrH= swsF.chrV= NULL;
-	f->preFilterContext= sws_getContext(
-		width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, get_sws_cpuflags()|SWS_POINT, &swsF, NULL, NULL);
+    vec = sws_getGaussianVec(f->preFilterRadius, f->quality);
+    swsF.lumH= swsF.lumV= vec;
+    swsF.chrH= swsF.chrV= NULL;
+    f->preFilterContext= sws_getContext(
+        width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, get_sws_cpuflags()|SWS_POINT, &swsF, NULL, NULL);
 
-	sws_freeVec(vec);
-	vec = sws_getGaussianVec(f->strength, 5.0);
-	for(i=0; i<512; i++){
-		double d;
-		int index= i-256 + vec->length/2;
+    sws_freeVec(vec);
+    vec = sws_getGaussianVec(f->strength, 5.0);
+    for(i=0; i<512; i++){
+        double d;
+        int index= i-256 + vec->length/2;
 
-		if(index<0 || index>=vec->length) 	d= 0.0;
-		else					d= vec->coeff[index];
+        if(index<0 || index>=vec->length)     d= 0.0;
+        else                    d= vec->coeff[index];
 
-		f->colorDiffCoeff[i]= (int)(d/vec->coeff[vec->length/2]*(1<<12) + 0.5);
-	}
-	sws_freeVec(vec);
-	vec = sws_getGaussianVec(f->radius, f->quality);
-	f->distWidth= vec->length;
-	f->distStride= (vec->length+7)&~7;
-	f->distCoeff= (int32_t*)memalign(8, f->distWidth*f->distStride*sizeof(int32_t));
+        f->colorDiffCoeff[i]= (int)(d/vec->coeff[vec->length/2]*(1<<12) + 0.5);
+    }
+    sws_freeVec(vec);
+    vec = sws_getGaussianVec(f->radius, f->quality);
+    f->distWidth= vec->length;
+    f->distStride= (vec->length+7)&~7;
+    f->distCoeff= (int32_t*)memalign(8, f->distWidth*f->distStride*sizeof(int32_t));
 
-	for(y=0; y<vec->length; y++){
-		for(x=0; x<vec->length; x++){
-			double d= vec->coeff[x] * vec->coeff[y];
+    for(y=0; y<vec->length; y++){
+        for(x=0; x<vec->length; x++){
+            double d= vec->coeff[x] * vec->coeff[y];
 
-			f->distCoeff[x + y*f->distStride]= (int)(d*(1<<10) + 0.5);
-//			if(y==vec->length/2)
-//				printf("%6d ", f->distCoeff[x + y*f->distStride]);
-		}
-	}
-	sws_freeVec(vec);
+            f->distCoeff[x + y*f->distStride]= (int)(d*(1<<10) + 0.5);
+//            if(y==vec->length/2)
+//                printf("%6d ", f->distCoeff[x + y*f->distStride]);
+        }
+    }
+    sws_freeVec(vec);
 
-	return 0;
+    return 0;
 }
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt){
 
-	int sw, sh;
+    int sw, sh;
 //__asm__ volatile("emms\n\t");
-	allocStuff(&vf->priv->luma, width, height);
+    allocStuff(&vf->priv->luma, width, height);
 
-	getSubSampleFactors(&sw, &sh, outfmt);
-	allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
+    getSubSampleFactors(&sw, &sh, outfmt);
+    allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void freeBuffers(FilterParam *f){
-	if(f->preFilterContext) sws_freeContext(f->preFilterContext);
-	f->preFilterContext=NULL;
+    if(f->preFilterContext) sws_freeContext(f->preFilterContext);
+    f->preFilterContext=NULL;
 
-	free(f->preFilterBuf);
-	f->preFilterBuf=NULL;
+    free(f->preFilterBuf);
+    f->preFilterBuf=NULL;
 
-	free(f->distCoeff);
-	f->distCoeff=NULL;
+    free(f->distCoeff);
+    f->distCoeff=NULL;
 }
 
 static void uninit(struct vf_instance *vf){
-	if(!vf->priv) return;
+    if(!vf->priv) return;
 
-	freeBuffers(&vf->priv->luma);
-	freeBuffers(&vf->priv->chroma);
+    freeBuffers(&vf->priv->luma);
+    freeBuffers(&vf->priv->chroma);
 
-	free(vf->priv);
-	vf->priv=NULL;
+    free(vf->priv);
+    vf->priv=NULL;
 }
 
 static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, FilterParam *fp){
-	int x, y;
-	FilterParam f= *fp;
-	const int radius= f.distWidth/2;
-	const uint8_t* const srcArray[MP_MAX_PLANES] = {src};
-	uint8_t *dstArray[MP_MAX_PLANES]= {f.preFilterBuf};
-	int srcStrideArray[MP_MAX_PLANES]= {srcStride};
-	int dstStrideArray[MP_MAX_PLANES]= {f.preFilterStride};
+    int x, y;
+    FilterParam f= *fp;
+    const int radius= f.distWidth/2;
+    const uint8_t* const srcArray[MP_MAX_PLANES] = {src};
+    uint8_t *dstArray[MP_MAX_PLANES]= {f.preFilterBuf};
+    int srcStrideArray[MP_MAX_PLANES]= {srcStride};
+    int dstStrideArray[MP_MAX_PLANES]= {f.preFilterStride};
 
-//	f.preFilterContext->swScale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
-	sws_scale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
+//    f.preFilterContext->swScale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
+    sws_scale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
 
-	for(y=0; y<h; y++){
-		for(x=0; x<w; x++){
-			int sum=0;
-			int div=0;
-			int dy;
-			const int preVal= f.preFilterBuf[x + y*f.preFilterStride];
+    for(y=0; y<h; y++){
+        for(x=0; x<w; x++){
+            int sum=0;
+            int div=0;
+            int dy;
+            const int preVal= f.preFilterBuf[x + y*f.preFilterStride];
 #if 0
-			const int srcVal= src[x + y*srcStride];
+            const int srcVal= src[x + y*srcStride];
 if((x/32)&1){
     dst[x + y*dstStride]= srcVal;
     if(y%32==0) dst[x + y*dstStride]= 0;
     continue;
 }
 #endif
-			if(x >= radius && x < w - radius){
-				for(dy=0; dy<radius*2+1; dy++){
-					int dx;
-					int iy= y+dy - radius;
-					if     (iy<0)  iy=  -iy;
-					else if(iy>=h) iy= h+h-iy-1;
+            if(x >= radius && x < w - radius){
+                for(dy=0; dy<radius*2+1; dy++){
+                    int dx;
+                    int iy= y+dy - radius;
+                    if     (iy<0)  iy=  -iy;
+                    else if(iy>=h) iy= h+h-iy-1;
 
-					for(dx=0; dx<radius*2+1; dx++){
-						const int ix= x+dx - radius;
-						int factor;
+                    for(dx=0; dx<radius*2+1; dx++){
+                        const int ix= x+dx - radius;
+                        int factor;
 
-						factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
-							*f.distCoeff[dx + dy*f.distStride];
-						sum+= src[ix + iy*srcStride] *factor;
-						div+= factor;
-					}
-				}
-			}else{
-				for(dy=0; dy<radius*2+1; dy++){
-					int dx;
-					int iy= y+dy - radius;
-					if     (iy<0)  iy=  -iy;
-					else if(iy>=h) iy= h+h-iy-1;
+                        factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
+                            *f.distCoeff[dx + dy*f.distStride];
+                        sum+= src[ix + iy*srcStride] *factor;
+                        div+= factor;
+                    }
+                }
+            }else{
+                for(dy=0; dy<radius*2+1; dy++){
+                    int dx;
+                    int iy= y+dy - radius;
+                    if     (iy<0)  iy=  -iy;
+                    else if(iy>=h) iy= h+h-iy-1;
 
-					for(dx=0; dx<radius*2+1; dx++){
-						int ix= x+dx - radius;
-						int factor;
-						if     (ix<0)  ix=  -ix;
-						else if(ix>=w) ix= w+w-ix-1;
+                    for(dx=0; dx<radius*2+1; dx++){
+                        int ix= x+dx - radius;
+                        int factor;
+                        if     (ix<0)  ix=  -ix;
+                        else if(ix>=w) ix= w+w-ix-1;
 
-						factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
-							*f.distCoeff[dx + dy*f.distStride];
-						sum+= src[ix + iy*srcStride] *factor;
-						div+= factor;
-					}
-				}
-			}
-			dst[x + y*dstStride]= (sum + div/2)/div;
-		}
-	}
+                        factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
+                            *f.distCoeff[dx + dy*f.distStride];
+                        sum+= src[ix + iy*srcStride] *factor;
+                        div+= factor;
+                    }
+                }
+            }
+            dst[x + y*dstStride]= (sum + div/2)/div;
+        }
+    }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
+    int cw= mpi->w >> mpi->chroma_x_shift;
+    int ch= mpi->h >> mpi->chroma_y_shift;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-		mpi->w,mpi->h);
+    mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->w,mpi->h);
 
-	assert(mpi->flags&MP_IMGFLAG_PLANAR);
+    assert(mpi->flags&MP_IMGFLAG_PLANAR);
 
-	blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
-	blur(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
-	blur(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
+    blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
+    blur(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
+    blur(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
 
-	return vf_next_put_image(vf,dmpi, pts);
+    return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
-	switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    switch(fmt)
+    {
+    case IMGFMT_YV12:
+    case IMGFMT_I420:
+    case IMGFMT_IYUV:
+    case IMGFMT_YVU9:
+    case IMGFMT_444P:
+    case IMGFMT_422P:
+    case IMGFMT_411P:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
-	int e;
+    int e;
 
-	vf->config=config;
-	vf->put_image=put_image;
-//	vf->get_image=get_image;
-	vf->query_format=query_format;
-	vf->uninit=uninit;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
-	memset(vf->priv, 0, sizeof(struct vf_priv_s));
+    vf->config=config;
+    vf->put_image=put_image;
+//    vf->get_image=get_image;
+    vf->query_format=query_format;
+    vf->uninit=uninit;
+    vf->priv=malloc(sizeof(struct vf_priv_s));
+    memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
-	if(args==NULL) return 0;
+    if(args==NULL) return 0;
 
-	e=sscanf(args, "%f:%f:%f:%f:%f:%f",
-		&vf->priv->luma.radius,
-		&vf->priv->luma.preFilterRadius,
-		&vf->priv->luma.strength,
-		&vf->priv->chroma.radius,
-		&vf->priv->chroma.preFilterRadius,
-		&vf->priv->chroma.strength
-		);
+    e=sscanf(args, "%f:%f:%f:%f:%f:%f",
+        &vf->priv->luma.radius,
+        &vf->priv->luma.preFilterRadius,
+        &vf->priv->luma.strength,
+        &vf->priv->chroma.radius,
+        &vf->priv->chroma.preFilterRadius,
+        &vf->priv->chroma.strength
+        );
 
-	vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
+    vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
 
-	if(e==3){
-		vf->priv->chroma.radius= vf->priv->luma.radius;
-		vf->priv->chroma.preFilterRadius = vf->priv->luma.preFilterRadius;
-		vf->priv->chroma.strength= vf->priv->luma.strength;
-	}else if(e!=6)
-		return 0;
+    if(e==3){
+        vf->priv->chroma.radius= vf->priv->luma.radius;
+        vf->priv->chroma.preFilterRadius = vf->priv->luma.preFilterRadius;
+        vf->priv->chroma.strength= vf->priv->luma.strength;
+    }else if(e!=6)
+        return 0;
 
-//	if(vf->priv->luma.radius < 0) return 0;
-//	if(vf->priv->chroma.radius < 0) return 0;
+//    if(vf->priv->luma.radius < 0) return 0;
+//    if(vf->priv->chroma.radius < 0) return 0;
 
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_sab = {
--- a/libmpcodecs/vf_smartblur.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_smartblur.c	Fri Jan 14 22:10:21 2011 +0000
@@ -35,16 +35,16 @@
 //===========================================================================//
 
 typedef struct FilterParam{
-	float radius;
-	float strength;
-	int threshold;
-	float quality;
-	struct SwsContext *filterContext;
+    float radius;
+    float strength;
+    int threshold;
+    float quality;
+    struct SwsContext *filterContext;
 }FilterParam;
 
 struct vf_priv_s {
-	FilterParam luma;
-	FilterParam chroma;
+    FilterParam luma;
+    FilterParam chroma;
 };
 
 
@@ -52,202 +52,202 @@
 
 //FIXME stupid code duplication
 static void getSubSampleFactors(int *h, int *v, int format){
-	switch(format){
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-		*h=1;
-		*v=1;
-		break;
-	case IMGFMT_YVU9:
-		*h=2;
-		*v=2;
-		break;
-	case IMGFMT_444P:
-		*h=0;
-		*v=0;
-		break;
-	case IMGFMT_422P:
-		*h=1;
-		*v=0;
-		break;
-	case IMGFMT_411P:
-		*h=2;
-		*v=0;
-		break;
-	}
+    switch(format){
+    case IMGFMT_YV12:
+    case IMGFMT_I420:
+        *h=1;
+        *v=1;
+        break;
+    case IMGFMT_YVU9:
+        *h=2;
+        *v=2;
+        break;
+    case IMGFMT_444P:
+        *h=0;
+        *v=0;
+        break;
+    case IMGFMT_422P:
+        *h=1;
+        *v=0;
+        break;
+    case IMGFMT_411P:
+        *h=2;
+        *v=0;
+        break;
+    }
 }
 
 static int allocStuff(FilterParam *f, int width, int height){
-	SwsVector *vec;
-	SwsFilter swsF;
+    SwsVector *vec;
+    SwsFilter swsF;
 
-	vec = sws_getGaussianVec(f->radius, f->quality);
-	sws_scaleVec(vec, f->strength);
-	vec->coeff[vec->length/2]+= 1.0 - f->strength;
-	swsF.lumH= swsF.lumV= vec;
-	swsF.chrH= swsF.chrV= NULL;
-	f->filterContext= sws_getContext(
-		width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC | get_sws_cpuflags(), &swsF, NULL, NULL);
+    vec = sws_getGaussianVec(f->radius, f->quality);
+    sws_scaleVec(vec, f->strength);
+    vec->coeff[vec->length/2]+= 1.0 - f->strength;
+    swsF.lumH= swsF.lumV= vec;
+    swsF.chrH= swsF.chrV= NULL;
+    f->filterContext= sws_getContext(
+        width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC | get_sws_cpuflags(), &swsF, NULL, NULL);
 
-	sws_freeVec(vec);
+    sws_freeVec(vec);
 
-	return 0;
+    return 0;
 }
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt){
 
-	int sw, sh;
+    int sw, sh;
 
-	allocStuff(&vf->priv->luma, width, height);
+    allocStuff(&vf->priv->luma, width, height);
 
-	getSubSampleFactors(&sw, &sh, outfmt);
-	allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
+    getSubSampleFactors(&sw, &sh, outfmt);
+    allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void freeBuffers(FilterParam *f){
-	if(f->filterContext) sws_freeContext(f->filterContext);
-	f->filterContext=NULL;
+    if(f->filterContext) sws_freeContext(f->filterContext);
+    f->filterContext=NULL;
 }
 
 static void uninit(struct vf_instance *vf){
-	if(!vf->priv) return;
+    if(!vf->priv) return;
 
-	freeBuffers(&vf->priv->luma);
-	freeBuffers(&vf->priv->chroma);
+    freeBuffers(&vf->priv->luma);
+    freeBuffers(&vf->priv->chroma);
 
-	free(vf->priv);
-	vf->priv=NULL;
+    free(vf->priv);
+    vf->priv=NULL;
 }
 
 static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, FilterParam *fp){
-	int x, y;
-	FilterParam f= *fp;
-	const uint8_t* const srcArray[MP_MAX_PLANES] = {src};
-	uint8_t *dstArray[MP_MAX_PLANES]= {dst};
-	int srcStrideArray[MP_MAX_PLANES]= {srcStride};
-	int dstStrideArray[MP_MAX_PLANES]= {dstStride};
+    int x, y;
+    FilterParam f= *fp;
+    const uint8_t* const srcArray[MP_MAX_PLANES] = {src};
+    uint8_t *dstArray[MP_MAX_PLANES]= {dst};
+    int srcStrideArray[MP_MAX_PLANES]= {srcStride};
+    int dstStrideArray[MP_MAX_PLANES]= {dstStride};
 
-	sws_scale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
+    sws_scale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
 
-	if(f.threshold > 0){
-		for(y=0; y<h; y++){
-			for(x=0; x<w; x++){
-				const int orig= src[x + y*srcStride];
-				const int filtered= dst[x + y*dstStride];
-				const int diff= orig - filtered;
+    if(f.threshold > 0){
+        for(y=0; y<h; y++){
+            for(x=0; x<w; x++){
+                const int orig= src[x + y*srcStride];
+                const int filtered= dst[x + y*dstStride];
+                const int diff= orig - filtered;
 
-				if(diff > 0){
-					if(diff > 2*f.threshold){
-						dst[x + y*dstStride]= orig;
-					}else if(diff > f.threshold){
-						dst[x + y*dstStride]= filtered + diff - f.threshold;
-					}
-				}else{
-					if(-diff > 2*f.threshold){
-						dst[x + y*dstStride]= orig;
-					}else if(-diff > f.threshold){
-						dst[x + y*dstStride]= filtered + diff + f.threshold;
-					}
-				}
-			}
-		}
-	}else if(f.threshold < 0){
-		for(y=0; y<h; y++){
-			for(x=0; x<w; x++){
-				const int orig= src[x + y*srcStride];
-				const int filtered= dst[x + y*dstStride];
-				const int diff= orig - filtered;
+                if(diff > 0){
+                    if(diff > 2*f.threshold){
+                        dst[x + y*dstStride]= orig;
+                    }else if(diff > f.threshold){
+                        dst[x + y*dstStride]= filtered + diff - f.threshold;
+                    }
+                }else{
+                    if(-diff > 2*f.threshold){
+                        dst[x + y*dstStride]= orig;
+                    }else if(-diff > f.threshold){
+                        dst[x + y*dstStride]= filtered + diff + f.threshold;
+                    }
+                }
+            }
+        }
+    }else if(f.threshold < 0){
+        for(y=0; y<h; y++){
+            for(x=0; x<w; x++){
+                const int orig= src[x + y*srcStride];
+                const int filtered= dst[x + y*dstStride];
+                const int diff= orig - filtered;
 
-				if(diff > 0){
-					if(diff > -2*f.threshold){
-					}else if(diff > -f.threshold){
-						dst[x + y*dstStride]= orig - diff - f.threshold;
-					}else
-						dst[x + y*dstStride]= orig;
-				}else{
-					if(diff < 2*f.threshold){
-					}else if(diff < f.threshold){
-						dst[x + y*dstStride]= orig - diff + f.threshold;
-					}else
-						dst[x + y*dstStride]= orig;
-				}
-			}
-		}
-	}
+                if(diff > 0){
+                    if(diff > -2*f.threshold){
+                    }else if(diff > -f.threshold){
+                        dst[x + y*dstStride]= orig - diff - f.threshold;
+                    }else
+                        dst[x + y*dstStride]= orig;
+                }else{
+                    if(diff < 2*f.threshold){
+                    }else if(diff < f.threshold){
+                        dst[x + y*dstStride]= orig - diff + f.threshold;
+                    }else
+                        dst[x + y*dstStride]= orig;
+                }
+            }
+        }
+    }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	int cw= mpi->w >> mpi->chroma_x_shift;
-	int ch= mpi->h >> mpi->chroma_y_shift;
-	FilterParam *f= &vf->priv;
+    int cw= mpi->w >> mpi->chroma_x_shift;
+    int ch= mpi->h >> mpi->chroma_y_shift;
+    FilterParam *f= &vf->priv;
 
-	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
-		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
-		(f->threshold) ? MP_IMGFLAG_READABLE : 0,
-		mpi->w,mpi->h);
+    mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
+        (f->threshold) ? MP_IMGFLAG_READABLE : 0,
+        mpi->w,mpi->h);
 
-	assert(mpi->flags&MP_IMGFLAG_PLANAR);
+    assert(mpi->flags&MP_IMGFLAG_PLANAR);
 
-	blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
-	blur(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
-	blur(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
+    blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
+    blur(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
+    blur(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
 
-	return vf_next_put_image(vf,dmpi, pts);
+    return vf_next_put_image(vf,dmpi, pts);
 }
 
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
-	switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    switch(fmt)
+    {
+    case IMGFMT_YV12:
+    case IMGFMT_I420:
+    case IMGFMT_IYUV:
+    case IMGFMT_YVU9:
+    case IMGFMT_444P:
+    case IMGFMT_422P:
+    case IMGFMT_411P:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
-	int e;
+    int e;
 
-	vf->config=config;
-	vf->put_image=put_image;
-//	vf->get_image=get_image;
-	vf->query_format=query_format;
-	vf->uninit=uninit;
-	vf->priv=malloc(sizeof(struct vf_priv_s));
-	memset(vf->priv, 0, sizeof(struct vf_priv_s));
+    vf->config=config;
+    vf->put_image=put_image;
+//    vf->get_image=get_image;
+    vf->query_format=query_format;
+    vf->uninit=uninit;
+    vf->priv=malloc(sizeof(struct vf_priv_s));
+    memset(vf->priv, 0, sizeof(struct vf_priv_s));
 
-	if(args==NULL) return 0;
+    if(args==NULL) return 0;
 
-	e=sscanf(args, "%f:%f:%d:%f:%f:%d",
-		&vf->priv->luma.radius,
-		&vf->priv->luma.strength,
-		&vf->priv->luma.threshold,
-		&vf->priv->chroma.radius,
-		&vf->priv->chroma.strength,
-		&vf->priv->chroma.threshold
-		);
+    e=sscanf(args, "%f:%f:%d:%f:%f:%d",
+        &vf->priv->luma.radius,
+        &vf->priv->luma.strength,
+        &vf->priv->luma.threshold,
+        &vf->priv->chroma.radius,
+        &vf->priv->chroma.strength,
+        &vf->priv->chroma.threshold
+        );
 
-	vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
+    vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
 
-	if(e==3){
-		vf->priv->chroma.radius= vf->priv->luma.radius;
-		vf->priv->chroma.strength= vf->priv->luma.strength;
-		vf->priv->chroma.threshold = vf->priv->luma.threshold;
-	}else if(e!=6)
-		return 0;
+    if(e==3){
+        vf->priv->chroma.radius= vf->priv->luma.radius;
+        vf->priv->chroma.strength= vf->priv->luma.strength;
+        vf->priv->chroma.threshold = vf->priv->luma.threshold;
+    }else if(e!=6)
+        return 0;
 
-	return 1;
+    return 1;
 }
 
 const vf_info_t vf_info_smartblur = {
--- a/libmpcodecs/vf_softpulldown.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_softpulldown.c	Fri Jan 14 22:10:21 2011 +0000
@@ -30,128 +30,128 @@
 #include "libvo/fastmemcpy.h"
 
 struct vf_priv_s {
-	int state;
-	long long in;
-	long long out;
+    int state;
+    long long in;
+    long long out;
 };
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
-	int ret = 0;
-	int flags = mpi->fields;
-	int state = vf->priv->state;
+    mp_image_t *dmpi;
+    int ret = 0;
+    int flags = mpi->fields;
+    int state = vf->priv->state;
 
-	dmpi = vf_get_image(vf->next, mpi->imgfmt,
-	                    MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-	                    MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
+    dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                        MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+                        MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
 
-	vf->priv->in++;
+    vf->priv->in++;
 
-	if ((state == 0 &&
-	     !(flags & MP_IMGFIELD_TOP_FIRST)) ||
-	    (state == 1 &&
-	     flags & MP_IMGFIELD_TOP_FIRST)) {
-		mp_msg(MSGT_VFILTER, MSGL_WARN,
-		       "softpulldown: Unexpected field flags: state=%d top_field_first=%d repeat_first_field=%d\n",
-		       state,
-		       (flags & MP_IMGFIELD_TOP_FIRST) != 0,
-		       (flags & MP_IMGFIELD_REPEAT_FIRST) != 0);
-		state ^= 1;
-	}
+    if ((state == 0 &&
+         !(flags & MP_IMGFIELD_TOP_FIRST)) ||
+        (state == 1 &&
+         flags & MP_IMGFIELD_TOP_FIRST)) {
+        mp_msg(MSGT_VFILTER, MSGL_WARN,
+               "softpulldown: Unexpected field flags: state=%d top_field_first=%d repeat_first_field=%d\n",
+               state,
+               (flags & MP_IMGFIELD_TOP_FIRST) != 0,
+               (flags & MP_IMGFIELD_REPEAT_FIRST) != 0);
+        state ^= 1;
+    }
 
-	if (state == 0) {
-		ret = vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
-		vf->priv->out++;
-		if (flags & MP_IMGFIELD_REPEAT_FIRST) {
-			my_memcpy_pic(dmpi->planes[0],
-			           mpi->planes[0], mpi->w, mpi->h/2,
-			           dmpi->stride[0]*2, mpi->stride[0]*2);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				my_memcpy_pic(dmpi->planes[1],
-				              mpi->planes[1],
-				              mpi->chroma_width,
-				              mpi->chroma_height/2,
-				              dmpi->stride[1]*2,
-				              mpi->stride[1]*2);
-				my_memcpy_pic(dmpi->planes[2],
-				              mpi->planes[2],
-				              mpi->chroma_width,
-				              mpi->chroma_height/2,
-				              dmpi->stride[2]*2,
-				              mpi->stride[2]*2);
-			}
-			state=1;
-		}
-	} else {
-		my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
-		              mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
-		              dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
-			              mpi->planes[1]+mpi->stride[1],
-			              mpi->chroma_width, mpi->chroma_height/2,
-			              dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
-			              mpi->planes[2]+mpi->stride[2],
-			              mpi->chroma_width, mpi->chroma_height/2,
-			              dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-		vf->priv->out++;
-		if (flags & MP_IMGFIELD_REPEAT_FIRST) {
-			ret |= vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
-			vf->priv->out++;
-			state=0;
-		} else {
-			my_memcpy_pic(dmpi->planes[0],
-			              mpi->planes[0], mpi->w, mpi->h/2,
-			              dmpi->stride[0]*2, mpi->stride[0]*2);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				my_memcpy_pic(dmpi->planes[1],
-				              mpi->planes[1],
-				              mpi->chroma_width,
-				              mpi->chroma_height/2,
-				              dmpi->stride[1]*2,
-				              mpi->stride[1]*2);
-				my_memcpy_pic(dmpi->planes[2],
-				              mpi->planes[2],
-				              mpi->chroma_width,
-				              mpi->chroma_height/2,
-				              dmpi->stride[2]*2,
-				              mpi->stride[2]*2);
-			}
-		}
-	}
+    if (state == 0) {
+        ret = vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
+        vf->priv->out++;
+        if (flags & MP_IMGFIELD_REPEAT_FIRST) {
+            my_memcpy_pic(dmpi->planes[0],
+                       mpi->planes[0], mpi->w, mpi->h/2,
+                       dmpi->stride[0]*2, mpi->stride[0]*2);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                my_memcpy_pic(dmpi->planes[1],
+                              mpi->planes[1],
+                              mpi->chroma_width,
+                              mpi->chroma_height/2,
+                              dmpi->stride[1]*2,
+                              mpi->stride[1]*2);
+                my_memcpy_pic(dmpi->planes[2],
+                              mpi->planes[2],
+                              mpi->chroma_width,
+                              mpi->chroma_height/2,
+                              dmpi->stride[2]*2,
+                              mpi->stride[2]*2);
+            }
+            state=1;
+        }
+    } else {
+        my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
+                      mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
+                      dmpi->stride[0]*2, mpi->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
+                          mpi->planes[1]+mpi->stride[1],
+                          mpi->chroma_width, mpi->chroma_height/2,
+                          dmpi->stride[1]*2, mpi->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
+                          mpi->planes[2]+mpi->stride[2],
+                          mpi->chroma_width, mpi->chroma_height/2,
+                          dmpi->stride[2]*2, mpi->stride[2]*2);
+        }
+        ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+        vf->priv->out++;
+        if (flags & MP_IMGFIELD_REPEAT_FIRST) {
+            ret |= vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
+            vf->priv->out++;
+            state=0;
+        } else {
+            my_memcpy_pic(dmpi->planes[0],
+                          mpi->planes[0], mpi->w, mpi->h/2,
+                          dmpi->stride[0]*2, mpi->stride[0]*2);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                my_memcpy_pic(dmpi->planes[1],
+                              mpi->planes[1],
+                              mpi->chroma_width,
+                              mpi->chroma_height/2,
+                              dmpi->stride[1]*2,
+                              mpi->stride[1]*2);
+                my_memcpy_pic(dmpi->planes[2],
+                              mpi->planes[2],
+                              mpi->chroma_width,
+                              mpi->chroma_height/2,
+                              dmpi->stride[2]*2,
+                              mpi->stride[2]*2);
+            }
+        }
+    }
 
-	vf->priv->state = state;
+    vf->priv->state = state;
 
-	return ret;
+    return ret;
 }
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt)
 {
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	mp_msg(MSGT_VFILTER, MSGL_INFO, "softpulldown: %lld frames in, %lld frames out\n", vf->priv->in, vf->priv->out);
-	free(vf->priv);
+    mp_msg(MSGT_VFILTER, MSGL_INFO, "softpulldown: %lld frames in, %lld frames out\n", vf->priv->in, vf->priv->out);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
-	vf->config = config;
-	vf->put_image = put_image;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
-	vf->priv->state = 0;
-	return 1;
+    struct vf_priv_s *p;
+    vf->config = config;
+    vf->put_image = put_image;
+    vf->uninit = uninit;
+    vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+    vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+    vf->priv->state = 0;
+    return 1;
 }
 
 const vf_info_t vf_info_softpulldown = {
--- a/libmpcodecs/vf_softskip.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_softskip.c	Fri Jan 14 22:10:21 2011 +0000
@@ -28,68 +28,68 @@
 #include "vf.h"
 
 struct vf_priv_s {
-	int skipflag;
+    int skipflag;
 };
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
+    mp_image_t *dmpi;
 
-	if (vf->priv->skipflag)
-		return vf->priv->skipflag = 0;
+    if (vf->priv->skipflag)
+        return vf->priv->skipflag = 0;
 
-	dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);
-	vf_clone_mpi_attributes(dmpi, mpi);
+    dmpi = vf_get_image(vf->next, mpi->imgfmt,
+        MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);
+    vf_clone_mpi_attributes(dmpi, mpi);
 
-	dmpi->planes[0] = mpi->planes[0];
-	dmpi->stride[0] = mpi->stride[0];
-	if (dmpi->flags&MP_IMGFLAG_PLANAR) {
-		dmpi->planes[1] = mpi->planes[1];
-		dmpi->stride[1] = mpi->stride[1];
-		dmpi->planes[2] = mpi->planes[2];
-		dmpi->stride[2] = mpi->stride[2];
-	}
+    dmpi->planes[0] = mpi->planes[0];
+    dmpi->stride[0] = mpi->stride[0];
+    if (dmpi->flags&MP_IMGFLAG_PLANAR) {
+        dmpi->planes[1] = mpi->planes[1];
+        dmpi->stride[1] = mpi->stride[1];
+        dmpi->planes[2] = mpi->planes[2];
+        dmpi->stride[2] = mpi->stride[2];
+    }
 
-	return vf_next_put_image(vf, dmpi, pts);
+    return vf_next_put_image(vf, dmpi, pts);
 }
 
 static int control(struct vf_instance *vf, int request, void* data)
 {
-	switch (request) {
-	case VFCTRL_SKIP_NEXT_FRAME:
-		vf->priv->skipflag = 1;
-		return CONTROL_TRUE;
-	}
-	return vf_next_control(vf, request, data);
+    switch (request) {
+    case VFCTRL_SKIP_NEXT_FRAME:
+        vf->priv->skipflag = 1;
+        return CONTROL_TRUE;
+    }
+    return vf_next_control(vf, request, data);
 }
 
 #if 0
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - figure out which other formats work */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    /* FIXME - figure out which other formats work */
+    switch (fmt) {
+    case IMGFMT_YV12:
+    case IMGFMT_IYUV:
+    case IMGFMT_I420:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 #endif
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	vf->put_image = put_image;
-	vf->control = control;
-	vf->uninit = uninit;
-	vf->priv = calloc(1, sizeof(struct vf_priv_s));
-	return 1;
+    vf->put_image = put_image;
+    vf->control = control;
+    vf->uninit = uninit;
+    vf->priv = calloc(1, sizeof(struct vf_priv_s));
+    return 1;
 }
 
 const vf_info_t vf_info_softskip = {
--- a/libmpcodecs/vf_spp.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_spp.c	Fri Jan 14 22:10:21 2011 +0000
@@ -91,282 +91,282 @@
 };
 
 struct vf_priv_s {
-	int log2_count;
-	int qp;
-	int mode;
-	int mpeg2;
-	int temp_stride;
-	uint8_t *src;
-	int16_t *temp;
-	AVCodecContext *avctx;
-	DSPContext dsp;
+        int log2_count;
+        int qp;
+        int mode;
+        int mpeg2;
+        int temp_stride;
+        uint8_t *src;
+        int16_t *temp;
+        AVCodecContext *avctx;
+        DSPContext dsp;
         char *non_b_qp;
 };
 
 #define SHIFT 22
 
 static void hardthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){
-	int i;
-	int bias= 0; //FIXME
-	unsigned int threshold1, threshold2;
+        int i;
+        int bias= 0; //FIXME
+        unsigned int threshold1, threshold2;
 
-	threshold1= qp*((1<<4) - bias) - 1;
-	threshold2= (threshold1<<1);
+        threshold1= qp*((1<<4) - bias) - 1;
+        threshold2= (threshold1<<1);
 
-	memset(dst, 0, 64*sizeof(DCTELEM));
-	dst[0]= (src[0] + 4)>>3;
+        memset(dst, 0, 64*sizeof(DCTELEM));
+        dst[0]= (src[0] + 4)>>3;
 
         for(i=1; i<64; i++){
-		int level= src[i];
-		if(((unsigned)(level+threshold1))>threshold2){
-			const int j= permutation[i];
-			dst[j]= (level + 4)>>3;
-		}
-	}
+                int level= src[i];
+                if(((unsigned)(level+threshold1))>threshold2){
+                        const int j= permutation[i];
+                        dst[j]= (level + 4)>>3;
+                }
+        }
 }
 
 static void softthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){
-	int i;
-	int bias= 0; //FIXME
-	unsigned int threshold1, threshold2;
+        int i;
+        int bias= 0; //FIXME
+        unsigned int threshold1, threshold2;
 
-	threshold1= qp*((1<<4) - bias) - 1;
-	threshold2= (threshold1<<1);
+        threshold1= qp*((1<<4) - bias) - 1;
+        threshold2= (threshold1<<1);
 
-	memset(dst, 0, 64*sizeof(DCTELEM));
-	dst[0]= (src[0] + 4)>>3;
+        memset(dst, 0, 64*sizeof(DCTELEM));
+        dst[0]= (src[0] + 4)>>3;
 
         for(i=1; i<64; i++){
-		int level= src[i];
-		if(((unsigned)(level+threshold1))>threshold2){
-			const int j= permutation[i];
-			if(level>0)
-				dst[j]= (level - threshold1 + 4)>>3;
-			else
-				dst[j]= (level + threshold1 + 4)>>3;
-		}
-	}
+                int level= src[i];
+                if(((unsigned)(level+threshold1))>threshold2){
+                        const int j= permutation[i];
+                        if(level>0)
+                                dst[j]= (level - threshold1 + 4)>>3;
+                        else
+                                dst[j]= (level + threshold1 + 4)>>3;
+                }
+        }
 }
 
 #if HAVE_MMX
 static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){
-	int bias= 0; //FIXME
-	unsigned int threshold1;
+        int bias= 0; //FIXME
+        unsigned int threshold1;
 
-	threshold1= qp*((1<<4) - bias) - 1;
+        threshold1= qp*((1<<4) - bias) - 1;
 
         __asm__ volatile(
 #define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
-		"movq " #src0 ", %%mm0	\n\t"\
-		"movq " #src1 ", %%mm1	\n\t"\
-		"movq " #src2 ", %%mm2	\n\t"\
-		"movq " #src3 ", %%mm3	\n\t"\
-		"psubw %%mm4, %%mm0	\n\t"\
-		"psubw %%mm4, %%mm1	\n\t"\
-		"psubw %%mm4, %%mm2	\n\t"\
-		"psubw %%mm4, %%mm3	\n\t"\
-		"paddusw %%mm5, %%mm0	\n\t"\
-		"paddusw %%mm5, %%mm1	\n\t"\
-		"paddusw %%mm5, %%mm2	\n\t"\
-		"paddusw %%mm5, %%mm3	\n\t"\
-		"paddw %%mm6, %%mm0	\n\t"\
-		"paddw %%mm6, %%mm1	\n\t"\
-		"paddw %%mm6, %%mm2	\n\t"\
-		"paddw %%mm6, %%mm3	\n\t"\
-		"psubusw %%mm6, %%mm0	\n\t"\
-		"psubusw %%mm6, %%mm1	\n\t"\
-		"psubusw %%mm6, %%mm2	\n\t"\
-		"psubusw %%mm6, %%mm3	\n\t"\
-		"psraw $3, %%mm0	\n\t"\
-		"psraw $3, %%mm1	\n\t"\
-		"psraw $3, %%mm2	\n\t"\
-		"psraw $3, %%mm3	\n\t"\
+                "movq " #src0 ", %%mm0        \n\t"\
+                "movq " #src1 ", %%mm1        \n\t"\
+                "movq " #src2 ", %%mm2        \n\t"\
+                "movq " #src3 ", %%mm3        \n\t"\
+                "psubw %%mm4, %%mm0        \n\t"\
+                "psubw %%mm4, %%mm1        \n\t"\
+                "psubw %%mm4, %%mm2        \n\t"\
+                "psubw %%mm4, %%mm3        \n\t"\
+                "paddusw %%mm5, %%mm0        \n\t"\
+                "paddusw %%mm5, %%mm1        \n\t"\
+                "paddusw %%mm5, %%mm2        \n\t"\
+                "paddusw %%mm5, %%mm3        \n\t"\
+                "paddw %%mm6, %%mm0        \n\t"\
+                "paddw %%mm6, %%mm1        \n\t"\
+                "paddw %%mm6, %%mm2        \n\t"\
+                "paddw %%mm6, %%mm3        \n\t"\
+                "psubusw %%mm6, %%mm0        \n\t"\
+                "psubusw %%mm6, %%mm1        \n\t"\
+                "psubusw %%mm6, %%mm2        \n\t"\
+                "psubusw %%mm6, %%mm3        \n\t"\
+                "psraw $3, %%mm0        \n\t"\
+                "psraw $3, %%mm1        \n\t"\
+                "psraw $3, %%mm2        \n\t"\
+                "psraw $3, %%mm3        \n\t"\
 \
-		"movq %%mm0, %%mm7	\n\t"\
-		"punpcklwd %%mm2, %%mm0	\n\t" /*A*/\
-		"punpckhwd %%mm2, %%mm7	\n\t" /*C*/\
-		"movq %%mm1, %%mm2	\n\t"\
-		"punpcklwd %%mm3, %%mm1	\n\t" /*B*/\
-		"punpckhwd %%mm3, %%mm2	\n\t" /*D*/\
-		"movq %%mm0, %%mm3	\n\t"\
-		"punpcklwd %%mm1, %%mm0	\n\t" /*A*/\
-		"punpckhwd %%mm7, %%mm3	\n\t" /*C*/\
-		"punpcklwd %%mm2, %%mm7	\n\t" /*B*/\
-		"punpckhwd %%mm2, %%mm1	\n\t" /*D*/\
+                "movq %%mm0, %%mm7        \n\t"\
+                "punpcklwd %%mm2, %%mm0        \n\t" /*A*/\
+                "punpckhwd %%mm2, %%mm7        \n\t" /*C*/\
+                "movq %%mm1, %%mm2        \n\t"\
+                "punpcklwd %%mm3, %%mm1        \n\t" /*B*/\
+                "punpckhwd %%mm3, %%mm2        \n\t" /*D*/\
+                "movq %%mm0, %%mm3        \n\t"\
+                "punpcklwd %%mm1, %%mm0        \n\t" /*A*/\
+                "punpckhwd %%mm7, %%mm3        \n\t" /*C*/\
+                "punpcklwd %%mm2, %%mm7        \n\t" /*B*/\
+                "punpckhwd %%mm2, %%mm1        \n\t" /*D*/\
 \
-		"movq %%mm0, " #dst0 "	\n\t"\
-		"movq %%mm7, " #dst1 "	\n\t"\
-		"movq %%mm3, " #dst2 "	\n\t"\
-		"movq %%mm1, " #dst3 "	\n\t"
+                "movq %%mm0, " #dst0 "        \n\t"\
+                "movq %%mm7, " #dst1 "        \n\t"\
+                "movq %%mm3, " #dst2 "        \n\t"\
+                "movq %%mm1, " #dst3 "        \n\t"
 
-		"movd %2, %%mm4		\n\t"
-		"movd %3, %%mm5		\n\t"
-		"movd %4, %%mm6		\n\t"
-		"packssdw %%mm4, %%mm4	\n\t"
-		"packssdw %%mm5, %%mm5	\n\t"
-		"packssdw %%mm6, %%mm6	\n\t"
-		"packssdw %%mm4, %%mm4	\n\t"
-		"packssdw %%mm5, %%mm5	\n\t"
-		"packssdw %%mm6, %%mm6	\n\t"
-		REQUANT_CORE(  (%1),  8(%1), 16(%1), 24(%1),  (%0), 8(%0), 64(%0), 72(%0))
-		REQUANT_CORE(32(%1), 40(%1), 48(%1), 56(%1),16(%0),24(%0), 48(%0), 56(%0))
-		REQUANT_CORE(64(%1), 72(%1), 80(%1), 88(%1),32(%0),40(%0), 96(%0),104(%0))
-		REQUANT_CORE(96(%1),104(%1),112(%1),120(%1),80(%0),88(%0),112(%0),120(%0))
-		: : "r" (src), "r" (dst), "g" (threshold1+1), "g" (threshold1+5), "g" (threshold1-4) //FIXME maybe more accurate then needed?
-	);
-	dst[0]= (src[0] + 4)>>3;
+                "movd %2, %%mm4                \n\t"
+                "movd %3, %%mm5                \n\t"
+                "movd %4, %%mm6                \n\t"
+                "packssdw %%mm4, %%mm4        \n\t"
+                "packssdw %%mm5, %%mm5        \n\t"
+                "packssdw %%mm6, %%mm6        \n\t"
+                "packssdw %%mm4, %%mm4        \n\t"
+                "packssdw %%mm5, %%mm5        \n\t"
+                "packssdw %%mm6, %%mm6        \n\t"
+                REQUANT_CORE(  (%1),  8(%1), 16(%1), 24(%1),  (%0), 8(%0), 64(%0), 72(%0))
+                REQUANT_CORE(32(%1), 40(%1), 48(%1), 56(%1),16(%0),24(%0), 48(%0), 56(%0))
+                REQUANT_CORE(64(%1), 72(%1), 80(%1), 88(%1),32(%0),40(%0), 96(%0),104(%0))
+                REQUANT_CORE(96(%1),104(%1),112(%1),120(%1),80(%0),88(%0),112(%0),120(%0))
+                : : "r" (src), "r" (dst), "g" (threshold1+1), "g" (threshold1+5), "g" (threshold1-4) //FIXME maybe more accurate then needed?
+        );
+        dst[0]= (src[0] + 4)>>3;
 }
 
 static void softthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){
-	int bias= 0; //FIXME
-	unsigned int threshold1;
+        int bias= 0; //FIXME
+        unsigned int threshold1;
 
-	threshold1= qp*((1<<4) - bias) - 1;
+        threshold1= qp*((1<<4) - bias) - 1;
 
         __asm__ volatile(
 #undef REQUANT_CORE
 #define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
-		"movq " #src0 ", %%mm0	\n\t"\
-		"movq " #src1 ", %%mm1	\n\t"\
-		"pxor %%mm6, %%mm6	\n\t"\
-		"pxor %%mm7, %%mm7	\n\t"\
-		"pcmpgtw %%mm0, %%mm6	\n\t"\
-		"pcmpgtw %%mm1, %%mm7	\n\t"\
-		"pxor %%mm6, %%mm0	\n\t"\
-		"pxor %%mm7, %%mm1	\n\t"\
-		"psubusw %%mm4, %%mm0	\n\t"\
-		"psubusw %%mm4, %%mm1	\n\t"\
-		"pxor %%mm6, %%mm0	\n\t"\
-		"pxor %%mm7, %%mm1	\n\t"\
-		"movq " #src2 ", %%mm2	\n\t"\
-		"movq " #src3 ", %%mm3	\n\t"\
-		"pxor %%mm6, %%mm6	\n\t"\
-		"pxor %%mm7, %%mm7	\n\t"\
-		"pcmpgtw %%mm2, %%mm6	\n\t"\
-		"pcmpgtw %%mm3, %%mm7	\n\t"\
-		"pxor %%mm6, %%mm2	\n\t"\
-		"pxor %%mm7, %%mm3	\n\t"\
-		"psubusw %%mm4, %%mm2	\n\t"\
-		"psubusw %%mm4, %%mm3	\n\t"\
-		"pxor %%mm6, %%mm2	\n\t"\
-		"pxor %%mm7, %%mm3	\n\t"\
+                "movq " #src0 ", %%mm0        \n\t"\
+                "movq " #src1 ", %%mm1        \n\t"\
+                "pxor %%mm6, %%mm6        \n\t"\
+                "pxor %%mm7, %%mm7        \n\t"\
+                "pcmpgtw %%mm0, %%mm6        \n\t"\
+                "pcmpgtw %%mm1, %%mm7        \n\t"\
+                "pxor %%mm6, %%mm0        \n\t"\
+                "pxor %%mm7, %%mm1        \n\t"\
+                "psubusw %%mm4, %%mm0        \n\t"\
+                "psubusw %%mm4, %%mm1        \n\t"\
+                "pxor %%mm6, %%mm0        \n\t"\
+                "pxor %%mm7, %%mm1        \n\t"\
+                "movq " #src2 ", %%mm2        \n\t"\
+                "movq " #src3 ", %%mm3        \n\t"\
+                "pxor %%mm6, %%mm6        \n\t"\
+                "pxor %%mm7, %%mm7        \n\t"\
+                "pcmpgtw %%mm2, %%mm6        \n\t"\
+                "pcmpgtw %%mm3, %%mm7        \n\t"\
+                "pxor %%mm6, %%mm2        \n\t"\
+                "pxor %%mm7, %%mm3        \n\t"\
+                "psubusw %%mm4, %%mm2        \n\t"\
+                "psubusw %%mm4, %%mm3        \n\t"\
+                "pxor %%mm6, %%mm2        \n\t"\
+                "pxor %%mm7, %%mm3        \n\t"\
 \
-		"paddsw %%mm5, %%mm0	\n\t"\
-		"paddsw %%mm5, %%mm1	\n\t"\
-		"paddsw %%mm5, %%mm2	\n\t"\
-		"paddsw %%mm5, %%mm3	\n\t"\
-		"psraw $3, %%mm0	\n\t"\
-		"psraw $3, %%mm1	\n\t"\
-		"psraw $3, %%mm2	\n\t"\
-		"psraw $3, %%mm3	\n\t"\
+                "paddsw %%mm5, %%mm0        \n\t"\
+                "paddsw %%mm5, %%mm1        \n\t"\
+                "paddsw %%mm5, %%mm2        \n\t"\
+                "paddsw %%mm5, %%mm3        \n\t"\
+                "psraw $3, %%mm0        \n\t"\
+                "psraw $3, %%mm1        \n\t"\
+                "psraw $3, %%mm2        \n\t"\
+                "psraw $3, %%mm3        \n\t"\
 \
-		"movq %%mm0, %%mm7	\n\t"\
-		"punpcklwd %%mm2, %%mm0	\n\t" /*A*/\
-		"punpckhwd %%mm2, %%mm7	\n\t" /*C*/\
-		"movq %%mm1, %%mm2	\n\t"\
-		"punpcklwd %%mm3, %%mm1	\n\t" /*B*/\
-		"punpckhwd %%mm3, %%mm2	\n\t" /*D*/\
-		"movq %%mm0, %%mm3	\n\t"\
-		"punpcklwd %%mm1, %%mm0	\n\t" /*A*/\
-		"punpckhwd %%mm7, %%mm3	\n\t" /*C*/\
-		"punpcklwd %%mm2, %%mm7	\n\t" /*B*/\
-		"punpckhwd %%mm2, %%mm1	\n\t" /*D*/\
+                "movq %%mm0, %%mm7        \n\t"\
+                "punpcklwd %%mm2, %%mm0        \n\t" /*A*/\
+                "punpckhwd %%mm2, %%mm7        \n\t" /*C*/\
+                "movq %%mm1, %%mm2        \n\t"\
+                "punpcklwd %%mm3, %%mm1        \n\t" /*B*/\
+                "punpckhwd %%mm3, %%mm2        \n\t" /*D*/\
+                "movq %%mm0, %%mm3        \n\t"\
+                "punpcklwd %%mm1, %%mm0        \n\t" /*A*/\
+                "punpckhwd %%mm7, %%mm3        \n\t" /*C*/\
+                "punpcklwd %%mm2, %%mm7        \n\t" /*B*/\
+                "punpckhwd %%mm2, %%mm1        \n\t" /*D*/\
 \
-		"movq %%mm0, " #dst0 "	\n\t"\
-		"movq %%mm7, " #dst1 "	\n\t"\
-		"movq %%mm3, " #dst2 "	\n\t"\
-		"movq %%mm1, " #dst3 "	\n\t"
+                "movq %%mm0, " #dst0 "        \n\t"\
+                "movq %%mm7, " #dst1 "        \n\t"\
+                "movq %%mm3, " #dst2 "        \n\t"\
+                "movq %%mm1, " #dst3 "        \n\t"
 
-		"movd %2, %%mm4		\n\t"
-		"movd %3, %%mm5		\n\t"
-		"packssdw %%mm4, %%mm4	\n\t"
-		"packssdw %%mm5, %%mm5	\n\t"
-		"packssdw %%mm4, %%mm4	\n\t"
-		"packssdw %%mm5, %%mm5	\n\t"
-		REQUANT_CORE(  (%1),  8(%1), 16(%1), 24(%1),  (%0), 8(%0), 64(%0), 72(%0))
-		REQUANT_CORE(32(%1), 40(%1), 48(%1), 56(%1),16(%0),24(%0), 48(%0), 56(%0))
-		REQUANT_CORE(64(%1), 72(%1), 80(%1), 88(%1),32(%0),40(%0), 96(%0),104(%0))
-		REQUANT_CORE(96(%1),104(%1),112(%1),120(%1),80(%0),88(%0),112(%0),120(%0))
-		: : "r" (src), "r" (dst), "g" (threshold1), "rm" (4) //FIXME maybe more accurate then needed?
-	);
+                "movd %2, %%mm4                \n\t"
+                "movd %3, %%mm5                \n\t"
+                "packssdw %%mm4, %%mm4        \n\t"
+                "packssdw %%mm5, %%mm5        \n\t"
+                "packssdw %%mm4, %%mm4        \n\t"
+                "packssdw %%mm5, %%mm5        \n\t"
+                REQUANT_CORE(  (%1),  8(%1), 16(%1), 24(%1),  (%0), 8(%0), 64(%0), 72(%0))
+                REQUANT_CORE(32(%1), 40(%1), 48(%1), 56(%1),16(%0),24(%0), 48(%0), 56(%0))
+                REQUANT_CORE(64(%1), 72(%1), 80(%1), 88(%1),32(%0),40(%0), 96(%0),104(%0))
+                REQUANT_CORE(96(%1),104(%1),112(%1),120(%1),80(%0),88(%0),112(%0),120(%0))
+                : : "r" (src), "r" (dst), "g" (threshold1), "rm" (4) //FIXME maybe more accurate then needed?
+        );
 
-	dst[0]= (src[0] + 4)>>3;
+        dst[0]= (src[0] + 4)>>3;
 }
 #endif
 
 static inline void add_block(int16_t *dst, int stride, DCTELEM block[64]){
-	int y;
+        int y;
 
-	for(y=0; y<8; y++){
-		*(uint32_t*)&dst[0 + y*stride]+= *(uint32_t*)&block[0 + y*8];
-		*(uint32_t*)&dst[2 + y*stride]+= *(uint32_t*)&block[2 + y*8];
-		*(uint32_t*)&dst[4 + y*stride]+= *(uint32_t*)&block[4 + y*8];
-		*(uint32_t*)&dst[6 + y*stride]+= *(uint32_t*)&block[6 + y*8];
-	}
+        for(y=0; y<8; y++){
+                *(uint32_t*)&dst[0 + y*stride]+= *(uint32_t*)&block[0 + y*8];
+                *(uint32_t*)&dst[2 + y*stride]+= *(uint32_t*)&block[2 + y*8];
+                *(uint32_t*)&dst[4 + y*stride]+= *(uint32_t*)&block[4 + y*8];
+                *(uint32_t*)&dst[6 + y*stride]+= *(uint32_t*)&block[6 + y*8];
+        }
 }
 
 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
-	int y, x;
+        int y, x;
 
 #define STORE(pos) \
-	temp= ((src[x + y*src_stride + pos]<<log2_scale) + d[pos])>>6;\
-	if(temp & 0x100) temp= ~(temp>>31);\
-	dst[x + y*dst_stride + pos]= temp;
+        temp= ((src[x + y*src_stride + pos]<<log2_scale) + d[pos])>>6;\
+        if(temp & 0x100) temp= ~(temp>>31);\
+        dst[x + y*dst_stride + pos]= temp;
 
-	for(y=0; y<height; y++){
-		const uint8_t *d= dither[y];
-		for(x=0; x<width; x+=8){
-			int temp;
-			STORE(0);
-			STORE(1);
-			STORE(2);
-			STORE(3);
-			STORE(4);
-			STORE(5);
-			STORE(6);
-			STORE(7);
-		}
-	}
+        for(y=0; y<height; y++){
+                const uint8_t *d= dither[y];
+                for(x=0; x<width; x+=8){
+                        int temp;
+                        STORE(0);
+                        STORE(1);
+                        STORE(2);
+                        STORE(3);
+                        STORE(4);
+                        STORE(5);
+                        STORE(6);
+                        STORE(7);
+                }
+        }
 }
 
 #if HAVE_MMX
 static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
-	int y;
+        int y;
 
-	for(y=0; y<height; y++){
-		uint8_t *dst1= dst;
-		int16_t *src1= src;
-		__asm__ volatile(
-			"movq (%3), %%mm3	\n\t"
-			"movq (%3), %%mm4	\n\t"
-			"movd %4, %%mm2		\n\t"
-			"pxor %%mm0, %%mm0	\n\t"
-			"punpcklbw %%mm0, %%mm3	\n\t"
-			"punpckhbw %%mm0, %%mm4	\n\t"
-			"psraw %%mm2, %%mm3	\n\t"
-			"psraw %%mm2, %%mm4	\n\t"
-			"movd %5, %%mm2		\n\t"
-			"1:			\n\t"
-			"movq (%0), %%mm0	\n\t"
-			"movq 8(%0), %%mm1	\n\t"
-			"paddw %%mm3, %%mm0	\n\t"
-			"paddw %%mm4, %%mm1	\n\t"
-			"psraw %%mm2, %%mm0	\n\t"
-			"psraw %%mm2, %%mm1	\n\t"
-			"packuswb %%mm1, %%mm0	\n\t"
-			"movq %%mm0, (%1) 	\n\t"
-			"add $16, %0		\n\t"
-			"add $8, %1		\n\t"
-			"cmp %2, %1		\n\t"
-			" jb 1b			\n\t"
-			: "+r" (src1), "+r"(dst1)
-			: "r"(dst + width), "r"(dither[y]), "g"(log2_scale), "g"(6-log2_scale)
-		);
-		src += src_stride;
-		dst += dst_stride;
-	}
-//	if(width != mmxw)
-//		store_slice_c(dst + mmxw, src + mmxw, dst_stride, src_stride, width - mmxw, log2_scale);
+        for(y=0; y<height; y++){
+                uint8_t *dst1= dst;
+                int16_t *src1= src;
+                __asm__ volatile(
+                        "movq (%3), %%mm3        \n\t"
+                        "movq (%3), %%mm4        \n\t"
+                        "movd %4, %%mm2                \n\t"
+                        "pxor %%mm0, %%mm0        \n\t"
+                        "punpcklbw %%mm0, %%mm3        \n\t"
+                        "punpckhbw %%mm0, %%mm4        \n\t"
+                        "psraw %%mm2, %%mm3        \n\t"
+                        "psraw %%mm2, %%mm4        \n\t"
+                        "movd %5, %%mm2                \n\t"
+                        "1:                        \n\t"
+                        "movq (%0), %%mm0        \n\t"
+                        "movq 8(%0), %%mm1        \n\t"
+                        "paddw %%mm3, %%mm0        \n\t"
+                        "paddw %%mm4, %%mm1        \n\t"
+                        "psraw %%mm2, %%mm0        \n\t"
+                        "psraw %%mm2, %%mm1        \n\t"
+                        "packuswb %%mm1, %%mm0        \n\t"
+                        "movq %%mm0, (%1)         \n\t"
+                        "add $16, %0                \n\t"
+                        "add $8, %1                \n\t"
+                        "cmp %2, %1                \n\t"
+                        " jb 1b                        \n\t"
+                        : "+r" (src1), "+r"(dst1)
+                        : "r"(dst + width), "r"(dither[y]), "g"(log2_scale), "g"(6-log2_scale)
+                );
+                src += src_stride;
+                dst += dst_stride;
+        }
+//        if(width != mmxw)
+//                store_slice_c(dst + mmxw, src + mmxw, dst_stride, src_stride, width - mmxw, log2_scale);
 }
 #endif
 
@@ -375,77 +375,77 @@
 static void (*requantize)(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation)= hardthresh_c;
 
 static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma){
-	int x, y, i;
-	const int count= 1<<p->log2_count;
-	const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15));
-	uint64_t __attribute__((aligned(16))) block_align[32];
-	DCTELEM *block = (DCTELEM *)block_align;
-	DCTELEM *block2= (DCTELEM *)(block_align+16);
+        int x, y, i;
+        const int count= 1<<p->log2_count;
+        const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15));
+        uint64_t __attribute__((aligned(16))) block_align[32];
+        DCTELEM *block = (DCTELEM *)block_align;
+        DCTELEM *block2= (DCTELEM *)(block_align+16);
 
-	if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
-	for(y=0; y<height; y++){
-		int index= 8 + 8*stride + y*stride;
-		fast_memcpy(p->src + index, src + y*src_stride, width);
-		for(x=0; x<8; x++){
-			p->src[index         - x - 1]= p->src[index +         x    ];
-			p->src[index + width + x    ]= p->src[index + width - x - 1];
-		}
-	}
-	for(y=0; y<8; y++){
-		fast_memcpy(p->src + (      7-y)*stride, p->src + (      y+8)*stride, stride);
-		fast_memcpy(p->src + (height+8+y)*stride, p->src + (height-y+7)*stride, stride);
-	}
-	//FIXME (try edge emu)
+        if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
+        for(y=0; y<height; y++){
+                int index= 8 + 8*stride + y*stride;
+                fast_memcpy(p->src + index, src + y*src_stride, width);
+                for(x=0; x<8; x++){
+                        p->src[index         - x - 1]= p->src[index +         x    ];
+                        p->src[index + width + x    ]= p->src[index + width - x - 1];
+                }
+        }
+        for(y=0; y<8; y++){
+                fast_memcpy(p->src + (      7-y)*stride, p->src + (      y+8)*stride, stride);
+                fast_memcpy(p->src + (height+8+y)*stride, p->src + (height-y+7)*stride, stride);
+        }
+        //FIXME (try edge emu)
 
-	for(y=0; y<height+8; y+=8){
-		memset(p->temp + (8+y)*stride, 0, 8*stride*sizeof(int16_t));
-		for(x=0; x<width+8; x+=8){
-			const int qps= 3 + is_luma;
-			int qp;
+        for(y=0; y<height+8; y+=8){
+                memset(p->temp + (8+y)*stride, 0, 8*stride*sizeof(int16_t));
+                for(x=0; x<width+8; x+=8){
+                        const int qps= 3 + is_luma;
+                        int qp;
 
-			if(p->qp)
-				qp= p->qp;
-			else{
-				qp= qp_store[ (XMIN(x, width-1)>>qps) + (XMIN(y, height-1)>>qps) * qp_stride];
-				qp = FFMAX(1, norm_qscale(qp, p->mpeg2));
-			}
-			for(i=0; i<count; i++){
-				const int x1= x + offset[i+count-1][0];
-				const int y1= y + offset[i+count-1][1];
-				const int index= x1 + y1*stride;
-				p->dsp.get_pixels(block, p->src + index, stride);
-				p->dsp.fdct(block);
-				requantize(block2, block, qp, p->dsp.idct_permutation);
-				p->dsp.idct(block2);
-				add_block(p->temp + index, stride, block2);
-			}
-		}
-		if(y)
-			store_slice(dst + (y-8)*dst_stride, p->temp + 8 + y*stride, dst_stride, stride, width, XMIN(8, height+8-y), 6-p->log2_count);
-	}
+                        if(p->qp)
+                                qp= p->qp;
+                        else{
+                                qp= qp_store[ (XMIN(x, width-1)>>qps) + (XMIN(y, height-1)>>qps) * qp_stride];
+                                qp = FFMAX(1, norm_qscale(qp, p->mpeg2));
+                        }
+                        for(i=0; i<count; i++){
+                                const int x1= x + offset[i+count-1][0];
+                                const int y1= y + offset[i+count-1][1];
+                                const int index= x1 + y1*stride;
+                                p->dsp.get_pixels(block, p->src + index, stride);
+                                p->dsp.fdct(block);
+                                requantize(block2, block, qp, p->dsp.idct_permutation);
+                                p->dsp.idct(block2);
+                                add_block(p->temp + index, stride, block2);
+                        }
+                }
+                if(y)
+                        store_slice(dst + (y-8)*dst_stride, p->temp + 8 + y*stride, dst_stride, stride, width, XMIN(8, height+8-y), 6-p->log2_count);
+        }
 #if 0
-	for(y=0; y<height; y++){
-		for(x=0; x<width; x++){
-			if((((x>>6) ^ (y>>6)) & 1) == 0)
-				dst[x + y*dst_stride]= p->src[8 + 8*stride  + x + y*stride];
-			if((x&63) == 0 || (y&63)==0)
-				dst[x + y*dst_stride] += 128;
+        for(y=0; y<height; y++){
+                for(x=0; x<width; x++){
+                        if((((x>>6) ^ (y>>6)) & 1) == 0)
+                                dst[x + y*dst_stride]= p->src[8 + 8*stride  + x + y*stride];
+                        if((x&63) == 0 || (y&63)==0)
+                                dst[x + y*dst_stride] += 128;
                 }
-	}
+        }
 #endif
-	//FIXME reorder for better caching
+        //FIXME reorder for better caching
 }
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
-	int h= (height+16+15)&(~15);
+        unsigned int flags, unsigned int outfmt){
+        int h= (height+16+15)&(~15);
 
-	vf->priv->temp_stride= (width+16+15)&(~15);
+        vf->priv->temp_stride= (width+16+15)&(~15);
         vf->priv->temp= malloc(vf->priv->temp_stride*h*sizeof(int16_t));
         vf->priv->src = malloc(vf->priv->temp_stride*h*sizeof(uint8_t));
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void get_image(struct vf_instance *vf, mp_image_t *mpi){
@@ -459,17 +459,17 @@
     if(mpi->flags&MP_IMGFLAG_PLANAR){
         mpi->planes[1]=vf->dmpi->planes[1];
         mpi->planes[2]=vf->dmpi->planes[2];
-	mpi->stride[1]=vf->dmpi->stride[1];
-	mpi->stride[2]=vf->dmpi->stride[2];
+        mpi->stride[1]=vf->dmpi->stride[1];
+        mpi->stride[2]=vf->dmpi->stride[2];
     }
     mpi->flags|=MP_IMGFLAG_DIRECT;
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
-	mp_image_t *dmpi;
+        mp_image_t *dmpi;
 
-	if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-		// no DR, so get a new image! hope we'll get DR buffer:
+        if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
+                // no DR, so get a new image! hope we'll get DR buffer:
                 dmpi=vf_get_image(vf->next,mpi->imgfmt,
                     MP_IMGTYPE_TEMP,
                     MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
@@ -491,63 +491,63 @@
                 vf->priv->non_b_qp= malloc(w*h);
             fast_memcpy(vf->priv->non_b_qp, mpi->qscale, w*h);
         }
-	if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
+        if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){
             char *qp_tab= vf->priv->non_b_qp;
             if((vf->priv->mode&4) || !qp_tab)
                 qp_tab= mpi->qscale;
 
-	    if(qp_tab || vf->priv->qp){
-		filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
-		filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
-		filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
-	    }else{
-		memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
-		memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
-		memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
-	    }
-	}
+            if(qp_tab || vf->priv->qp){
+                filter(vf->priv, dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, qp_tab, mpi->qstride, 1);
+                filter(vf->priv, dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
+                filter(vf->priv, dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, qp_tab, mpi->qstride, 0);
+            }else{
+                memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);
+                memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);
+                memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
+            }
+        }
 
 #if HAVE_MMX
-	if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
+        if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
 #if HAVE_MMX2
-	if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
+        if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
-	return vf_next_put_image(vf,dmpi, pts);
+        return vf_next_put_image(vf,dmpi, pts);
 }
 
 static void uninit(struct vf_instance *vf){
-	if(!vf->priv) return;
+        if(!vf->priv) return;
 
-	free(vf->priv->temp);
-	vf->priv->temp= NULL;
-	free(vf->priv->src);
-	vf->priv->src= NULL;
+        free(vf->priv->temp);
+        vf->priv->temp= NULL;
+        free(vf->priv->src);
+        vf->priv->src= NULL;
         free(vf->priv->avctx);
         vf->priv->avctx= NULL;
         free(vf->priv->non_b_qp);
         vf->priv->non_b_qp= NULL;
 
-	free(vf->priv);
-	vf->priv=NULL;
+        free(vf->priv);
+        vf->priv=NULL;
 }
 
 //===========================================================================//
 static int query_format(struct vf_instance *vf, unsigned int fmt){
     switch(fmt){
-	case IMGFMT_YVU9:
-	case IMGFMT_IF09:
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_CLPL:
-	case IMGFMT_Y800:
-	case IMGFMT_Y8:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-	    return vf_next_query_format(vf,fmt);
+        case IMGFMT_YVU9:
+        case IMGFMT_IF09:
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_CLPL:
+        case IMGFMT_Y800:
+        case IMGFMT_Y8:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+            return vf_next_query_format(vf,fmt);
     }
     return 0;
 }
@@ -555,10 +555,10 @@
 static int control(struct vf_instance *vf, int request, void* data){
     switch(request){
     case VFCTRL_QUERY_MAX_PP_LEVEL:
-	return 6;
+        return 6;
     case VFCTRL_SET_PP_LEVEL:
-	vf->priv->log2_count= *((unsigned int*)data);
-	return CONTROL_TRUE;
+        vf->priv->log2_count= *((unsigned int*)data);
+        return CONTROL_TRUE;
     }
     return vf_next_control(vf,request,data);
 }
@@ -593,17 +593,17 @@
 
     switch(vf->priv->mode&3){
         default:
-	case 0: requantize= hardthresh_c; break;
-	case 1: requantize= softthresh_c; break;
+        case 0: requantize= hardthresh_c; break;
+        case 1: requantize= softthresh_c; break;
     }
 
 #if HAVE_MMX
     if(gCpuCaps.hasMMX){
-	store_slice= store_slice_mmx;
-	switch(vf->priv->mode&3){
-	    case 0: requantize= hardthresh_mmx; break;
-	    case 1: requantize= softthresh_mmx; break;
-	}
+        store_slice= store_slice_mmx;
+        switch(vf->priv->mode&3){
+            case 0: requantize= hardthresh_mmx; break;
+            case 1: requantize= softthresh_mmx; break;
+        }
     }
 #endif
 
--- a/libmpcodecs/vf_swapuv.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_swapuv.c	Fri Jan 14 22:10:21 2011 +0000
@@ -34,7 +34,7 @@
 
 static void get_image(struct vf_instance *vf, mp_image_t *mpi){
     mp_image_t *dmpi= vf_get_image(vf->next, mpi->imgfmt,
-	mpi->type, mpi->flags, mpi->w, mpi->h);
+        mpi->type, mpi->flags, mpi->w, mpi->h);
 
     mpi->planes[0]=dmpi->planes[0];
     mpi->planes[1]=dmpi->planes[2];
@@ -52,17 +52,17 @@
     mp_image_t *dmpi;
 
     if(mpi->flags&MP_IMGFLAG_DIRECT){
-	dmpi=(mp_image_t*)mpi->priv;
+        dmpi=(mp_image_t*)mpi->priv;
     } else {
-	dmpi=vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h);
-	assert(mpi->flags&MP_IMGFLAG_PLANAR);
-	dmpi->planes[0]=mpi->planes[0];
-	dmpi->planes[1]=mpi->planes[2];
-	dmpi->planes[2]=mpi->planes[1];
-	dmpi->stride[0]=mpi->stride[0];
-	dmpi->stride[1]=mpi->stride[2];
-	dmpi->stride[2]=mpi->stride[1];
-	dmpi->width=mpi->width;
+        dmpi=vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h);
+        assert(mpi->flags&MP_IMGFLAG_PLANAR);
+        dmpi->planes[0]=mpi->planes[0];
+        dmpi->planes[1]=mpi->planes[2];
+        dmpi->planes[2]=mpi->planes[1];
+        dmpi->stride[0]=mpi->stride[0];
+        dmpi->stride[1]=mpi->stride[2];
+        dmpi->stride[2]=mpi->stride[1];
+        dmpi->width=mpi->width;
     }
 
     vf_clone_mpi_attributes(dmpi, mpi);
@@ -73,18 +73,18 @@
 //===========================================================================//
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
-	switch(fmt)
-	{
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_YVU9:
-	case IMGFMT_444P:
-	case IMGFMT_422P:
-	case IMGFMT_411P:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        switch(fmt)
+        {
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_YVU9:
+        case IMGFMT_444P:
+        case IMGFMT_422P:
+        case IMGFMT_411P:
+                return vf_next_query_format(vf, fmt);
+        }
+        return 0;
 }
 
 static int vf_open(vf_instance_t *vf, char *args){
--- a/libmpcodecs/vf_telecine.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_telecine.c	Fri Jan 14 22:10:21 2011 +0000
@@ -30,119 +30,119 @@
 #include "libvo/fastmemcpy.h"
 
 struct vf_priv_s {
-	int frame;
+    int frame;
 };
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	mp_image_t *dmpi;
-	int ret;
+    mp_image_t *dmpi;
+    int ret;
 
-	vf->priv->frame = (vf->priv->frame+1)%4;
+    vf->priv->frame = (vf->priv->frame+1)%4;
 
-	dmpi = vf_get_image(vf->next, mpi->imgfmt,
-		MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-		MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
+    dmpi = vf_get_image(vf->next, mpi->imgfmt,
+        MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+        MP_IMGFLAG_PRESERVE, mpi->width, mpi->height);
 
-	ret = 0;
-	//    0/0  1/1  2/2  2/3  3/0
-	switch (vf->priv->frame) {
-	case 0:
-		my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
-			mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
-				mpi->planes[1]+mpi->stride[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
-				mpi->planes[2]+mpi->stride[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-	case 1:
-	case 2:
-		memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
-			dmpi->stride[0], mpi->stride[0]);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			memcpy_pic(dmpi->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height,
-				dmpi->stride[1], mpi->stride[1]);
-			memcpy_pic(dmpi->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height,
-				dmpi->stride[2], mpi->stride[2]);
-		}
-		return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE) || ret;
-	case 3:
-		my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
-			mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
-				mpi->planes[1]+mpi->stride[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
-				mpi->planes[2]+mpi->stride[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-		my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
-			dmpi->stride[0]*2, mpi->stride[0]*2);
-		if (mpi->flags & MP_IMGFLAG_PLANAR) {
-			my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[1]*2, mpi->stride[1]*2);
-			my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
-				mpi->chroma_width, mpi->chroma_height/2,
-				dmpi->stride[2]*2, mpi->stride[2]*2);
-		}
-		return ret;
-	}
-	return 0;
+    ret = 0;
+    //    0/0  1/1  2/2  2/3  3/0
+    switch (vf->priv->frame) {
+    case 0:
+        my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
+            mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
+            dmpi->stride[0]*2, mpi->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
+                mpi->planes[1]+mpi->stride[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, mpi->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
+                mpi->planes[2]+mpi->stride[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, mpi->stride[2]*2);
+        }
+        ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+    case 1:
+    case 2:
+        memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
+            dmpi->stride[0], mpi->stride[0]);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                mpi->chroma_width, mpi->chroma_height,
+                dmpi->stride[1], mpi->stride[1]);
+            memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                mpi->chroma_width, mpi->chroma_height,
+                dmpi->stride[2], mpi->stride[2]);
+        }
+        return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE) || ret;
+    case 3:
+        my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
+            mpi->planes[0]+mpi->stride[0], mpi->w, mpi->h/2,
+            dmpi->stride[0]*2, mpi->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
+                mpi->planes[1]+mpi->stride[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, mpi->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
+                mpi->planes[2]+mpi->stride[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, mpi->stride[2]*2);
+        }
+        ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+        my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
+            dmpi->stride[0]*2, mpi->stride[0]*2);
+        if (mpi->flags & MP_IMGFLAG_PLANAR) {
+            my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[1]*2, mpi->stride[1]*2);
+            my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                mpi->chroma_width, mpi->chroma_height/2,
+                dmpi->stride[2]*2, mpi->stride[2]*2);
+        }
+        return ret;
+    }
+    return 0;
 }
 
 #if 0
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - figure out which other formats work */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    /* FIXME - figure out which other formats work */
+    switch (fmt) {
+    case IMGFMT_YV12:
+    case IMGFMT_IYUV:
+    case IMGFMT_I420:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+    unsigned int flags, unsigned int outfmt)
 {
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 #endif
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	//vf->config = config;
-	vf->put_image = put_image;
-	//vf->query_format = query_format;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = calloc(1, sizeof(struct vf_priv_s));
-	vf->priv->frame = 1;
-	if (args) sscanf(args, "%d", &vf->priv->frame);
-	vf->priv->frame--;
-	return 1;
+    //vf->config = config;
+    vf->put_image = put_image;
+    //vf->query_format = query_format;
+    vf->uninit = uninit;
+    vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+    vf->priv = calloc(1, sizeof(struct vf_priv_s));
+    vf->priv->frame = 1;
+    if (args) sscanf(args, "%d", &vf->priv->frame);
+    vf->priv->frame--;
+    return 1;
 }
 
 const vf_info_t vf_info_telecine = {
--- a/libmpcodecs/vf_test.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_test.c	Fri Jan 14 22:10:21 2011 +0000
@@ -49,11 +49,11 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
     if(vf_next_query_format(vf,IMGFMT_YV12)<=0){
-	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YV12");
-	return 0;
+        mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YV12");
+        return 0;
     }
 
     //hmm whats the meaning of these ... ;)
@@ -67,206 +67,206 @@
 
 static void initIdct(void)
 {
-	int i;
+        int i;
 
-	for (i=0; i<8; i++)
-	{
-		double s= i==0 ? sqrt(0.125) : 0.5;
-		int j;
+        for (i=0; i<8; i++)
+        {
+                double s= i==0 ? sqrt(0.125) : 0.5;
+                int j;
 
-		for(j=0; j<8; j++)
-			c[i*8+j]= s*cos((3.141592654/8.0)*i*(j+0.5));
-	}
+                for(j=0; j<8; j++)
+                        c[i*8+j]= s*cos((3.141592654/8.0)*i*(j+0.5));
+        }
 }
 
 
 static void idct(uint8_t *dst, int dstStride, int src[64])
 {
-	int i, j, k;
-	double tmp[64];
+        int i, j, k;
+        double tmp[64];
 
-	for(i=0; i<8; i++)
-	{
-		for(j=0; j<8; j++)
-		{
-			double sum= 0.0;
+        for(i=0; i<8; i++)
+        {
+                for(j=0; j<8; j++)
+                {
+                        double sum= 0.0;
 
-			for(k=0; k<8; k++)
-				sum+= c[k*8+j]*src[8*i+k];
+                        for(k=0; k<8; k++)
+                                sum+= c[k*8+j]*src[8*i+k];
 
-			tmp[8*i+j]= sum;
-		}
-	}
+                        tmp[8*i+j]= sum;
+                }
+        }
 
-	for(j=0; j<8; j++)
-	{
-		for(i=0; i<8; i++)
-		{
-			int v;
-			double sum= 0.0;
+        for(j=0; j<8; j++)
+        {
+                for(i=0; i<8; i++)
+                {
+                        int v;
+                        double sum= 0.0;
 
-			for(k=0; k<8; k++)
-				sum+= c[k*8+i]*tmp[8*k+j];
+                        for(k=0; k<8; k++)
+                                sum+= c[k*8+i]*tmp[8*k+j];
 
-			v= (int)floor(sum+0.5);
-			if(v<0) v=0;
-			else if(v>255) v=255;
+                        v= (int)floor(sum+0.5);
+                        if(v<0) v=0;
+                        else if(v>255) v=255;
 
-			dst[dstStride*i + j] = v;
-		}
-	}
+                        dst[dstStride*i + j] = v;
+                }
+        }
 }
 
 static void drawDc(uint8_t *dst, int stride, int color, int w, int h)
 {
-	int y;
-	for(y=0; y<h; y++)
-	{
-		int x;
-		for(x=0; x<w; x++)
-		{
-			dst[x + y*stride]= color;
-		}
-	}
+        int y;
+        for(y=0; y<h; y++)
+        {
+                int x;
+                for(x=0; x<w; x++)
+                {
+                        dst[x + y*stride]= color;
+                }
+        }
 }
 
 static void drawBasis(uint8_t *dst, int stride, int amp, int freq, int dc)
 {
-	int src[64];
+        int src[64];
 
-	memset(src, 0, 64*sizeof(int));
-	src[0]= dc;
-	if(amp) src[freq]= amp;
-	idct(dst, stride, src);
+        memset(src, 0, 64*sizeof(int));
+        src[0]= dc;
+        if(amp) src[freq]= amp;
+        idct(dst, stride, src);
 }
 
 static void drawCbp(uint8_t *dst[3], int stride[3], int cbp, int amp, int dc)
 {
-	if(cbp&1) drawBasis(dst[0]              , stride[0], amp, 1, dc);
-	if(cbp&2) drawBasis(dst[0]+8            , stride[0], amp, 1, dc);
-	if(cbp&4) drawBasis(dst[0]+  8*stride[0], stride[0], amp, 1, dc);
-	if(cbp&8) drawBasis(dst[0]+8+8*stride[0], stride[0], amp, 1, dc);
-	if(cbp&16)drawBasis(dst[1]              , stride[1], amp, 1, dc);
-	if(cbp&32)drawBasis(dst[2]              , stride[2], amp, 1, dc);
+        if(cbp&1) drawBasis(dst[0]              , stride[0], amp, 1, dc);
+        if(cbp&2) drawBasis(dst[0]+8            , stride[0], amp, 1, dc);
+        if(cbp&4) drawBasis(dst[0]+  8*stride[0], stride[0], amp, 1, dc);
+        if(cbp&8) drawBasis(dst[0]+8+8*stride[0], stride[0], amp, 1, dc);
+        if(cbp&16)drawBasis(dst[1]              , stride[1], amp, 1, dc);
+        if(cbp&32)drawBasis(dst[2]              , stride[2], amp, 1, dc);
 }
 
 static void dc1Test(uint8_t *dst, int stride, int w, int h, int off)
 {
-	const int step= MAX(256/(w*h/256), 1);
-	int y;
-	int color=off;
-	for(y=0; y<h; y+=16)
-	{
-		int x;
-		for(x=0; x<w; x+=16)
-		{
-			drawDc(dst + x + y*stride, stride, color, 8, 8);
-			color+=step;
-		}
-	}
+        const int step= MAX(256/(w*h/256), 1);
+        int y;
+        int color=off;
+        for(y=0; y<h; y+=16)
+        {
+                int x;
+                for(x=0; x<w; x+=16)
+                {
+                        drawDc(dst + x + y*stride, stride, color, 8, 8);
+                        color+=step;
+                }
+        }
 }
 
 static void freq1Test(uint8_t *dst, int stride, int off)
 {
-	int y;
-	int freq=0;
-	for(y=0; y<8*16; y+=16)
-	{
-		int x;
-		for(x=0; x<8*16; x+=16)
-		{
-			drawBasis(dst + x + y*stride, stride, 4*(96+off), freq, 128*8);
-			freq++;
-		}
-	}
+        int y;
+        int freq=0;
+        for(y=0; y<8*16; y+=16)
+        {
+                int x;
+                for(x=0; x<8*16; x+=16)
+                {
+                        drawBasis(dst + x + y*stride, stride, 4*(96+off), freq, 128*8);
+                        freq++;
+                }
+        }
 }
 
 static void amp1Test(uint8_t *dst, int stride, int off)
 {
-	int y;
-	int amp=off;
-	for(y=0; y<16*16; y+=16)
-	{
-		int x;
-		for(x=0; x<16*16; x+=16)
-		{
-			drawBasis(dst + x + y*stride, stride, 4*(amp), 1, 128*8);
-			amp++;
-		}
-	}
+        int y;
+        int amp=off;
+        for(y=0; y<16*16; y+=16)
+        {
+                int x;
+                for(x=0; x<16*16; x+=16)
+                {
+                        drawBasis(dst + x + y*stride, stride, 4*(amp), 1, 128*8);
+                        amp++;
+                }
+        }
 }
 
 static void cbp1Test(uint8_t *dst[3], int stride[3], int off)
 {
-	int y;
-	int cbp=0;
-	for(y=0; y<16*8; y+=16)
-	{
-		int x;
-		for(x=0; x<16*8; x+=16)
-		{
-			uint8_t *dst1[3];
-			dst1[0]= dst[0] + x*2 + y*2*stride[0];
-			dst1[1]= dst[1] + x + y*stride[1];
-			dst1[2]= dst[2] + x + y*stride[2];
+        int y;
+        int cbp=0;
+        for(y=0; y<16*8; y+=16)
+        {
+                int x;
+                for(x=0; x<16*8; x+=16)
+                {
+                        uint8_t *dst1[3];
+                        dst1[0]= dst[0] + x*2 + y*2*stride[0];
+                        dst1[1]= dst[1] + x + y*stride[1];
+                        dst1[2]= dst[2] + x + y*stride[2];
 
-			drawCbp(dst1, stride, cbp, (64+off)*4, 128*8);
-			cbp++;
-		}
-	}
+                        drawCbp(dst1, stride, cbp, (64+off)*4, 128*8);
+                        cbp++;
+                }
+        }
 }
 
 static void mv1Test(uint8_t *dst, int stride, int off)
 {
-	int y;
-	for(y=0; y<16*16; y++)
-	{
-		int x;
-		if(y&16) continue;
-		for(x=0; x<16*16; x++)
-		{
-			dst[x + y*stride]= x + off*8/(y/32+1);
-		}
-	}
+        int y;
+        for(y=0; y<16*16; y++)
+        {
+                int x;
+                if(y&16) continue;
+                for(x=0; x<16*16; x++)
+                {
+                        dst[x + y*stride]= x + off*8/(y/32+1);
+                }
+        }
 }
 
 static void ring1Test(uint8_t *dst, int stride, int off)
 {
-	int y;
-	int color=0;
-	for(y=off; y<16*16; y+=16)
-	{
-		int x;
-		for(x=off; x<16*16; x+=16)
-		{
-			drawDc(dst + x + y*stride, stride, ((x+y)&16) ? color : -color, 16, 16);
-//			dst[x + y*stride]= 255 + (off&1);
-			color++;
-		}
-	}
+        int y;
+        int color=0;
+        for(y=off; y<16*16; y+=16)
+        {
+                int x;
+                for(x=off; x<16*16; x+=16)
+                {
+                        drawDc(dst + x + y*stride, stride, ((x+y)&16) ? color : -color, 16, 16);
+//                        dst[x + y*stride]= 255 + (off&1);
+                        color++;
+                }
+        }
 }
 
 static void ring2Test(uint8_t *dst, int stride, int off)
 {
-	int y;
-	for(y=0; y<16*16; y++)
-	{
-		int x;
-		for(x=0; x<16*16; x++)
-		{
-			double d= sqrt((x-8*16)*(x-8*16) + (y-8*16)*(y-8*16));
-			double r= d/20 - (int)(d/20);
-			if(r<off/30.0)
-			{
-				dst[x + y*stride]= 255;
-				dst[x + y*stride+256]= 0;
-			}
-			else{
-				dst[x + y*stride]= x;
-				dst[x + y*stride+256]= x;
-			}
-		}
-	}
+        int y;
+        for(y=0; y<16*16; y++)
+        {
+                int x;
+                for(x=0; x<16*16; x++)
+                {
+                        double d= sqrt((x-8*16)*(x-8*16) + (y-8*16)*(y-8*16));
+                        double r= d/20 - (int)(d/20);
+                        if(r<off/30.0)
+                        {
+                                dst[x + y*stride]= 255;
+                                dst[x + y*stride+256]= 0;
+                        }
+                        else{
+                                dst[x + y*stride]= x;
+                                dst[x + y*stride+256]= x;
+                        }
+                }
+        }
 }
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
@@ -275,8 +275,8 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,IMGFMT_YV12,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	WIDTH, HEIGHT);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        WIDTH, HEIGHT);
 
     // clean
     memset(dmpi->planes[0], 0, dmpi->stride[0]*dmpi->h);
@@ -286,18 +286,18 @@
     if(frame%30)
     {
         switch(frame/30)
-	{
-	case 0:   dc1Test(dmpi->planes[0], dmpi->stride[0], 256, 256, frame%30); break;
-	case 1:   dc1Test(dmpi->planes[1], dmpi->stride[1], 256, 256, frame%30); break;
-	case 2: freq1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
-	case 3: freq1Test(dmpi->planes[1], dmpi->stride[1], frame%30); break;
-	case 4:  amp1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
-	case 5:  amp1Test(dmpi->planes[1], dmpi->stride[1], frame%30); break;
-	case 6:  cbp1Test(dmpi->planes   , dmpi->stride   , frame%30); break;
-	case 7:   mv1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
-	case 8: ring1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
-	case 9: ring2Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
-	}
+        {
+        case 0:   dc1Test(dmpi->planes[0], dmpi->stride[0], 256, 256, frame%30); break;
+        case 1:   dc1Test(dmpi->planes[1], dmpi->stride[1], 256, 256, frame%30); break;
+        case 2: freq1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
+        case 3: freq1Test(dmpi->planes[1], dmpi->stride[1], frame%30); break;
+        case 4:  amp1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
+        case 5:  amp1Test(dmpi->planes[1], dmpi->stride[1], frame%30); break;
+        case 6:  cbp1Test(dmpi->planes   , dmpi->stride   , frame%30); break;
+        case 7:   mv1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
+        case 8: ring1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
+        case 9: ring2Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;
+        }
     }
 
     frame++;
--- a/libmpcodecs/vf_tile.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_tile.c	Fri Jan 14 22:10:21 2011 +0000
@@ -86,7 +86,7 @@
 
 static int config(struct vf_instance *vf,
                   int width, int height, int d_width, int d_height,
-	          unsigned int flags, unsigned int outfmt){
+              unsigned int flags, unsigned int outfmt){
 
     struct vf_priv_s  *priv;
     int               xw;
@@ -201,18 +201,18 @@
 /* rgb/bgr 12...32 supported & some Yxxx */
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	switch (fmt) {
+    switch (fmt) {
         /* rgb 12...32 bit */
         case IMGFMT_RGB12:
         case IMGFMT_RGB15:
-	case IMGFMT_RGB16:
-	case IMGFMT_RGB24:
+        case IMGFMT_RGB16:
+        case IMGFMT_RGB24:
         case IMGFMT_RGB32:
         /* bgr 12...32 bit */
         case IMGFMT_BGR12:
-	case IMGFMT_BGR15:
-	case IMGFMT_BGR16:
-	case IMGFMT_BGR24:
+        case IMGFMT_BGR15:
+        case IMGFMT_BGR16:
+        case IMGFMT_BGR24:
         case IMGFMT_BGR32:
         /* Various Yxxx Formats */
         case IMGFMT_444P:
@@ -224,9 +224,9 @@
         case IMGFMT_YVU9:
         case IMGFMT_IF09:
         case IMGFMT_IYUV:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 /* Get an integer from the string pointed by s, adjusting s.
--- a/libmpcodecs/vf_tinterlace.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_tinterlace.c	Fri Jan 14 22:10:21 2011 +0000
@@ -32,204 +32,204 @@
 #include "libvo/fastmemcpy.h"
 
 struct vf_priv_s {
-	int mode;
-	int frame;
-	mp_image_t *dmpi;
+    int mode;
+    int frame;
+    mp_image_t *dmpi;
 };
 
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
 {
-	int ret = 0;
-	mp_image_t *dmpi;
+    int ret = 0;
+    mp_image_t *dmpi;
 
-	switch (vf->priv->mode) {
-	case 0:
-		dmpi = vf->priv->dmpi;
-		if (dmpi == NULL) {
-			dmpi = vf_get_image(vf->next, mpi->imgfmt,
-					    MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-					    MP_IMGFLAG_PRESERVE,
-					    mpi->width, mpi->height*2);
+    switch (vf->priv->mode) {
+    case 0:
+        dmpi = vf->priv->dmpi;
+        if (dmpi == NULL) {
+            dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                        MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+                        MP_IMGFLAG_PRESERVE,
+                        mpi->width, mpi->height*2);
 
-			vf->priv->dmpi = dmpi;
+            vf->priv->dmpi = dmpi;
 
-			memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
-				   dmpi->stride[0]*2, mpi->stride[0]);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				memcpy_pic(dmpi->planes[1], mpi->planes[1],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[1]*2, mpi->stride[1]);
-				memcpy_pic(dmpi->planes[2], mpi->planes[2],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[2]*2, mpi->stride[2]);
-			}
-		} else {
-			vf->priv->dmpi = NULL;
+            memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
+                   dmpi->stride[0]*2, mpi->stride[0]);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[1]*2, mpi->stride[1]);
+                memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[2]*2, mpi->stride[2]);
+            }
+        } else {
+            vf->priv->dmpi = NULL;
 
-			memcpy_pic(dmpi->planes[0]+dmpi->stride[0], mpi->planes[0], mpi->w, mpi->h,
-				   dmpi->stride[0]*2, mpi->stride[0]);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				memcpy_pic(dmpi->planes[1]+dmpi->stride[1], mpi->planes[1],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[1]*2, mpi->stride[1]);
-				memcpy_pic(dmpi->planes[2]+dmpi->stride[2], mpi->planes[2],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[2]*2, mpi->stride[2]);
-			}
-			ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-		}
-		break;
-	case 1:
-		if (vf->priv->frame & 1)
-			ret = vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
-		break;
-	case 2:
-		if ((vf->priv->frame & 1) == 0)
-			ret = vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
-		break;
-	case 3:
-		dmpi = vf_get_image(vf->next, mpi->imgfmt,
-				    MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-				    mpi->width, mpi->height*2);
-		/* fixme, just clear alternate lines */
-		vf_mpi_clear(dmpi, 0, 0, dmpi->w, dmpi->h);
-		if ((vf->priv->frame & 1) == 0) {
-			memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
-				   dmpi->stride[0]*2, mpi->stride[0]);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				memcpy_pic(dmpi->planes[1], mpi->planes[1],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[1]*2, mpi->stride[1]);
-				memcpy_pic(dmpi->planes[2], mpi->planes[2],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[2]*2, mpi->stride[2]);
-			}
-		} else {
-			memcpy_pic(dmpi->planes[0]+dmpi->stride[0], mpi->planes[0], mpi->w, mpi->h,
-				   dmpi->stride[0]*2, mpi->stride[0]);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				memcpy_pic(dmpi->planes[1]+dmpi->stride[1], mpi->planes[1],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[1]*2, mpi->stride[1]);
-				memcpy_pic(dmpi->planes[2]+dmpi->stride[2], mpi->planes[2],
-					   mpi->chroma_width, mpi->chroma_height,
-					   dmpi->stride[2]*2, mpi->stride[2]);
-			}
-		}
-		ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-		break;
-	case 4:
-		// Interleave even lines (only) from Frame 'i' with odd
-		// lines (only) from Frame 'i+1', halving the Frame
-		// rate and preserving image height.
+            memcpy_pic(dmpi->planes[0]+dmpi->stride[0], mpi->planes[0], mpi->w, mpi->h,
+                   dmpi->stride[0]*2, mpi->stride[0]);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                memcpy_pic(dmpi->planes[1]+dmpi->stride[1], mpi->planes[1],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[1]*2, mpi->stride[1]);
+                memcpy_pic(dmpi->planes[2]+dmpi->stride[2], mpi->planes[2],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[2]*2, mpi->stride[2]);
+            }
+            ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+        }
+        break;
+    case 1:
+        if (vf->priv->frame & 1)
+            ret = vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
+        break;
+    case 2:
+        if ((vf->priv->frame & 1) == 0)
+            ret = vf_next_put_image(vf, mpi, MP_NOPTS_VALUE);
+        break;
+    case 3:
+        dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                    MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+                    mpi->width, mpi->height*2);
+        /* fixme, just clear alternate lines */
+        vf_mpi_clear(dmpi, 0, 0, dmpi->w, dmpi->h);
+        if ((vf->priv->frame & 1) == 0) {
+            memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h,
+                   dmpi->stride[0]*2, mpi->stride[0]);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[1]*2, mpi->stride[1]);
+                memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[2]*2, mpi->stride[2]);
+            }
+        } else {
+            memcpy_pic(dmpi->planes[0]+dmpi->stride[0], mpi->planes[0], mpi->w, mpi->h,
+                   dmpi->stride[0]*2, mpi->stride[0]);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                memcpy_pic(dmpi->planes[1]+dmpi->stride[1], mpi->planes[1],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[1]*2, mpi->stride[1]);
+                memcpy_pic(dmpi->planes[2]+dmpi->stride[2], mpi->planes[2],
+                       mpi->chroma_width, mpi->chroma_height,
+                       dmpi->stride[2]*2, mpi->stride[2]);
+            }
+        }
+        ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+        break;
+    case 4:
+        // Interleave even lines (only) from Frame 'i' with odd
+        // lines (only) from Frame 'i+1', halving the Frame
+        // rate and preserving image height.
 
-		dmpi = vf->priv->dmpi;
+        dmpi = vf->priv->dmpi;
 
-		// @@ Need help:  Should I set dmpi->fields to indicate
-		// that the (new) frame will be interlaced!?  E.g. ...
-		// dmpi->fields |= MP_IMGFIELD_INTERLACED;
-		// dmpi->fields |= MP_IMGFIELD_TOP_FIRST;
-		// etc.
+        // @@ Need help:  Should I set dmpi->fields to indicate
+        // that the (new) frame will be interlaced!?  E.g. ...
+        // dmpi->fields |= MP_IMGFIELD_INTERLACED;
+        // dmpi->fields |= MP_IMGFIELD_TOP_FIRST;
+        // etc.
 
-		if (dmpi == NULL) {
-			dmpi = vf_get_image(vf->next, mpi->imgfmt,
-					    MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
-					    MP_IMGFLAG_PRESERVE,
-					    mpi->width, mpi->height);
+        if (dmpi == NULL) {
+            dmpi = vf_get_image(vf->next, mpi->imgfmt,
+                        MP_IMGTYPE_STATIC, MP_IMGFLAG_ACCEPT_STRIDE |
+                        MP_IMGFLAG_PRESERVE,
+                        mpi->width, mpi->height);
 
-			vf->priv->dmpi = dmpi;
+            vf->priv->dmpi = dmpi;
 
-			my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
-				      dmpi->stride[0]*2, mpi->stride[0]*2);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
-					      mpi->chroma_width, mpi->chroma_height/2,
-					      dmpi->stride[1]*2, mpi->stride[1]*2);
-				my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
-					      mpi->chroma_width, mpi->chroma_height/2,
-					      dmpi->stride[2]*2, mpi->stride[2]*2);
-			}
-		} else {
-			vf->priv->dmpi = NULL;
+            my_memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h/2,
+                      dmpi->stride[0]*2, mpi->stride[0]*2);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                my_memcpy_pic(dmpi->planes[1], mpi->planes[1],
+                          mpi->chroma_width, mpi->chroma_height/2,
+                          dmpi->stride[1]*2, mpi->stride[1]*2);
+                my_memcpy_pic(dmpi->planes[2], mpi->planes[2],
+                          mpi->chroma_width, mpi->chroma_height/2,
+                          dmpi->stride[2]*2, mpi->stride[2]*2);
+            }
+        } else {
+            vf->priv->dmpi = NULL;
 
-			my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
-				      mpi->planes[0]+mpi->stride[0],
-				      mpi->w, mpi->h/2,
-				      dmpi->stride[0]*2, mpi->stride[0]*2);
-			if (mpi->flags & MP_IMGFLAG_PLANAR) {
-				my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
-					      mpi->planes[1]+mpi->stride[1],
-					      mpi->chroma_width, mpi->chroma_height/2,
-					      dmpi->stride[1]*2, mpi->stride[1]*2);
-				my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
-					      mpi->planes[2]+mpi->stride[2],
-					      mpi->chroma_width, mpi->chroma_height/2,
-					      dmpi->stride[2]*2, mpi->stride[2]*2);
-			}
-			ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
-		}
-		break;
-	}
+            my_memcpy_pic(dmpi->planes[0]+dmpi->stride[0],
+                      mpi->planes[0]+mpi->stride[0],
+                      mpi->w, mpi->h/2,
+                      dmpi->stride[0]*2, mpi->stride[0]*2);
+            if (mpi->flags & MP_IMGFLAG_PLANAR) {
+                my_memcpy_pic(dmpi->planes[1]+dmpi->stride[1],
+                          mpi->planes[1]+mpi->stride[1],
+                          mpi->chroma_width, mpi->chroma_height/2,
+                          dmpi->stride[1]*2, mpi->stride[1]*2);
+                my_memcpy_pic(dmpi->planes[2]+dmpi->stride[2],
+                          mpi->planes[2]+mpi->stride[2],
+                          mpi->chroma_width, mpi->chroma_height/2,
+                          dmpi->stride[2]*2, mpi->stride[2]*2);
+            }
+            ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
+        }
+        break;
+    }
 
-	vf->priv->frame++;
+    vf->priv->frame++;
 
-	return ret;
+    return ret;
 }
 
 static int query_format(struct vf_instance *vf, unsigned int fmt)
 {
-	/* FIXME - figure out which other formats work */
-	switch (fmt) {
-	case IMGFMT_YV12:
-	case IMGFMT_IYUV:
-	case IMGFMT_I420:
-		return vf_next_query_format(vf, fmt);
-	}
-	return 0;
+    /* FIXME - figure out which other formats work */
+    switch (fmt) {
+    case IMGFMT_YV12:
+    case IMGFMT_IYUV:
+    case IMGFMT_I420:
+        return vf_next_query_format(vf, fmt);
+    }
+    return 0;
 }
 
 static int config(struct vf_instance *vf,
-        int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt)
+    int width, int height, int d_width, int d_height,
+    unsigned int flags, unsigned int outfmt)
 {
-	switch (vf->priv->mode) {
-	case 0:
-	case 3:
-		return vf_next_config(vf,width,height*2,d_width,d_height*2,flags,outfmt);
-	case 1:			/* odd frames */
-	case 2:			/* even frames */
-	case 4:			/* alternate frame (height-preserving) interlacing */
-		return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
-	}
-	return 0;
+    switch (vf->priv->mode) {
+    case 0:
+    case 3:
+        return vf_next_config(vf,width,height*2,d_width,d_height*2,flags,outfmt);
+    case 1:            /* odd frames */
+    case 2:            /* even frames */
+    case 4:            /* alternate frame (height-preserving) interlacing */
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    }
+    return 0;
 }
 
 static void uninit(struct vf_instance *vf)
 {
-	free(vf->priv);
+    free(vf->priv);
 }
 
 static int vf_open(vf_instance_t *vf, char *args)
 {
-	struct vf_priv_s *p;
-	vf->config = config;
-	vf->put_image = put_image;
-	vf->query_format = query_format;
-	vf->uninit = uninit;
-	vf->default_reqs = VFCAP_ACCEPT_STRIDE;
-	vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
-	vf->priv->mode = 0;
-	if (args)
-	  sscanf(args, "%d", &vf->priv->mode);
-	vf->priv->frame = 0;
-	return 1;
+    struct vf_priv_s *p;
+    vf->config = config;
+    vf->put_image = put_image;
+    vf->query_format = query_format;
+    vf->uninit = uninit;
+    vf->default_reqs = VFCAP_ACCEPT_STRIDE;
+    vf->priv = p = calloc(1, sizeof(struct vf_priv_s));
+    vf->priv->mode = 0;
+    if (args)
+      sscanf(args, "%d", &vf->priv->mode);
+    vf->priv->frame = 0;
+    return 1;
 }
 
 const vf_info_t vf_info_tinterlace = {
-	"temporal field interlacing",
-	"tinterlace",
-	"Michael Zucchi",
-	"",
-	vf_open,
-	NULL
+    "temporal field interlacing",
+    "tinterlace",
+    "Michael Zucchi",
+    "",
+    vf_open,
+    NULL
 };
--- a/libmpcodecs/vf_unsharp.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_unsharp.c	Fri Jan 14 22:10:21 2011 +0000
@@ -83,52 +83,52 @@
     int32_t halfscale = 1 << ((stepsX+stepsY)*2-1);
 
     if( !fp->amount ) {
-	if( src == dst )
-	    return;
-	if( dstStride == srcStride )
-	    fast_memcpy( dst, src, srcStride*height );
-	else
-	    for( y=0; y<height; y++, dst+=dstStride, src+=srcStride )
-		fast_memcpy( dst, src, width );
-	return;
+        if( src == dst )
+            return;
+        if( dstStride == srcStride )
+            fast_memcpy( dst, src, srcStride*height );
+        else
+            for( y=0; y<height; y++, dst+=dstStride, src+=srcStride )
+                fast_memcpy( dst, src, width );
+        return;
     }
 
     for( y=0; y<2*stepsY; y++ )
-	memset( SC[y], 0, sizeof(SC[y][0]) * (width+2*stepsX) );
+        memset( SC[y], 0, sizeof(SC[y][0]) * (width+2*stepsX) );
 
     for( y=-stepsY; y<height+stepsY; y++ ) {
-	if( y < height ) src2 = src;
-	memset( SR, 0, sizeof(SR[0]) * (2*stepsX-1) );
-	for( x=-stepsX; x<width+stepsX; x++ ) {
-	    Tmp1 = x<=0 ? src2[0] : x>=width ? src2[width-1] : src2[x];
-	    for( z=0; z<stepsX*2; z+=2 ) {
-		Tmp2 = SR[z+0] + Tmp1; SR[z+0] = Tmp1;
-		Tmp1 = SR[z+1] + Tmp2; SR[z+1] = Tmp2;
-	    }
-	    for( z=0; z<stepsY*2; z+=2 ) {
-		Tmp2 = SC[z+0][x+stepsX] + Tmp1; SC[z+0][x+stepsX] = Tmp1;
-		Tmp1 = SC[z+1][x+stepsX] + Tmp2; SC[z+1][x+stepsX] = Tmp2;
-	    }
-	    if( x>=stepsX && y>=stepsY ) {
-		uint8_t* srx = src - stepsY*srcStride + x - stepsX;
-		uint8_t* dsx = dst - stepsY*dstStride + x - stepsX;
+        if( y < height ) src2 = src;
+        memset( SR, 0, sizeof(SR[0]) * (2*stepsX-1) );
+        for( x=-stepsX; x<width+stepsX; x++ ) {
+            Tmp1 = x<=0 ? src2[0] : x>=width ? src2[width-1] : src2[x];
+            for( z=0; z<stepsX*2; z+=2 ) {
+                Tmp2 = SR[z+0] + Tmp1; SR[z+0] = Tmp1;
+                Tmp1 = SR[z+1] + Tmp2; SR[z+1] = Tmp2;
+            }
+            for( z=0; z<stepsY*2; z+=2 ) {
+                Tmp2 = SC[z+0][x+stepsX] + Tmp1; SC[z+0][x+stepsX] = Tmp1;
+                Tmp1 = SC[z+1][x+stepsX] + Tmp2; SC[z+1][x+stepsX] = Tmp2;
+            }
+            if( x>=stepsX && y>=stepsY ) {
+                uint8_t* srx = src - stepsY*srcStride + x - stepsX;
+                uint8_t* dsx = dst - stepsY*dstStride + x - stepsX;
 
-		res = (int32_t)*srx + ( ( ( (int32_t)*srx - (int32_t)((Tmp1+halfscale) >> scalebits) ) * amount ) >> 16 );
-		*dsx = res>255 ? 255 : res<0 ? 0 : (uint8_t)res;
-	    }
-	}
-	if( y >= 0 ) {
-	    dst += dstStride;
-	    src += srcStride;
-	}
+                res = (int32_t)*srx + ( ( ( (int32_t)*srx - (int32_t)((Tmp1+halfscale) >> scalebits) ) * amount ) >> 16 );
+                *dsx = res>255 ? 255 : res<0 ? 0 : (uint8_t)res;
+            }
+        }
+        if( y >= 0 ) {
+            dst += dstStride;
+            src += srcStride;
+        }
     }
 }
 
 //===========================================================================//
 
 static int config( struct vf_instance *vf,
-		   int width, int height, int d_width, int d_height,
-		   unsigned int flags, unsigned int outfmt ) {
+                   int width, int height, int d_width, int d_height,
+                   unsigned int flags, unsigned int outfmt ) {
 
     int z, stepsX, stepsY;
     FilterParam *fp;
@@ -143,7 +143,7 @@
     stepsX = fp->msizeX/2;
     stepsY = fp->msizeY/2;
     for( z=0; z<2*stepsY; z++ )
-	fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX));
+        fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX));
 
     fp = &vf->priv->chromaParam;
     effect = fp->amount == 0 ? "don't touch" : fp->amount < 0 ? "blur" : "sharpen";
@@ -152,7 +152,7 @@
     stepsX = fp->msizeX/2;
     stepsY = fp->msizeY/2;
     for( z=0; z<2*stepsY; z++ )
-	fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX));
+        fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX));
 
     return vf_next_config( vf, width, height, d_width, d_height, flags, outfmt );
 }
@@ -161,9 +161,9 @@
 
 static void get_image( struct vf_instance *vf, mp_image_t *mpi ) {
     if( mpi->flags & MP_IMGFLAG_PRESERVE )
-	return; // don't change
+        return; // don't change
     if( mpi->imgfmt!=vf->priv->outfmt )
-	return; // colorspace differ
+        return; // colorspace differ
 
     vf->dmpi = vf_get_image( vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h );
     mpi->planes[0] = vf->dmpi->planes[0];
@@ -172,8 +172,8 @@
     if( mpi->flags & MP_IMGFLAG_PLANAR ) {
         mpi->planes[1] = vf->dmpi->planes[1];
         mpi->planes[2] = vf->dmpi->planes[2];
-	mpi->stride[1] = vf->dmpi->stride[1];
-	mpi->stride[2] = vf->dmpi->stride[2];
+        mpi->stride[1] = vf->dmpi->stride[1];
+        mpi->stride[2] = vf->dmpi->stride[2];
     }
     mpi->flags |= MP_IMGFLAG_DIRECT;
 }
@@ -182,8 +182,8 @@
     mp_image_t *dmpi;
 
     if( !(mpi->flags & MP_IMGFLAG_DIRECT) )
-	// no DR, so get a new image! hope we'll get DR buffer:
-	vf->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h);
+        // no DR, so get a new image! hope we'll get DR buffer:
+        vf->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h);
     dmpi= vf->dmpi;
 
     unsharp( dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w,   mpi->h,   &vf->priv->lumaParam );
@@ -194,11 +194,11 @@
 
 #if HAVE_MMX
     if(gCpuCaps.hasMMX)
-	__asm__ volatile ("emms\n\t");
+        __asm__ volatile ("emms\n\t");
 #endif
 #if HAVE_MMX2
     if(gCpuCaps.hasMMX2)
-	__asm__ volatile ("sfence\n\t");
+        __asm__ volatile ("sfence\n\t");
 #endif
 
     return vf_next_put_image( vf, dmpi, pts);
@@ -212,13 +212,13 @@
 
     fp = &vf->priv->lumaParam;
     for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) {
-	av_free( fp->SC[z] );
-	fp->SC[z] = NULL;
+        av_free( fp->SC[z] );
+        fp->SC[z] = NULL;
     }
     fp = &vf->priv->chromaParam;
     for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) {
-	av_free( fp->SC[z] );
-	fp->SC[z] = NULL;
+        av_free( fp->SC[z] );
+        fp->SC[z] = NULL;
     }
 
     free( vf->priv );
@@ -232,7 +232,7 @@
     case IMGFMT_YV12:
     case IMGFMT_I420:
     case IMGFMT_IYUV:
-	return vf_next_query_format( vf, vf->priv->outfmt );
+        return vf_next_query_format( vf, vf->priv->outfmt );
     }
     return 0;
 }
@@ -280,32 +280,32 @@
     memset( vf->priv, 0, sizeof(struct vf_priv_s) );
 
     if( args ) {
-	char *args2 = strchr( args, 'l' );
-	if( args2 )
-	    parse( &vf->priv->lumaParam, args2 );
-	else {
-	    vf->priv->lumaParam.amount =
-	    vf->priv->lumaParam.msizeX =
-	    vf->priv->lumaParam.msizeY = 0;
-	}
+        char *args2 = strchr( args, 'l' );
+        if( args2 )
+            parse( &vf->priv->lumaParam, args2 );
+        else {
+            vf->priv->lumaParam.amount =
+            vf->priv->lumaParam.msizeX =
+            vf->priv->lumaParam.msizeY = 0;
+        }
 
-	args2 = strchr( args, 'c' );
-	if( args2 )
-	    parse( &vf->priv->chromaParam, args2 );
-	else {
-	    vf->priv->chromaParam.amount =
-	    vf->priv->chromaParam.msizeX =
-	    vf->priv->chromaParam.msizeY = 0;
-	}
+        args2 = strchr( args, 'c' );
+        if( args2 )
+            parse( &vf->priv->chromaParam, args2 );
+        else {
+            vf->priv->chromaParam.amount =
+            vf->priv->chromaParam.msizeX =
+            vf->priv->chromaParam.msizeY = 0;
+        }
 
-	if( !vf->priv->lumaParam.msizeX && !vf->priv->chromaParam.msizeX )
-	    return 0; // nothing to do
+        if( !vf->priv->lumaParam.msizeX && !vf->priv->chromaParam.msizeX )
+            return 0; // nothing to do
     }
 
     // check csp:
     vf->priv->outfmt = vf_match_csp( &vf->next, fmt_list, IMGFMT_YV12 );
     if( !vf->priv->outfmt ) {
-	uninit( vf );
+        uninit( vf );
         return 0; // no csp match :(
     }
 
--- a/libmpcodecs/vf_uspp.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_uspp.c	Fri Jan 14 22:10:21 2011 +0000
@@ -113,27 +113,27 @@
 };
 
 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
-	int y, x;
+        int y, x;
 
 #define STORE(pos) \
-	temp= ((src[x + y*src_stride + pos]<<log2_scale) + d[pos])>>8;\
-	if(temp & 0x100) temp= ~(temp>>31);\
-	dst[x + y*dst_stride + pos]= temp;
+        temp= ((src[x + y*src_stride + pos]<<log2_scale) + d[pos])>>8;\
+        if(temp & 0x100) temp= ~(temp>>31);\
+        dst[x + y*dst_stride + pos]= temp;
 
-	for(y=0; y<height; y++){
-		const uint8_t *d= dither[y&7];
-		for(x=0; x<width; x+=8){
-			int temp;
-			STORE(0);
-			STORE(1);
-			STORE(2);
-			STORE(3);
-			STORE(4);
-			STORE(5);
-			STORE(6);
-			STORE(7);
-		}
-	}
+        for(y=0; y<height; y++){
+                const uint8_t *d= dither[y&7];
+                for(x=0; x<width; x+=8){
+                        int temp;
+                        STORE(0);
+                        STORE(1);
+                        STORE(2);
+                        STORE(3);
+                        STORE(4);
+                        STORE(5);
+                        STORE(6);
+                        STORE(7);
+                }
+        }
 }
 
 static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int dst_stride[3], int src_stride[3], int width, int height, uint8_t *qp_store, int qp_stride){
@@ -207,7 +207,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
         int i;
         AVCodec *enc= avcodec_find_encoder(CODEC_ID_SNOW);
 
@@ -243,7 +243,7 @@
         vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10;
         vf->priv->outbuf= malloc(vf->priv->outbuf_size);
 
-	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+        return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
 static void get_image(struct vf_instance *vf, mp_image_t *mpi){
@@ -257,8 +257,8 @@
     if(mpi->flags&MP_IMGFLAG_PLANAR){
         mpi->planes[1]=vf->dmpi->planes[1];
         mpi->planes[2]=vf->dmpi->planes[2];
-	mpi->stride[1]=vf->dmpi->stride[1];
-	mpi->stride[2]=vf->dmpi->stride[2];
+        mpi->stride[1]=vf->dmpi->stride[1];
+        mpi->stride[2]=vf->dmpi->stride[2];
     }
     mpi->flags|=MP_IMGFLAG_DIRECT;
 }
@@ -319,12 +319,12 @@
 //===========================================================================//
 static int query_format(struct vf_instance *vf, unsigned int fmt){
     switch(fmt){
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	case IMGFMT_Y800:
-	case IMGFMT_Y8:
-	    return vf_next_query_format(vf,fmt);
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+        case IMGFMT_Y800:
+        case IMGFMT_Y8:
+            return vf_next_query_format(vf,fmt);
     }
     return 0;
 }
@@ -332,11 +332,11 @@
 static int control(struct vf_instance *vf, int request, void* data){
     switch(request){
     case VFCTRL_QUERY_MAX_PP_LEVEL:
-	return 8;
+        return 8;
     case VFCTRL_SET_PP_LEVEL:
-	vf->priv->log2_count= *((unsigned int*)data);
+        vf->priv->log2_count= *((unsigned int*)data);
         //FIXME we have to realloc a few things here
-	return CONTROL_TRUE;
+        return CONTROL_TRUE;
     }
     return vf_next_control(vf,request,data);
 }
@@ -368,7 +368,7 @@
 
 // #if HAVE_MMX
 //     if(gCpuCaps.hasMMX){
-// 	store_slice= store_slice_mmx;
+//         store_slice= store_slice_mmx;
 //     }
 // #endif
 
--- a/libmpcodecs/vf_yuvcsp.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_yuvcsp.c	Fri Jan 14 22:10:21 2011 +0000
@@ -36,7 +36,7 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
     return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
 }
 
@@ -54,8 +54,8 @@
     uint8_t *y_out, *cb_out, *cr_out;
 
     vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
-	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
-	mpi->width, mpi->height);
+        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
+        mpi->width, mpi->height);
 
     y_in = mpi->planes[0];
     cb_in = mpi->planes[1];
@@ -66,15 +66,15 @@
     cr_out = vf->dmpi->planes[2];
 
     for (i = 0; i < mpi->height; i++)
-	for (j = 0; j < mpi->width; j++)
-	    y_out[i*vf->dmpi->stride[0]+j] = clamp_y(y_in[i*mpi->stride[0]+j]);
+        for (j = 0; j < mpi->width; j++)
+            y_out[i*vf->dmpi->stride[0]+j] = clamp_y(y_in[i*mpi->stride[0]+j]);
 
     for (i = 0; i < mpi->chroma_height; i++)
-	for (j = 0; j < mpi->chroma_width; j++)
-	{
-	    cb_out[i*vf->dmpi->stride[1]+j] = clamp_c(cb_in[i*mpi->stride[1]+j]);
-	    cr_out[i*vf->dmpi->stride[2]+j] = clamp_c(cr_in[i*mpi->stride[2]+j]);
-	}
+        for (j = 0; j < mpi->chroma_width; j++)
+        {
+            cb_out[i*vf->dmpi->stride[1]+j] = clamp_c(cb_in[i*mpi->stride[1]+j]);
+            cr_out[i*vf->dmpi->stride[2]+j] = clamp_c(cr_in[i*mpi->stride[2]+j]);
+        }
 
     return vf_next_put_image(vf,vf->dmpi, pts);
 }
@@ -83,16 +83,16 @@
 
 /*
 static void uninit(struct vf_instance *vf){
-	free(vf->priv);
+        free(vf->priv);
 }
 */
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
     switch(fmt){
-	case IMGFMT_YV12:
-	case IMGFMT_I420:
-	case IMGFMT_IYUV:
-	    return 1;
+        case IMGFMT_YV12:
+        case IMGFMT_I420:
+        case IMGFMT_IYUV:
+            return 1;
     }
     return 0;
 }
@@ -104,7 +104,7 @@
     vf->query_format=query_format;
 //    vf->priv=calloc(1, sizeof(struct vf_priv_s));
 //    if (args)
-//	vf->priv->csp = atoi(args);
+//        vf->priv->csp = atoi(args);
     return 1;
 }
 
--- a/libmpcodecs/vf_yvu9.c	Fri Jan 14 13:36:48 2011 +0000
+++ b/libmpcodecs/vf_yvu9.c	Fri Jan 14 22:10:21 2011 +0000
@@ -35,11 +35,11 @@
 
 static int config(struct vf_instance *vf,
         int width, int height, int d_width, int d_height,
-	unsigned int flags, unsigned int outfmt){
+        unsigned int flags, unsigned int outfmt){
 
     if(vf_next_query_format(vf,IMGFMT_YV12)<=0){
-	mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YVU9");
-	return 0;
+        mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_WarnNextFilterDoesntSupport, "YVU9");
+        return 0;
     }
 
     return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_YV12);
@@ -51,26 +51,26 @@
 
     // hope we'll get DR buffer:
     dmpi=vf_get_image(vf->next,IMGFMT_YV12,
-	MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/,
-	mpi->w, mpi->h);
+        MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/,
+        mpi->w, mpi->h);
 
     for(y=0;y<mpi->h;y++)
-	fast_memcpy(dmpi->planes[0]+dmpi->stride[0]*y,
-	       mpi->planes[0]+mpi->stride[0]*y,
-	       mpi->w);
+        fast_memcpy(dmpi->planes[0]+dmpi->stride[0]*y,
+               mpi->planes[0]+mpi->stride[0]*y,
+               mpi->w);
 
     w=mpi->w/4; h=mpi->h/2;
     for(y=0;y<h;y++){
-	unsigned char* s=mpi->planes[1]+mpi->stride[1]*(y>>1);
-	unsigned char* d=dmpi->planes[1]+dmpi->stride[1]*y;
-	int x;
-	for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];
+        unsigned char* s=mpi->planes[1]+mpi->stride[1]*(y>>1);
+        unsigned char* d=dmpi->planes[1]+dmpi->stride[1]*y;
+        int x;
+        for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];
     }
     for(y=0;y<h;y++){
-	unsigned char* s=mpi->planes[2]+mpi->stride[2]*(y>>1);
-	unsigned char* d=dmpi->planes[2]+dmpi->stride[2]*y;
-	int x;
-	for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];
+        unsigned char* s=mpi->planes[2]+mpi->stride[2]*(y>>1);
+        unsigned char* d=dmpi->planes[2]+dmpi->stride[2]*y;
+        int x;
+        for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];
     }
 
     vf_clone_mpi_attributes(dmpi, mpi);
@@ -82,7 +82,7 @@
 
 static int query_format(struct vf_instance *vf, unsigned int fmt){
     if (fmt == IMGFMT_YVU9 || fmt == IMGFMT_IF09)
-	return vf_next_query_format(vf,IMGFMT_YV12) & (~VFCAP_CSP_SUPPORTED_BY_HW);
+        return vf_next_query_format(vf,IMGFMT_YV12) & (~VFCAP_CSP_SUPPORTED_BY_HW);
     return 0;
 }
 
--- a/libvo/fastmemcpy.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/libvo/fastmemcpy.h	Fri Jan 14 22:10:21 2011 +0000
@@ -34,30 +34,30 @@
 
 static inline void * mem2agpcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride)
 {
-	int i;
-	void *retval=dst;
+    int i;
+    void *retval=dst;
 
-	if(dstStride == srcStride)
-	{
-		if (srcStride < 0) {
-	    		src = (uint8_t*)src + (height-1)*srcStride;
-	    		dst = (uint8_t*)dst + (height-1)*dstStride;
-	    		srcStride = -srcStride;
-		}
+    if(dstStride == srcStride)
+    {
+        if (srcStride < 0) {
+                src = (uint8_t*)src + (height-1)*srcStride;
+                dst = (uint8_t*)dst + (height-1)*dstStride;
+                srcStride = -srcStride;
+        }
 
-		mem2agpcpy(dst, src, srcStride*height);
-	}
-	else
-	{
-		for(i=0; i<height; i++)
-		{
-			mem2agpcpy(dst, src, bytesPerLine);
-			src = (uint8_t*)src + srcStride;
-			dst = (uint8_t*)dst + dstStride;
-		}
-	}
+        mem2agpcpy(dst, src, srcStride*height);
+    }
+    else
+    {
+        for(i=0; i<height; i++)
+        {
+            mem2agpcpy(dst, src, bytesPerLine);
+            src = (uint8_t*)src + srcStride;
+            dst = (uint8_t*)dst + dstStride;
+        }
+    }
 
-	return retval;
+    return retval;
 }
 
 #define memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 0)
@@ -71,30 +71,30 @@
                                  int bytesPerLine, int height,
                                  int dstStride, int srcStride, int limit2width)
 {
-	int i;
-	void *retval=dst;
+    int i;
+    void *retval=dst;
 
-	if(!limit2width && dstStride == srcStride)
-	{
-		if (srcStride < 0) {
-	    		src = (uint8_t*)src + (height-1)*srcStride;
-	    		dst = (uint8_t*)dst + (height-1)*dstStride;
-	    		srcStride = -srcStride;
-		}
+    if(!limit2width && dstStride == srcStride)
+    {
+        if (srcStride < 0) {
+                src = (uint8_t*)src + (height-1)*srcStride;
+                dst = (uint8_t*)dst + (height-1)*dstStride;
+                srcStride = -srcStride;
+        }
 
-		fast_memcpy(dst, src, srcStride*height);
-	}
-	else
-	{
-		for(i=0; i<height; i++)
-		{
-			fast_memcpy(dst, src, bytesPerLine);
-			src = (uint8_t*)src + srcStride;
-			dst = (uint8_t*)dst + dstStride;
-		}
-	}
+        fast_memcpy(dst, src, srcStride*height);
+    }
+    else
+    {
+        for(i=0; i<height; i++)
+        {
+            fast_memcpy(dst, src, bytesPerLine);
+            src = (uint8_t*)src + srcStride;
+            dst = (uint8_t*)dst + dstStride;
+        }
+    }
 
-	return retval;
+    return retval;
 }
 
 #endif /* MPLAYER_FASTMEMCPY_H */
--- a/libvo/video_out.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/libvo/video_out.h	Fri Jan 14 22:10:21 2011 +0000
@@ -95,19 +95,19 @@
   int w,h;
 } mp_win_t;
 
-#define VO_TRUE		1
-#define VO_FALSE	0
-#define VO_ERROR	-1
-#define VO_NOTAVAIL	-2
-#define VO_NOTIMPL	-3
+#define VO_TRUE      1
+#define VO_FALSE     0
+#define VO_ERROR    -1
+#define VO_NOTAVAIL -2
+#define VO_NOTIMPL  -3
 
-#define VOFLAG_FULLSCREEN	0x01
-#define VOFLAG_MODESWITCHING	0x02
-#define VOFLAG_SWSCALE		0x04
-#define VOFLAG_FLIPPING		0x08
-#define VOFLAG_HIDDEN		0x10  //< Use to create a hidden window
-#define VOFLAG_STEREO		0x20  //< Use to create a stereo-capable window
-#define VOFLAG_XOVERLAY_SUB_VO  0x10000
+#define VOFLAG_FULLSCREEN         0x01
+#define VOFLAG_MODESWITCHING      0x02
+#define VOFLAG_SWSCALE            0x04
+#define VOFLAG_FLIPPING           0x08
+#define VOFLAG_HIDDEN             0x10  //< Use to create a hidden window
+#define VOFLAG_STEREO             0x20  //< Use to create a stereo-capable window
+#define VOFLAG_XOVERLAY_SUB_VO 0x10000
 
 typedef struct vo_info_s
 {
@@ -257,8 +257,8 @@
 
 typedef struct {
         float min;
-	float max;
-	} range_t;
+        float max;
+        } range_t;
 
 float range_max(range_t *r);
 int in_range(range_t *r, float f);
--- a/mp_msg.h	Fri Jan 14 13:36:48 2011 +0000
+++ b/mp_msg.h	Fri Jan 14 22:10:21 2011 +0000
@@ -50,8 +50,8 @@
 #define MSGT_CPLAYER 1       // console player (mplayer.c)
 #define MSGT_GPLAYER 2       // gui player
 
-#define MSGT_VO 3	       // libvo
-#define MSGT_AO 4	       // libao
+#define MSGT_VO 3       // libvo
+#define MSGT_AO 4       // libao
 
 #define MSGT_DEMUXER 5    // demuxer.c (general stuff)
 #define MSGT_DS 6         // demux stream (add/read packet etc)
@@ -66,26 +66,26 @@
 #define MSGT_DECAUDIO 12  // av decoder
 #define MSGT_DECVIDEO 13
 
-#define MSGT_SEEK 14	// seeking code
-#define MSGT_WIN32 15	// win32 dll stuff
-#define MSGT_OPEN 16	// open.c (stream opening)
-#define MSGT_DVD 17	// open.c (DVD init/read/seek)
+#define MSGT_SEEK 14    // seeking code
+#define MSGT_WIN32 15   // win32 dll stuff
+#define MSGT_OPEN 16    // open.c (stream opening)
+#define MSGT_DVD 17     // open.c (DVD init/read/seek)
 
-#define MSGT_PARSEES 18	// parse_es.c (mpeg stream parser)
-#define MSGT_LIRC 19	// lirc_mp.c and input lirc driver
+#define MSGT_PARSEES 18 // parse_es.c (mpeg stream parser)
+#define MSGT_LIRC 19    // lirc_mp.c and input lirc driver
 
 #define MSGT_STREAM 20  // stream.c
-#define MSGT_CACHE 21 	// cache2.c
+#define MSGT_CACHE 21   // cache2.c
 
 #define MSGT_MENCODER 22
 
-#define MSGT_XACODEC 23	// XAnim codecs
+#define MSGT_XACODEC 23 // XAnim codecs
 
-#define MSGT_TV 24	// TV input subsystem
+#define MSGT_TV 24      // TV input subsystem
 
-#define MSGT_OSDEP 25	// OS-dependent parts
+#define MSGT_OSDEP 25  // OS-dependent parts
 
-#define MSGT_SPUDEC 26	// spudec.c
+#define MSGT_SPUDEC 26 // spudec.c
 
 #define MSGT_PLAYTREE 27    // Playtree handeling (playtree.c, playtreeparser.c)