shithub: openh264

Download patch

ref: a5b53a690fc9d10a3a454ef6f5ea6b9826874ec6
parent: 9b0a9428b410ae2f6dfff88238f1bf3deb149595
author: Sindre Aamås <[email protected]>
date: Wed Jul 20 05:19:10 EDT 2016

[Common/x86] Drop McCopyWidthEq4_mmx

Using the equivalent C routine should be faster.

Some limited testing with recent gcc and clang on Haswell supports this.

--- a/codec/common/inc/mc.h
+++ b/codec/common/inc/mc.h
@@ -252,8 +252,6 @@
                              int32_t iHeight);
 void McChromaWidthEq4_mmx (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
                            const uint8_t* kpABCD, int32_t iHeight);
-void McCopyWidthEq4_mmx (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
-                         int32_t iHeight);
 void McCopyWidthEq8_mmx (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
                          int32_t iHeight);
 void PixelAvgWidthEq4_mmx (uint8_t* pDst, int32_t iDstStride, const uint8_t* pSrcA, int32_t iSrcAStride,
--- a/codec/common/src/mc.cpp
+++ b/codec/common/src/mc.cpp
@@ -442,7 +442,7 @@
   else if (iWidth == 8)
     McCopyWidthEq8_mmx (pSrc, iSrcStride, pDst, iDstStride, iHeight);
   else if (iWidth == 4)
-    McCopyWidthEq4_mmx (pSrc, iSrcStride, pDst, iDstStride, iHeight);
+    McCopyWidthEq4_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
   else
     McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
 }
--- a/codec/common/x86/mb_copy.asm
+++ b/codec/common/x86/mb_copy.asm
@@ -503,33 +503,6 @@
     ret
 
 ;*******************************************************************************
-;  void McCopyWidthEq4_mmx( uint8_t *pSrc, int iSrcStride,
-;                          uint8_t *pDst, int iDstStride, int iHeight )
-;*******************************************************************************
-WELS_EXTERN McCopyWidthEq4_mmx
-    push    r5
-    %assign  push_num 1
-    LOAD_5_PARA
-
-    SIGN_EXTENSION  r1, r1d
-    SIGN_EXTENSION  r3, r3d
-    SIGN_EXTENSION  r4, r4d
-
-ALIGN 4
-.height_loop:
-    mov r5d, [r0]
-    mov [r2], r5d
-
-    add r0, r1
-    add r2, r3
-    dec r4
-    jnz .height_loop
-    WELSEMMS
-    LOAD_5_PARA_POP
-    pop    r5
-    ret
-
-;*******************************************************************************
 ;   void McCopyWidthEq8_mmx( uint8_t *pSrc, int iSrcStride,
 ;                           uint8_t *pDst, int iDstStride, int iHeight )
 ;*******************************************************************************