[x265-commits] [x265] asm: repair ICL compile on Windows

Steve Borho steve at borho.org
Tue Nov 26 01:37:37 CET 2013


details:   http://hg.videolan.org/x265/rev/864f4664c775
branches:  
changeset: 5284:864f4664c775
user:      Steve Borho <steve at borho.org>
date:      Sun Nov 24 15:34:57 2013 -0600
description:
asm: repair ICL compile on Windows
Subject: [x265] log: improve statistics display

details:   http://hg.videolan.org/x265/rev/c7b97ebc1c9b
branches:  
changeset: 5285:c7b97ebc1c9b
user:      Kavitha Sampath <kavitha at multicorewareinc.com>
date:      Mon Nov 25 12:59:56 2013 +0530
description:
log: improve statistics display

represent 4x4 statistics for I frame, combine I frame log in single line,
preserve space in log
Subject: [x265] encoder: compilers can't agree on how to print long longs

details:   http://hg.videolan.org/x265/rev/319881b4ebf3
branches:  
changeset: 5286:319881b4ebf3
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 25 16:55:03 2013 -0600
description:
encoder: compilers can't agree on how to print long longs
Subject: [x265] dct: remove unused static array

details:   http://hg.videolan.org/x265/rev/81f4e226c5a3
branches:  
changeset: 5287:81f4e226c5a3
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 25 17:17:08 2013 -0600
description:
dct: remove unused static array
Subject: [x265] log: do not output statistics for disabled features

details:   http://hg.videolan.org/x265/rev/484ac0c345a2
branches:  
changeset: 5288:484ac0c345a2
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 25 18:00:38 2013 -0600
description:
log: do not output statistics for disabled features
Subject: [x265] log: shorten Planar to P

details:   http://hg.videolan.org/x265/rev/e607520863c0
branches:  
changeset: 5289:e607520863c0
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 25 18:01:16 2013 -0600
description:
log: shorten Planar to P
Subject: [x265] encoder: do not warn of b-pyramid and small bframe value

details:   http://hg.videolan.org/x265/rev/fdaa754dfbd4
branches:  
changeset: 5290:fdaa754dfbd4
user:      Steve Borho <steve at borho.org>
date:      Mon Nov 25 18:12:07 2013 -0600
description:
encoder: do not warn of b-pyramid and small bframe value

Many default presets can do this, it is harmless

diffstat:

 source/Lib/TLibEncoder/TEncCu.cpp    |   16 +++-
 source/common/dct.cpp                |    1 -
 source/common/x86/asm-primitives.cpp |    1 +
 source/encoder/compress.cpp          |    2 +-
 source/encoder/encoder.cpp           |  146 ++++++++++++++++++++--------------
 5 files changed, 101 insertions(+), 65 deletions(-)

diffs (277 lines):

diff -r 10f605bd0530 -r fdaa754dfbd4 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Mon Nov 25 18:12:07 2013 -0600
@@ -636,14 +636,26 @@ void TEncCu::xCompressIntraCU(TComDataCU
         if (outBestCU->m_totalCost < outTempCU->m_totalCost)
         {
             m_log->cntIntra[depth]++;
-            m_log->cntIntra[depth + 1] = m_log->cntIntra[depth + 1] - 4 + boundaryCu;
+            for (int i = 0; i < 4; i++)
+            {
+                if (outTempCU->getPartitionSize(i) != SIZE_NxN)
+                    m_log->cntIntra[depth + 1]--;
+                else
+                    m_log->cntIntraNxN--;
+            }
+            m_log->cntIntra[depth + 1] += boundaryCu;
         }
         xCheckBestMode(outBestCU, outTempCU, depth); // RD compare current prediction with split prediction.
     }
 
     if (depth == g_maxCUDepth - 1 && bSubBranch)
     {
-        m_log->cntIntra[depth]++;
+        if (outBestCU->getPartitionSize(0) == SIZE_NxN)
+        {
+            m_log->cntIntraNxN++;
+        }
+        else
+            m_log->cntIntra[depth]++;
     }
     outBestCU->copyToPic(depth); // Copy Best data to Picture for next partition prediction.
 
diff -r 10f605bd0530 -r fdaa754dfbd4 source/common/dct.cpp
--- a/source/common/dct.cpp	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/common/dct.cpp	Mon Nov 25 18:12:07 2013 -0600
@@ -720,7 +720,6 @@ void idct32_c(int32_t *src, int16_t *dst
 
 void dequant_normal_c(const int32_t* quantCoef, int32_t* coef, int num, int scale, int shift)
 {
-    static const int invQuantScales[6] = { 40, 45, 51, 57, 64, 72 };
     assert(num <= 32 * 32);
 
     int add, coeffQ;
diff -r 10f605bd0530 -r fdaa754dfbd4 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 25 18:12:07 2013 -0600
@@ -25,6 +25,7 @@
 
 #include "primitives.h"
 #include "x265.h"
+#include "cpu.h"
 
 extern "C" {
 #include "pixel.h"
diff -r 10f605bd0530 -r fdaa754dfbd4 source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/encoder/compress.cpp	Mon Nov 25 18:12:07 2013 -0600
@@ -350,7 +350,6 @@ void TEncCu::xComputeCostMerge2Nx2N(TCom
 
 void TEncCu::xCompressInterCU(TComDataCU*& outBestCU, TComDataCU*& outTempCU, TComDataCU*& cu, uint32_t depth, uint32_t PartitionIndex, UChar minDepth)
 {
-    m_log->cntTotalCu[depth]++;
     m_abortFlag = false;
 
     TComPic* pic = outTempCU->getPic();
@@ -424,6 +423,7 @@ void TEncCu::xCompressInterCU(TComDataCU
     if (!(depth < minDepth)) //topskip
 #endif
     {
+        m_log->cntTotalCu[depth]++;
         if (!bSliceEnd && bInsidePicture)
         {
             // variables for fast encoder decision
diff -r 10f605bd0530 -r fdaa754dfbd4 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/encoder/encoder.cpp	Mon Nov 25 18:12:07 2013 -0600
@@ -356,31 +356,19 @@ char* Encoder::statsString(EncStats& sta
 
 void Encoder::printSummary()
 {
-    if (param.logLevel >= X265_LOG_INFO)
-    {
-        char buffer[200];
-        if (m_analyzeI.m_numPics)
-            x265_log(&param, X265_LOG_INFO, "frame I: %s\n", statsString(m_analyzeI, buffer));
-        if (m_analyzeP.m_numPics)
-            x265_log(&param, X265_LOG_INFO, "frame P: %s\n", statsString(m_analyzeP, buffer));
-        if (m_analyzeB.m_numPics)
-            x265_log(&param, X265_LOG_INFO, "frame B: %s\n", statsString(m_analyzeB, buffer));
-        if (m_analyzeAll.m_numPics)
-            x265_log(&param, X265_LOG_INFO, "global : %s\n", statsString(m_analyzeAll, buffer));
-        if (param.bEnableWeightedPred)
-        {
-            x265_log(&param, X265_LOG_INFO, "%d of %d (%.2f%%) P frames weighted\n",
-                     m_numWPFrames, m_analyzeP.m_numPics, (float)100.0 * m_numWPFrames / m_analyzeP.m_numPics);
-        }
-    }
     for (int sliceType = 2; sliceType >= 0; sliceType--)
     {
+        if (sliceType == P_SLICE && !m_analyzeP.m_numPics)
+            continue;
+        if (sliceType == B_SLICE && !m_analyzeB.m_numPics)
+            continue;
+
         StatisticLog finalLog;
+        uint64_t cntIntraNxN = 0, cntIntra[4];
         for (int depth = 0; depth < (int)g_maxCUDepth; depth++)
         {
-            double cntInter, cntIntra, cntSplit, cntSkipCu;
-            double cuInterDistribution[INTER_MODES], cuIntraDistribution[INTRA_MODES];
-            double cntIntraNxN = 0.0;
+            uint64_t cntInter, cntSplit, cntSkipCu;
+            uint64_t cuInterDistribution[INTER_MODES], cuIntraDistribution[INTRA_MODES];
             for (int j = 0; j < param.frameNumThreads; j++)
             {
                 for (int row = 0; row < m_frameEncoder[0].m_numRows; row++)
@@ -401,9 +389,9 @@ void Encoder::printSummary()
                             }
                             finalLog.cuInterDistribution[depth][m] += enclog.cuInterDistribution[depth][m];
                         }
-                        if (depth == (int)g_maxCUDepth - 1)
-                            finalLog.cntIntraNxN += enclog.cntIntraNxN;
                     }
+                    if (depth == (int)g_maxCUDepth - 1)
+                        finalLog.cntIntraNxN += enclog.cntIntraNxN;
                 }
             }
             // check for 0/0, if true assign 0 else calculate percentage
@@ -412,7 +400,7 @@ void Encoder::printSummary()
                 if (finalLog.cntInter[depth] == 0)
                     cuInterDistribution[n] = 0;
                 else
-                    cuInterDistribution[n] = (double)(finalLog.cuInterDistribution[depth][n] * 100) / (double)finalLog.cntInter[depth];
+                    cuInterDistribution[n] = (finalLog.cuInterDistribution[depth][n] * 100) / finalLog.cntInter[depth];
                 if (n < INTRA_MODES)
                 {
                     if (finalLog.cntIntra[depth] == 0)
@@ -422,57 +410,94 @@ void Encoder::printSummary()
                     }
                     else
                     {
-                        cntIntraNxN = (double)(finalLog.cntIntraNxN * 100) / (double)finalLog.cntIntra[depth];
-                        cuIntraDistribution[n] = (double)(finalLog.cuIntraDistribution[depth][n] * 100) / (double)finalLog.cntIntra[depth];
+                        cntIntraNxN = (finalLog.cntIntraNxN * 100) / finalLog.cntIntra[depth];
+                        cuIntraDistribution[n] = (finalLog.cuIntraDistribution[depth][n] * 100) / finalLog.cntIntra[depth];
                     }
                 }
             }
             if (finalLog.cntTotalCu[depth] == 0)
             {
                 cntInter = 0;
-                cntIntra = 0;
+                cntIntra[depth] = 0;
                 cntSplit = 0;
                 cntSkipCu = 0;
             }
             else
             {
-                cntInter = (double)(finalLog.cntInter[depth] * 100) / (double)finalLog.cntTotalCu[depth];
-                cntIntra = (double)(finalLog.cntIntra[depth] * 100) / (double)finalLog.cntTotalCu[depth];
-                cntSplit = (double)(finalLog.cntSplit[depth] * 100) / (double)finalLog.cntTotalCu[depth];
-                cntSkipCu = (double)(finalLog.cntSkipCu[depth] * 100) / (double)finalLog.cntTotalCu[depth];
+                cntInter = (finalLog.cntInter[depth] * 100) / finalLog.cntTotalCu[depth];
+                cntIntra[depth] = (finalLog.cntIntra[depth] * 100) / finalLog.cntTotalCu[depth];
+                cntSplit = (finalLog.cntSplit[depth] * 100) / finalLog.cntTotalCu[depth];
+                cntSkipCu = (finalLog.cntSkipCu[depth] * 100) / finalLog.cntTotalCu[depth];
+                if (sliceType == I_SLICE)
+                    cntIntraNxN = (finalLog.cntIntraNxN * 100) / finalLog.cntTotalCu[depth];
             }
+#if defined(_MSC_VER)
+#define LL "%I64d"
+#else
+#define LL "%lld"
+#endif
             // print statistics
-            if (sliceType == I_SLICE)
-                x265_log(&param, X265_LOG_INFO, "Intra I%d   %.2f%%\n", g_maxCUWidth >> depth, cntIntra);
+            if (sliceType != I_SLICE)
+            {
+                char stats[256];
+                int len;
+
+                int cuSize = g_maxCUWidth >> depth;
+                len = sprintf(stats, "Split "LL"%% Skip "LL"%% Inter "LL"%%",
+                              cntSplit, cntSkipCu, cntInter);
+
+                if (param.bEnableAMP)
+                    len += sprintf(stats + len, "(%dx%d "LL"%% %dx%d "LL"%% %dx%d "LL"%% AMP "LL"%%)",
+                                   cuSize, cuSize, cuInterDistribution[0],
+                                   cuSize/2, cuSize, cuInterDistribution[2],
+                                   cuSize, cuSize/2, cuInterDistribution[1],
+                                   cuInterDistribution[3]);
+                else if (param.bEnableRectInter)
+                    len += sprintf(stats + len, "(%dx%d "LL"%% %dx%d "LL"%% %dx%d "LL"%%)",
+                                   cuSize, cuSize, cuInterDistribution[0],
+                                   cuSize/2, cuSize, cuInterDistribution[2],
+                                   cuSize, cuSize/2, cuInterDistribution[1]);
+
+                if (cntIntra[depth])
+                {
+                    len += sprintf(stats + len, " Intra "LL"%%(DC "LL"%% P "LL"%% Ang "LL"%%",
+                                   cntIntra[depth], cuIntraDistribution[0],
+                                   cuIntraDistribution[1], cuIntraDistribution[2]);
+                    if (depth == (int)g_maxCUDepth - 1)
+                        len += sprintf(stats + len, " %dx%d "LL"%%", cuSize/2, cuSize/2, cntIntraNxN);
+                    len += sprintf(stats + len, ")");
+                }
+
+                x265_log(&param, X265_LOG_INFO, "%c%-2d: %s\n", sliceType == P_SLICE ? 'P' : 'B', cuSize, stats);
+            }
+        }
+        if (sliceType == I_SLICE)
+        {
+            char stats[50];
+            if (g_maxCUDepth == 4)
+                sprintf(stats, LL"%%  "LL"%%  "LL"%%  "LL"%%  "LL"%%", cntIntra[0], cntIntra[1], cntIntra[2], cntIntra[3], cntIntraNxN);
+            else if (g_maxCUDepth == 3)
+                sprintf(stats, LL"%%  "LL"%%  "LL"%%  "LL"%%", cntIntra[0], cntIntra[1], cntIntra[2], cntIntraNxN);
             else
-            {
-                if (depth < (int)g_maxCUDepth - 1)
-                {
-                    if (sliceType == P_SLICE)
-                        x265_log(&param, X265_LOG_INFO, "Inter P%d   Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%% )  Split %.2f%%  Skipped %.2f%% \n", g_maxCUWidth >> depth,
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntSplit, cntSkipCu);
-                    else
-                        x265_log(&param, X265_LOG_INFO, "Inter B%d   Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%% )  Split %.2f%%  Skipped %.2f%% \n", g_maxCUWidth >> depth,
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntSplit, cntSkipCu);
-                }
-                else
-                {
-                    if (sliceType == P_SLICE)
-                        x265_log(&param, X265_LOG_INFO, "Inter P%d    Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%%  NXN %.2f%%)  Skipped %.2f%% \n", g_maxCUWidth >> depth,
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntIntraNxN, cntSkipCu);
-                    else
-                        x265_log(&param, X265_LOG_INFO, "Inter B%d    Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%%  NXN %.2f%%)  Skipped %.2f%% \n", g_maxCUWidth >> depth,
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntIntraNxN, cntSkipCu);
-                }
-            }
+                sprintf(stats, LL"%%  "LL"%%  "LL"%%", cntIntra[0], cntIntra[1], cntIntraNxN);
+            x265_log(&param, X265_LOG_INFO, "I-frame %d..4:  %s\n", g_maxCUWidth, stats);
+        }
+    }
+    if (param.logLevel >= X265_LOG_INFO)
+    {
+        char buffer[200];
+        if (m_analyzeI.m_numPics)
+            x265_log(&param, X265_LOG_INFO, "frame I: %s\n", statsString(m_analyzeI, buffer));
+        if (m_analyzeP.m_numPics)
+            x265_log(&param, X265_LOG_INFO, "frame P: %s\n", statsString(m_analyzeP, buffer));
+        if (m_analyzeB.m_numPics)
+            x265_log(&param, X265_LOG_INFO, "frame B: %s\n", statsString(m_analyzeB, buffer));
+        if (m_analyzeAll.m_numPics)
+            x265_log(&param, X265_LOG_INFO, "global : %s\n", statsString(m_analyzeAll, buffer));
+        if (param.bEnableWeightedPred)
+        {
+            x265_log(&param, X265_LOG_INFO, "%d of %d (%.2f%%) P frames weighted\n",
+                     m_numWPFrames, m_analyzeP.m_numPics, (float)100.0 * m_numWPFrames / m_analyzeP.m_numPics);
         }
     }
 }
@@ -1188,7 +1213,6 @@ void Encoder::configure(x265_param *_par
     }
     if (_param->bpyramid && !_param->bframes)
     {
-        x265_log(_param, X265_LOG_WARNING,"b-pyramid enabled if bframes > 1\n");
         _param->bpyramid = 0;
     }
     /* Set flags according to RDLevel specified - check_params has verified that RDLevel is within range */


More information about the x265-commits mailing list