[x265] [PATCH] tcomrom: scaning order table g_sigLastScan replaced with g_scanOrder

gopu at multicorewareinc.com gopu at multicorewareinc.com
Thu Feb 20 19:35:48 CET 2014


# HG changeset patch
# User Gopu Govindaswamy
# Date 1392921339 28800
#      Thu Feb 20 10:35:39 2014 -0800
# Node ID 34886273d14b41d777a9129fc3657aef34d2c986
# Parent  3389061b75a486e004409ab628c46fed39d03b72
tcomrom: scaning order table g_sigLastScan replaced with g_scanOrder

Scaning order table initialization moved into initRom() and same scaning order table
can be used for both 444 and 420

diff -r 3389061b75a4 -r 34886273d14b source/Lib/TLibCommon/CommonDef.h
--- a/source/Lib/TLibCommon/CommonDef.h	Wed Feb 19 17:03:21 2014 -0600
+++ b/source/Lib/TLibCommon/CommonDef.h	Thu Feb 20 10:35:39 2014 -0800
@@ -108,7 +108,7 @@
 #define NUM_CHROMA_MODE             5 // total number of chroma modes
 #define DM_CHROMA_IDX               36 // chroma mode index for derived from luma intra mode
 
-#define FULL_NBIT 0 ///< When enabled, compute costs using full sample bitdepth.  When disabled, compute costs as if it is 8-bit source video.
+#define FULL_NBIT 1 ///< When enabled, compute costs using full sample bitdepth.  When disabled, compute costs as if it is 8-bit source video.
 #if FULL_NBIT || !HIGH_BIT_DEPTH
 # define DISTORTION_PRECISION_ADJUSTMENT(x) 0
 #else
diff -r 3389061b75a4 -r 34886273d14b source/Lib/TLibCommon/TComRom.cpp
--- a/source/Lib/TLibCommon/TComRom.cpp	Wed Feb 19 17:03:21 2014 -0600
+++ b/source/Lib/TLibCommon/TComRom.cpp	Thu Feb 20 10:35:39 2014 -0800
@@ -458,9 +458,6 @@
 // Scanning order & context model mapping
 // ====================================================================================================================
 
-// scanning order table
-uint32_t* g_sigLastScan[3][MAX_CU_DEPTH];
-
 const uint32_t g_sigLastScan8x8[3][4] =
 {
     { 0, 2, 1, 3 },
@@ -487,131 +484,6 @@
 
 const uint32_t g_goRicePrefixLen[5] = { 8, 7, 6, 5, 4 };
 
-void initSigLastScan(uint32_t* buffD, uint32_t* buffH, uint32_t* buffV, int width, int height)
-{
-    const uint32_t  numScanPos  = uint32_t(width * width);
-    uint32_t        nextScanPos = 0;
-
-    if (width <= 4)
-    {
-        for (uint32_t scanLine = 0; nextScanPos < numScanPos; scanLine++)
-        {
-            int primDim = int(scanLine);
-            int scndDim = 0;
-            while (primDim >= width)
-            {
-                scndDim++;
-                primDim--;
-            }
-
-            while (primDim >= 0 && scndDim < width)
-            {
-                buffD[nextScanPos] = primDim * width + scndDim;
-                nextScanPos++;
-                scndDim++;
-                primDim--;
-            }
-        }
-    }
-    if (width > 4)
-    {
-        uint32_t numBlkSide = width >> 2;
-        uint32_t numBlks    = numBlkSide * numBlkSide;
-        uint32_t log2Blk    = g_convertToBit[numBlkSide] + 1;
-
-        for (uint32_t blk = 0; blk < numBlks; blk++)
-        {
-            nextScanPos   = 0;
-            uint32_t initBlkPos = g_sigLastScan[SCAN_DIAG][log2Blk][blk];
-            if (width == 32)
-            {
-                initBlkPos = g_sigLastScanCG32x32[blk];
-            }
-            uint32_t offsetY    = initBlkPos / numBlkSide;
-            uint32_t offsetX    = initBlkPos - offsetY * numBlkSide;
-            uint32_t offsetD    = 4 * (offsetX + offsetY * width);
-            uint32_t offsetScan = 16 * blk;
-            for (uint32_t scanLine = 0; nextScanPos < 16; scanLine++)
-            {
-                int primDim = int(scanLine);
-                int scndDim = 0;
-                while (primDim >= 4)
-                {
-                    scndDim++;
-                    primDim--;
-                }
-
-                while (primDim >= 0 && scndDim < 4)
-                {
-                    buffD[nextScanPos + offsetScan] = primDim * width + scndDim + offsetD;
-                    nextScanPos++;
-                    scndDim++;
-                    primDim--;
-                }
-            }
-        }
-    }
-
-    uint32_t cnt = 0;
-    if (width > 2)
-    {
-        uint32_t numBlkSide = width >> 2;
-        for (int blkY = 0; blkY < numBlkSide; blkY++)
-        {
-            for (int blkX = 0; blkX < numBlkSide; blkX++)
-            {
-                uint32_t offset = blkY * 4 * width + blkX * 4;
-                for (int y = 0; y < 4; y++)
-                {
-                    for (int x = 0; x < 4; x++)
-                    {
-                        buffH[cnt] = y * width + x + offset;
-                        cnt++;
-                    }
-                }
-            }
-        }
-
-        cnt = 0;
-        for (int blkX = 0; blkX < numBlkSide; blkX++)
-        {
-            for (int blkY = 0; blkY < numBlkSide; blkY++)
-            {
-                uint32_t offset    = blkY * 4 * width + blkX * 4;
-                for (int x = 0; x < 4; x++)
-                {
-                    for (int y = 0; y < 4; y++)
-                    {
-                        buffV[cnt] = y * width + x + offset;
-                        cnt++;
-                    }
-                }
-            }
-        }
-    }
-    else
-    {
-        for (int y = 0; y < height; y++)
-        {
-            for (int iX = 0; iX < width; iX++)
-            {
-                buffH[cnt] = y * width + iX;
-                cnt++;
-            }
-        }
-
-        cnt = 0;
-        for (int x = 0; x < width; x++)
-        {
-            for (int iY = 0; iY < height; iY++)
-            {
-                buffV[cnt] = iY * width + x;
-                cnt++;
-            }
-        }
-    }
-}
-
 int g_quantTSDefault4x4[16] =
 {
     16, 16, 16, 16,
diff -r 3389061b75a4 -r 34886273d14b source/Lib/TLibCommon/TComRom.h
--- a/source/Lib/TLibCommon/TComRom.h	Wed Feb 19 17:03:21 2014 -0600
+++ b/source/Lib/TLibCommon/TComRom.h	Thu Feb 20 10:35:39 2014 -0800
@@ -67,7 +67,6 @@
 
 void initROM();
 void destroyROM();
-void initSigLastScan(uint32_t* buffD, uint32_t* buffH, uint32_t* buffV, int width, int height);
 
 // ====================================================================================================================
 static const int chromaQPMappingTableSize = 58;
@@ -132,8 +131,6 @@
 // Scanning order & context mapping table
 // ====================================================================================================================
 
-extern uint32_t* g_sigLastScan[3][MAX_CU_DEPTH];  // raster index from scanning index (diag, hor, ver)
-
 extern const uint32_t g_groupIdx[32];
 extern const uint32_t g_minInGroup[10];
 


More information about the x265-devel mailing list