[x265-commits] [x265] primitive: rename weight primitives to match our naming c...

Steve Borho steve at borho.org
Thu Nov 21 23:14:03 CET 2013


details:   http://hg.videolan.org/x265/rev/49f8b71ae89b
branches:  
changeset: 5250:49f8b71ae89b
user:      Steve Borho <steve at borho.org>
date:      Thu Nov 21 14:35:28 2013 -0600
description:
primitive: rename weight primitives to match our naming convention

weight_pp -> weight pixels to pixels
weight_sp -> weight shorts to pixels
Subject: [x265] testbench: re-line up test results to improve readability

details:   http://hg.videolan.org/x265/rev/1643c78be418
branches:  
changeset: 5251:1643c78be418
user:      Steve Borho <steve at borho.org>
date:      Thu Nov 21 15:04:39 2013 -0600
description:
testbench: re-line up test results to improve readability
Subject: [x265] pixelharness: cleanup check function names

details:   http://hg.videolan.org/x265/rev/8dfe7282ce81
branches:  
changeset: 5252:8dfe7282ce81
user:      Steve Borho <steve at borho.org>
date:      Thu Nov 21 15:10:37 2013 -0600
description:
pixelharness: cleanup check function names
Subject: [x265] pixel_add_ps, 32xN corrected xmm register count

details:   http://hg.videolan.org/x265/rev/76b0d2a278fb
branches:  
changeset: 5253:76b0d2a278fb
user:      Praveen Tiwari
date:      Thu Nov 21 15:13:39 2013 +0530
description:
pixel_add_ps, 32xN corrected xmm register count

diffstat:

 source/Lib/TLibCommon/TComWeightPrediction.cpp |    6 +-
 source/common/pixel.cpp                        |    8 +-
 source/common/primitives.h                     |    8 +-
 source/common/vec/pixel-sse41.cpp              |    6 +-
 source/common/x86/pixeladd8.asm                |    2 +-
 source/encoder/motion.cpp                      |    6 +-
 source/encoder/reference.cpp                   |    2 +-
 source/encoder/slicetype.cpp                   |    8 +-
 source/test/intrapredharness.cpp               |    4 +-
 source/test/pixelharness.cpp                   |  129 +++++++++++++-----------
 source/test/pixelharness.h                     |   31 ++---
 source/test/testharness.h                      |    2 +-
 12 files changed, 108 insertions(+), 104 deletions(-)

diffs (truncated from 705 to 300 lines):

diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/Lib/TLibCommon/TComWeightPrediction.cpp
--- a/source/Lib/TLibCommon/TComWeightPrediction.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/Lib/TLibCommon/TComWeightPrediction.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -454,7 +454,7 @@ void TComWeightPrediction::addWeightUni(
         srcStride = srcYuv0->m_width;
         dstStride  = outDstYuv->getStride();
 
-        primitives.weightpUni((int16_t*)srcY0, dstY, srcStride, dstStride, width, height, w0, round, shift, offset);
+        primitives.weight_sp(srcY0, dstY, srcStride, dstStride, width, height, w0, round, shift, offset);
     }
 
     if (bChroma)
@@ -472,7 +472,7 @@ void TComWeightPrediction::addWeightUni(
         width  >>= 1;
         height >>= 1;
 
-        primitives.weightpUni((int16_t*)srcU0, dstU, srcStride, dstStride, width, height, w0, round, shift, offset);
+        primitives.weight_sp(srcU0, dstU, srcStride, dstStride, width, height, w0, round, shift, offset);
 
         // Chroma V : --------------------------------------------
         w0      = wp0[2].w;
@@ -480,7 +480,7 @@ void TComWeightPrediction::addWeightUni(
         shift   = wp0[2].shift + shiftNum;
         round   = shift ? (1 << (shift - 1)) : 0;
 
-        primitives.weightpUni((int16_t*)srcV0, dstV, srcStride, dstStride, width, height, w0, round, shift, offset);
+        primitives.weight_sp(srcV0, dstV, srcStride, dstStride, width, height, w0, round, shift, offset);
     }
 }
 
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/common/pixel.cpp
--- a/source/common/pixel.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/common/pixel.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -491,7 +491,7 @@ void transpose(pixel* dst, pixel* src, i
     }
 }
 
-void weightUnidir(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)
+void weight_sp_c(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)
 {
     int x, y;
 
@@ -509,7 +509,7 @@ void weightUnidir(int16_t *src, pixel *d
     }
 }
 
-void weightUnidirPix(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)
+void weight_pp_c(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)
 {
     int x, y;
 
@@ -957,8 +957,8 @@ void Setup_C_PixelPrimitives(EncoderPrim
     p.transpose[3] = transpose<32>;
     p.transpose[4] = transpose<64>;
 
-    p.weightpUniPixel = weightUnidirPix;
-    p.weightpUni = weightUnidir;
+    p.weight_pp = weight_pp_c;
+    p.weight_sp = weight_sp_c;
 
     p.pixeladd_ss = pixeladd_ss_c;
 
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/common/primitives.h
--- a/source/common/primitives.h	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/common/primitives.h	Thu Nov 21 15:13:39 2013 +0530
@@ -181,8 +181,8 @@ typedef uint32_t (*quant_t)(int32_t *coe
 typedef void (*dequant_t)(const int32_t* src, int32_t* dst, int width, int height, int mcqp_miper, int mcqp_mirem, bool useScalingList,
                           unsigned int trSizeLog2, int32_t *dequantCoef);
 
-typedef void (*weightpUniPixel_t)(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
-typedef void (*weightpUni_t)(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
+typedef void (*weightp_pp_t)(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
+typedef void (*weightp_sp_t)(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset);
 typedef void (*scale_t)(pixel *dst, pixel *src, intptr_t stride);
 typedef void (*downscale_t)(pixel *src0, pixel *dstf, pixel *dsth, pixel *dstv, pixel *dstc,
                             intptr_t src_stride, intptr_t dst_stride, int width, int height);
@@ -246,8 +246,8 @@ struct EncoderPrimitives
     filter_p2s_t    chroma_p2s;
     ipfilter_sp_t   chroma_vsp;
 
-    weightpUni_t    weightpUni;
-    weightpUniPixel_t weightpUniPixel;
+    weightp_sp_t    weight_sp;
+    weightp_pp_t    weight_pp;
     pixeladd_ss_t   pixeladd_ss;
     pixelavg_pp_t   pixelavg_pp[NUM_LUMA_PARTITIONS];
 
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/common/vec/pixel-sse41.cpp
--- a/source/common/vec/pixel-sse41.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/common/vec/pixel-sse41.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -244,7 +244,7 @@ int sse_pp_64(pixel* fenc, intptr_t stri
     return _mm_cvtsi128_si32(sum);
 }
 
-void weightUnidir(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)
+void weight_sp_c(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)
 {
     __m128i w00, roundoff, ofs, fs, tmpsrc, tmpdst, tmp, sign;
     int x, y;
@@ -997,8 +997,8 @@ void Setup_Vec_PixelPrimitives_sse41(Enc
     p.sse_pp[LUMA_64x48] = sse_pp_64<48>;
     p.sse_pp[LUMA_64x16] = sse_pp_64<16>;
 
-    p.weightpUniPixel = weightUnidirPixel;
-    p.weightpUni = weightUnidir;
+    p.weight_pp = weightUnidirPixel;
+    p.weight_sp = weight_sp_c;
 #endif /* !HIGH_BIT_DEPTH */
 }
 }
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/common/x86/pixeladd8.asm	Thu Nov 21 15:13:39 2013 +0530
@@ -604,7 +604,7 @@ cglobal pixel_add_ps_16x4, 6, 6, 4, dest
 ;-----------------------------------------------------------------------------
 %macro PIXEL_ADD_PS_W16_H4 2
 INIT_XMM sse4
-cglobal pixel_add_ps_%1x%2, 6, 7, 4, dest, destride, src0, scr1, srcStride0, srcStride1
+cglobal pixel_add_ps_%1x%2, 6, 7, 8, dest, destride, src0, scr1, srcStride0, srcStride1
 
 add         r5,            r5
 
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/encoder/motion.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -1147,12 +1147,12 @@ int MotionEstimate::subpelCompare(Refere
             if (yFrac == 0)
             {
                 primitives.ipfilter_ps[FILTER_H_P_S_8](fref, ref->lumaStride, immedVal, FENC_STRIDE, blockwidth, blockheight, g_lumaFilter[xFrac]);
-                primitives.weightpUni(immedVal, subpelbuf, FENC_STRIDE, FENC_STRIDE, blockwidth, blockheight, ref->weight, round, shift, ref->offset);
+                primitives.weight_sp(immedVal, subpelbuf, FENC_STRIDE, FENC_STRIDE, blockwidth, blockheight, ref->weight, round, shift, ref->offset);
             }
             else if (xFrac == 0)
             {
                 primitives.ipfilter_ps[FILTER_V_P_S_8](fref, ref->lumaStride, immedVal, FENC_STRIDE, blockwidth, blockheight, g_lumaFilter[yFrac]);
-                primitives.weightpUni(immedVal, subpelbuf, FENC_STRIDE, FENC_STRIDE, blockwidth, blockheight, ref->weight, round, shift, ref->offset);
+                primitives.weight_sp(immedVal, subpelbuf, FENC_STRIDE, FENC_STRIDE, blockwidth, blockheight, ref->weight, round, shift, ref->offset);
             }
             else
             {
@@ -1160,7 +1160,7 @@ int MotionEstimate::subpelCompare(Refere
                 int halfFilterSize = (filterSize >> 1);
                 primitives.ipfilter_ps[FILTER_H_P_S_8](fref - (halfFilterSize - 1) * ref->lumaStride, ref->lumaStride, immedVal, blockwidth, blockwidth, blockheight + filterSize - 1, g_lumaFilter[xFrac]);
                 primitives.ipfilter_ss[FILTER_V_S_S_8](immedVal + (halfFilterSize - 1) * blockwidth, blockwidth, immedVal2, FENC_STRIDE, blockwidth, blockheight, yFrac);
-                primitives.weightpUni(immedVal2, subpelbuf, FENC_STRIDE, FENC_STRIDE, blockwidth, blockheight, ref->weight, round, shift, ref->offset);
+                primitives.weight_sp(immedVal2, subpelbuf, FENC_STRIDE, FENC_STRIDE, blockwidth, blockheight, ref->weight, round, shift, ref->offset);
             }
         }
         else
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/encoder/reference.cpp
--- a/source/encoder/reference.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/encoder/reference.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -95,7 +95,7 @@ void MotionReference::applyWeight(int ro
     int shiftNum = IF_INTERNAL_PREC - X265_DEPTH;
     int local_shift = shift + shiftNum;
     int local_round = local_shift ? (1 << (local_shift - 1)) : 0;
-    primitives.weightpUniPixel(src, dst, lumaStride, dstStride, width, height, weight, local_round, local_shift, offset);
+    primitives.weight_pp(src, dst, lumaStride, dstStride, width, height, weight, local_round, local_shift, offset);
 
     // Extending Left & Right
     primitives.extendRowBorder(dst, dstStride, width, height, marginX);
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/encoder/slicetype.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -233,8 +233,8 @@ uint32_t Lookahead::weightCostLuma(int b
         int correction = IF_INTERNAL_PREC - X265_DEPTH;
 
         // Adding (IF_INTERNAL_PREC - X265_DEPTH) to cancel effect of pixel to short conversion inside the primitive
-        primitives.weightpUniPixel(src, weightedRef.fpelPlane, stride, stride, stride, fenc->lines,
-                                   scale, (1 << (denom - 1 + correction)), denom + correction, offset);
+        primitives.weight_pp(src, weightedRef.fpelPlane, stride, stride, stride, fenc->lines,
+                             scale, (1 << (denom - 1 + correction)), denom + correction, offset);
         src = weightedRef.fpelPlane;
     }
 
@@ -327,8 +327,8 @@ void Lookahead::weightsAnalyse(int b, in
         for (int i = 0; i < 4; i++)
         {
             // Adding (IF_INTERNAL_PREC - X265_DEPTH) to cancel effect of pixel to short conversion inside the primitive
-            primitives.weightpUniPixel(ref->buffer[i], wbuffer[i], stride, stride, stride, paddedLines,
-                                       scale, (1 << (denom - 1 + correction)), denom + correction, offset);
+            primitives.weight_pp(ref->buffer[i], wbuffer[i], stride, stride, stride, paddedLines,
+                                 scale, (1 << (denom - 1 + correction)), denom + correction, offset);
         }
         weightedRef.isWeighted = true;
     }
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/test/intrapredharness.cpp
--- a/source/test/intrapredharness.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/test/intrapredharness.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -299,12 +299,12 @@ void IntraPredHarness::measureSpeed(cons
         if (opt.intra_pred_dc[i])
         {
             const int size = (1 << (i + 2));
-            printf("intra_dc_%dx%d[filter=0]", size, size);
+            printf("intra_dc_%dx%d[f=0]", size, size);
             REPORT_SPEEDUP(opt.intra_pred_dc[i], ref.intra_pred_dc[i],
                            pixel_buff + srcStride, pixel_buff, pixel_out_vec, FENC_STRIDE, 0);
             if (size <= 16)
             {
-                printf("intra_dc_%dx%d[filter=1]", size, size);
+                printf("intra_dc_%dx%d[f=1]", size, size);
                 REPORT_SPEEDUP(opt.intra_pred_dc[i], ref.intra_pred_dc[i],
                            pixel_buff + srcStride, pixel_buff, pixel_out_vec, FENC_STRIDE, 1);
             }
diff -r 8dc9e5e4a0e6 -r 76b0d2a278fb source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Thu Nov 21 14:15:27 2013 -0600
+++ b/source/test/pixelharness.cpp	Thu Nov 21 15:13:39 2013 +0530
@@ -173,7 +173,7 @@ bool PixelHarness::check_pixelcmp_x4(pix
     return true;
 }
 
-bool PixelHarness::check_block_copy(blockcpy_pp_t ref, blockcpy_pp_t opt)
+bool PixelHarness::check_blockcopy_pp(blockcpy_pp_t ref, blockcpy_pp_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -196,7 +196,7 @@ bool PixelHarness::check_block_copy(bloc
     return true;
 }
 
-bool PixelHarness::check_block_copy_p_s(blockcpy_ps_t ref, blockcpy_ps_t opt)
+bool PixelHarness::check_blockcopy_ps(blockcpy_ps_t ref, blockcpy_ps_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -279,7 +279,7 @@ bool PixelHarness::check_calcrecon(calcr
     return true;
 }
 
-bool PixelHarness::check_weightpUni(weightpUni_t ref, weightpUni_t opt)
+bool PixelHarness::check_weightp(weightp_sp_t ref, weightp_sp_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -307,7 +307,7 @@ bool PixelHarness::check_weightpUni(weig
     return true;
 }
 
-bool PixelHarness::check_weightpUni(weightpUniPixel_t ref, weightpUniPixel_t opt)
+bool PixelHarness::check_weightp(weightp_pp_t ref, weightp_pp_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -443,7 +443,7 @@ bool PixelHarness::check_pixelavg_pp(pix
     return true;
 }
 
-bool PixelHarness::check_block_copy_pp(copy_pp_t ref, copy_pp_t opt)
+bool PixelHarness::check_copy_pp(copy_pp_t ref, copy_pp_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -468,7 +468,7 @@ bool PixelHarness::check_block_copy_pp(c
     return true;
 }
 
-bool PixelHarness::check_block_copy_sp(copy_sp_t ref, copy_sp_t opt)
+bool PixelHarness::check_copy_sp(copy_sp_t ref, copy_sp_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -493,7 +493,7 @@ bool PixelHarness::check_block_copy_sp(c
     return true;
 }
 
-bool PixelHarness::check_block_copy_ps(copy_ps_t ref, copy_ps_t opt)
+bool PixelHarness::check_copy_ps(copy_ps_t ref, copy_ps_t opt)
 {
     ALIGN_VAR_16(int16_t, ref_dest[64 * 64]);
     ALIGN_VAR_16(int16_t, opt_dest[64 * 64]);
@@ -563,7 +563,7 @@ bool PixelHarness::check_pixel_sub_ps(pi
     return true;
 }
 
-bool PixelHarness::check_pixel_scale_pp(scale_t ref, scale_t opt)
+bool PixelHarness::check_scale_pp(scale_t ref, scale_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
     ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
@@ -717,7 +717,7 @@ bool PixelHarness::testPartition(int par
 
     if (opt.luma_copy_pp[part])
     {
-        if (!check_block_copy_pp(ref.luma_copy_pp[part], opt.luma_copy_pp[part]))
+        if (!check_copy_pp(ref.luma_copy_pp[part], opt.luma_copy_pp[part]))
         {
             printf("luma_copy_pp[%s] failed\n", lumaPartStr[part]);
             return false;
@@ -726,7 +726,7 @@ bool PixelHarness::testPartition(int par
 
     if (opt.luma_copy_sp[part])
     {
-        if (!check_block_copy_sp(ref.luma_copy_sp[part], opt.luma_copy_sp[part]))
+        if (!check_copy_sp(ref.luma_copy_sp[part], opt.luma_copy_sp[part]))
         {
             printf("luma_copy_sp[%s] failed\n", lumaPartStr[part]);
             return false;
@@ -735,7 +735,7 @@ bool PixelHarness::testPartition(int par
 
     if (opt.luma_copy_ps[part])


More information about the x265-commits mailing list