[x264-devel] MBAFF: Update x264_cabac_mvd_sum_mmxext to work with larger MVDs.

Simon Horlick git at videolan.org
Thu May 12 08:39:01 CEST 2011


x264 | branch: master | Simon Horlick <simonhorlick at gmail.com> | Thu Apr 21 01:47:53 2011 +0100| [e1a96db2ba4537221677930db084eff74167047b] | committer: Jason Garrett-Glaser

MBAFF: Update x264_cabac_mvd_sum_mmxext to work with larger MVDs.

Author: Loren Merritt <pengvado at akuvian.org>

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e1a96db2ba4537221677930db084eff74167047b
---

 common/x86/util.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/x86/util.h b/common/x86/util.h
index ab346cb..0552308 100644
--- a/common/x86/util.h
+++ b/common/x86/util.h
@@ -100,11 +100,13 @@ static ALWAYS_INLINE uint16_t x264_cabac_mvd_sum_mmxext(uint8_t *mvdleft, uint8_
 {
     static const uint64_t pb_2    = 0x0202020202020202ULL;
     static const uint64_t pb_32   = 0x2020202020202020ULL;
+    static const uint64_t pb_33   = 0x2121212121212121ULL;
     int amvd;
     asm(
         "movd         %1, %%mm0 \n"
         "movd         %2, %%mm1 \n"
-        "paddb     %%mm1, %%mm0 \n"
+        "paddusb   %%mm1, %%mm0 \n"
+        "pminub       %5, %%mm0 \n"
         "pxor      %%mm2, %%mm2 \n"
         "movq      %%mm0, %%mm1 \n"
         "pcmpgtb      %3, %%mm0 \n"
@@ -114,7 +116,7 @@ static ALWAYS_INLINE uint16_t x264_cabac_mvd_sum_mmxext(uint8_t *mvdleft, uint8_
         "movd      %%mm2, %0    \n"
         :"=r"(amvd)
         :"m"(M16( mvdleft )),"m"(M16( mvdtop )),
-         "m"(pb_2),"m"(pb_32)
+         "m"(pb_2),"m"(pb_32),"m"(pb_33)
     );
     return amvd;
 }



More information about the x264-devel mailing list