[x265] [PATCH] Uncrustyfied dct.cpp file

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Jun 26 12:36:23 CEST 2013


# HG changeset patch
# User praveentiwari
# Date 1372242969 -19800
# Node ID cfebb777402484c322e9783c182d005fca6db3b6
# Parent  9f6a0fb1947ac494a0b3a12d28f4808f2f7ebb94
Uncrustyfied dct.cpp file

diff -r 9f6a0fb1947a -r cfebb7774024 source/common/dct.cpp
--- a/source/common/dct.cpp	Tue Jun 25 17:30:29 2013 +0530
+++ b/source/common/dct.cpp	Wed Jun 26 16:06:09 2013 +0530
@@ -428,25 +428,27 @@
 {
     const int shift_1st = 1;
     const int shift_2nd = 8;
-    ALIGN_VAR_32(Short, tmp [4 * 4]);
+
+    ALIGN_VAR_32(Short, tmp[4 * 4]);
     ALIGN_VAR_32(Short, tmp1[4 * 4]);
 
-    for(int i=0; i<4; i++)
+    for (int i = 0; i < 4; i++)
     {
-        memcpy(&tmp1[i*4], &pSrc[i*nStride], 4*sizeof(short));
+        memcpy(&tmp1[i * 4], &pSrc[i * nStride], 4 * sizeof(short));
     }
 
     fastForwardDst(tmp1, tmp, shift_1st);
     fastForwardDst(tmp, tmp1, shift_2nd);
 
 #define N (4)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            pDst[i*N+j] = tmp1[i*N+j];
+            pDst[i * N + j] = tmp1[i * N + j];
         }
     }
+
 #undef N
 }
 
@@ -454,24 +456,26 @@
 {
     const int shift_1st = 1;
     const int shift_2nd = 8;
+
     ALIGN_VAR_32(Short, tmp[4 * 4]);
     ALIGN_VAR_32(Short, tmp1[4 * 4]);
 
-    for(int i=0; i<4; i++)
+    for (int i = 0; i < 4; i++)
     {
-        memcpy(&tmp1[i*4], &pSrc[i*nStride], 4*sizeof(short));
+        memcpy(&tmp1[i * 4], &pSrc[i * nStride], 4 * sizeof(short));
     }
 
     partialButterfly4(tmp1, tmp, shift_1st, 4);
     partialButterfly4(tmp, tmp1, shift_2nd, 4);
 #define N (4)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            pDst[i*N+j] = tmp1[i*N+j];
+            pDst[i * N + j] = tmp1[i * N + j];
         }
     }
+
 #undef N
 }
 
@@ -479,25 +483,27 @@
 {
     const int shift_1st = 2;
     const int shift_2nd = 9;
-    ALIGN_VAR_32(Short, tmp [8 * 8]);
+
+    ALIGN_VAR_32(Short, tmp[8 * 8]);
     ALIGN_VAR_32(Short, tmp1[8 * 8]);
 
-    for(int i=0; i<8; i++)
+    for (int i = 0; i < 8; i++)
     {
-        memcpy(&tmp1[i*8], &pSrc[i*nStride], 8*sizeof(short));
+        memcpy(&tmp1[i * 8], &pSrc[i * nStride], 8 * sizeof(short));
     }
 
     partialButterfly8(tmp1, tmp, shift_1st, 8);
     partialButterfly8(tmp, tmp1, shift_2nd, 8);
 
 #define N (8)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            pDst[i*N+j] = tmp1[i*N+j];
+            pDst[i * N + j] = tmp1[i * N + j];
         }
     }
+
 #undef N
 }
 
@@ -505,25 +511,27 @@
 {
     const int shift_1st = 3;
     const int shift_2nd = 10;
-    ALIGN_VAR_32(Short, tmp [16 * 16]);
+
+    ALIGN_VAR_32(Short, tmp[16 * 16]);
     ALIGN_VAR_32(Short, tmp1[16 * 16]);
 
-    for(int i=0; i<16; i++)
+    for (int i = 0; i < 16; i++)
     {
-        memcpy(&tmp1[i*16], &pSrc[i*nStride], 16*sizeof(short));
+        memcpy(&tmp1[i * 16], &pSrc[i * nStride], 16 * sizeof(short));
     }
 
     partialButterfly16(tmp1, tmp, shift_1st, 16);
     partialButterfly16(tmp, tmp1, shift_2nd, 16);
 
 #define N (16)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            pDst[i*N+j] = tmp1[i*N+j];
+            pDst[i * N + j] = tmp1[i * N + j];
         }
     }
+
 #undef N
 }
 
@@ -531,25 +539,27 @@
 {
     const int shift_1st = 4;
     const int shift_2nd = 11;
-    ALIGN_VAR_32(Short, tmp [32 * 32]);
+
+    ALIGN_VAR_32(Short, tmp[32 * 32]);
     ALIGN_VAR_32(Short, tmp1[32 * 32]);
 
-    for(int i=0; i<32; i++)
+    for (int i = 0; i < 32; i++)
     {
-        memcpy(&tmp1[i*32], &pSrc[i*nStride], 32*sizeof(short));
+        memcpy(&tmp1[i * 32], &pSrc[i * nStride], 32 * sizeof(short));
     }
 
     partialButterfly32(tmp1, tmp, shift_1st, 32);
     partialButterfly32(tmp, tmp1, shift_2nd, 32);
 
 #define N (32)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            pDst[i*N+j] = tmp1[i*N+j];
+            pDst[i * N + j] = tmp1[i * N + j];
         }
     }
+
 #undef N
 }
 
@@ -557,23 +567,25 @@
 {
     const int shift_1st = 7;
     const int shift_2nd = 12;
+
     ALIGN_VAR_32(Short, tmp[4 * 4]);
     ALIGN_VAR_32(Short, tmp2[4 * 4]);
 
 #define N (4)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            tmp2[i*N+j] = (short)pSrc[i*N+j];
+            tmp2[i * N + j] = (short)pSrc[i * N + j];
         }
     }
+
 #undef N
 
     inversedst(tmp2, tmp, shift_1st); // Forward DST BY FAST ALGORITHM, block input, tmp output
     inversedst(tmp, tmp2, shift_2nd); // Forward DST BY FAST ALGORITHM, tmp input, coeff output
 
-    for(int i=0; i<4; i++)
+    for (int i = 0; i < 4; i++)
     {
         memcpy(&pDst[i * stride], &tmp2[i * 4], 4 * sizeof(short));
     }
@@ -583,23 +595,25 @@
 {
     const int shift_1st = 7;
     const int shift_2nd = 12;
+
     ALIGN_VAR_32(Short, tmp[4 * 4]);
     ALIGN_VAR_32(Short, tmp2[4 * 4]);
 
 #define N (4)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            tmp2[i*N+j] = (short)pSrc[i*N+j];
+            tmp2[i * N + j] = (short)pSrc[i * N + j];
         }
     }
+
 #undef N
 
     partialButterflyInverse4(tmp2, tmp, shift_1st, 4); // Forward DST BY FAST ALGORITHM, block input, tmp output
     partialButterflyInverse4(tmp, tmp2, shift_2nd, 4); // Forward DST BY FAST ALGORITHM, tmp input, coeff output
 
-    for(int i=0; i<4; i++)
+    for (int i = 0; i < 4; i++)
     {
         memcpy(&pDst[i * stride], &tmp2[i * 4], 4 * sizeof(short));
     }
@@ -609,22 +623,24 @@
 {
     const int shift_1st = 7;
     const int shift_2nd = 12;
+
     ALIGN_VAR_32(Short, tmp[8 * 8]);
     ALIGN_VAR_32(Short, tmp2[8 * 8]);
 
 #define N (8)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            tmp2[i*N+j] = (short)pSrc[i*N+j];
+            tmp2[i * N + j] = (short)pSrc[i * N + j];
         }
     }
+
 #undef N
 
     partialButterflyInverse8(tmp2, tmp, shift_1st, 8);
     partialButterflyInverse8(tmp, tmp2, shift_2nd, 8);
-    for(int i=0; i<8; i++)
+    for (int i = 0; i < 8; i++)
     {
         memcpy(&pDst[i * stride], &tmp2[i * 8], 8 * sizeof(short));
     }
@@ -634,22 +650,24 @@
 {
     const int shift_1st = 7;
     const int shift_2nd = 12;
+
     ALIGN_VAR_32(Short, tmp[16 * 16]);
     ALIGN_VAR_32(Short, tmp2[16 * 16]);
 
 #define N (16)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            tmp2[i*N+j] = (short)pSrc[i*N+j];
+            tmp2[i * N + j] = (short)pSrc[i * N + j];
         }
     }
+
 #undef N
 
     partialButterflyInverse16(tmp2, tmp, shift_1st, 16);
     partialButterflyInverse16(tmp, tmp2, shift_2nd, 16);
-    for(int i=0; i<16; i++)
+    for (int i = 0; i < 16; i++)
     {
         memcpy(&pDst[i * stride], &tmp2[i * 16], 16 * sizeof(short));
     }
@@ -659,29 +677,30 @@
 {
     const int shift_1st = 7;
     const int shift_2nd = 12;
+
     ALIGN_VAR_32(Short, tmp[32 * 32]);
     ALIGN_VAR_32(Short, tmp2[32 * 32]);
 
 #define N (32)
-    for(int i=0; i<N; i++)
+    for (int i = 0; i < N; i++)
     {
-        for(int j=0; j<N; j++)
+        for (int j = 0; j < N; j++)
         {
-            tmp2[i*N+j] = (short)pSrc[i*N+j];
+            tmp2[i * N + j] = (short)pSrc[i * N + j];
         }
     }
+
 #undef N
 
     partialButterflyInverse32(tmp2, tmp, shift_1st, 32);
     partialButterflyInverse32(tmp, tmp2, shift_2nd, 32);
 
-    for(int i=0; i<32; i++)
+    for (int i = 0; i < 32; i++)
     {
         memcpy(&pDst[i * stride], &tmp2[i * 32], 32 * sizeof(short));
     }
 }
 
-
 void xDeQuant(int bitDepth, const int* pSrc, int* pDes, int iWidth, int iHeight, int iPer, int iRem, bool useScalingList, unsigned int uiLog2TrSize, int *piDequantCoefOrig)
 {
     const int* piQCoef = pSrc;


More information about the x265-devel mailing list