Commit 0735245c authored by Frank Barchard's avatar Frank Barchard

pinsrw instruction allows reading 2 bytes directly into an xmm register.

Saving a gpr register allows the register to not be pushed for now, and in future it can be used to point to color conversion matrix or alpha channel.

R=harryjin@google.com
BUG=libyuv:488

Review URL: https://webrtc-codereview.appspot.com/52789004.
parent be11f500
...@@ -2378,14 +2378,12 @@ void I422ToABGRRow_AVX2(const uint8* y_buf, ...@@ -2378,14 +2378,12 @@ void I422ToABGRRow_AVX2(const uint8* y_buf,
// Read 2 UV from 411, upsample to 8 UV. // Read 2 UV from 411, upsample to 8 UV.
#define READYUV411 __asm { \ #define READYUV411 __asm { \
__asm movzx ebx, word ptr [esi] /* U */ /* NOLINT */ \ __asm pinsrw xmm0, [esi], 0 /* U */ \
__asm movd xmm0, ebx \ __asm pinsrw xmm1, [esi + edi], 0 /* V */ \
__asm movzx ebx, word ptr [esi + edi] /* V */ /* NOLINT */ \
__asm movd xmm1, ebx \
__asm lea esi, [esi + 2] \ __asm lea esi, [esi + 2] \
__asm punpcklbw xmm0, xmm1 /* UV */ \ __asm punpcklbw xmm0, xmm1 /* UV */ \
__asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \
__asm punpckldq xmm0, xmm0 /* UVUVUVUV (upsample) */ \ __asm punpckldq xmm0, xmm0 /* UVUVUVUV (upsample) */ \
} }
// Read 4 UV from NV12, upsample to 8 UV. // Read 4 UV from NV12, upsample to 8 UV.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment