From 68a1de942ca0374bb5d5cde4ced9b907c6660e64 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Mon, 12 Jun 2006 11:14:10 +0000 Subject: moves invariant code (chiefly MMX register initialization) out of loops as well as eliminating some memory accesses within the inner loop. Patch by Zuxy Meng < zuxy POIS meng AH gmail POIS com > Original thread: Date: Mon, 12 Jun 2006 00:31:53 -0700 (PDT) Subject [MPlayer-dev-eng] [PATCH] Loop invariant motion in libvo/osd_template.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18686 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/osd_template.c | 64 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 21 deletions(-) (limited to 'libvo') diff --git a/libvo/osd_template.c b/libvo/osd_template.c index af014b9480..9ae0196dbc 100644 --- a/libvo/osd_template.c +++ b/libvo/osd_template.c @@ -31,6 +31,15 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u int y; #if defined(FAST_OSD) && !defined(HAVE_MMX) w=w>>1; +#endif +#ifdef HAVE_MMX + asm volatile( + "pcmpeqb %%mm5, %%mm5\n\t" // F..F + "movq %%mm5, %%mm4\n\t" + "movq %%mm5, %%mm7\n\t" + "psllw $8, %%mm5\n\t" //FF00FF00FF00 + "psrlw $8, %%mm4\n\t" //00FF00FF00FF + ::); #endif for(y=0;y>1; +#endif +#ifdef HAVE_MMX + asm volatile( + "pxor %%mm7, %%mm7\n\t" + "pcmpeqb %%mm5, %%mm5\n\t" // F..F + "movq %%mm5, %%mm6\n\t" + "movq %%mm5, %%mm4\n\t" + "psllw $8, %%mm5\n\t" //FF00FF00FF00 + "psrlw $8, %%mm4\n\t" //00FF00FF00FF + ::); #endif for(y=0;y