--- deinterlace.c.orig 2005-01-29 15:29:30.531946920 +0100 +++ deinterlace.c 2005-01-29 17:00:07.049470632 +0100 @@ -161,7 +161,11 @@ " pxor %%mm7 , %%mm7; /* clear mm7 */\n" " /* */\n" " movl %1 , %%eax; /* load frameadress into eax */\n" +#ifdef __PIC__ + " movl %2 , %%esi; /* load frameadress into esi */\n" +#else " movl %2 , %%ebx; /* load frameadress into ebx */\n" +#endif " movl %3 , %%ecx; /* load frameadress into ecx */\n" " /* */\n" " .rept 3 /* repeat 3 times */\n" @@ -177,7 +181,11 @@ " paddusw %%mm1 , %%mm0; /* add mm1 (stored in mm1 and mm2...) */\n" " paddusw %%mm2 , %%mm0; /* to mm0 */\n" " /* */\n" +#ifdef __PIC__ + " movq (%%esi), %%mm1; /* 8 Pixels from line */\n" +#else " movq (%%ebx), %%mm1; /* 8 Pixels from line */\n" +#endif " movq (%%ecx), %%mm2; /* 8 Pixels from displaced line */\n" " movq %%mm2 , %%mm3; /* hold a copy of mm2 in mm3 */\n" " psubusb %%mm1 , %%mm3; /* positive differences between mm2 and mm1 */\n" @@ -189,14 +197,22 @@ " paddusw %%mm1 , %%mm0; /* add mm1 (stored in mm1 and mm2...) */\n" " paddusw %%mm2 , %%mm0; /* to mm0 */\n" " addl $8 , %%eax; /* add 8 to frameaddress */\n" +#ifdef __PIC__ + " addl $8 , %%esi; /* add 8 to frameaddress */\n" +#else " addl $8 , %%ebx; /* add 8 to frameaddress */\n" +#endif " addl $8 , %%ecx; /* add 8 to frameaddress */\n" " .endr /* end loop */\n" " /* */\n" " movq %%mm0 , %0 ; /* make mm0 available to gcc ... */\n" :"=m" (a) :"m" (ref1), "m" (ref2), "m" (ref3) +#ifdef __PIC__ + :"%eax", "%esi", "%ecx" +#else :"%eax", "%ebx", "%ecx" +#endif ); d=a[0]+a[1]+a[2]+a[3];