changeset 402:92d143c2d5a8 libavcodec

removed unused code
author glantau
date Mon, 20 May 2002 16:25:09 +0000
parents e20655449d4a
children 2c3e25f4c496
files i386/dsputil_mmx.c i386/dsputil_mmx_avg.h
diffstat 2 files changed, 18 insertions(+), 233 deletions(-) [+]
line wrap: on
line diff
--- a/i386/dsputil_mmx.c	Mon May 20 16:24:39 2002 +0000
+++ b/i386/dsputil_mmx.c	Mon May 20 16:25:09 2002 +0000
@@ -907,162 +907,6 @@
   } while(--h);
 }
 
-static void sub_pixels_mmx( DCTELEM  *block, const UINT8 *pixels, int line_size, int h)
-{
-  DCTELEM  *p;
-  const UINT8 *pix;
-  p = block;
-  pix = pixels;
-  MOVQ_ZERO(mm7);
-  do {
-    __asm __volatile(
-	"movq	%0, %%mm0\n\t"
-	"movq	%1, %%mm2\n\t"
-	"movq	8%0, %%mm1\n\t"
-	"movq	%%mm2, %%mm3\n\t"
-	"punpcklbw %%mm7, %%mm2\n\t"
-	"punpckhbw %%mm7, %%mm3\n\t"
-	"psubsw %%mm2, %%mm0\n\t"
-	"psubsw %%mm3, %%mm1\n\t"
-	"movq	%%mm0, %0\n\t"
-	"movq	%%mm1, 8%0\n\t"
-	:"+m"(*p)
-	:"m"(*pix)
-	:"memory");
-   pix += line_size;
-   p +=   8;
-  } while (--h);
-}
-
-static void sub_pixels_x2_mmx( DCTELEM  *block, const UINT8 *pixels, int line_size, int h)
-{
-  DCTELEM  *p;
-  const UINT8 *pix;
-  p = block;
-  pix = pixels;
-  MOVQ_ZERO(mm7);
-  MOVQ_WONE(mm6);
-  JUMPALIGN();
-  do {
-    __asm __volatile(
-	"movq	%0, %%mm0\n\t"
-	"movq	%1, %%mm2\n\t"
-	"movq	8%0, %%mm1\n\t"
-	"movq	1%1, %%mm4\n\t"
-	"movq	%%mm2, %%mm3\n\t"
-	"movq	%%mm4, %%mm5\n\t"
-	"punpcklbw %%mm7, %%mm2\n\t"
-	"punpckhbw %%mm7, %%mm3\n\t"
-	"punpcklbw %%mm7, %%mm4\n\t"
-	"punpckhbw %%mm7, %%mm5\n\t"
-	"paddusw %%mm4, %%mm2\n\t"
-	"paddusw %%mm5, %%mm3\n\t"
-	"paddusw %%mm6, %%mm2\n\t"
-	"paddusw %%mm6, %%mm3\n\t"
-	"psrlw	$1, %%mm2\n\t"
-	"psrlw	$1, %%mm3\n\t"
-	"psubsw %%mm2, %%mm0\n\t"
-	"psubsw %%mm3, %%mm1\n\t"
-	"movq	%%mm0, %0\n\t"
-	"movq	%%mm1, 8%0\n\t"
-	:"+m"(*p)
-	:"m"(*pix)
-	:"memory");
-   pix += line_size;
-   p +=   8;
- } while (--h);
-}
-
-static void sub_pixels_y2_mmx( DCTELEM  *block, const UINT8 *pixels, int line_size, int h)
-{
-  DCTELEM  *p;
-  const UINT8 *pix;
-  p = block;
-  pix = pixels;
-  MOVQ_ZERO(mm7);
-  MOVQ_WONE(mm6);
-  do {
-    __asm __volatile(
-	"movq	%0, %%mm0\n\t"
-	"movq	%1, %%mm2\n\t"
-	"movq	8%0, %%mm1\n\t"
-	"movq	%2, %%mm4\n\t"
-	"movq	%%mm2, %%mm3\n\t"
-	"movq	%%mm4, %%mm5\n\t"
-	"punpcklbw %%mm7, %%mm2\n\t"
-	"punpckhbw %%mm7, %%mm3\n\t"
-	"punpcklbw %%mm7, %%mm4\n\t"
-	"punpckhbw %%mm7, %%mm5\n\t"
-	"paddusw %%mm4, %%mm2\n\t"
-	"paddusw %%mm5, %%mm3\n\t"
-	"paddusw %%mm6, %%mm2\n\t"
-	"paddusw %%mm6, %%mm3\n\t"
-	"psrlw	$1, %%mm2\n\t"
-	"psrlw	$1, %%mm3\n\t"
-	"psubsw %%mm2, %%mm0\n\t"
-	"psubsw %%mm3, %%mm1\n\t"
-	"movq	%%mm0, %0\n\t"
-	"movq	%%mm1, 8%0\n\t"
-	:"+m"(*p)
-	:"m"(*pix), "m"(*(pix+line_size))
-	:"memory");
-   pix += line_size;
-   p +=   8;
- } while (--h);
-}
-
-static void   sub_pixels_xy2_mmx( DCTELEM  *block, const UINT8 *pixels, int line_size, int h)
-{
-  DCTELEM  *p;
-  const UINT8 *pix;
-  p = block;
-  pix = pixels;
-  MOVQ_ZERO(mm7);
-  MOVQ_WTWO(mm6);
-  JUMPALIGN();
-  do {
-    __asm __volatile(
-	"movq	%1, %%mm0\n\t"
-	"movq	%2, %%mm1\n\t"
-	"movq	1%1, %%mm4\n\t"
-	"movq	1%2, %%mm5\n\t"
-	"movq	%%mm0, %%mm2\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"
-	"paddusw %%mm1, %%mm0\n\t"
-	"paddusw %%mm3, %%mm2\n\t"
-	"movq	%%mm4, %%mm1\n\t"
-	"movq	%%mm5, %%mm3\n\t"
-	"punpcklbw %%mm7, %%mm4\n\t"
-	"punpcklbw %%mm7, %%mm5\n\t"
-	"punpckhbw %%mm7, %%mm1\n\t"
-	"punpckhbw %%mm7, %%mm3\n\t"
-	"paddusw %%mm5, %%mm4\n\t"
-	"paddusw %%mm3, %%mm1\n\t"
-	"paddusw %%mm6, %%mm4\n\t"
-	"paddusw %%mm6, %%mm1\n\t"
-	"paddusw %%mm4, %%mm0\n\t"
-	"paddusw %%mm1, %%mm2\n\t"
-	"movq	%0, %%mm1\n\t"
-	"movq	8%0, %%mm3\n\t"
-	"psrlw	$2, %%mm0\n\t"
-	"psrlw	$2, %%mm2\n\t"
-	"psubsw %%mm0, %%mm1\n\t"
-	"psubsw %%mm2, %%mm3\n\t"
-	"movq	%%mm1, %0\n\t"
-	"movq	%%mm3, 8%0\n\t"
-	:"+m"(*p)
-	:"m"(*pix),
-	 "m"(*(pix+line_size))
-	:"memory");
-   pix += line_size;
-   p +=   8 ;
-  } while(--h);
-}
-
 static void clear_blocks_mmx(DCTELEM *blocks)
 {
         asm volatile(
@@ -1139,11 +983,6 @@
         avg_no_rnd_pixels_tab[2] = avg_no_rnd_pixels_y2_mmx;
         avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels_xy2_mmx;
 
-        sub_pixels_tab[0] = sub_pixels_mmx;
-        sub_pixels_tab[1] = sub_pixels_x2_mmx;
-        sub_pixels_tab[2] = sub_pixels_y2_mmx;
-        sub_pixels_tab[3] = sub_pixels_xy2_mmx;
-
         if (mm_flags & MM_MMXEXT) {
             pix_abs16x16    = pix_abs16x16_mmx2;
             pix_abs16x16_x2 = pix_abs16x16_x2_mmx2;
@@ -1164,9 +1003,6 @@
             avg_pixels_tab[1] = avg_pixels_x2_mmx2;
             avg_pixels_tab[2] = avg_pixels_y2_mmx2;
             avg_pixels_tab[3] = avg_pixels_xy2_mmx2;
-
-            sub_pixels_tab[1] = sub_pixels_x2_mmx2;
-            sub_pixels_tab[2] = sub_pixels_y2_mmx2;
         } else if (mm_flags & MM_3DNOW) {
             put_pixels_tab[1] = put_pixels_x2_3dnow;
             put_pixels_tab[2] = put_pixels_y2_3dnow;
@@ -1177,9 +1013,6 @@
             avg_pixels_tab[1] = avg_pixels_x2_3dnow;
             avg_pixels_tab[2] = avg_pixels_y2_3dnow;
             avg_pixels_tab[3] = avg_pixels_xy2_3dnow;
-
-            sub_pixels_tab[1] = sub_pixels_x2_3dnow;
-            sub_pixels_tab[2] = sub_pixels_y2_3dnow;
         }
 
         /* idct */
@@ -1225,12 +1058,25 @@
     avg_no_rnd_pixels_tab[2] = just_return;
     avg_no_rnd_pixels_tab[3] = just_return;
 
-    sub_pixels_tab[0] = just_return;
-    sub_pixels_tab[1] = just_return;
-    sub_pixels_tab[2] = just_return;
-    sub_pixels_tab[3] = just_return;
-
     //av_fdct = just_return;
     //ff_idct = just_return;
 #endif
 }
+
+/* remove any non bit exact operation (testing purpose). NOTE that
+   this function should be kept as small as possible because it is
+   always difficult to test automatically non bit exact cases. */
+void dsputil_set_bit_exact_mmx(void)
+{
+    if (mm_flags & MM_MMX) {
+        if (mm_flags & MM_MMXEXT) {
+            put_no_rnd_pixels_tab[1] = put_no_rnd_pixels_x2_mmx;
+            put_no_rnd_pixels_tab[2] = put_no_rnd_pixels_y2_mmx;
+            avg_pixels_tab[3] = avg_pixels_xy2_mmx;
+        } else if (mm_flags & MM_3DNOW) {
+            put_no_rnd_pixels_tab[1] = put_no_rnd_pixels_x2_mmx;
+            put_no_rnd_pixels_tab[2] = put_no_rnd_pixels_y2_mmx;
+            avg_pixels_tab[3] = avg_pixels_xy2_mmx;
+        }
+    }
+}
--- a/i386/dsputil_mmx_avg.h	Mon May 20 16:24:39 2002 +0000
+++ b/i386/dsputil_mmx_avg.h	Mon May 20 16:25:09 2002 +0000
@@ -313,64 +313,3 @@
          "D" (block+line_size), "g"(line_size<<1)
 	:"%eax",  "memory");
 }
-
-//Note: the sub* functions are no used 
-
-static void DEF(sub_pixels_x2)( DCTELEM  *block, const UINT8 *pixels, int line_size, int h)
-{
-  DCTELEM  *p;
-  const UINT8 *pix;
-  p = block;
-  pix = pixels;
-  __asm __volatile(
-      "pxor	%%mm7, %%mm7":);
-  do {
-    __asm __volatile(
-	"movq	1%1, %%mm2\n\t"
-	"movq	%0, %%mm0\n\t"
-	PAVGB"	%1, %%mm2\n\t"
-	"movq	8%0, %%mm1\n\t"
-	"movq	%%mm2, %%mm3\n\t"
-	"punpcklbw %%mm7, %%mm2\n\t"
-	"punpckhbw %%mm7, %%mm3\n\t"
-	"psubsw %%mm2, %%mm0\n\t"
-	"psubsw %%mm3, %%mm1\n\t"
-	"movq	%%mm0, %0\n\t"
-	"movq	%%mm1, 8%0\n\t"
-	:"+m"(*p)
-	:"m"(*pix)
-	:"memory");
-   pix += line_size;
-   p +=   8;
- } while (--h);
-}
-
-static void DEF(sub_pixels_y2)( DCTELEM  *block, const UINT8 *pixels, int line_size, int h)
-{
-  DCTELEM  *p;
-  const UINT8 *pix;
-  p = block;
-  pix = pixels;
-  __asm __volatile(
-      "pxor	%%mm7, %%mm7":);
-  do {
-    __asm __volatile(
-	"movq	%2, %%mm2\n\t"
-	"movq	%0, %%mm0\n\t"
-	PAVGB"	%1, %%mm2\n\t"
-	"movq	8%0, %%mm1\n\t"
-	"movq	%%mm2, %%mm3\n\t"
-	"punpcklbw %%mm7, %%mm2\n\t"
-	"punpckhbw %%mm7, %%mm3\n\t"
-	"psubsw %%mm2, %%mm0\n\t"
-	"psubsw %%mm3, %%mm1\n\t"
-	"movq	%%mm0, %0\n\t"
-	"movq	%%mm1, 8%0\n\t"
-	:"+m"(*p)
-	:"m"(*pix), "m"(*(pix+line_size))
-	:"memory");
-   pix += line_size;
-   p +=   8;
- } while (--h);
-}
-