[x265] [PATCH 2 of 3] motion: use new pixelavg_pp primitive for lowres QPEL pixel generation

Steve Borho steve at borho.org
Sat Oct 5 00:02:02 CEST 2013


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1380920521 18000
#      Fri Oct 04 16:02:01 2013 -0500
# Node ID 7976c35f5b769431f99db1a77151329be16934ba
# Parent  cb6b3038a1e67b5697e748614485a027a18b4c12
motion: use new pixelavg_pp primitive for lowres QPEL pixel generation

diff -r cb6b3038a1e6 -r 7976c35f5b76 source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Fri Oct 04 16:01:15 2013 -0500
+++ b/source/encoder/motion.cpp	Fri Oct 04 16:02:01 2013 -0500
@@ -1118,10 +1118,8 @@
             int hpelB = (qmvB.y & 2) | ((qmvB.x & 2) >> 1);
             pixel *frefB = ref->lowresPlane[hpelB] + blockOffset + (qmvB.x >> 2) + (qmvB.y >> 2) * ref->lumaStride;
 
-            /* TODO: make this into a lowres MC primitive */
-            for (int y = 0; y < blockheight; y++)
-                for (int x = 0; x < blockwidth; x++)
-                    subpelbuf[y * FENC_STRIDE + x] = (frefA[y * ref->lumaStride + x] + frefB[y * ref->lumaStride + x] + 1) >> 1;
+            // average nearest two HPEL pixels to generate H.264 style QPEL pixels
+            primitives.pixelavg_pp[PARTITION_8x8](subpelbuf, FENC_STRIDE, frefA, frefB, ref->lumaStride, ref->lumaStride);
             return cmp(fenc, FENC_STRIDE, subpelbuf, FENC_STRIDE);
         }
         else


More information about the x265-devel mailing list