[FFmpeg-cvslog] r26132 - in trunk/libavcodec/x86: h264_intrapred.asm h264_intrapred_init.c
rbultje
subversion
Wed Dec 29 18:42:34 CET 2010
Author: rbultje
Date: Wed Dec 29 18:42:34 2010
New Revision: 26132
Log:
Port pred8x8_top_dc_mmxext (H.264 intra prediction) from x264 to FFmpeg.
Original authors: Holger Lubitz <holger lubitz org>, Jason Garrett-Glaser
<darkshikari gmail com> (approves LGPL relicensing for this code) and Loren
Merritt <lorenm at u dot washington dot edu> (approves LGPL relicensing for
this code). Patch by Daniel Kang <daniel dot d dot kang at gmail com>, as
part of Google's GCI 2010.
Modified:
trunk/libavcodec/x86/h264_intrapred.asm
trunk/libavcodec/x86/h264_intrapred_init.c
Modified: trunk/libavcodec/x86/h264_intrapred.asm
==============================================================================
--- trunk/libavcodec/x86/h264_intrapred.asm Wed Dec 29 18:34:00 2010 (r26131)
+++ trunk/libavcodec/x86/h264_intrapred.asm Wed Dec 29 18:42:34 2010 (r26132)
@@ -828,6 +828,41 @@ 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)
;-----------------------------------------------------------------------------
Modified: trunk/libavcodec/x86/h264_intrapred_init.c
==============================================================================
--- trunk/libavcodec/x86/h264_intrapred_init.c Wed Dec 29 18:34:00 2010 (r26131)
+++ trunk/libavcodec/x86/h264_intrapred_init.c Wed Dec 29 18:42:34 2010 (r26132)
@@ -44,6 +44,7 @@ void ff_pred16x16_plane_svq3_ssse3 (uint
void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride);
void ff_pred16x16_tm_vp8_mmxext (uint8_t *src, int stride);
void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride);
+void ff_pred8x8_top_dc_mmxext (uint8_t *src, int stride);
void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride);
void ff_pred8x8_vertical_mmx (uint8_t *src, int stride);
void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride);
@@ -98,6 +99,9 @@ void ff_h264_pred_init_x86(H264PredConte
#if CONFIG_GPL
if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
+ if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) {
+ h->pred8x8 [TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext;
+ }
#endif
if (codec_id == CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
More information about the ffmpeg-cvslog
mailing list