diff options
author | Jason Garrett-Glaser <jason@x264.com> | 2012-07-20 18:33:06 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-22 16:56:58 -0400 |
commit | 85a3c19ed127e8a333bcc0700a5465faed1f7753 (patch) | |
tree | d01bef54a957dfb082d15252ed00757d8943c12c | |
parent | b2704a65d513f63d12e705e941abfbc62676c8fa (diff) | |
download | ffmpeg-85a3c19ed127e8a333bcc0700a5465faed1f7753.tar.gz |
dsputil: x86: add SHUFFLE_MASK_W macro
Simplifies pshufb masks that operate on words.
-rw-r--r-- | libavcodec/x86/dsputil_yasm.asm | 2 | ||||
-rw-r--r-- | libavutil/x86/x86util.asm | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index 313e774669..077f3a0db7 100644 --- a/libavcodec/x86/dsputil_yasm.asm +++ b/libavcodec/x86/dsputil_yasm.asm @@ -28,7 +28,7 @@ pb_zzzzzzzz77777777: times 8 db -1 pb_7: times 8 db 7 pb_zzzz3333zzzzbbbb: db -1,-1,-1,-1,3,3,3,3,-1,-1,-1,-1,11,11,11,11 pb_zz11zz55zz99zzdd: db -1,-1,1,1,-1,-1,5,5,-1,-1,9,9,-1,-1,13,13 -pb_revwords: db 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1 +pb_revwords: SHUFFLE_MASK_W 7, 6, 5, 4, 3, 2, 1, 0 pd_16384: times 4 dd 16384 pb_bswap32: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm index 941ec76084..8450acd87c 100644 --- a/libavutil/x86/x86util.asm +++ b/libavutil/x86/x86util.asm @@ -625,3 +625,15 @@ shufps %1, %1, 0 %endif %endmacro + +%macro SHUFFLE_MASK_W 8 + %rep 8 + %if %1>=0x80 + db %1, %1 + %else + db %1*2 + db %1*2+1 + %endif + %rotate 1 + %endrep +%endmacro |