[x265] [PATCH] Testbench build fix for DCT/IDCT interface change

praveen at multicorewareinc.com praveen at multicorewareinc.com
Tue Oct 28 13:12:02 CET 2014


# HG changeset patch
# User Praveen Tiwari
# Date 1414495107 -19800
# Node ID 91cb96595a4b74addda32d543802cde9e9da6dfd
# Parent  b94b25c88de7cd7df4e2f3c223e2e229488b7d54
Testbench build fix for DCT/IDCT interface change

diff -r b94b25c88de7 -r 91cb96595a4b source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Tue Oct 28 16:05:28 2014 +0530
+++ b/source/common/x86/blockcopy8.h	Tue Oct 28 16:48:27 2014 +0530
@@ -24,7 +24,7 @@
 #ifndef X265_BLOCKCOPY8_H
 #define X265_BLOCKCOPY8_H
 
-void x265_cvt32to16_shr_sse2(int16_t * dst, int *src, intptr_t, int, int);
+void x265_cvt32to16_shr_sse2(int16_t * dst, int16_t *src, intptr_t, int, int);
 void x265_cvt32to16_shl_4_sse2(int16_t * dst, int *src, intptr_t, int);
 void x265_cvt32to16_shl_8_sse2(int16_t * dst, int *src, intptr_t, int);
 void x265_cvt32to16_shl_16_sse2(int16_t * dst, int *src, intptr_t, int);
@@ -33,7 +33,7 @@
 void x265_cvt32to16_shl_8_avx2(int16_t * dst, int *src, intptr_t, int);
 void x265_cvt32to16_shl_16_avx2(int16_t * dst, int *src, intptr_t, int);
 void x265_cvt32to16_shl_32_avx2(int16_t * dst, int *src, intptr_t, int);
-void x265_cvt16to32_shl_sse4(int32_t * dst, int16_t * src, intptr_t, int32_t, int32_t);
+void x265_cvt16to32_shl_sse4(int16_t * dst, int16_t * src, intptr_t, int32_t, int32_t);
 void x265_cvt16to32_shr_4_sse4(int32_t * dst, int16_t * src, intptr_t, int32_t, int32_t);
 void x265_cvt16to32_shr_8_sse4(int32_t * dst, int16_t * src, intptr_t, int32_t, int32_t);
 void x265_cvt16to32_shr_16_sse4(int32_t * dst, int16_t * src, intptr_t, int32_t, int32_t);
diff -r b94b25c88de7 -r 91cb96595a4b source/common/x86/dct8.h
--- a/source/common/x86/dct8.h	Tue Oct 28 16:05:28 2014 +0530
+++ b/source/common/x86/dct8.h	Tue Oct 28 16:48:27 2014 +0530
@@ -23,23 +23,23 @@
 
 #ifndef X265_DCT8_H
 #define X265_DCT8_H
-void x265_dct4_sse2(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_dst4_ssse3(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_dct8_sse4(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_dct4_avx2(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_dct8_avx2(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_dct16_avx2(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_dct32_avx2(int16_t *src, int32_t *dst, intptr_t stride);
-void x265_idct32_avx2(int32_t *src, int16_t *dst, intptr_t stride);
+void x265_dct4_sse2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_dst4_ssse3(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_dct8_sse4(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_dct4_avx2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_dct8_avx2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_dct16_avx2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_dct32_avx2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_idct32_avx2(int16_t *src, int16_t *dst, intptr_t stride);
 
-void x265_idst4_sse2(int32_t *src, int16_t *dst, intptr_t stride);
-void x265_idct4_sse2(int32_t *src, int16_t *dst, intptr_t stride);
-void x265_idct4_avx2(int32_t *src, int16_t *dst, intptr_t stride);
-void x265_idct8_ssse3(int32_t *src, int16_t *dst, intptr_t stride);
-void x265_idct8_avx2(int32_t *src, int16_t *dst, intptr_t stride);
-void x265_idct16_avx2(int32_t *src, int16_t *dst, intptr_t stride);
+void x265_idst4_sse2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_idct4_sse2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_idct4_avx2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_idct8_ssse3(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_idct8_avx2(int16_t *src, int16_t *dst, intptr_t stride);
+void x265_idct16_avx2(int16_t *src, int16_t *dst, intptr_t stride);
 
-void x265_denoise_dct_sse4(int32_t *dct, uint32_t *sum, uint16_t *offset, int size);
-void x265_denoise_dct_avx2(int32_t *dct, uint32_t *sum, uint16_t *offset, int size);
+void x265_denoise_dct_sse4(int16_t *dct, uint32_t *sum, uint16_t *offset, int size);
+void x265_denoise_dct_avx2(int16_t *dct, uint32_t *sum, uint16_t *offset, int size);
 
 #endif // ifndef X265_DCT8_H
diff -r b94b25c88de7 -r 91cb96595a4b source/common/x86/pixel-util.h
--- a/source/common/x86/pixel-util.h	Tue Oct 28 16:05:28 2014 +0530
+++ b/source/common/x86/pixel-util.h	Tue Oct 28 16:48:27 2014 +0530
@@ -49,12 +49,12 @@
 void x265_transpose32_avx2(pixel *dest, pixel *src, intptr_t stride);
 void x265_transpose64_avx2(pixel *dest, pixel *src, intptr_t stride);
 
-uint32_t x265_quant_sse4(int32_t *coef, int32_t *quantCoeff, int32_t *deltaU, int16_t *qCoef, int qBits, int add, int numCoeff);
-uint32_t x265_quant_avx2(int32_t *coef, int32_t *quantCoeff, int32_t *deltaU, int16_t *qCoef, int qBits, int add, int numCoeff);
-uint32_t x265_nquant_sse4(int32_t *coef, int32_t *quantCoeff, int16_t *qCoef, int qBits, int add, int numCoeff);
-uint32_t x265_nquant_avx2(int32_t *coef, int32_t *quantCoeff, int16_t *qCoef, int qBits, int add, int numCoeff);
-void x265_dequant_normal_sse4(const int16_t* quantCoef, int32_t* coef, int num, int scale, int shift);
-void x265_dequant_normal_avx2(const int16_t* quantCoef, int32_t* coef, int num, int scale, int shift);
+uint32_t x265_quant_sse4(int16_t *coef, int32_t *quantCoeff, int32_t *deltaU, int16_t *qCoef, int qBits, int add, int numCoeff);
+uint32_t x265_quant_avx2(int16_t *coef, int32_t *quantCoeff, int32_t *deltaU, int16_t *qCoef, int qBits, int add, int numCoeff);
+uint32_t x265_nquant_sse4(int16_t *coef, int32_t *quantCoeff, int16_t *qCoef, int qBits, int add, int numCoeff);
+uint32_t x265_nquant_avx2(int16_t *coef, int32_t *quantCoeff, int16_t *qCoef, int qBits, int add, int numCoeff);
+void x265_dequant_normal_sse4(const int16_t* quantCoef, int16_t* coef, int num, int scale, int shift);
+void x265_dequant_normal_avx2(const int16_t* quantCoef, int16_t* coef, int num, int scale, int shift);
 int x265_count_nonzero_ssse3(const int16_t *quantCoeff, int numCoeff);
 
 void x265_weight_pp_sse4(pixel *src, pixel *dst, intptr_t stride, int width, int height, int w0, int round, int shift, int offset);
diff -r b94b25c88de7 -r 91cb96595a4b source/test/mbdstharness.cpp
--- a/source/test/mbdstharness.cpp	Tue Oct 28 16:05:28 2014 +0530
+++ b/source/test/mbdstharness.cpp	Tue Oct 28 16:48:27 2014 +0530
@@ -65,17 +65,17 @@
         short_test_buff[0][i]    = (rand() & PIXEL_MAX) - (rand() & PIXEL_MAX);
         int_test_buff[0][i]      = rand() % PIXEL_MAX;
         int_idct_test_buff[0][i] = (rand() % (SHORT_MAX - SHORT_MIN)) - SHORT_MAX;
-        int_denoise_test_buff1[0][i] = int_denoise_test_buff2[0][i] = (rand() & UNSIGNED_SHORT_MAX) - (rand() & UNSIGNED_SHORT_MAX);
+        int_denoise_test_buff1[0][i] = int_denoise_test_buff2[0][i] = (rand() & SHORT_MAX) - (rand() & SHORT_MAX);
 
         short_test_buff[1][i]    = -PIXEL_MAX;
         int_test_buff[1][i]      = -PIXEL_MAX;
         int_idct_test_buff[1][i] = SHORT_MIN;
-        int_denoise_test_buff1[1][i] = int_denoise_test_buff2[1][i] = -UNSIGNED_SHORT_MAX;
+        int_denoise_test_buff1[1][i] = int_denoise_test_buff2[1][i] = -SHORT_MAX;
 
         short_test_buff[2][i]    = PIXEL_MAX;
         int_test_buff[2][i]      = PIXEL_MAX;
         int_idct_test_buff[2][i] = SHORT_MAX;
-        int_denoise_test_buff1[2][i] = int_denoise_test_buff2[2][i] = UNSIGNED_SHORT_MAX;
+        int_denoise_test_buff1[2][i] = int_denoise_test_buff2[2][i] = SHORT_MAX;
 
         mbuf1[i] = rand() & PIXEL_MAX;
         mbufdct[i] = (rand() & PIXEL_MAX) - (rand() & PIXEL_MAX);
@@ -102,10 +102,10 @@
     {
         int index = rand() % TEST_CASES;
 
-        ref(short_test_buff[index] + j, mintbuf3, width);
-        checked(opt, short_test_buff[index] + j, mintbuf4, width);
+        ref(short_test_buff[index] + j, mshortbuf2, width);
+        checked(opt, short_test_buff[index] + j, mshortbuf3, width);
 
-        if (memcmp(mintbuf3, mintbuf4, cmp_size))
+        if (memcmp(mshortbuf2, mshortbuf3, cmp_size))
             return false;
 
         reportfail();
@@ -124,8 +124,8 @@
     {
         int index = rand() % TEST_CASES;
 
-        ref(int_idct_test_buff[index] + j, mshortbuf2, width);
-        checked(opt, int_idct_test_buff[index] + j, mshortbuf3, width);
+        ref(short_test_buff[index] + j, mshortbuf2, width);
+        checked(opt, short_test_buff[index] + j, mshortbuf3, width);
 
         if (memcmp(mshortbuf2, mshortbuf3, cmp_size))
             return false;
@@ -156,10 +156,10 @@
         int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
         int shift = QUANT_IQUANT_SHIFT - QUANT_SHIFT - transformShift;
 
-        ref(short_test_buff[index] + j, mintbuf3, width * height, scale, shift);
-        checked(opt, short_test_buff[index] + j, mintbuf4, width * height, scale, shift);
+        ref(short_test_buff[index] + j, mshortbuf2, width * height, scale, shift);
+        checked(opt, short_test_buff[index] + j, mshortbuf3, width * height, scale, shift);
 
-        if (memcmp(mintbuf3, mintbuf4, sizeof(int) * height * width))
+        if (memcmp(mshortbuf2, mshortbuf3, sizeof(int16_t) * height * width))
             return false;
 
         reportfail();
@@ -185,13 +185,13 @@
         int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
         int shift = QUANT_IQUANT_SHIFT - QUANT_SHIFT - transformShift;
 
-        int cmp_size = sizeof(int) * height * width;
+        int cmp_size = sizeof(int16_t) * height * width;
         int index1 = rand() % TEST_CASES;
 
-        ref(short_test_buff[index1] + j, mintbuf3, mintbuf1, width * height, per, shift);
-        checked(opt, short_test_buff[index1] + j, mintbuf4, mintbuf2, width * height, per, shift);
+        ref(short_test_buff[index1] + j, mintbuf3, mshortbuf2, width * height, per, shift);
+        checked(opt, short_test_buff[index1] + j, mintbuf4, mshortbuf3, width * height, per, shift);
 
-        if (memcmp(mintbuf1, mintbuf2, cmp_size))
+        if (memcmp(mshortbuf2, mshortbuf3, cmp_size))
             return false;
 
         reportfail();
@@ -222,8 +222,8 @@
         int index1 = rand() % TEST_CASES;
         int index2 = rand() % TEST_CASES;
 
-        refReturnValue = ref(int_test_buff[index1] + j, int_test_buff[index2] + j, mintbuf1, mshortbuf2, bits, valueToAdd, numCoeff);
-        optReturnValue = (uint32_t)checked(opt, int_test_buff[index1] + j, int_test_buff[index2] + j, mintbuf3, mshortbuf3, bits, valueToAdd, numCoeff);
+        refReturnValue = ref(short_test_buff[index1] + j, int_test_buff[index2] + j, mintbuf1, mshortbuf2, bits, valueToAdd, numCoeff);
+        optReturnValue = (uint32_t)checked(opt, short_test_buff[index1] + j, int_test_buff[index2] + j, mintbuf3, mshortbuf3, bits, valueToAdd, numCoeff);
 
         if (memcmp(mintbuf1, mintbuf3, cmp_size))
             return false;
@@ -261,8 +261,8 @@
         int index1 = rand() % TEST_CASES;
         int index2 = rand() % TEST_CASES;
 
-        refReturnValue = ref(int_test_buff[index1] + j, int_test_buff[index2] + j, mshortbuf2, bits, valueToAdd, numCoeff);
-        optReturnValue = (uint32_t)checked(opt, int_test_buff[index1] + j, int_test_buff[index2] + j, mshortbuf3, bits, valueToAdd, numCoeff);
+        refReturnValue = ref(short_test_buff[index1] + j, int_test_buff[index2] + j, mshortbuf2, bits, valueToAdd, numCoeff);
+        optReturnValue = (uint32_t)checked(opt, short_test_buff[index1] + j, int_test_buff[index2] + j, mshortbuf3, bits, valueToAdd, numCoeff);
 
         if (memcmp(mshortbuf2, mshortbuf3, cmp_size))
             return false;
@@ -454,7 +454,7 @@
         if (opt.dct[value])
         {
             printf("%s\t", dctInfo[value].name);
-            REPORT_SPEEDUP(opt.dct[value], ref.dct[value], mbuf1, mintbuf3, dctInfo[value].width);
+            REPORT_SPEEDUP(opt.dct[value], ref.dct[value], mbuf1, mshortbuf2, dctInfo[value].width);
         }
     }
 
@@ -463,32 +463,32 @@
         if (opt.idct[value])
         {
             printf("%s\t", idctInfo[value].name);
-            REPORT_SPEEDUP(opt.idct[value], ref.idct[value], mbufidct, mshortbuf2, idctInfo[value].width);
+            REPORT_SPEEDUP(opt.idct[value], ref.idct[value], mshortbuf3, mshortbuf2, idctInfo[value].width);
         }
     }
 
     if (opt.dequant_normal)
     {
         printf("dequant_normal\t");
-        REPORT_SPEEDUP(opt.dequant_normal, ref.dequant_normal, short_test_buff[0], mintbuf3, 32 * 32, 70, 1);
+        REPORT_SPEEDUP(opt.dequant_normal, ref.dequant_normal, short_test_buff[0], mshortbuf2, 32 * 32, 70, 1);
     }
 
     if (opt.dequant_scaling)
     {
         printf("dequant_scaling\t");
-        REPORT_SPEEDUP(opt.dequant_scaling, ref.dequant_scaling, short_test_buff[0], mintbuf3, mintbuf4, 32 * 32, 5, 1);
+        REPORT_SPEEDUP(opt.dequant_scaling, ref.dequant_scaling, short_test_buff[0], mintbuf3, mshortbuf2, 32 * 32, 5, 1);
     }
 
     if (opt.quant)
     {
         printf("quant\t\t");
-        REPORT_SPEEDUP(opt.quant, ref.quant, int_test_buff[0], int_test_buff[1], mintbuf3, mshortbuf2, 23, 23785, 32 * 32);
+        REPORT_SPEEDUP(opt.quant, ref.quant, short_test_buff[0], int_test_buff[1], mintbuf3, mshortbuf2, 23, 23785, 32 * 32);
     }
 
     if (opt.nquant)
     {
         printf("nquant\t\t");
-        REPORT_SPEEDUP(opt.nquant, ref.nquant, int_test_buff[0], int_test_buff[1], mshortbuf2, 23, 23785, 32 * 32);
+        REPORT_SPEEDUP(opt.nquant, ref.nquant, short_test_buff[0], int_test_buff[1], mshortbuf2, 23, 23785, 32 * 32);
     }
 
     if (opt.count_nonzero)
diff -r b94b25c88de7 -r 91cb96595a4b source/test/mbdstharness.h
--- a/source/test/mbdstharness.h	Tue Oct 28 16:05:28 2014 +0530
+++ b/source/test/mbdstharness.h	Tue Oct 28 16:48:27 2014 +0530
@@ -60,8 +60,8 @@
     uint32_t mubuf2[MAX_TU_SIZE];
     uint16_t mushortbuf1[MAX_TU_SIZE];
 
-    int int_denoise_test_buff1[TEST_CASES][TEST_BUF_SIZE];
-    int int_denoise_test_buff2[TEST_CASES][TEST_BUF_SIZE];
+    int16_t int_denoise_test_buff1[TEST_CASES][TEST_BUF_SIZE];
+    int16_t int_denoise_test_buff2[TEST_CASES][TEST_BUF_SIZE];
 
     bool check_dequant_primitive(dequant_scaling_t ref, dequant_scaling_t opt);
     bool check_dequant_primitive(dequant_normal_t ref, dequant_normal_t opt);
diff -r b94b25c88de7 -r 91cb96595a4b source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Tue Oct 28 16:05:28 2014 +0530
+++ b/source/test/pixelharness.cpp	Tue Oct 28 16:48:27 2014 +0530
@@ -359,8 +359,8 @@
         int shift = (rand() % 7 + 1);
 
         int index = i % TEST_CASES;
-        checked(opt, opt_dest, int_test_buff[index] + j, stride, shift, (int)STRIDE);
-        ref(ref_dest, int_test_buff[index] + j, stride, shift, (int)STRIDE);
+        checked(opt, opt_dest, short_test_buff1[index] + j, stride, shift, (int)STRIDE);
+        ref(ref_dest, short_test_buff1[index] + j, stride, shift, (int)STRIDE);
 
         if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int16_t)))
             return false;
@@ -374,8 +374,8 @@
 
 bool PixelHarness::check_cvt16to32_shl_t(cvt16to32_shl_t ref, cvt16to32_shl_t opt)
 {
-    ALIGN_VAR_16(int32_t, ref_dest[64 * 64]);
-    ALIGN_VAR_16(int32_t, opt_dest[64 * 64]);
+    ALIGN_VAR_16(int16_t, ref_dest[64 * 64]);
+    ALIGN_VAR_16(int16_t, opt_dest[64 * 64]);
 
     int j = 0;
     intptr_t stride = STRIDE;
@@ -1703,13 +1703,13 @@
     if (opt.cvt32to16_shr)
     {
         HEADER0("cvt32to16_shr");
-        REPORT_SPEEDUP(opt.cvt32to16_shr, ref.cvt32to16_shr, sbuf1, ibuf1, 64, 5, 64);
+        REPORT_SPEEDUP(opt.cvt32to16_shr, ref.cvt32to16_shr, sbuf1, sbuf2, 64, 5, 64);
     }
 
     if (opt.cvt16to32_shl)
     {
         HEADER0("cvt16to32_shl");
-        REPORT_SPEEDUP(opt.cvt16to32_shl, ref.cvt16to32_shl, ibuf1, sbuf1, 64, 5, 64);
+        REPORT_SPEEDUP(opt.cvt16to32_shl, ref.cvt16to32_shl, sbuf2, sbuf1, 64, 5, 64);
     }
 
     if (opt.weight_pp)


More information about the x265-devel mailing list