<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 10, 2013 at 2:05 AM,  <span dir="ltr"><<a href="mailto:yuvaraj@multicorewareinc.com" target="_blank">yuvaraj@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User Yuvaraj Venkatesh <<a href="mailto:yuvaraj@multicorewareinc.com">yuvaraj@multicorewareinc.com</a>><br>
# Date 1381388695 -19800<br>
#      Thu Oct 10 12:34:55 2013 +0530<br>
# Node ID f0df51b8dc1c16c7a0dbbe1adacdb488b12cbde2<br>
# Parent  283fbedb6265f82ee62651edf25ec5ce767d8f4f<br>
pixel: replace sse_sp64 vector class with intrinsic<br></blockquote><div><br></div><div>Nice, only sse_pp4 remains of the 8bpp vector pixel functions.  I've moved it into pixel-sse41.cpp and deleted sse.inc</div><div>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
diff -r 283fbedb6265 -r f0df51b8dc1c source/common/vec/sse.inc<br>
--- a/source/common/vec/sse.inc Thu Oct 10 12:29:30 2013 +0530<br>
+++ b/source/common/vec/sse.inc Thu Oct 10 12:34:55 2013 +0530<br>
@@ -543,57 +543,65 @@<br>
 template<int ly><br>
 int sse_sp64(short* fenc, intptr_t strideFenc, pixel* fref, intptr_t strideFref)<br>
 {<br>
-    int rows = ly;<br>
-    Vec8s m1;<br>
-    Vec16uc n1;<br>
+    __m128i sum0 = _mm_setzero_si128();<br>
+    __m128i sum1 = _mm_setzero_si128();<br>
<br>
-    Vec8us diff_low(0), diff_high(0);<br>
-    Vec4i sum_low(0), sum_high(0);<br>
-    for (; rows != 0; rows--)<br>
+    for(int i = 0; i < ly; i++)<br>
     {<br>
-        n1.load(fref);<br>
-        m1.load(fenc);<br>
-        diff_low = m1 - extend_low(n1);<br>
-        m1.load(fenc + 8);<br>
-        diff_high = m1 - extend_high(n1);<br>
-        diff_low = diff_low * diff_low;<br>
-        diff_high = diff_high * diff_high;<br>
-        sum_low += (extend_low(diff_low) + extend_low(diff_high));<br>
-        sum_high += (extend_high(diff_low) + extend_high(diff_high));<br>
+        __m128i T00, T01, T02;<br>
+        __m128i T10, T11, T12, T13;<br>
<br>
-        n1.load(fref + 16);<br>
-        m1.load(fenc + 16);<br>
-        diff_low = m1 - extend_low(n1);<br>
-        m1.load(fenc + 24);<br>
-        diff_high = m1 - extend_high(n1);<br>
-        diff_low = diff_low * diff_low;<br>
-        diff_high = diff_high * diff_high;<br>
-        sum_low += (extend_low(diff_low) + extend_low(diff_high));<br>
-        sum_high += (extend_high(diff_low) + extend_high(diff_high));<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc));<br>
+        T01 = _mm_loadu_si128((__m128i*)(fref));<br>
+        T02 = _mm_unpacklo_epi8(T01, _mm_setzero_si128());<br>
<br>
-        n1.load(fref + 32);<br>
-        m1.load(fenc + 32);<br>
-        diff_low = m1 - extend_low(n1);<br>
-        m1.load(fenc + 40);<br>
-        diff_high = m1 - extend_high(n1);<br>
-        diff_low = diff_low * diff_low;<br>
-        diff_high = diff_high * diff_high;<br>
-        sum_low += (extend_low(diff_low) + extend_low(diff_high));<br>
-        sum_high += (extend_high(diff_low) + extend_high(diff_high));<br>
+        SSE_SP8x1;<br>
<br>
-        n1.load(fref + 48);<br>
-        m1.load(fenc + 48);<br>
-        diff_low = m1 - extend_low(n1);<br>
-        m1.load(fenc + 56);<br>
-        diff_high = m1 - extend_high(n1);<br>
-        diff_low = diff_low * diff_low;<br>
-        diff_high = diff_high * diff_high;<br>
-        sum_low += (extend_low(diff_low) + extend_low(diff_high));<br>
-        sum_high += (extend_high(diff_low) + extend_high(diff_high));<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 8));<br>
+        T02 = _mm_unpackhi_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
+<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 16));<br>
+        T01 = _mm_loadu_si128((__m128i*)(fref + 16));<br>
+        T02 = _mm_unpacklo_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
+<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 24));<br>
+        T02 = _mm_unpackhi_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
+<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 32));<br>
+        T01 = _mm_loadu_si128((__m128i*)(fref + 32));<br>
+        T02 = _mm_unpacklo_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
+<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 40));<br>
+        T02 = _mm_unpackhi_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
+<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 48));<br>
+        T01 = _mm_loadu_si128((__m128i*)(fref + 48));<br>
+        T02 = _mm_unpacklo_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
+<br>
+        T00 = _mm_loadu_si128((__m128i*)(fenc + 56));<br>
+        T02 = _mm_unpackhi_epi8(T01, _mm_setzero_si128());<br>
+<br>
+        SSE_SP8x1;<br>
<br>
         fenc += strideFenc;<br>
         fref += strideFref;<br>
     }<br>
+    sum0 = _mm_add_epi32(sum0, sum1);<br>
<br>
-    return horizontal_add(sum_low) + horizontal_add(sum_high);<br>
+    sum0 = _mm_hadd_epi32(sum0, _mm_setzero_si128());<br>
+    sum0 = _mm_hadd_epi32(sum0, _mm_setzero_si128());<br>
+<br>
+    return _mm_cvtsi128_si32(sum0);<br>
 }<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>