[x265] [PATCH] asm: Unit test code for scale1D_128to64 Routine
murugan at multicorewareinc.com
murugan at multicorewareinc.com
Thu Nov 14 07:07:09 CET 2013
# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1384409049 -19800
# Thu Nov 14 11:34:09 2013 +0530
# Node ID c9fdf510182348c979a58be67101446c84b36569
# Parent 481cdfc251de0f99ef0a3c4fd53c786b79b5f182
asm: Unit test code for scale1D_128to64 Routine
diff -r 481cdfc251de -r c9fdf5101823 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp Wed Nov 13 12:46:07 2013 +0530
+++ b/source/test/pixelharness.cpp Thu Nov 14 11:34:09 2013 +0530
@@ -586,6 +586,29 @@
return true;
}
+bool PixelHarness::check_scale_pixel_t(scale_t ref, scale_t opt)
+{
+ ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
+ ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
+
+ memset(ref_dest, 0, sizeof(ref_dest));
+ memset(opt_dest, 0, sizeof(opt_dest));
+
+ int j = 0;
+ for (int i = 0; i < ITERS; i++)
+ {
+ opt(opt_dest, pbuf1 + j, STRIDE);
+ ref(ref_dest, pbuf1 + j, STRIDE);
+
+ if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))
+ return false;
+
+ j += INCR;
+ }
+
+ return true;
+}
+
bool PixelHarness::testPartition(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)
{
if (opt.satd[part])
@@ -880,6 +903,15 @@
return false;
}
}
+
+ if (opt.scale1D_128to64)
+ {
+ if (!check_scale_pixel_t(ref.scale1D_128to64, opt.scale1D_128to64))
+ {
+ printf("scale1D_128to64 failed!\n");
+ return false;
+ }
+ }
return true;
}
@@ -1093,4 +1125,10 @@
printf("downscale");
REPORT_SPEEDUP(opt.frame_init_lowres_core, ref.frame_init_lowres_core, pbuf2, pbuf1, pbuf2, pbuf3, pbuf4, 64, 64, 64, 64);
}
+
+ if (opt.scale1D_128to64)
+ {
+ printf("scale1D_128to64");
+ REPORT_SPEEDUP(opt.scale1D_128to64, ref.scale1D_128to64, pbuf2, pbuf1, 64);
+ }
}
diff -r 481cdfc251de -r c9fdf5101823 source/test/pixelharness.h
--- a/source/test/pixelharness.h Wed Nov 13 12:46:07 2013 +0530
+++ b/source/test/pixelharness.h Thu Nov 14 11:34:09 2013 +0530
@@ -61,6 +61,8 @@
bool check_blockfill_s(blockfill_s_t ref, blockfill_s_t opt);
bool check_pixel_sub_ps(pixel_sub_ps_t ref, pixel_sub_ps_t opt);
+
+ bool check_scale_pixel_t(scale_t ref, scale_t opt);
public:
PixelHarness();
More information about the x265-devel
mailing list