summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepa K G <deepa.kg@ittiam.com>2023-04-24 15:56:18 +0530
committerDeepa K G <deepa.kg@ittiam.com>2023-06-05 12:48:24 +0530
commit7b66c730a2edd3e232dce5e8ef2522ff83928a90 (patch)
tree4330a849fa82dd34289c53d4260a602e235babf0
parent575bd73f6118a88c5a0cf1d27a8ec9b5bda8c278 (diff)
downloadlibvpx-7b66c730a2edd3e232dce5e8ef2522ff83928a90.tar
libvpx-7b66c730a2edd3e232dce5e8ef2522ff83928a90.tar.gz
libvpx-7b66c730a2edd3e232dce5e8ef2522ff83928a90.tar.bz2
libvpx-7b66c730a2edd3e232dce5e8ef2522ff83928a90.zip
Fix c vs avx mismatch of diamond_search_sad()
In the function vp9_diamond_search_sad_avx(), arranged the cost vector in a specific order. This ensures that the motion vector with the least index is selected, when there exists more than one candidate motion vector with the minimum cost, thus resolving the c vs avx mismatch. STATS_CHANGED Change-Id: I4f8864f464f9ea2aae6250db3d8ad91cb08b26e2
-rw-r--r--vp9/encoder/x86/vp9_diamond_search_sad_avx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vp9/encoder/x86/vp9_diamond_search_sad_avx.c b/vp9/encoder/x86/vp9_diamond_search_sad_avx.c
index 80442e359..c00579edc 100644
--- a/vp9/encoder/x86/vp9_diamond_search_sad_avx.c
+++ b/vp9/encoder/x86/vp9_diamond_search_sad_avx.c
@@ -233,8 +233,9 @@ int vp9_diamond_search_sad_avx(const MACROBLOCK *x,
if (UNLIKELY(local_best_sad == 0xffff)) {
__m128i v_loval_d, v_hival_d, v_loidx_d, v_hiidx_d, v_sel_d;
- v_loval_d = v_sad_d;
- v_loidx_d = _mm_set_epi32(3, 2, 1, 0);
+ v_loval_d = _mm_shuffle_epi32(v_sad_d, 0xd8);
+ v_loidx_d = _mm_set_epi32(3, 1, 2, 0);
+
v_hival_d = _mm_srli_si128(v_loval_d, 8);
v_hiidx_d = _mm_srli_si128(v_loidx_d, 8);