[x265] [PATCH] Testbench code for blockcopy_ss
murugan at multicorewareinc.com
murugan at multicorewareinc.com
Thu Mar 6 15:27:02 CET 2014
# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1394104114 -19800
# Thu Mar 06 16:38:34 2014 +0530
# Node ID 20374496757b5c64b798833c2d48b8b585ca4b2e
# Parent 5cd0151094ba957f83e00d4a319c9e615f6c8587
Testbench code for blockcopy_ss
diff -r 5cd0151094ba -r 20374496757b source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp Thu Mar 06 16:37:41 2014 +0530
+++ b/source/test/pixelharness.cpp Thu Mar 06 16:38:34 2014 +0530
@@ -645,6 +645,32 @@
return true;
}
+bool PixelHarness::check_copy_ss(copy_ss_t ref, copy_ss_t opt)
+{
+ ALIGN_VAR_16(int16_t, ref_dest[64 * 64]);
+ ALIGN_VAR_16(int16_t, opt_dest[64 * 64]);
+
+ // we don't know the partition size so we are checking the entire output buffer so
+ // we must initialize the buffers
+ memset(ref_dest, 0xCD, sizeof(ref_dest));
+ memset(opt_dest, 0xCD, sizeof(opt_dest));
+
+ int j = 0;
+ for (int i = 0; i < ITERS; i++)
+ {
+ int index = i % TEST_CASES;
+ opt(opt_dest, STRIDE, short_test_buff1[index] + j, STRIDE);
+ ref(ref_dest, STRIDE, short_test_buff1[index] + j, STRIDE);
+
+ if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))
+ return false;
+
+ j += INCR;
+ }
+
+ return true;
+}
+
bool PixelHarness::check_blockfill_s(blockfill_s_t ref, blockfill_s_t opt)
{
ALIGN_VAR_16(int16_t, ref_dest[64 * 64]);
@@ -1004,6 +1030,15 @@
}
}
+ if (opt.luma_copy_ss[part])
+ {
+ if (!check_copy_ss(ref.luma_copy_ss[part], opt.luma_copy_ss[part]))
+ {
+ printf("luma_copy_ss[%s] failed\n", lumaPartStr[part]);
+ return false;
+ }
+ }
+
if (opt.luma_sub_ps[part])
{
if (!check_pixel_sub_ps(ref.luma_sub_ps[part], opt.luma_sub_ps[part]))
@@ -1057,6 +1092,14 @@
return false;
}
}
+ if (opt.chroma[i].copy_ss[part])
+ {
+ if (!check_copy_ss(ref.chroma[i].copy_ss[part], opt.chroma[i].copy_ss[part]))
+ {
+ printf("chroma_copy_ss[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[part]);
+ return false;
+ }
+ }
if (opt.chroma[i].sub_ps[part])
{
if (!check_pixel_sub_ps(ref.chroma[i].sub_ps[part], opt.chroma[i].sub_ps[part]))
@@ -1367,6 +1410,11 @@
HEADER("luma_copy_ps[%s]", lumaPartStr[part]);
REPORT_SPEEDUP(opt.luma_copy_ps[part], ref.luma_copy_ps[part], sbuf1, 64, pbuf1, 128);
}
+ if (opt.luma_copy_ss[part])
+ {
+ HEADER("luma_copy_ss[%s]", lumaPartStr[part]);
+ REPORT_SPEEDUP(opt.luma_copy_ss[part], ref.luma_copy_ss[part], sbuf1, 64, sbuf2, 128);
+ }
if (opt.luma_sub_ps[part])
{
HEADER("luma_sub_ps[%s]", lumaPartStr[part]);
@@ -1402,6 +1450,11 @@
HEADER("[%s] copy_ps[%s]", x265_source_csp_names[i], chromaPartStr[part]);
REPORT_SPEEDUP(opt.chroma[i].copy_ps[part], ref.chroma[i].copy_ps[part], sbuf1, 64, pbuf1, 128);
}
+ if (opt.chroma[i].copy_ss[part])
+ {
+ HEADER("[%s] copy_ss[%s]", x265_source_csp_names[i], chromaPartStr[part]);
+ REPORT_SPEEDUP(opt.chroma[i].copy_ss[part], ref.chroma[i].copy_ss[part], sbuf1, 64, sbuf2, 128);
+ }
if (opt.chroma[i].sub_ps[part])
{
HEADER("[%s] sub_ps[%s]", x265_source_csp_names[i], chromaPartStr[part]);
diff -r 5cd0151094ba -r 20374496757b source/test/pixelharness.h
--- a/source/test/pixelharness.h Thu Mar 06 16:37:41 2014 +0530
+++ b/source/test/pixelharness.h Thu Mar 06 16:38:34 2014 +0530
@@ -45,6 +45,7 @@
bool check_copy_pp(copy_pp_t ref, copy_pp_t opt);
bool check_copy_sp(copy_sp_t ref, copy_sp_t opt);
bool check_copy_ps(copy_ps_t ref, copy_ps_t opt);
+ bool check_copy_ss(copy_ss_t ref, copy_ss_t opt);
bool check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt);
bool check_pixel_sub_ps(pixel_sub_ps_t ref, pixel_sub_ps_t opt);
bool check_pixel_add_ps(pixel_add_ps_t ref, pixel_add_ps_t opt);
More information about the x265-devel
mailing list