View | Details | Raw Unified
Collapse All | Expand All

(-) motion.c.orig (+128 lines)
 Lines 146-157    Link Here 
    " pxor        %%mm7 , %%mm7;           /* clear mm7                                          */\n"
    " pxor        %%mm7 , %%mm7;           /* clear mm7                                          */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
    " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    ".rept 8                    ;          /* Loop for 8 lines                                   */\n"
    ".rept 8                    ;          /* Loop for 8 lines                                   */\n"
    " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */\n"
    " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
    " movq        (%%esi), %%mm2;          /* 8 Pixels from reference frame to mm2               */\n"
#else
    " movq        (%%ebx), %%mm2;          /* 8 Pixels from reference frame to mm2               */\n"
    " movq        (%%ebx), %%mm2;          /* 8 Pixels from reference frame to mm2               */\n"
#endif
    " movq         %%mm2 , %%mm3;          /* hold a copy of mm2 in mm3                          */\n"
    " movq         %%mm2 , %%mm3;          /* hold a copy of mm2 in mm3                          */\n"
    " psubusb      %%mm1 , %%mm3;          /* positive differences between mm2 and mm1           */\n"
    " psubusb      %%mm1 , %%mm3;          /* positive differences between mm2 and mm1           */\n"
    " psubusb      %%mm2 , %%mm1;          /* positive differences between mm1 and mm3           */\n"
    " psubusb      %%mm2 , %%mm1;          /* positive differences between mm1 and mm3           */\n"
 Lines 162-174    Link Here 
    " paddusw      %%mm1 , %%mm0;          /* add mm1 (stored in mm1 and mm2...)                 */\n"
    " paddusw      %%mm1 , %%mm0;          /* add mm1 (stored in mm1 and mm2...)                 */\n"
    " paddusw      %%mm2 , %%mm0;          /* to mm0                                             */\n"
    " paddusw      %%mm2 , %%mm0;          /* to mm0                                             */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
    " addl         %%ecx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
    " .endr                                /* end loop                                           */\n"
    " .endr                                /* end loop                                           */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    :"=m" (a)     
    :"=m" (a)     
    :"m" (frm), "m" (ref), "m" (denoiser.frame.w)
    :"m" (frm), "m" (ref), "m" (denoiser.frame.w)
#ifdef __PIC__
    :"%eax", "%esi", "%ecx"
#else
    :"%eax", "%ebx", "%ecx"
    :"%eax", "%ebx", "%ecx"
#endif
    );
    );
#endif
#endif
 Lines 191-211    Link Here 
    (
    (
    " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
    " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
    " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
    " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    "                           ;          /*                                                    */\n"
    "                           ;          /*                                                    */\n"
    " .rept 8                   ;          /*                                                    */\n"
    " .rept 8                   ;          /*                                                    */\n"
    " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */\n"
    " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
    " psadbw      (%%esi), %%mm1;          /* 8 Pixels difference to mm1                         */\n"
#else
    " psadbw      (%%ebx), %%mm1;          /* 8 Pixels difference to mm1                         */\n"
    " psadbw      (%%ebx), %%mm1;          /* 8 Pixels difference to mm1                         */\n"
#endif
    " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
    " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
    " addl         %%ecx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
    " .endr                     ;          /*                                                    */\n"
    " .endr                     ;          /*                                                    */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    :"=m" (a)     
    :"=m" (a)     
    :"m" (frm), "m" (ref), "m" (denoiser.frame.w)
    :"m" (frm), "m" (ref), "m" (denoiser.frame.w)
#ifdef __PIC__
    :"%eax", "%esi", "%ecx"
#else
    :"%eax", "%ebx", "%ecx"
    :"%eax", "%ebx", "%ecx"
#endif
    );
    );
#endif
#endif
  return a;
  return a;
 Lines 254-265    Link Here 
    " pxor        %%mm7 , %%mm7;           /* clear mm7                                          */\n"
    " pxor        %%mm7 , %%mm7;           /* clear mm7                                          */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
    " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    ".rept 4                    ;          /* Loop for 4 lines                                   */\n"
    ".rept 4                    ;          /* Loop for 4 lines                                   */\n"
    " movd        (%%eax), %%mm1;          /* 4 Pixels from filtered frame to mm1                */\n"
    " movd        (%%eax), %%mm1;          /* 4 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
    " movd        (%%esi), %%mm2;          /* 4 Pixels from reference frame to mm2               */\n"
#else
    " movd        (%%ebx), %%mm2;          /* 4 Pixels from reference frame to mm2               */\n"
    " movd        (%%ebx), %%mm2;          /* 4 Pixels from reference frame to mm2               */\n"
#endif
    " movq         %%mm2 , %%mm3;          /* hold a copy of mm2 in mm3                          */\n"
    " movq         %%mm2 , %%mm3;          /* hold a copy of mm2 in mm3                          */\n"
    " psubusb      %%mm1 , %%mm3;          /* positive differences between mm2 and mm1           */\n"
    " psubusb      %%mm1 , %%mm3;          /* positive differences between mm2 and mm1           */\n"
    " psubusb      %%mm2 , %%mm1;          /* positive differences between mm1 and mm3           */\n"
    " psubusb      %%mm2 , %%mm1;          /* positive differences between mm1 and mm3           */\n"
 Lines 270-282    Link Here 
    " paddusw      %%mm1 , %%mm2;          /* add mm1 (stored in mm1 and mm2...)                 */\n"
    " paddusw      %%mm1 , %%mm2;          /* add mm1 (stored in mm1 and mm2...)                 */\n"
    " paddusw      %%mm2 , %%mm0;          /* to mm0                                             */\n"
    " paddusw      %%mm2 , %%mm0;          /* to mm0                                             */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
    " addl         %%ecx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
    " .endr                                /* end loop                                           */\n"
    " .endr                                /* end loop                                           */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    :"=m" (a)     
    :"=m" (a)     
    :"m" (frm), "m" (ref), "m" (halfwidth)
    :"m" (frm), "m" (ref), "m" (halfwidth)
#ifdef __PIC__
    :"%eax", "%esi", "%ecx"
#else
    :"%eax", "%ebx", "%ecx"
    :"%eax", "%ebx", "%ecx"
#endif
    );
    );
#endif
#endif
  return (uint32_t)(a[0]+a[1]+a[2]+a[3]);
  return (uint32_t)(a[0]+a[1]+a[2]+a[3]);
 Lines 300-312    Link Here 
    " pxor        %%mm7 , %%mm7;           /* clear mm7                                          */\n"
    " pxor        %%mm7 , %%mm7;           /* clear mm7                                          */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
    " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    ".rept 8                    ;          /* Loop for 8 lines                                   */\n"
    ".rept 8                    ;          /* Loop for 8 lines                                   */\n"
    " movw        (%%eax),  %%dx;          /*                                                    */\n"
    " movw        (%%eax),  %%dx;          /*                                                    */\n"
    " movd         %%edx , %%mm1;          /* 2 Pixels from filtered frame to mm1                */\n"
    " movd         %%edx , %%mm1;          /* 2 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
    " movw        (%%esi),  %%dx;          /*                                                    */\n"
#else
    " movw        (%%ebx),  %%dx;          /*                                                    */\n"
    " movw        (%%ebx),  %%dx;          /*                                                    */\n"
#endif
    " movd         %%edx , %%mm2;          /* 2 Pixels from reference frame to mm2               */\n"
    " movd         %%edx , %%mm2;          /* 2 Pixels from reference frame to mm2               */\n"
    " movq         %%mm2 , %%mm3;          /* hold a copy of mm2 in mm3                          */\n"
    " movq         %%mm2 , %%mm3;          /* hold a copy of mm2 in mm3                          */\n"
    " psubusb      %%mm1 , %%mm3;          /* positive differences between mm2 and mm1           */\n"
    " psubusb      %%mm1 , %%mm3;          /* positive differences between mm2 and mm1           */\n"
 Lines 318-330    Link Here 
    " paddusw      %%mm1 , %%mm2;          /* add mm1 (stored in mm1 and mm2...)                 */\n"
    " paddusw      %%mm1 , %%mm2;          /* add mm1 (stored in mm1 and mm2...)                 */\n"
    " paddusw      %%mm2 , %%mm0;          /* to mm0                                             */\n"
    " paddusw      %%mm2 , %%mm0;          /* to mm0                                             */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
    " addl         %%ecx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
    " .endr                                /* end loop                                           */\n"
    " .endr                                /* end loop                                           */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    :"=m" (a)     
    :"=m" (a)     
    :"m" (frm), "m" (ref), "m" (W2)
    :"m" (frm), "m" (ref), "m" (W2)
#ifdef __PIC__
    :"%eax", "%esi", "%ecx"
#else
    :"%eax", "%ebx", "%ecx"
    :"%eax", "%ebx", "%ecx"
#endif
    );
    );
#endif
#endif
  return (uint32_t)(a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]);
  return (uint32_t)(a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]);
 Lines 348-369    Link Here 
    (
    (
    " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
    " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
    " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
    " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    "                           ;          /*                                                    */\n"
    "                           ;          /*                                                    */\n"
    " .rept 4                   ;          /*                                                    */\n"
    " .rept 4                   ;          /*                                                    */\n"
    " movd        (%%eax), %%mm1;          /* 4 Pixels from filtered frame to mm1                */\n"
    " movd        (%%eax), %%mm1;          /* 4 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
    " movd        (%%esi), %%mm2;          /* 4 Pixels from filtered frame to mm2                */\n"
#else
    " movd        (%%ebx), %%mm2;          /* 4 Pixels from filtered frame to mm2                */\n"
    " movd        (%%ebx), %%mm2;          /* 4 Pixels from filtered frame to mm2                */\n"
#endif
    " psadbw       %%mm2 , %%mm1;          /* 4 Pixels difference to mm1                         */\n"
    " psadbw       %%mm2 , %%mm1;          /* 4 Pixels difference to mm1                         */\n"
    " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
    " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
    " addl         %%ecx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
    " .endr                     ;          /*                                                    */\n"
    " .endr                     ;          /*                                                    */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    :"=m" (a)     
    :"=m" (a)     
    :"m" (frm), "m" (ref), "m" (halfwidth)
    :"m" (frm), "m" (ref), "m" (halfwidth)
#ifdef __PIC__
    :"%eax", "%esi", "%ecx"
#else
    :"%eax", "%ebx", "%ecx"
    :"%eax", "%ebx", "%ecx"
#endif
    );
    );
#endif
#endif
  return a;
  return a;
 Lines 385-408    Link Here 
    (
    (
    " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
    " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
    " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
    " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    " movl         %3    , %%ecx;          /* load width       into ecx                          */\n"
    "                           ;          /*                                                    */\n"
    "                           ;          /*                                                    */\n"
    " .rept 8                   ;          /*                                                    */\n"
    " .rept 8                   ;          /*                                                    */\n"
    " movw        (%%eax),  %%dx;          /*                                                    */\n"
    " movw        (%%eax),  %%dx;          /*                                                    */\n"
    " movd         %%edx , %%mm1;          /* 2 Pixels from filtered frame to mm1                */\n"
    " movd         %%edx , %%mm1;          /* 2 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
    " movw        (%%esi),  %%dx;          /*                                                    */\n"
#else
    " movw        (%%ebx),  %%dx;          /*                                                    */\n"
    " movw        (%%ebx),  %%dx;          /*                                                    */\n"
#endif
    " movd         %%edx , %%mm2;          /* 2 Pixels from filtered frame to mm2                */\n"
    " movd         %%edx , %%mm2;          /* 2 Pixels from filtered frame to mm2                */\n"
    " psadbw       %%mm2 , %%mm1;          /* 2 Pixels difference to mm1                         */\n"
    " psadbw       %%mm2 , %%mm1;          /* 2 Pixels difference to mm1                         */\n"
    " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
    " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
    " addl         %%ecx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
    " addl         %%ecx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
    " .endr                     ;          /*                                                    */\n"
    " .endr                     ;          /*                                                    */\n"
    "                                      /*                                                    */\n"
    "                                      /*                                                    */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
    :"=m" (a)     
    :"=m" (a)     
    :"m" (frm), "m" (ref), "m" (W2)
    :"m" (frm), "m" (ref), "m" (W2)
#ifdef __PIC__
    :"%eax", "%esi", "%ecx"
#else
    :"%eax", "%ebx", "%ecx"
    :"%eax", "%ebx", "%ecx"
#endif
    );
    );
#endif
#endif
  return a;
  return a;
 Lines 448-460    Link Here 
      (
      (
	  " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */"
	  " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */"
	  " movl         %1    , %%eax;          /* load frameadress into eax                          */"
	  " movl         %1    , %%eax;          /* load frameadress into eax                          */"
#ifdef __PIC__
	  " movl         %2    , %%esi;          /* load frameadress into esi                          */"
#else
	  " movl         %2    , %%ebx;          /* load frameadress into ebx                          */"
	  " movl         %2    , %%ebx;          /* load frameadress into ebx                          */"
#endif
	  " movl         %3    , %%ecx;          /* load frameadress into ecx                          */"
	  " movl         %3    , %%ecx;          /* load frameadress into ecx                          */"
	  " movl         %4    , %%edx;          /* load width       into edx                          */"
	  " movl         %4    , %%edx;          /* load width       into edx                          */"
	  "                           ;          /*                                                    */"
	  "                           ;          /*                                                    */"
	  " .rept 8                   ;          /*                                                    */"
	  " .rept 8                   ;          /*                                                    */"
	  " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */"
	  " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */"
#ifdef __PIC__
	  " movq        (%%esi), %%mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */"
#else
	  " movq        (%%ebx), %%mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */"
	  " movq        (%%ebx), %%mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */"
#endif
	  " movq        (%%ecx), %%mm3;          /* reference to mm3                                   */"
	  " movq        (%%ecx), %%mm3;          /* reference to mm3                                   */"
	  " psrlq        $1    , %%mm1;          /* average source pixels                              */"
	  " psrlq        $1    , %%mm1;          /* average source pixels                              */"
	  " psrlq        $1    , %%mm2;          /* shift right by one (divide by two)                 */"
	  " psrlq        $1    , %%mm2;          /* shift right by one (divide by two)                 */"
 Lines 468-481    Link Here 
	  " paddusb      %%mm3 , %%mm1;          /* mm1 now contains abs(mm1-mm2) */"
	  " paddusb      %%mm3 , %%mm1;          /* mm1 now contains abs(mm1-mm2) */"
	  " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */"
	  " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */"
	  " addl         %%edx , %%eax;          /* add framewidth to frameaddress                     */"
	  " addl         %%edx , %%eax;          /* add framewidth to frameaddress                     */"
#ifdef __PIC__
	  " addl         %%edx , %%esi;          /* add framewidth to frameaddress                     */"
#else
	  " addl         %%edx , %%ebx;          /* add framewidth to frameaddress                     */"
	  " addl         %%edx , %%ebx;          /* add framewidth to frameaddress                     */"
#endif
	  " addl         %%edx , %%ecx;          /* add framewidth to frameaddress                     */"
	  " addl         %%edx , %%ecx;          /* add framewidth to frameaddress                     */"
	  " .endr                     ;          /*                                                    */"
	  " .endr                     ;          /*                                                    */"
	  "                                      /*                                                    */"
	  "                                      /*                                                    */"
	  " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */"
	  " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */"
	  :"=m" (a)     
	  :"=m" (a)     
	  :"m" (frm1),"m" (frm2), "m" (ref), "m" (denoiser.frame.w), "m" (*bit_mask)
	  :"m" (frm1),"m" (frm2), "m" (ref), "m" (denoiser.frame.w), "m" (*bit_mask)
#ifdef __PIC__
	  :"%eax", "%esi", "%ecx", "%edx"
#else
	  :"%eax", "%ebx", "%ecx", "%edx"
	  :"%eax", "%ebx", "%ecx", "%edx"
#endif
	  );
	  );
#endif
#endif
  return a;
  return a;
 Lines 497-522    Link Here 
      (
      (
	  " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
	  " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */\n"
	  " movl         %1    , %%eax;          /* load frameadress into eax                          */\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"
	  " movl         %2    , %%ebx;          /* load frameadress into ebx                          */\n"
#endif
	  " movl         %3    , %%ecx;          /* load frameadress into ecx                          */\n"
	  " movl         %3    , %%ecx;          /* load frameadress into ecx                          */\n"
	  " movl         %4    , %%edx;          /* load width       into edx                          */\n"
	  " movl         %4    , %%edx;          /* load width       into edx                          */\n"
	  "                           ;          /*                                                    */\n"
	  "                           ;          /*                                                    */\n"
	  " .rept 8                   ;          /*                                                    */\n"
	  " .rept 8                   ;          /*                                                    */\n"
	  " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */\n"
	  " movq        (%%eax), %%mm1;          /* 8 Pixels from filtered frame to mm1                */\n"
#ifdef __PIC__
	  " movq        (%%esi), %%mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */\n"
#else
	  " movq        (%%ebx), %%mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */\n"
	  " movq        (%%ebx), %%mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */\n"
#endif
	  " movq        (%%ecx), %%mm3;          /* 8 Pixels from reference frame to mm3               */\n"
	  " movq        (%%ecx), %%mm3;          /* 8 Pixels from reference frame to mm3               */\n"
	  " pavgb        %%mm2 , %%mm1;          /* average source pixels                              */\n"
	  " pavgb        %%mm2 , %%mm1;          /* average source pixels                              */\n"
	  " psadbw       %%mm3 , %%mm1;          /* 8 Pixels difference to mm1                         */\n"
	  " psadbw       %%mm3 , %%mm1;          /* 8 Pixels difference to mm1                         */\n"
	  " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
	  " paddusw      %%mm1 , %%mm0;          /* add result to mm0                                  */\n"
	  " addl         %%edx , %%eax;          /* add framewidth to frameaddress                     */\n"
	  " addl         %%edx , %%eax;          /* add framewidth to frameaddress                     */\n"
#ifdef __PIC__
	  " addl         %%edx , %%esi;          /* add framewidth to frameaddress                     */\n"
#else
	  " addl         %%edx , %%ebx;          /* add framewidth to frameaddress                     */\n"
	  " addl         %%edx , %%ebx;          /* add framewidth to frameaddress                     */\n"
#endif
	  " addl         %%edx , %%ecx;          /* add framewidth to frameaddress                     */\n"
	  " addl         %%edx , %%ecx;          /* add framewidth to frameaddress                     */\n"
	  " .endr                     ;          /*                                                    */\n"
	  " .endr                     ;          /*                                                    */\n"
	  "                                      /*                                                    */\n"
	  "                                      /*                                                    */\n"
	  " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
	  " movq         %%mm0 , %0   ;          /* make mm0 available to gcc ...                      */\n"
	  :"=m" (a)     
	  :"=m" (a)     
	  :"m" (frm1),"m" (frm2), "m" (ref), "m" (denoiser.frame.w)
	  :"m" (frm1),"m" (frm2), "m" (ref), "m" (denoiser.frame.w)
#ifdef __PIC__
	  :"%eax", "%esi", "%ecx", "%edx"
#else
	  :"%eax", "%ebx", "%ecx", "%edx"
	  :"%eax", "%ebx", "%ecx", "%edx"
#endif
	  );
	  );
#endif
#endif
  return a;
  return a;