changeset 4505:cb5628800a62 libavcodec

factor out common subexprssion (gcc of course is too stupid to do this ...) 5% faster avg_h264_chroma_mc2_mmx2() 10% faster put_h264_chroma_mc2_mmx2()
author michael
date Fri, 09 Feb 2007 12:37:38 +0000
parents 6287a2ff4d08
children 709ddd620e04
files i386/dsputil_h264_template_mmx.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/i386/dsputil_h264_template_mmx.c	Fri Feb 09 12:24:22 2007 +0000
+++ b/i386/dsputil_h264_template_mmx.c	Fri Feb 09 12:37:38 2007 +0000
@@ -265,8 +265,9 @@
 #ifdef H264_CHROMA_MC2_TMPL
 static void H264_CHROMA_MC2_TMPL(uint8_t *dst/*align 2*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
 {
-    int CD=((1<<16)-1)*x*y + 8*y;
-    int AB=((8<<16)-8)*x + 64 - CD;
+    int tmp = ((1<<16)-1)*x + 8;
+    int CD= tmp*y;
+    int AB= (tmp<<3) - CD;
     asm volatile(
         /* mm5 = {A,B,A,B} */
         /* mm6 = {C,D,C,D} */