diff options
author | shaodiwei <weishaodizss@gmail.com> | 2023-05-09 19:11:14 +0800 |
---|---|---|
committer | Frank Barchard <fbarchard@chromium.org> | 2023-05-09 18:54:25 +0000 |
commit | 4c209d264d5e4b297bab17f7ba0a49ecafa08b98 (patch) | |
tree | 581143a35b4b37ad769ba02b5a66e13e645d74da /source | |
parent | b2ea744591aac173f09814e36e65a5de790e7c74 (diff) | |
download | libyuv-4c209d264d5e4b297bab17f7ba0a49ecafa08b98.tar.gz |
MergeUVRow_AVX2 implementation is consistent in row_win.cc and row_gcc.cc,the commit can fix memory is wrote out of bounds
Change-Id: I4b771a46fc853effc4c0fa3ae8032322a8369dc9
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4514810
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source')
-rw-r--r-- | source/row_win.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/row_win.cc b/source/row_win.cc index c5a14f86..ba5e5318 100644 --- a/source/row_win.cc +++ b/source/row_win.cc @@ -3461,17 +3461,14 @@ __declspec(naked) void MergeUVRow_AVX2(const uint8_t* src_u, sub edx, eax convertloop: - vmovdqu ymm0, [eax] // read 32 U's - vmovdqu ymm1, [eax + edx] // and 32 V's - lea eax, [eax + 32] - vpunpcklbw ymm2, ymm0, ymm1 // low 16 UV pairs. mutated qqword 0,2 - vpunpckhbw ymm0, ymm0, ymm1 // high 16 UV pairs. mutated qqword 1,3 - vextractf128 [edi], ymm2, 0 // bytes 0..15 - vextractf128 [edi + 16], ymm0, 0 // bytes 16..31 - vextractf128 [edi + 32], ymm2, 1 // bytes 32..47 - vextractf128 [edi + 48], ymm0, 1 // bytes 47..63 - lea edi, [edi + 64] - sub ecx, 32 + vpmovzxbw ymm0, [eax] + vpmovzxbw ymm1, [eax + edx] + lea eax, [eax + 16] + vpsllw ymm1, ymm1, 8 + vpor ymm2, ymm1, ymm0 + vmovdqu [edi], ymm2 + lea edi, [edi + 32] + sub ecx, 16 jg convertloop pop edi |