<div dir="ltr">Please ignore this patch.I will resend it.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 1, 2015 at 6:40 PM,  <span dir="ltr"><<a href="mailto:rajesh@multicorewareinc.com" target="_blank">rajesh@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Rajesh Paulraj<<a href="mailto:rajesh@multicorewareinc.com">rajesh@multicorewareinc.com</a>><br>
# Date 1427889433 -19800<br>
#      Wed Apr 01 17:27:13 2015 +0530<br>
# Node ID c26756d8ced6fe69e58b2bb77419b5f975a54de9<br>
# Parent  ac85c775620f1dcb0df056874633cbf916098bd2<br>
primivites: rename luma_p2s to convert_p2s and move into PU<br>
<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/ipfilter.cpp<br>
--- a/source/common/ipfilter.cpp        Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/ipfilter.cpp        Wed Apr 01 17:27:13 2015 +0530<br>
@@ -34,27 +34,8 @@<br>
 #endif<br>
<br>
 namespace {<br>
-template<int dstStride, int width, int height><br>
-void pixelToShort_c(const pixel* src, intptr_t srcStride, int16_t* dst)<br>
-{<br>
-    int shift = IF_INTERNAL_PREC - X265_DEPTH;<br>
-    int row, col;<br>
-<br>
-    for (row = 0; row < height; row++)<br>
-    {<br>
-        for (col = 0; col < width; col++)<br>
-        {<br>
-            int16_t val = src[col] << shift;<br>
-            dst[col] = val - (int16_t)IF_INTERNAL_OFFS;<br>
-        }<br>
-<br>
-        src += srcStride;<br>
-        dst += dstStride;<br>
-    }<br>
-}<br>
-<br>
-template<int dstStride><br>
-void filterPixelToShort_c(const pixel* src, intptr_t srcStride, int16_t* dst, int width, int height)<br>
+template<int width, int height><br>
+void filterPixelToShort_c(const pixel* src, intptr_t srcStride, int16_t* dst, int16_t dstStride)<br>
 {<br>
     int shift = IF_INTERNAL_PREC - X265_DEPTH;<br>
     int row, col;<br>
@@ -398,7 +379,7 @@<br>
     p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vps = interp_vert_ps_c<4, W, H>;  \<br>
     p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vsp = interp_vert_sp_c<4, W, H>;  \<br>
     p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vss = interp_vert_ss_c<4, W, H>; \<br>
-    p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].chroma_p2s = pixelToShort_c<MAX_CU_SIZE / 2, W, H>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].chroma_p2s = filterPixelToShort_c<W, H>;<br>
<br>
 #define CHROMA_422(W, H) \<br>
     p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_hpp = interp_horiz_pp_c<4, W, H>; \<br>
@@ -407,7 +388,7 @@<br>
     p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vps = interp_vert_ps_c<4, W, H>;  \<br>
     p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vsp = interp_vert_sp_c<4, W, H>;  \<br>
     p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vss = interp_vert_ss_c<4, W, H>; \<br>
-    p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].chroma_p2s = pixelToShort_c<MAX_CU_SIZE / 2, W, H>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].chroma_p2s = filterPixelToShort_c<W, H>;<br>
<br>
 #define CHROMA_444(W, H) \<br>
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_hpp = interp_horiz_pp_c<4, W, H>; \<br>
@@ -416,7 +397,7 @@<br>
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vps = interp_vert_ps_c<4, W, H>;  \<br>
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vsp = interp_vert_sp_c<4, W, H>;  \<br>
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vss = interp_vert_ss_c<4, W, H>; \<br>
-    p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].chroma_p2s = pixelToShort_c<MAX_CU_SIZE, W, H>;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].chroma_p2s = filterPixelToShort_c<W, H>;<br>
<br>
 #define LUMA(W, H) \<br>
     p.pu[LUMA_ ## W ## x ## H].luma_hpp     = interp_horiz_pp_c<8, W, H>; \<br>
@@ -426,7 +407,7 @@<br>
     p.pu[LUMA_ ## W ## x ## H].luma_vsp     = interp_vert_sp_c<8, W, H>;  \<br>
     p.pu[LUMA_ ## W ## x ## H].luma_vss     = interp_vert_ss_c<8, W, H>;  \<br>
     p.pu[LUMA_ ## W ## x ## H].luma_hvpp    = interp_hv_pp_c<8, W, H>; \<br>
-    p.pu[LUMA_ ## W ## x ## H].filter_p2s = pixelToShort_c<MAX_CU_SIZE, W, H><br>
+    p.pu[LUMA_ ## W ## x ## H].convert_p2s = filterPixelToShort_c<W, H>;<br>
<br>
 void setupFilterPrimitives_c(EncoderPrimitives& p)<br>
 {<br>
@@ -530,11 +511,82 @@<br>
     CHROMA_444(48, 64);<br>
     CHROMA_444(64, 16);<br>
     CHROMA_444(16, 64);<br>
-    p.luma_p2s = filterPixelToShort_c<MAX_CU_SIZE>;<br>
<br>
-    p.chroma[X265_CSP_I444].p2s = filterPixelToShort_c<MAX_CU_SIZE>;<br>
-    p.chroma[X265_CSP_I420].p2s = filterPixelToShort_c<MAX_CU_SIZE / 2>;<br>
-    p.chroma[X265_CSP_I422].p2s = filterPixelToShort_c<MAX_CU_SIZE / 2>;<br>
+    p.pu[LUMA_4x4].convert_p2s = filterPixelToShort_c<4, 4>;<br>
+    p.pu[LUMA_4x8].convert_p2s = filterPixelToShort_c<4, 8>;<br>
+    p.pu[LUMA_4x16].convert_p2s = filterPixelToShort_c<4, 16>;<br>
+    p.pu[LUMA_8x4].convert_p2s = filterPixelToShort_c<8, 4>;<br>
+    p.pu[LUMA_8x8].convert_p2s = filterPixelToShort_c<8, 8>;<br>
+    p.pu[LUMA_8x16].convert_p2s = filterPixelToShort_c<8, 16>;<br>
+    p.pu[LUMA_8x32].convert_p2s = filterPixelToShort_c<8, 32>;<br>
+    p.pu[LUMA_16x4].convert_p2s = filterPixelToShort_c<16, 4>;<br>
+    p.pu[LUMA_16x8].convert_p2s = filterPixelToShort_c<16, 8>;<br>
+    p.pu[LUMA_16x12].convert_p2s = filterPixelToShort_c<16, 12>;<br>
+    p.pu[LUMA_16x16].convert_p2s = filterPixelToShort_c<16, 16>;<br>
+    p.pu[LUMA_16x32].convert_p2s = filterPixelToShort_c<16, 32>;<br>
+    p.pu[LUMA_16x64].convert_p2s = filterPixelToShort_c<16, 64>;<br>
+    p.pu[LUMA_32x8].convert_p2s = filterPixelToShort_c<32, 8>;<br>
+    p.pu[LUMA_32x16].convert_p2s = filterPixelToShort_c<32, 16>;<br>
+    p.pu[LUMA_32x24].convert_p2s = filterPixelToShort_c<32, 24>;<br>
+    p.pu[LUMA_32x32].convert_p2s = filterPixelToShort_c<32, 32>;<br>
+    p.pu[LUMA_32x64].convert_p2s = filterPixelToShort_c<32, 64>;<br>
+    p.pu[LUMA_64x16].convert_p2s = filterPixelToShort_c<64, 16>;<br>
+    p.pu[LUMA_64x32].convert_p2s = filterPixelToShort_c<64, 32>;<br>
+    p.pu[LUMA_64x48].convert_p2s = filterPixelToShort_c<64, 48>;<br>
+    p.pu[LUMA_64x64].convert_p2s = filterPixelToShort_c<64, 64>;<br>
+    p.pu[LUMA_12x16].convert_p2s = filterPixelToShort_c<12, 16>;<br>
+    p.pu[LUMA_24x32].convert_p2s = filterPixelToShort_c<24, 32>;<br>
+    p.pu[LUMA_48x64].convert_p2s = filterPixelToShort_c<48, 64>;<br>
+<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].chroma_p2s = filterPixelToShort_c<4, 4>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].chroma_p2s = filterPixelToShort_c<8, 8>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].chroma_p2s = filterPixelToShort_c<16, 16>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].chroma_p2s = filterPixelToShort_c<32, 32>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].chroma_p2s = filterPixelToShort_c<4, 2>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].chroma_p2s = filterPixelToShort_c<2, 4>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].chroma_p2s = filterPixelToShort_c<8, 4>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].chroma_p2s = filterPixelToShort_c<4, 8>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_16x8].chroma_p2s = filterPixelToShort_c<16, 8>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].chroma_p2s = filterPixelToShort_c<8, 16>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_32x16].chroma_p2s = filterPixelToShort_c<32, 16>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].chroma_p2s = filterPixelToShort_c<16, 32>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_8x6].chroma_p2s = filterPixelToShort_c<8, 6>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].chroma_p2s = filterPixelToShort_c<6, 8>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].chroma_p2s = filterPixelToShort_c<8, 2>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].chroma_p2s = filterPixelToShort_c<2, 8>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].chroma_p2s = filterPixelToShort_c<16, 12>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_12x16].chroma_p2s = filterPixelToShort_c<12, 16>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].chroma_p2s = filterPixelToShort_c<16, 4>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].chroma_p2s = filterPixelToShort_c<4, 16>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_32x24].chroma_p2s = filterPixelToShort_c<32, 24>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].chroma_p2s = filterPixelToShort_c<24, 32>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].chroma_p2s = filterPixelToShort_c<32, 8>;<br>
+    p.chroma[X265_CSP_I420].pu[CHROMA_420_8x32].chroma_p2s = filterPixelToShort_c<8, 32>;<br>
+<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_4x8].chroma_p2s = filterPixelToShort_c<4, 8>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_8x16].chroma_p2s = filterPixelToShort_c<8, 16>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_16x32].chroma_p2s = filterPixelToShort_c<16, 32>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_32x64].chroma_p2s = filterPixelToShort_c<32, 64>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_4x4].chroma_p2s = filterPixelToShort_c<4, 4>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_2x8].chroma_p2s = filterPixelToShort_c<2, 8>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_8x8].chroma_p2s = filterPixelToShort_c<8, 8>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_4x16].chroma_p2s = filterPixelToShort_c<4, 16>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_16x16].chroma_p2s = filterPixelToShort_c<16, 16>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_8x32].chroma_p2s = filterPixelToShort_c<8, 32>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_32x32].chroma_p2s = filterPixelToShort_c<32, 32>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_16x64].chroma_p2s = filterPixelToShort_c<16, 64>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_8x12].chroma_p2s = filterPixelToShort_c<8, 12>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_6x16].chroma_p2s = filterPixelToShort_c<6, 16>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_8x4].chroma_p2s = filterPixelToShort_c<8, 4>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].chroma_p2s = filterPixelToShort_c<2, 16>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_16x24].chroma_p2s = filterPixelToShort_c<16, 24>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_12x32].chroma_p2s = filterPixelToShort_c<12, 32>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_16x8].chroma_p2s = filterPixelToShort_c<16, 8>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_4x32].chroma_p2s = filterPixelToShort_c<4, 32>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_32x48].chroma_p2s = filterPixelToShort_c<32, 48>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_24x64].chroma_p2s = filterPixelToShort_c<24, 64>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_32x16].chroma_p2s = filterPixelToShort_c<32, 16>;<br>
+    p.chroma[X265_CSP_I422].pu[CHROMA_422_8x64].chroma_p2s = filterPixelToShort_c<8, 64>;<br>
<br>
     p.extendRowBorder = extendCURowColBorder;<br>
 }<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/predict.cpp<br>
--- a/source/common/predict.cpp Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/predict.cpp Wed Apr 01 17:27:13 2015 +0530<br>
@@ -273,7 +273,8 @@<br>
 void Predict::predInterLumaShort(const PredictionUnit& pu, ShortYuv& dstSYuv, const PicYuv& refPic, const MV& mv) const<br>
 {<br>
     int16_t* dst = dstSYuv.getLumaAddr(pu.puAbsPartIdx);<br>
-    int dstStride = dstSYuv.m_size;<br>
+    /* get dstStride from predInterLumaShort */<br>
+    int16_t dstStride = MAX_CU_SIZE;<br>
<br>
     intptr_t srcStride = refPic.m_stride;<br>
     intptr_t srcOffset = (mv.x >> 2) + (mv.y >> 2) * srcStride;<br>
@@ -288,7 +289,7 @@<br>
     X265_CHECK(dstStride == MAX_CU_SIZE, "stride expected to be max cu size\n");<br>
<br>
     if (!(yFrac | xFrac))<br>
-        primitives.luma_p2s(src, srcStride, dst, pu.width, pu.height);<br>
+        primitives.pu[partEnum].convert_p2s(src, srcStride, dst, dstStride);<br>
     else if (!yFrac)<br>
         primitives.pu[partEnum].luma_hps(src, srcStride, dst, dstStride, xFrac, 0);<br>
     else if (!xFrac)<br>
@@ -356,7 +357,8 @@<br>
 void Predict::predInterChromaShort(const PredictionUnit& pu, ShortYuv& dstSYuv, const PicYuv& refPic, const MV& mv) const<br>
 {<br>
     intptr_t refStride = refPic.m_strideC;<br>
-    intptr_t dstStride = dstSYuv.m_csize;<br>
+    /* get dstStride from predInterChromaShort */<br>
+    int16_t dstStride = MAX_CU_SIZE / 2;<br>
<br>
     int shiftHor = (2 + m_hChromaShift);<br>
     int shiftVer = (2 + m_vChromaShift);<br>
@@ -373,16 +375,23 @@<br>
     int yFrac = mv.y & ((1 << shiftVer) - 1);<br>
<br>
     int partEnum = partitionFromSizes(pu.width, pu.height);<br>
-<br>
+<br>
     uint32_t cxWidth  = pu.width >> m_hChromaShift;<br>
-    uint32_t cxHeight = pu.height >> m_vChromaShift;<br>
<br>
-    X265_CHECK(((cxWidth | cxHeight) % 2) == 0, "chroma block size expected to be multiple of 2\n");<br>
+    X265_CHECK(((cxWidth | (pu.height >> m_vChromaShift)) % 2) == 0, "chroma block size expected to be multiple of 2\n");<br>
<br>
     if (!(yFrac | xFrac))<br>
     {<br>
-        primitives.chroma[m_csp].p2s(refCb, refStride, dstCb, cxWidth, cxHeight);<br>
-        primitives.chroma[m_csp].p2s(refCr, refStride, dstCr, cxWidth, cxHeight);<br>
+        if (m_csp != X265_CSP_I444)<br>
+        {<br>
+            primitives.chroma[m_csp].pu[partEnum].chroma_p2s(refCb, refStride, dstCb, dstStride);<br>
+            primitives.chroma[m_csp].pu[partEnum].chroma_p2s(refCr, refStride, dstCr, dstStride);<br>
+        }<br>
+        else<br>
+        {<br>
+            primitives.chroma[m_csp].pu[partEnum].chroma_p2s(refCb, refStride, dstCb, dstStride << 1);<br>
+            primitives.chroma[m_csp].pu[partEnum].chroma_p2s(refCr, refStride, dstCr, dstStride << 1);<br>
+        }<br>
     }<br>
     else if (!yFrac)<br>
     {<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/primitives.cpp<br>
--- a/source/common/primitives.cpp      Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/primitives.cpp      Wed Apr 01 17:27:13 2015 +0530<br>
@@ -90,7 +90,6 @@<br>
<br>
     /* alias chroma 4:4:4 from luma primitives (all but chroma filters) */<br>
<br>
-    p.chroma[X265_CSP_I444].p2s = p.luma_p2s;<br>
     p.chroma[X265_CSP_I444].cu[BLOCK_4x4].sa8d = NULL;<br>
<br>
     for (int i = 0; i < NUM_PU_SIZES; i++)<br>
@@ -98,7 +97,7 @@<br>
         p.chroma[X265_CSP_I444].pu[i].copy_pp = p.pu[i].copy_pp;<br>
         p.chroma[X265_CSP_I444].pu[i].addAvg  = p.pu[i].addAvg;<br>
         p.chroma[X265_CSP_I444].pu[i].satd    = p.pu[i].satd;<br>
-        p.chroma[X265_CSP_I444].pu[i].chroma_p2s = p.pu[i].filter_p2s;<br>
+        p.chroma[X265_CSP_I444].pu[i].chroma_p2s = p.pu[i].convert_p2s;<br>
     }<br>
<br>
     for (int i = 0; i < NUM_CU_SIZES; i++)<br>
@@ -185,6 +184,34 @@<br>
     p.chroma[X265_CSP_I420].cu[BLOCK_420_32x32].sse_pp = <a href="http://p.cu" target="_blank">p.cu</a>[BLOCK_32x32].sse_pp;<br>
<br>
     p.chroma[X265_CSP_I422].cu[BLOCK_422_2x4].sse_pp = NULL;<br>
+<br>
+    /* Chroma PU can often use luma P2S primitives */<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_4x4].chroma_p2s = p.pu[LUMA_4x4].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_4x8].chroma_p2s = p.pu[LUMA_4x8].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_4x16].chroma_p2s = p.pu[LUMA_4x16].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_8x4].chroma_p2s = p.pu[LUMA_8x4].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_8x8].chroma_p2s = p.pu[LUMA_8x8].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_8x16].chroma_p2s = p.pu[LUMA_8x16].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_8x32].chroma_p2s = p.pu[LUMA_8x32].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_16x4].chroma_p2s = p.pu[LUMA_16x4].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_16x8].chroma_p2s = p.pu[LUMA_16x8].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_16x12].chroma_p2s = p.pu[LUMA_16x12].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_16x16].chroma_p2s = p.pu[LUMA_16x16].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_16x32].chroma_p2s = p.pu[LUMA_16x32].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_16x64].chroma_p2s = p.pu[LUMA_16x64].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_32x8].chroma_p2s = p.pu[LUMA_32x8].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_32x16].chroma_p2s = p.pu[LUMA_32x16].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_32x24].chroma_p2s = p.pu[LUMA_32x24].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_32x32].chroma_p2s = p.pu[LUMA_32x32].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_32x64].chroma_p2s = p.pu[LUMA_32x64].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_64x16].chroma_p2s = p.pu[LUMA_64x16].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_64x32].chroma_p2s = p.pu[LUMA_64x32].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_64x48].chroma_p2s = p.pu[LUMA_64x48].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_64x64].chroma_p2s = p.pu[LUMA_64x64].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_12x16].chroma_p2s = p.pu[LUMA_12x16].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_24x32].chroma_p2s = p.pu[LUMA_24x32].convert_p2s;<br>
+    p.chroma[X265_CSP_I444].pu[LUMA_48x64].chroma_p2s = p.pu[LUMA_48x64].convert_p2s;<br>
+<br>
 }<br>
 }<br>
 using namespace x265;<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/primitives.h<br>
--- a/source/common/primitives.h        Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/primitives.h        Wed Apr 01 17:27:13 2015 +0530<br>
@@ -156,8 +156,7 @@<br>
 typedef void (*filter_sp_t) (const int16_t* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int coeffIdx);<br>
 typedef void (*filter_ss_t) (const int16_t* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx);<br>
 typedef void (*filter_hv_pp_t) (const pixel* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int idxX, int idxY);<br>
-typedef void (*filter_p2s_wxh_t)(const pixel* src, intptr_t srcStride, int16_t* dst, int width, int height);<br>
-typedef void (*filter_p2s_t)(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
+typedef void (*filter_p2s_t)(const pixel* src, intptr_t srcStride, int16_t* dst, int16_t dstStride);<br>
<br>
 typedef void (*copy_pp_t)(pixel* dst, intptr_t dstStride, const pixel* src, intptr_t srcStride); // dst is aligned<br>
 typedef void (*copy_sp_t)(pixel* dst, intptr_t dstStride, const int16_t* src, intptr_t srcStride);<br>
@@ -211,7 +210,7 @@<br>
         addAvg_t       addAvg;      // bidir motion compensation, uses 16bit values<br>
<br>
         copy_pp_t      copy_pp;<br>
-        filter_p2s_t   filter_p2s;<br>
+        filter_p2s_t   convert_p2s;<br>
     }<br>
     pu[NUM_PU_SIZES];<br>
<br>
@@ -290,7 +289,6 @@<br>
     weightp_sp_t          weight_sp;<br>
     weightp_pp_t          weight_pp;<br>
<br>
-    filter_p2s_wxh_t      luma_p2s;<br>
<br>
     findPosLast_t         findPosLast;<br>
<br>
@@ -337,7 +335,6 @@<br>
         }<br>
         cu[NUM_CU_SIZES];<br>
<br>
-        filter_p2s_wxh_t p2s; // takes width/height as arguments<br>
     }<br>
     chroma[X265_CSP_COUNT];<br>
 };<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/x86/asm-primitives.cpp<br>
--- a/source/common/x86/asm-primitives.cpp      Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/x86/asm-primitives.cpp      Wed Apr 01 17:27:13 2015 +0530<br>
@@ -859,9 +859,6 @@<br>
         PIXEL_AVG_W4(mmx2);<br>
         LUMA_VAR(sse2);<br>
<br>
-        p.luma_p2s = x265_luma_p2s_sse2;<br>
-        p.chroma[X265_CSP_I420].p2s = x265_chroma_p2s_sse2;<br>
-        p.chroma[X265_CSP_I422].p2s = x265_chroma_p2s_sse2;<br>
<br>
         ALL_LUMA_TU(blockfill_s, blockfill_s, sse2);<br>
         ALL_LUMA_TU_S(cpy1Dto2D_shr, cpy1Dto2D_shr_, sse2);<br>
@@ -1249,31 +1246,7 @@<br>
         ASSIGN_SSE_PP(ssse3);<br>
         <a href="http://p.cu" target="_blank">p.cu</a>[BLOCK_4x4].sse_pp = x265_pixel_ssd_4x4_ssse3;<br>
         p.chroma[X265_CSP_I422].cu[BLOCK_422_4x8].sse_pp = x265_pixel_ssd_4x8_ssse3;<br>
-        p.pu[LUMA_4x4].filter_p2s = x265_pixelToShort_4x4_ssse3;<br>
-        p.pu[LUMA_4x8].filter_p2s = x265_pixelToShort_4x8_ssse3;<br>
-        p.pu[LUMA_4x16].filter_p2s = x265_pixelToShort_4x16_ssse3;<br>
-        p.pu[LUMA_8x4].filter_p2s = x265_pixelToShort_8x4_ssse3;<br>
-        p.pu[LUMA_8x8].filter_p2s = x265_pixelToShort_8x8_ssse3;<br>
-        p.pu[LUMA_8x16].filter_p2s = x265_pixelToShort_8x16_ssse3;<br>
-        p.pu[LUMA_8x32].filter_p2s = x265_pixelToShort_8x32_ssse3;<br>
-        p.pu[LUMA_16x4].filter_p2s = x265_pixelToShort_16x4_ssse3;<br>
-        p.pu[LUMA_16x8].filter_p2s = x265_pixelToShort_16x8_ssse3;<br>
-        p.pu[LUMA_16x12].filter_p2s = x265_pixelToShort_16x12_ssse3;<br>
-        p.pu[LUMA_16x16].filter_p2s = x265_pixelToShort_16x16_ssse3;<br>
-        p.pu[LUMA_16x32].filter_p2s = x265_pixelToShort_16x32_ssse3;<br>
-        p.pu[LUMA_16x64].filter_p2s = x265_pixelToShort_16x64_ssse3;<br>
-        p.pu[LUMA_32x8].filter_p2s = x265_pixelToShort_32x8_ssse3;<br>
-        p.pu[LUMA_32x16].filter_p2s = x265_pixelToShort_32x16_ssse3;<br>
-        p.pu[LUMA_32x24].filter_p2s = x265_pixelToShort_32x24_ssse3;<br>
-        p.pu[LUMA_32x32].filter_p2s = x265_pixelToShort_32x32_ssse3;<br>
-        p.pu[LUMA_32x64].filter_p2s = x265_pixelToShort_32x64_ssse3;<br>
-        p.pu[LUMA_64x16].filter_p2s = x265_pixelToShort_64x16_ssse3;<br>
-        p.pu[LUMA_64x32].filter_p2s = x265_pixelToShort_64x32_ssse3;<br>
-        p.pu[LUMA_64x48].filter_p2s = x265_pixelToShort_64x48_ssse3;<br>
-        p.pu[LUMA_64x64].filter_p2s = x265_pixelToShort_64x64_ssse3;<br>
<br>
-        p.chroma[X265_CSP_I420].p2s = x265_chroma_p2s_ssse3;<br>
-        p.chroma[X265_CSP_I422].p2s = x265_chroma_p2s_ssse3;<br>
<br>
         p.dst4x4 = x265_dst4_ssse3;<br>
         <a href="http://p.cu" target="_blank">p.cu</a>[BLOCK_8x8].idct = x265_idct8_ssse3;<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/x86/ipfilter8.asm<br>
--- a/source/common/x86/ipfilter8.asm   Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/x86/ipfilter8.asm   Wed Apr 01 17:27:13 2015 +0530<br>
@@ -7740,320 +7740,6 @@<br>
 FILTER_V4_W16n_H2 64, 48<br>
 FILTER_V4_W16n_H2 48, 64<br>
 FILTER_V4_W16n_H2 64, 16<br>
-;-----------------------------------------------------------------------------<br>
-; void pixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int width, int height)<br>
-;-----------------------------------------------------------------------------<br>
-%macro PIXEL_WH_4xN 2<br>
-INIT_XMM ssse3<br>
-cglobal pixelToShort_%1x%2, 3, 7, 6<br>
-<br>
-    ; load width and height<br>
-    mov         r3d, %1<br>
-    mov         r4d, %2<br>
-    ; load constant<br>
-    mova        m4, [pb_128]<br>
-    mova        m5, [tab_c_64_n64]<br>
-.loopH:<br>
-    xor         r5d, r5d<br>
-<br>
-.loopW:<br>
-    mov         r6, r0<br>
-    movh        m0, [r6]<br>
-    punpcklbw   m0, m4<br>
-    pmaddubsw   m0, m5<br>
-<br>
-    movh        m1, [r6 + r1]<br>
-    punpcklbw   m1, m4<br>
-    pmaddubsw   m1, m5<br>
-<br>
-    movh        m2, [r6 + r1 * 2]<br>
-    punpcklbw   m2, m4<br>
-    pmaddubsw   m2, m5<br>
-<br>
-    lea         r6, [r6 + r1 * 2]<br>
-    movh        m3, [r6 + r1]<br>
-    punpcklbw   m3, m4<br>
-    pmaddubsw   m3, m5<br>
-<br>
-    add         r5, 8<br>
-    cmp         r5, r3<br>
-    jg          .width4<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 0 - 16], m0<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 2 - 16], m1<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 4 - 16], m2<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 6 - 16], m3<br>
-    je          .nextH<br>
-    jmp         .loopW<br>
-<br>
-.width4:<br>
-    movh        [r2 + r5 * 2 + FENC_STRIDE * 0 - 16], m0<br>
-    movh        [r2 + r5 * 2 + FENC_STRIDE * 2 - 16], m1<br>
-    movh        [r2 + r5 * 2 + FENC_STRIDE * 4 - 16], m2<br>
-    movh        [r2 + r5 * 2 + FENC_STRIDE * 6 - 16], m3<br>
-<br>
-.nextH:<br>
-    lea         r0, [r0 + r1 * 4]<br>
-    add         r2, FENC_STRIDE * 8<br>
-<br>
-    sub         r4d, 4<br>
-    jnz         .loopH<br>
-    RET<br>
-%endmacro<br>
-PIXEL_WH_4xN 4, 4<br>
-PIXEL_WH_4xN 4, 8<br>
-PIXEL_WH_4xN 4, 16<br>
-<br>
-;-----------------------------------------------------------------------------<br>
-; void pixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int width, int height)<br>
-;-----------------------------------------------------------------------------<br>
-%macro PIXEL_WH_8xN 2<br>
-INIT_XMM ssse3<br>
-cglobal pixelToShort_%1x%2, 3, 7, 6<br>
-<br>
-    ; load width and height<br>
-    mov         r3d, %1<br>
-    mov         r4d, %2<br>
-<br>
-    ; load constant<br>
-    mova        m4, [pb_128]<br>
-    mova        m5, [tab_c_64_n64]<br>
-<br>
-.loopH<br>
-    xor         r5d, r5d<br>
-.loopW<br>
-    lea         r6, [r0 + r5]<br>
-<br>
-    movh        m0, [r6]<br>
-    punpcklbw   m0, m4<br>
-    pmaddubsw   m0, m5<br>
-<br>
-    movh        m1, [r6 + r1]<br>
-    punpcklbw   m1, m4<br>
-    pmaddubsw   m1, m5<br>
-<br>
-    movh        m2, [r6 + r1 * 2]<br>
-    punpcklbw   m2, m4<br>
-    pmaddubsw   m2, m5<br>
-<br>
-    lea         r6, [r6 + r1 * 2]<br>
-    movh        m3, [r6 + r1]<br>
-    punpcklbw   m3, m4<br>
-    pmaddubsw   m3, m5<br>
-<br>
-    add         r5, 8<br>
-    cmp         r5, r3<br>
-<br>
-    movu        [r2 + FENC_STRIDE * 0], m0<br>
-    movu        [r2 + FENC_STRIDE * 2], m1<br>
-    movu        [r2 + FENC_STRIDE * 4], m2<br>
-    movu        [r2 + FENC_STRIDE * 6], m3<br>
-<br>
-    je          .nextH<br>
-    jmp         .loopW<br>
-<br>
-<br>
-.nextH:<br>
-    lea         r0, [r0 + r1 * 4]<br>
-    add         r2, FENC_STRIDE * 8<br>
-<br>
-    sub         r4d, 4<br>
-    jnz         .loopH<br>
-    RET<br>
-%endmacro<br>
-PIXEL_WH_8xN 8, 8<br>
-PIXEL_WH_8xN 8, 4<br>
-PIXEL_WH_8xN 8, 16<br>
-PIXEL_WH_8xN 8, 32<br>
-<br>
-<br>
-;-----------------------------------------------------------------------------<br>
-; void pixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int width, int height)<br>
-;-----------------------------------------------------------------------------<br>
-%macro PIXEL_WH_16xN 2<br>
-INIT_XMM ssse3<br>
-cglobal pixelToShort_%1x%2, 3, 7, 6<br>
-<br>
-    ; load width and height<br>
-    mov         r3d, %1<br>
-    mov         r4d, %2<br>
-<br>
-    ; load constant<br>
-    mova        m4, [pb_128]<br>
-    mova        m5, [tab_c_64_n64]<br>
-<br>
-.loopH:<br>
-    xor         r5d, r5d<br>
-.loopW:<br>
-    lea         r6, [r0 + r5]<br>
-<br>
-    movh        m0, [r6]<br>
-    punpcklbw   m0, m4<br>
-    pmaddubsw   m0, m5<br>
-<br>
-    movh        m1, [r6 + r1]<br>
-    punpcklbw   m1, m4<br>
-    pmaddubsw   m1, m5<br>
-<br>
-    movh        m2, [r6 + r1 * 2]<br>
-    punpcklbw   m2, m4<br>
-    pmaddubsw   m2, m5<br>
-<br>
-    lea         r6, [r6 + r1 * 2]<br>
-    movh        m3, [r6 + r1]<br>
-    punpcklbw   m3, m4<br>
-    pmaddubsw   m3, m5<br>
-<br>
-    add         r5, 8<br>
-    cmp         r5, r3<br>
-<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 0 - 16], m0<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 2 - 16], m1<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 4 - 16], m2<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 6 - 16], m3<br>
-    je          .nextH<br>
-    jmp         .loopW<br>
-<br>
-<br>
-.nextH:<br>
-    lea         r0, [r0 + r1 * 4]<br>
-    add         r2, FENC_STRIDE * 8<br>
-<br>
-    sub         r4d, 4<br>
-    jnz         .loopH<br>
-<br>
-    RET<br>
-%endmacro<br>
-PIXEL_WH_16xN 16, 16<br>
-PIXEL_WH_16xN 16, 8<br>
-PIXEL_WH_16xN 16, 4<br>
-PIXEL_WH_16xN 16, 12<br>
-PIXEL_WH_16xN 16, 32<br>
-PIXEL_WH_16xN 16, 64<br>
-<br>
-;-----------------------------------------------------------------------------<br>
-; void pixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int width, int height)<br>
-;-----------------------------------------------------------------------------<br>
-%macro PIXEL_WH_32xN 2<br>
-INIT_XMM ssse3<br>
-cglobal pixelToShort_%1x%2, 3, 7, 6<br>
-<br>
-    ; load width and height<br>
-    mov         r3d, %1<br>
-    mov         r4d, %2<br>
-<br>
-    ; load constant<br>
-    mova        m4, [pb_128]<br>
-    mova        m5, [tab_c_64_n64]<br>
-<br>
-.loopH:<br>
-    xor         r5d, r5d<br>
-.loopW:<br>
-    lea         r6, [r0 + r5]<br>
-<br>
-    movh        m0, [r6]<br>
-    punpcklbw   m0, m4<br>
-    pmaddubsw   m0, m5<br>
-<br>
-    movh        m1, [r6 + r1]<br>
-    punpcklbw   m1, m4<br>
-    pmaddubsw   m1, m5<br>
-<br>
-    movh        m2, [r6 + r1 * 2]<br>
-    punpcklbw   m2, m4<br>
-    pmaddubsw   m2, m5<br>
-<br>
-    lea         r6, [r6 + r1 * 2]<br>
-    movh        m3, [r6 + r1]<br>
-    punpcklbw   m3, m4<br>
-    pmaddubsw   m3, m5<br>
-<br>
-    add         r5, 8<br>
-    cmp         r5, r3<br>
-<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 0 - 16], m0<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 2 - 16], m1<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 4 - 16], m2<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 6 - 16], m3<br>
-    je          .nextH<br>
-    jmp         .loopW<br>
-<br>
-<br>
-.nextH:<br>
-    lea         r0, [r0 + r1 * 4]<br>
-    add         r2, FENC_STRIDE * 8<br>
-<br>
-    sub         r4d, 4<br>
-    jnz         .loopH<br>
-<br>
-    RET<br>
-%endmacro<br>
-PIXEL_WH_32xN 32, 32<br>
-PIXEL_WH_32xN 32, 8<br>
-PIXEL_WH_32xN 32, 16<br>
-PIXEL_WH_32xN 32, 24<br>
-PIXEL_WH_32xN 32, 64<br>
-<br>
-;-----------------------------------------------------------------------------<br>
-; void pixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int width, int height)<br>
-;-----------------------------------------------------------------------------<br>
-%macro PIXEL_WH_64xN 2<br>
-INIT_XMM ssse3<br>
-cglobal pixelToShort_%1x%2, 3, 7, 6<br>
-<br>
-    ; load width and height<br>
-    mov         r3d, %1<br>
-    mov         r4d, %2<br>
-<br>
-    ; load constant<br>
-    mova        m4, [pb_128]<br>
-    mova        m5, [tab_c_64_n64]<br>
-<br>
-.loopH:<br>
-    xor         r5d, r5d<br>
-.loopW:<br>
-    lea         r6, [r0 + r5]<br>
-<br>
-    movh        m0, [r6]<br>
-    punpcklbw   m0, m4<br>
-    pmaddubsw   m0, m5<br>
-<br>
-    movh        m1, [r6 + r1]<br>
-    punpcklbw   m1, m4<br>
-    pmaddubsw   m1, m5<br>
-<br>
-    movh        m2, [r6 + r1 * 2]<br>
-    punpcklbw   m2, m4<br>
-    pmaddubsw   m2, m5<br>
-<br>
-    lea         r6, [r6 + r1 * 2]<br>
-    movh        m3, [r6 + r1]<br>
-    punpcklbw   m3, m4<br>
-    pmaddubsw   m3, m5<br>
-<br>
-    add         r5, 8<br>
-    cmp         r5, r3<br>
-<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 0 - 16], m0<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 2 - 16], m1<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 4 - 16], m2<br>
-    movu        [r2 + r5 * 2 + FENC_STRIDE * 6 - 16], m3<br>
-    je          .nextH<br>
-    jmp         .loopW<br>
-<br>
-<br>
-.nextH:<br>
-    lea         r0, [r0 + r1 * 4]<br>
-    add         r2, FENC_STRIDE * 8<br>
-<br>
-    sub         r4d, 4<br>
-    jnz         .loopH<br>
-<br>
-    RET<br>
-%endmacro<br>
-PIXEL_WH_64xN 64, 64<br>
-PIXEL_WH_64xN 64, 16<br>
-PIXEL_WH_64xN 64, 32<br>
-PIXEL_WH_64xN 64, 48<br>
<br>
 %macro PROCESS_LUMA_W4_4R 0<br>
     movd        m0, [r0]<br>
diff -r ac85c775620f -r c26756d8ced6 source/common/x86/ipfilter8.h<br>
--- a/source/common/x86/ipfilter8.h     Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/common/x86/ipfilter8.h     Wed Apr 01 17:27:13 2015 +0530<br>
@@ -289,8 +289,6 @@<br>
     SETUP_CHROMA_420_HORIZ_FUNC_DEF(64, 16, cpu); \<br>
     SETUP_CHROMA_420_HORIZ_FUNC_DEF(16, 64, cpu)<br>
<br>
-void x265_chroma_p2s_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, int width, int height);<br>
-void x265_luma_p2s_sse2(const pixel* src, intptr_t srcStride, int16_t* dst, int width, int height);<br>
<br>
 CHROMA_420_VERT_FILTERS(_sse2);<br>
 CHROMA_420_HORIZ_FILTERS(_sse4);<br>
@@ -624,28 +622,6 @@<br>
 LUMA_SP_FILTERS(_avx2);<br>
 LUMA_SS_FILTERS(_avx2);<br>
 void x265_interp_8tap_hv_pp_8x8_sse4(const pixel* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int idxX, int idxY);<br>
-void x265_pixelToShort_4x4_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_4x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_4x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_8x4_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_8x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_8x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_8x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_16x4_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_16x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_16x12_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_16x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_16x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_16x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_32x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_32x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_32x24_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_32x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_32x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_64x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_64x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_64x48_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
-void x265_pixelToShort_64x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst);<br>
 #undef LUMA_FILTERS<br>
 #undef LUMA_SP_FILTERS<br>
 #undef LUMA_SS_FILTERS<br>
diff -r ac85c775620f -r c26756d8ced6 source/test/ipfilterharness.cpp<br>
--- a/source/test/ipfilterharness.cpp   Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/test/ipfilterharness.cpp   Wed Apr 01 17:27:13 2015 +0530<br>
@@ -61,55 +61,6 @@<br>
     }<br>
 }<br>
<br>
-bool IPFilterHarness::check_IPFilter_primitive(filter_p2s_wxh_t ref, filter_p2s_wxh_t opt, int isChroma, int csp)<br>
-{<br>
-    intptr_t rand_srcStride;<br>
-    int min_size = isChroma ? 2 : 4;<br>
-    int max_size = isChroma ? (MAX_CU_SIZE >> 1) : MAX_CU_SIZE;<br>
-<br>
-    if (isChroma && (csp == X265_CSP_I444))<br>
-    {<br>
-        min_size = 4;<br>
-        max_size = MAX_CU_SIZE;<br>
-    }<br>
-<br>
-    for (int i = 0; i < ITERS; i++)<br>
-    {<br>
-        int index = i % TEST_CASES;<br>
-        int rand_height = (int16_t)rand() % 100;<br>
-        int rand_width = (int16_t)rand() % 100;<br>
-<br>
-        rand_srcStride = rand_width + rand() % 100;<br>
-        if (rand_srcStride < rand_width)<br>
-            rand_srcStride = rand_width;<br>
-<br>
-        rand_width &= ~(min_size - 1);<br>
-        rand_width = x265_clip3(min_size, max_size, rand_width);<br>
-<br>
-        rand_height &= ~(min_size - 1);<br>
-        rand_height = x265_clip3(min_size, max_size, rand_height);<br>
-<br>
-        ref(pixel_test_buff[index],<br>
-            rand_srcStride,<br>
-            IPF_C_output_s,<br>
-            rand_width,<br>
-            rand_height);<br>
-<br>
-        checked(opt, pixel_test_buff[index],<br>
-                rand_srcStride,<br>
-                IPF_vec_output_s,<br>
-                rand_width,<br>
-                rand_height);<br>
-<br>
-        if (memcmp(IPF_vec_output_s, IPF_C_output_s, TEST_BUF_SIZE * sizeof(int16_t)))<br>
-            return false;<br>
-<br>
-        reportfail();<br>
-    }<br>
-<br>
-    return true;<br>
-}<br>
-<br>
 bool IPFilterHarness::check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_t opt)<br>
 {<br>
     intptr_t rand_srcStride, rand_dstStride;<br>
@@ -518,12 +469,13 @@<br>
     {<br>
         intptr_t rand_srcStride = rand() % 100;<br>
         int index = i % TEST_CASES;<br>
+        int16_t dstStride = MAX_CU_SIZE;<br>
<br>
-        ref(pixel_test_buff[index] + i, rand_srcStride, IPF_C_output_s);<br>
+        ref(pixel_test_buff[index] + i, rand_srcStride, IPF_C_output_s, dstStride);<br>
<br>
-        checked(opt, pixel_test_buff[index] + i, rand_srcStride, IPF_vec_output_s);<br>
+        checked(opt, pixel_test_buff[index] + i, rand_srcStride, IPF_vec_output_s, dstStride);<br>
<br>
-        if (memcmp(IPF_vec_output_s, IPF_C_output_s, TEST_BUF_SIZE * sizeof(pixel)))<br>
+        if (memcmp(IPF_vec_output_s, IPF_C_output_s, TEST_BUF_SIZE * sizeof(int16_t)))<br>
             return false;<br>
<br>
         reportfail();<br>
@@ -532,18 +484,24 @@<br>
     return true;<br>
 }<br>
<br>
-bool IPFilterHarness::check_IPFilterChromaP2S_primitive(filter_p2s_t ref, filter_p2s_t opt)<br>
+bool IPFilterHarness::check_IPFilterChromaP2S_primitive(filter_p2s_t ref, filter_p2s_t opt, int csp)<br>
 {<br>
     for (int i = 0; i < ITERS; i++)<br>
     {<br>
         intptr_t rand_srcStride = rand() % 100;<br>
         int index = i % TEST_CASES;<br>
+        int16_t dstStride;<br>
<br>
-        ref(pixel_test_buff[index] + i, rand_srcStride, IPF_C_output_s);<br>
+        if (csp == X265_CSP_I444)<br>
+            dstStride = MAX_CU_SIZE;<br>
+        else<br>
+            dstStride = MAX_CU_SIZE >> (int16_t)(csp != X265_CSP_I444);<br>
<br>
-        checked(opt, pixel_test_buff[index] + i, rand_srcStride, IPF_vec_output_s);<br>
+        ref(pixel_test_buff[index] + i, rand_srcStride, IPF_C_output_s, dstStride);<br>
<br>
-        if (memcmp(IPF_vec_output_s, IPF_C_output_s, TEST_BUF_SIZE * sizeof(pixel)))<br>
+        checked(opt, pixel_test_buff[index] + i, rand_srcStride, IPF_vec_output_s, dstStride);<br>
+<br>
+        if (memcmp(IPF_vec_output_s, IPF_C_output_s, TEST_BUF_SIZE * sizeof(int16_t)))<br>
             return false;<br>
<br>
         reportfail();<br>
@@ -554,15 +512,6 @@<br>
<br>
 bool IPFilterHarness::testCorrectness(const EncoderPrimitives& ref, const EncoderPrimitives& opt)<br>
 {<br>
-    if (opt.luma_p2s)<br>
-    {<br>
-        // last parameter does not matter in case of luma<br>
-        if (!check_IPFilter_primitive(ref.luma_p2s, opt.luma_p2s, 0, 1))<br>
-        {<br>
-            printf("luma_p2s failed\n");<br>
-            return false;<br>
-        }<br>
-    }<br>
<br>
     for (int value = 0; value < NUM_PU_SIZES; value++)<br>
     {<br>
@@ -622,11 +571,11 @@<br>
                 return false;<br>
             }<br>
         }<br>
-        if (opt.pu[value].filter_p2s)<br>
+        if (opt.pu[value].convert_p2s)<br>
         {<br>
-            if (!check_IPFilterLumaP2S_primitive(ref.pu[value].filter_p2s, opt.pu[value].filter_p2s))<br>
+            if (!check_IPFilterLumaP2S_primitive(ref.pu[value].convert_p2s, opt.pu[value].convert_p2s))<br>
             {<br>
-                printf("filter_p2s[%s]", lumaPartStr[value]);<br>
+                printf("convert_p2s[%s]", lumaPartStr[value]);<br>
                 return false;<br>
             }<br>
         }<br>
@@ -634,14 +583,6 @@<br>
<br>
     for (int csp = X265_CSP_I420; csp < X265_CSP_COUNT; csp++)<br>
     {<br>
-        if (opt.chroma[csp].p2s)<br>
-        {<br>
-            if (!check_IPFilter_primitive(ref.chroma[csp].p2s, opt.chroma[csp].p2s, 1, csp))<br>
-            {<br>
-                printf("chroma_p2s[%s]", x265_source_csp_names[csp]);<br>
-                return false;<br>
-            }<br>
-        }<br>
         for (int value = 0; value < NUM_PU_SIZES; value++)<br>
         {<br>
             if (opt.chroma[csp].pu[value].filter_hpp)<br>
@@ -694,7 +635,7 @@<br>
             }<br>
             if (opt.chroma[csp].pu[value].chroma_p2s)<br>
             {<br>
-                if (!check_IPFilterChromaP2S_primitive(ref.chroma[csp].pu[value].chroma_p2s, opt.chroma[csp].pu[value].chroma_p2s))<br>
+                if (!check_IPFilterChromaP2S_primitive(ref.chroma[csp].pu[value].chroma_p2s, opt.chroma[csp].pu[value].chroma_p2s, csp))<br>
                 {<br>
                     printf("chroma_p2s[%s]", chromaPartStr[csp][value]);<br>
                     return false;<br>
@@ -708,19 +649,10 @@<br>
<br>
 void IPFilterHarness::measureSpeed(const EncoderPrimitives& ref, const EncoderPrimitives& opt)<br>
 {<br>
-    int height = 64;<br>
-    int width = 64;<br>
     int16_t srcStride = 96;<br>
     int16_t dstStride = 96;<br>
     int maxVerticalfilterHalfDistance = 3;<br>
<br>
-    if (opt.luma_p2s)<br>
-    {<br>
-        printf("luma_p2s\t");<br>
-        REPORT_SPEEDUP(opt.luma_p2s, ref.luma_p2s,<br>
-                       pixel_buff, srcStride, IPF_vec_output_s, width, height);<br>
-    }<br>
-<br>
     for (int value = 0; value < NUM_PU_SIZES; value++)<br>
     {<br>
         if (opt.pu[value].luma_hpp)<br>
@@ -777,23 +709,18 @@<br>
                            pixel_buff + 3 * srcStride, srcStride, IPF_vec_output_p, srcStride, 1, 3);<br>
         }<br>
<br>
-        if (opt.pu[value].filter_p2s)<br>
+        if (opt.pu[value].convert_p2s)<br>
         {<br>
-            printf("filter_p2s [%s]\t", lumaPartStr[value]);<br>
-            REPORT_SPEEDUP(opt.pu[value].filter_p2s, ref.pu[value].filter_p2s,<br>
-                           pixel_buff, srcStride, IPF_vec_output_s);<br>
+            printf("convert_p2s[%s]\t", lumaPartStr[value]);<br>
+            REPORT_SPEEDUP(opt.pu[value].convert_p2s, ref.pu[value].convert_p2s,<br>
+                               pixel_buff, srcStride,<br>
+                               IPF_vec_output_s, dstStride);<br>
         }<br>
     }<br>
<br>
     for (int csp = X265_CSP_I420; csp < X265_CSP_COUNT; csp++)<br>
     {<br>
         printf("= Color Space %s =\n", x265_source_csp_names[csp]);<br>
-        if (opt.chroma[csp].p2s)<br>
-        {<br>
-            printf("chroma_p2s\t");<br>
-            REPORT_SPEEDUP(opt.chroma[csp].p2s, ref.chroma[csp].p2s,<br>
-                           pixel_buff, srcStride, IPF_vec_output_s, width, height);<br>
-        }<br>
         for (int value = 0; value < NUM_PU_SIZES; value++)<br>
         {<br>
             if (opt.chroma[csp].pu[value].filter_hpp)<br>
@@ -836,13 +763,12 @@<br>
                                short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,<br>
                                IPF_vec_output_s, dstStride, 1);<br>
             }<br>
-<br>
             if (opt.chroma[csp].pu[value].chroma_p2s)<br>
             {<br>
                 printf("chroma_p2s[%s]\t", chromaPartStr[csp][value]);<br>
                 REPORT_SPEEDUP(opt.chroma[csp].pu[value].chroma_p2s, ref.chroma[csp].pu[value].chroma_p2s,<br>
                                pixel_buff, srcStride,<br>
-                               IPF_vec_output_s);<br>
+                               IPF_vec_output_s, dstStride);<br>
             }<br>
         }<br>
     }<br>
diff -r ac85c775620f -r c26756d8ced6 source/test/ipfilterharness.h<br>
--- a/source/test/ipfilterharness.h     Tue Mar 31 20:04:28 2015 -0500<br>
+++ b/source/test/ipfilterharness.h     Wed Apr 01 17:27:13 2015 +0530<br>
@@ -50,7 +50,6 @@<br>
     pixel   pixel_test_buff[TEST_CASES][TEST_BUF_SIZE];<br>
     int16_t short_test_buff[TEST_CASES][TEST_BUF_SIZE];<br>
<br>
-    bool check_IPFilter_primitive(filter_p2s_wxh_t ref, filter_p2s_wxh_t opt, int isChroma, int csp);<br>
     bool check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_t opt);<br>
     bool check_IPFilterChroma_ps_primitive(filter_ps_t ref, filter_ps_t opt);<br>
     bool check_IPFilterChroma_hps_primitive(filter_hps_t ref, filter_hps_t opt);<br>
@@ -63,7 +62,7 @@<br>
     bool check_IPFilterLuma_ss_primitive(filter_ss_t ref, filter_ss_t opt);<br>
     bool check_IPFilterLumaHV_primitive(filter_hv_pp_t ref, filter_hv_pp_t opt);<br>
     bool check_IPFilterLumaP2S_primitive(filter_p2s_t ref, filter_p2s_t opt);<br>
-    bool check_IPFilterChromaP2S_primitive(filter_p2s_t ref, filter_p2s_t opt);<br>
+    bool check_IPFilterChromaP2S_primitive(filter_p2s_t ref, filter_p2s_t opt, int csp);<br>
<br>
 public:<br>
<br>
</blockquote></div><br></div>