changeset 613:8a517c789bbb

Changing 16-bit hard coded memory copy in TComTrQuant::xT
author Deepthi
date Fri, 19 Apr 2013 15:43:57 +0530
parents 3e327e235ef6
children d613c2fde0f8 cc32f7a1aacf 55d414249baa aa8a54f38812 afcb19e80d04
files source/Lib/TLibCommon/TComTrQuant.cpp
diffstat 1 files changed, 15 insertions(+-), 3 deletions(-) [+]
line wrap: on
line diff
--- a/source/Lib/TLibCommon/TComTrQuant.cpp	Fri Apr 19 15:38:58 2013 +0530
+++ b/source/Lib/TLibCommon/TComTrQuant.cpp	Fri Apr 19 15:43:57 2013 +0530
@@ -1497,12 +1497,24 @@ Void TComTrQuant::xT(Int bitDepth, UInt 
 #else
     Int j;
     {
-        Short block[64 * 64];
-        Short coeff[64 * 64];
+#ifdef _WIN32
+#ifdef __MINGW32__
+        Short block[64 * 64] __attribute__((aligned(32)));
+        Short coeff[64 * 64] __attribute__((aligned(32)));
+#else
+        __declspec(align(32)) Short block[64 * 64];
+        __declspec(align(32)) Short coeff[64 * 64];
+#endif
+#else
+        Short block[64 * 64] __attribute__((aligned(32)));
+        Short coeff[64 * 64] __attribute__((aligned(32)));
+#endif
         {
             for (j = 0; j < iHeight; j++)
             {
-                memcpy(block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof(Short));
+                for(int i = 0; i < iWidth; i++)
+                    block [j*iWidth + i] = (Short) piBlkResi [j*uiStride + i];                
+
             }
         }
         xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode);