[FFmpeg-cvslog] Merge commit '009adfd4fbdd78a890a4a65d6f141c467bb027fa'

Clément Bœsch git at videolan.org
Tue Mar 21 16:04:52 EET 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Tue Mar 21 15:02:31 2017 +0100| [f54da138e98ca9f0de1fa9d9ff7e05a91553ab57] | committer: Clément Bœsch

Merge commit '009adfd4fbdd78a890a4a65d6f141c467bb027fa'

* commit '009adfd4fbdd78a890a4a65d6f141c467bb027fa':
  x86: fpel: Remove unnecessary sign extend

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f54da138e98ca9f0de1fa9d9ff7e05a91553ab57
---

 libavcodec/x86/fpel.asm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/x86/fpel.asm b/libavcodec/x86/fpel.asm
index 0e3b444..961a158 100644
--- a/libavcodec/x86/fpel.asm
+++ b/libavcodec/x86/fpel.asm
@@ -48,7 +48,6 @@ SECTION .text
 %define LEN  %2
 %endif
 cglobal %1_pixels%2, 4,5,4
-    movsxdifnidn r2, r2d
     lea          r4, [r2*3]
 %ifidn %1, avg
 %if notcpuflag(mmxext)


======================================================================

diff --cc libavcodec/x86/fpel.asm
index 0e3b444,b1be289..961a158
--- a/libavcodec/x86/fpel.asm
+++ b/libavcodec/x86/fpel.asm
@@@ -25,65 -25,34 +25,64 @@@
  
  SECTION .text
  
 -INIT_MMX mmxext
 +%macro PAVGB_MMX 4
 +    LOAD   %3, %1
 +    por    %3, %2
 +    pxor   %2, %1
 +    pand   %2, %4
 +    psrlq  %2, 1
 +    psubb  %3, %2
 +    SWAP   %2, %3
 +%endmacro
 +
  ; void ff_put/avg_pixels(uint8_t *block, const uint8_t *pixels,
  ;                        ptrdiff_t line_size, int h)
 -%macro PIXELS48 2
 -%if %2 == 4
 -%define OP movh
 +%macro OP_PIXELS 2
 +%if %2 == mmsize/2
 +%define LOAD movh
 +%define SAVE movh
 +%define LEN  mmsize
  %else
 -%define OP mova
 +%define LOAD movu
 +%define SAVE mova
 +%define LEN  %2
  %endif
 -cglobal %1_pixels%2, 4,5
 +cglobal %1_pixels%2, 4,5,4
-     movsxdifnidn r2, r2d
      lea          r4, [r2*3]
 +%ifidn %1, avg
 +%if notcpuflag(mmxext)
 +    pcmpeqd      m6, m6
 +    paddb        m6, m6
 +%endif
 +%endif
  .loop:
 -    OP           m0, [r1]
 -    OP           m1, [r1+r2]
 -    OP           m2, [r1+r2*2]
 -    OP           m3, [r1+r4]
 -    lea          r1, [r1+r2*4]
 +%assign %%i 0
 +%rep LEN/mmsize
 +    LOAD         m0, [r1 + %%i]
 +    LOAD         m1, [r1+r2 + %%i]
 +    LOAD         m2, [r1+r2*2 + %%i]
 +    LOAD         m3, [r1+r4 + %%i]
  %ifidn %1, avg
 -    pavgb        m0, [r0]
 -    pavgb        m1, [r0+r2]
 -    pavgb        m2, [r0+r2*2]
 -    pavgb        m3, [r0+r4]
 +%if notcpuflag(mmxext)
 +    PAVGB_MMX    [r0 + %%i], m0, m4, m6
 +    PAVGB_MMX    [r0+r2 + %%i], m1, m5, m6
 +    PAVGB_MMX    [r0+r2*2 + %%i], m2, m4, m6
 +    PAVGB_MMX    [r0+r4 + %%i], m3, m5, m6
 +%else
 +    pavgb        m0, [r0 + %%i]
 +    pavgb        m1, [r0+r2 + %%i]
 +    pavgb        m2, [r0+r2*2 + %%i]
 +    pavgb        m3, [r0+r4 + %%i]
 +%endif
  %endif
 -    OP         [r0], m0
 -    OP      [r0+r2], m1
 -    OP    [r0+r2*2], m2
 -    OP      [r0+r4], m3
 +    SAVE       [r0 + %%i], m0
 +    SAVE    [r0+r2 + %%i], m1
 +    SAVE  [r0+r2*2 + %%i], m2
 +    SAVE    [r0+r4 + %%i], m3
 +%assign %%i %%i+mmsize
 +%endrep
      sub         r3d, 4
 +    lea          r1, [r1+r2*4]
      lea          r0, [r0+r2*4]
      jne       .loop
      RET



More information about the ffmpeg-cvslog mailing list