[FFmpeg-cvslog] x86: dsputil: Move avg_pixels16_mmx() out of rnd_template.c

Diego Biurrun git at videolan.org
Fri May 3 10:48:19 CEST 2013


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sat Apr 27 22:52:26 2013 +0200| [932806232108872655556100011fe369125805d3] | committer: Diego Biurrun

x86: dsputil: Move avg_pixels16_mmx() out of rnd_template.c

The function does not do any rounding, so there is no point in
keeping it in a round template file.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=932806232108872655556100011fe369125805d3
---

 libavcodec/x86/dsputil_mmx.c  |    2 +-
 libavcodec/x86/dsputil_mmx.h  |    2 ++
 libavcodec/x86/fpel_mmx.c     |   24 ++++++++++++++++++++++++
 libavcodec/x86/hpeldsp_init.c |    2 ++
 libavcodec/x86/rnd_template.c |   23 -----------------------
 5 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 0a58107..9dacff6 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -1028,7 +1028,7 @@ void ff_put_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
 
 void ff_avg_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
 {
-    avg_pixels16_mmx(dst, src, stride, 16);
+    ff_avg_pixels16_mmx(dst, src, stride, 16);
 }
 
 /* VC-1-specific */
diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h
index eb23377..7e98190 100644
--- a/libavcodec/x86/dsputil_mmx.h
+++ b/libavcodec/x86/dsputil_mmx.h
@@ -158,6 +158,8 @@ void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int
 
 void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
                         ptrdiff_t line_size, int h);
+void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
+                         ptrdiff_t line_size, int h);
 void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
                         ptrdiff_t line_size, int h);
 void ff_put_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
diff --git a/libavcodec/x86/fpel_mmx.c b/libavcodec/x86/fpel_mmx.c
index c427914..be64098 100644
--- a/libavcodec/x86/fpel_mmx.c
+++ b/libavcodec/x86/fpel_mmx.c
@@ -50,6 +50,30 @@ void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
     while (--h);
 }
 
+void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
+                         ptrdiff_t line_size, int h)
+{
+    MOVQ_BFE(mm6);
+    JUMPALIGN();
+    do {
+        __asm__ volatile(
+             "movq  %0, %%mm0           \n\t"
+             "movq  %1, %%mm1           \n\t"
+             PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
+             "movq  %%mm2, %0           \n\t"
+             "movq  8%0, %%mm0          \n\t"
+             "movq  8%1, %%mm1          \n\t"
+             PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
+             "movq  %%mm2, 8%0          \n\t"
+             :"+m"(*block)
+             :"m"(*pixels)
+             :"memory");
+        pixels += line_size;
+        block += line_size;
+    }
+    while (--h);
+}
+
 void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
                         ptrdiff_t line_size, int h)
 {
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index bc2a08f..d573d05 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -75,8 +75,10 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
                               ptrdiff_t line_size, int h);
 
 #define avg_pixels8_mmx         ff_avg_pixels8_mmx
+#define avg_pixels16_mmx        ff_avg_pixels16_mmx
 #define put_pixels8_mmx         ff_put_pixels8_mmx
 #define put_pixels16_mmx        ff_put_pixels16_mmx
+#define avg_no_rnd_pixels16_mmx ff_avg_pixels16_mmx
 #define put_no_rnd_pixels8_mmx  ff_put_pixels8_mmx
 #define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx
 
diff --git a/libavcodec/x86/rnd_template.c b/libavcodec/x86/rnd_template.c
index 08e8593..4443ec5 100644
--- a/libavcodec/x86/rnd_template.c
+++ b/libavcodec/x86/rnd_template.c
@@ -92,29 +92,6 @@ static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff
 }
 
 // avg_pixels
-static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    JUMPALIGN();
-    do {
-        __asm__ volatile(
-             "movq  %0, %%mm0           \n\t"
-             "movq  %1, %%mm1           \n\t"
-             OP_AVG(%%mm0, %%mm1, %%mm2, %%mm6)
-             "movq  %%mm2, %0           \n\t"
-             "movq  8%0, %%mm0          \n\t"
-             "movq  8%1, %%mm1          \n\t"
-             OP_AVG(%%mm0, %%mm1, %%mm2, %%mm6)
-             "movq  %%mm2, 8%0          \n\t"
-             :"+m"(*block)
-             :"m"(*pixels)
-             :"memory");
-        pixels += line_size;
-        block += line_size;
-    }
-    while (--h);
-}
-
 // this routine is 'slightly' suboptimal but mostly unused
 static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
 {



More information about the ffmpeg-cvslog mailing list