From 725a3f9dfb0c0d4ccd2950bdd7d401dc47a8855c Mon Sep 17 00:00:00 2001 From: Daniel Kang Date: Wed, 29 Dec 2010 17:42:34 +0000 Subject: Port pred8x8_top_dc_mmxext (H.264 intra prediction) from x264 to FFmpeg. Original authors: Holger Lubitz , Jason Garrett-Glaser (approves LGPL relicensing for this code) and Loren Merritt (approves LGPL relicensing for this code). Patch by Daniel Kang , as part of Google's GCI 2010. Originally committed as revision 26132 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/x86/h264_intrapred.asm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'libavcodec/x86/h264_intrapred.asm') diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm index 06a0148aeb..5d7afc2812 100644 --- a/libavcodec/x86/h264_intrapred.asm +++ b/libavcodec/x86/h264_intrapred.asm @@ -827,6 +827,41 @@ PRED8x8_H mmx PRED8x8_H mmxext PRED8x8_H ssse3 +;----------------------------------------------------------------------------- +; void pred8x8_top_dc_mmxext(uint8_t *src, int stride) +;----------------------------------------------------------------------------- +%ifdef CONFIG_GPL +cglobal pred8x8_top_dc_mmxext, 2,5 + sub r0, r1 + movq mm0, [r0] + pxor mm1, mm1 + pxor mm2, mm2 + lea r2, [r0+r1*2] + punpckhbw mm1, mm0 + punpcklbw mm0, mm2 + psadbw mm1, mm2 ; s1 + lea r3, [r2+r1*2] + psadbw mm0, mm2 ; s0 + psrlw mm1, 1 + psrlw mm0, 1 + pavgw mm1, mm2 + lea r4, [r3+r1*2] + pavgw mm0, mm2 + pshufw mm1, mm1, 0 + pshufw mm0, mm0, 0 ; dc0 (w) + packuswb mm0, mm1 ; dc0,dc1 (b) + movq [r0+r1*1], mm0 + movq [r0+r1*2], mm0 + lea r0, [r3+r1*2] + movq [r2+r1*1], mm0 + movq [r2+r1*2], mm0 + movq [r3+r1*1], mm0 + movq [r3+r1*2], mm0 + movq [r0+r1*1], mm0 + movq [r0+r1*2], mm0 + RET +%endif + ;----------------------------------------------------------------------------- ; void pred8x8_dc_rv40(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -- cgit v1.2.3