changeset 566:755bda7f920c

Merged multicoreware/xhevc into default
author Deepthi Devaki Akkoorath <deepthidevaki@multicorewareinc.com>
date Fri, 12 Apr 2013 11:33:00 +0530
parents 0826f419aa6d (current diff) 9193471ef54e (diff)
children 7f8daed75336
files source/encoder/macroblock.cpp
diffstat 5 files changed, 14 insertions(+-), 8 deletions(-) [+]
line wrap: on
line diff
--- a/source/Lib/TLibCommon/TComTrQuant.cpp	Fri Apr 12 10:34:45 2013 +0530
+++ b/source/Lib/TLibCommon/TComTrQuant.cpp	Fri Apr 12 11:33:00 2013 +0530
@@ -41,6 +41,7 @@
 #include "TComTrQuant.h"
 #include "TComPic.h"
 #include "ContextTables.h"
+#include "primitives.h"
 
 typedef struct
 {
@@ -889,8 +890,13 @@ void xITrMxN(Int bitDepth, Short *coeff,
     {
         if (uiMode != REG_DCT)
         {
+#ifdef ENABLE_PRIMITIVES
+			x265::primitives.inversedst(coeff, tmp, shift_1st);
+			x265::primitives.inversedst(tmp, block, shift_2nd);
+#else
             fastInverseDst(coeff, tmp, shift_1st); // Inverse DST by FAST Algorithm, coeff input, tmp output
             fastInverseDst(tmp, block, shift_2nd); // Inverse DST by FAST Algorithm, tmp input, coeff output
+#endif
         }
         else
         {
@@ -1521,7 +1527,7 @@ Void TComTrQuant::xIT(Int bitDepth, UInt
         }
 
         xITrMxN(bitDepth, coeff, block, iWidth, iHeight, uiMode);
-        {
+		{
             for (j = 0; j < iHeight; j++)
             {
                 memcpy(pResidual + j * uiStride, block + j * iWidth, iWidth * sizeof(Short));
--- a/source/encoder/macroblock.cpp	Fri Apr 12 10:34:45 2013 +0530
+++ b/source/encoder/macroblock.cpp	Fri Apr 12 11:33:00 2013 +0530
@@ -33,7 +33,7 @@
 namespace {
 // anonymous file-static namespace
 
-void CDECL inversedst(pixel *tmp, pixel *block, int shift)  // input tmp, output block
+void CDECL inversedst(short *tmp, short *block, int shift)  // input tmp, output block
 {
     int i, c[4];
     int rnd_factor = 1 << (shift - 1);
--- a/source/encoder/primitives.h	Fri Apr 12 10:34:45 2013 +0530
+++ b/source/encoder/primitives.h	Fri Apr 12 11:33:00 2013 +0530
@@ -113,7 +113,7 @@ enum FilterConf
 int PartitionFromSizes(int Width, int Height);
 
 typedef int (CDECL * pixelcmp)(pixel *fenc, intptr_t fencstride, pixel *fref, intptr_t frefstride);
-typedef void (CDECL * mbdst)(pixel *block, pixel *coeff, int shift);
+typedef void (CDECL * mbdst)(short *block, short *coeff, int shift);
 typedef void (CDECL * IPFilter)(const short *coeff, pixel *src, int srcStride, pixel *dst, int dstStride, int block_width,
                                 int block_height, int bitDepth);
 
--- a/source/encoder/vec/macroblock.inc	Fri Apr 12 10:34:45 2013 +0530
+++ b/source/encoder/vec/macroblock.inc	Fri Apr 12 11:33:00 2013 +0530
@@ -23,7 +23,7 @@
 
 // Vector class versions of macroblock performance primitives
 
-void CDECL inversedst(pixel *tmp, pixel *block, int shift)  // input tmp, output block
+void CDECL inversedst(short *tmp, short *block, int shift)  // input tmp, output block
 {
     int rnd_factor = 1 << (shift - 1);
 
--- a/source/test/testbench.cpp	Fri Apr 12 10:34:45 2013 +0530
+++ b/source/test/testbench.cpp	Fri Apr 12 11:33:00 2013 +0530
@@ -86,7 +86,7 @@ using namespace x265;
 
 /* pbuf1, pbuf2: initialized to random pixel data and shouldn't write into them. */
 pixel *pbuf1, *pbuf2;
-pixel *mbuf1, *mbuf2, *mbuf3;
+short *mbuf1, *mbuf2, *mbuf3;
 #define BENCH_ALIGNS 16
 
 // Initialize the Func Names for all the Pixel Comp
@@ -304,9 +304,9 @@ int init_mbdst_buffers()
 {
     int t_size = 32;
 
-    mbuf1 = (pixel*)malloc(0x1e00 * sizeof(pixel) + 16 * BENCH_ALIGNS);
-    mbuf2 = (pixel*)malloc(t_size);
-    mbuf3 = (pixel*)malloc(t_size);
+    mbuf1 = (short*)malloc(0x1e00 * sizeof(pixel) + 16 * BENCH_ALIGNS);
+    mbuf2 = (short*)malloc(t_size);
+    mbuf3 = (short*)malloc(t_size);
     if (!mbuf1 || !mbuf2 || !mbuf3)
     {
         fprintf(stderr, "malloc failed, unable to initiate tests!\n");