[x265] [PATCH] pixel: Replaced convert16to32 from vector class to intrinsic

yuvaraj at multicorewareinc.com yuvaraj at multicorewareinc.com
Fri Oct 11 08:31:37 CEST 2013


# HG changeset patch
# User Yuvaraj Venkatesh <yuvaraj at multicorewareinc.com>
# Date 1381473045 -19800
#      Fri Oct 11 12:00:45 2013 +0530
# Node ID 7ddc170e0ef7e1c4323409a0ea5e6587cdfe5134
# Parent  7320ecd0901c8338b5a1e1c121d2da44619ee17d
pixel: Replaced convert16to32 from vector class to intrinsic

diff -r 7320ecd0901c -r 7ddc170e0ef7 source/common/vec/pixel-sse3.cpp
--- a/source/common/vec/pixel-sse3.cpp	Thu Oct 10 22:11:58 2013 -0500
+++ b/source/common/vec/pixel-sse3.cpp	Fri Oct 11 12:00:45 2013 +0530
@@ -622,14 +622,16 @@
 
     for (i = 0; i < num; i += 8)
     {
-        Vec8s im16;
-        Vec4i im32L, im32H;
+        __m128i im16;
+        __m128i im32L, im32H;
+        __m128i sign;
 
-        im16.load(org);
-        im32L = extend_low(im16);
-        im32H = extend_high(im16);
-        im32L.store(dst);
-        im32H.store(dst + 4);
+        im16 = _mm_loadu_si128((__m128i*)org);
+        sign = _mm_srai_epi16(im16, 15);
+        im32L = _mm_unpacklo_epi16(im16, sign);
+        im32H = _mm_unpackhi_epi16(im16, sign);
+        _mm_storeu_si128((__m128i*)dst, im32L);
+        _mm_storeu_si128((__m128i*)(dst + 4), im32H);
 
         org += 8;
         dst += 8;


More information about the x265-devel mailing list