[x265] [PATCH 1 of 2] intra: replace 64x64 scaled reference pixel copy loop by memcpy

Min Chen chenm003 at 163.com
Sat Mar 28 01:42:50 CET 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1427503356 25200
# Node ID 6c739f92b1b18bf20531afea00480c86db1a9f0e
# Parent  dc7a6c5fbda13173004e6193f185ea857d7a22c8
intra: replace 64x64 scaled reference pixel copy loop by memcpy
---
 source/encoder/search.cpp |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff -r dc7a6c5fbda1 -r 6c739f92b1b1 source/encoder/search.cpp
--- a/source/encoder/search.cpp	Thu Mar 26 11:24:23 2015 -0500
+++ b/source/encoder/search.cpp	Fri Mar 27 17:42:36 2015 -0700
@@ -1234,13 +1234,8 @@
         primitives.scale1D_128to64(nScale + 1, intraNeighbourBuf[0] + 1, 0);
 
         // we do not estimate filtering for downscaled samples
-        for (int x = 1; x < 65; x++)
-        {
-            intraNeighbourBuf[0][x] = nScale[x];           // Top pixel
-            intraNeighbourBuf[0][x + 64] = nScale[x + 64]; // Left pixel
-            intraNeighbourBuf[1][x] = nScale[x];           // Top pixel
-            intraNeighbourBuf[1][x + 64] = nScale[x + 64]; // Left pixel
-        }
+        memcpy(&intraNeighbourBuf[0][1], &nScale[1], 2 * 64 * sizeof(pixel));   // Top & Left pixels
+        memcpy(&intraNeighbourBuf[1][1], &nScale[1], 2 * 64 * sizeof(pixel));
 
         scaleTuSize = 32;
         scaleStride = 32;
@@ -1467,14 +1462,8 @@
                     intraNeighbourBuf[1][0] = intraNeighbourBuf[0][0];
                     primitives.scale1D_128to64(nScale + 1, intraNeighbourBuf[0] + 1, 0);
 
-                    // TO DO: primitive
-                    for (int x = 1; x < 65; x++)
-                    {
-                        intraNeighbourBuf[0][x] = nScale[x];           // Top pixel
-                        intraNeighbourBuf[0][x + 64] = nScale[x + 64]; // Left pixel
-                        intraNeighbourBuf[1][x] = nScale[x];           // Top pixel
-                        intraNeighbourBuf[1][x + 64] = nScale[x + 64]; // Left pixel
-                    }
+                    memcpy(&intraNeighbourBuf[0][1], &nScale[1], 2 * 64 * sizeof(pixel));
+                    memcpy(&intraNeighbourBuf[1][1], &nScale[1], 2 * 64 * sizeof(pixel));
 
                     scaleTuSize = 32;
                     scaleStride = 32;



More information about the x265-devel mailing list