[x265-commits] [x265] build: change eoln of msys bash script to unix

Steve Borho steve at borho.org
Sat Feb 15 00:03:13 CET 2014


details:   http://hg.videolan.org/x265/rev/ad21da9b607c
branches:  
changeset: 6133:ad21da9b607c
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 14 14:01:58 2014 -0600
description:
build: change eoln of msys bash script to unix
Subject: [x265] ratecontrol: clean up struct; remove baseQp

details:   http://hg.videolan.org/x265/rev/8d4fd1d98337
branches:  
changeset: 6134:8d4fd1d98337
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Fri Feb 14 14:55:46 2014 +0530
description:
ratecontrol: clean up struct; remove baseQp
Subject: [x265] ratecontrol: cleanup

details:   http://hg.videolan.org/x265/rev/4906f1fe7d06
branches:  
changeset: 6135:4906f1fe7d06
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Fri Feb 14 15:04:23 2014 +0530
description:
ratecontrol: cleanup
Subject: [x265] ratecontrol: cleanup, remove sliceQPBase.

details:   http://hg.videolan.org/x265/rev/303634977dc4
branches:  
changeset: 6136:303634977dc4
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Fri Feb 14 15:32:00 2014 +0530
description:
ratecontrol: cleanup, remove sliceQPBase.

Always a duplicate of sliceQp.
Subject: [x265] ratecontrol: cleanup, repetitive code

details:   http://hg.videolan.org/x265/rev/5d76e8a19fed
branches:  
changeset: 6137:5d76e8a19fed
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Fri Feb 14 16:53:34 2014 +0530
description:
ratecontrol: cleanup, repetitive code
Subject: [x265] encoder: now only one QP per row in CSV output

details:   http://hg.videolan.org/x265/rev/a661d9eef931
branches:  
changeset: 6138:a661d9eef931
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 14 14:24:04 2014 -0600
description:
encoder: now only one QP per row in CSV output
Subject: [x265] encoder: use x265_log for per-frame debug log, use dB for SSIM

details:   http://hg.videolan.org/x265/rev/da7f6bebdd30
branches:  
changeset: 6139:da7f6bebdd30
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 14 14:52:28 2014 -0600
description:
encoder: use x265_log for per-frame debug log, use dB for SSIM
Subject: [x265] input: always set depth and colorspace fields

details:   http://hg.videolan.org/x265/rev/d329e698d420
branches:  
changeset: 6140:d329e698d420
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 14 16:37:10 2014 -0600
description:
input: always set depth and colorspace fields
Subject: [x265] version: today, our max supported input bit depth is 10

details:   http://hg.videolan.org/x265/rev/6b197e8561ec
branches:  
changeset: 6141:6b197e8561ec
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 14 16:37:31 2014 -0600
description:
version: today, our max supported input bit depth is 10
Subject: [x265] TComPicYuv: use pixel type instead of Pel type

details:   http://hg.videolan.org/x265/rev/d77a549b8061
branches:  
changeset: 6142:d77a549b8061
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 14 15:51:09 2014 -0600
description:
TComPicYuv: use pixel type instead of Pel type

diffstat:

 build/msys/make-Makefiles.sh         |   6 +++---
 source/Lib/TLibCommon/TComPicYuv.cpp |   6 +++---
 source/Lib/TLibCommon/TComSlice.cpp  |   1 -
 source/Lib/TLibCommon/TComSlice.h    |   7 +------
 source/common/version.cpp            |   2 +-
 source/encoder/encoder.cpp           |  21 ++++++++++++---------
 source/encoder/frameencoder.cpp      |   1 -
 source/encoder/ratecontrol.cpp       |  27 ++++++++++-----------------
 source/encoder/ratecontrol.h         |   2 +-
 source/input/y4m.cpp                 |   2 ++
 source/input/yuv.cpp                 |   1 +
 11 files changed, 34 insertions(+), 42 deletions(-)

diffs (254 lines):

diff -r a3a9e0fb1a87 -r d77a549b8061 build/msys/make-Makefiles.sh
--- a/build/msys/make-Makefiles.sh	Fri Feb 14 14:26:57 2014 +0900
+++ b/build/msys/make-Makefiles.sh	Fri Feb 14 15:51:09 2014 -0600
@@ -1,3 +1,3 @@
-#!/bin/sh
-# Run this from within an MSYS bash shell
-cmake -G "MSYS Makefiles" ../../source && cmake-gui ../../source
+#!/bin/sh
+# Run this from within an MSYS bash shell
+cmake -G "MSYS Makefiles" ../../source && cmake-gui ../../source
diff -r a3a9e0fb1a87 -r d77a549b8061 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -88,9 +88,9 @@ bool TComPicYuv::create(int picWidth, in
     m_strideC = ((m_numCuInWidth * g_maxCUWidth) >> m_hChromaShift) + (m_chromaMarginX * 2);
     int maxHeight = m_numCuInHeight * g_maxCUHeight;
 
-    CHECKED_MALLOC(m_picBufY, Pel, m_stride * (maxHeight + (m_lumaMarginY * 2)));
-    CHECKED_MALLOC(m_picBufU, Pel, m_strideC * ((maxHeight >> m_vChromaShift) + (m_chromaMarginY * 2)));
-    CHECKED_MALLOC(m_picBufV, Pel, m_strideC * ((maxHeight >> m_vChromaShift) + (m_chromaMarginY * 2)));
+    CHECKED_MALLOC(m_picBufY, pixel, m_stride * (maxHeight + (m_lumaMarginY * 2)));
+    CHECKED_MALLOC(m_picBufU, pixel, m_strideC * ((maxHeight >> m_vChromaShift) + (m_chromaMarginY * 2)));
+    CHECKED_MALLOC(m_picBufV, pixel, m_strideC * ((maxHeight >> m_vChromaShift) + (m_chromaMarginY * 2)));
 
     m_picOrgY = m_picBufY + m_lumaMarginY   * getStride()  + m_lumaMarginX;
     m_picOrgU = m_picBufU + m_chromaMarginY * getCStride() + m_chromaMarginX;
diff -r a3a9e0fb1a87 -r d77a549b8061 source/Lib/TLibCommon/TComSlice.cpp
--- a/source/Lib/TLibCommon/TComSlice.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/Lib/TLibCommon/TComSlice.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -54,7 +54,6 @@ TComSlice::TComSlice()
     , m_sliceType(I_SLICE)
     , m_sliceQp(0)
     , m_dependentSliceSegmentFlag(false)
-    , m_sliceQpBase(0)
     , m_deblockingFilterDisable(false)
     , m_deblockingFilterOverrideFlag(false)
     , m_deblockingFilterBetaOffsetDiv2(0)
diff -r a3a9e0fb1a87 -r d77a549b8061 source/Lib/TLibCommon/TComSlice.h
--- a/source/Lib/TLibCommon/TComSlice.h	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/Lib/TLibCommon/TComSlice.h	Fri Feb 14 15:51:09 2014 -0600
@@ -1303,7 +1303,6 @@ private:
     SliceType   m_sliceType;
     int         m_sliceQp;
     bool        m_dependentSliceSegmentFlag;
-    int         m_sliceQpBase;
     bool        m_deblockingFilterDisable;
     bool        m_deblockingFilterOverrideFlag;    //< offsets for deblocking filter inherit from PPS
     int         m_deblockingFilterBetaOffsetDiv2;  //< beta offset for deblocking filter
@@ -1414,9 +1413,7 @@ public:
     bool      getDependentSliceSegmentFlag() const   { return m_dependentSliceSegmentFlag; }
 
     void      setDependentSliceSegmentFlag(bool val) { m_dependentSliceSegmentFlag = val; }
-
-    int       getSliceQpBase()                    { return m_sliceQpBase; }
-
+    
     int       getSliceQpDelta()                   { return m_sliceQpDelta; }
 
     int       getSliceQpDeltaCb()                 { return m_sliceQpDeltaCb; }
@@ -1476,8 +1473,6 @@ public:
 
     void      setSliceQp(int i)                       { m_sliceQp = i; }
 
-    void      setSliceQpBase(int i)                   { m_sliceQpBase = i; }
-
     void      setSliceQpDelta(int i)                  { m_sliceQpDelta = i; }
 
     void      setSliceQpDeltaCb(int i)                { m_sliceQpDeltaCb = i; }
diff -r a3a9e0fb1a87 -r d77a549b8061 source/common/version.cpp
--- a/source/common/version.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/common/version.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -75,7 +75,7 @@
 
 #if HIGH_BIT_DEPTH
 #define BITDEPTH "16bpp"
-const int x265_max_bit_depth = 12;
+const int x265_max_bit_depth = 10;
 #else
 #define BITDEPTH "8bpp"
 const int x265_max_bit_depth = 8;
diff -r a3a9e0fb1a87 -r d77a549b8061 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/encoder/encoder.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -126,7 +126,7 @@ void Encoder::create()
             if (m_csvfpt)
             {
                 if (param.logLevel >= X265_LOG_DEBUG)
-                    fprintf(m_csvfpt, "Encode Order, Type, POC, nQP, QP, Bits, Y PSNR, U PSNR, V PSNR, YUV PSNR, SSIM, SSIM (dB), Encoding time, Elapsed time, List 0, List 1\n");
+                    fprintf(m_csvfpt, "Encode Order, Type, POC, QP, Bits, Y PSNR, U PSNR, V PSNR, YUV PSNR, SSIM, SSIM (dB), Encoding time, Elapsed time, List 0, List 1\n");
                 else
                     fprintf(m_csvfpt, "Command, Date/Time, Elapsed Time, FPS, Bitrate, Y PSNR, U PSNR, V PSNR, Global PSNR, SSIM, SSIM (dB), Version\n");
             }
@@ -831,36 +831,39 @@ uint64_t Encoder::calculateHashAndPSNR(T
     {
         char c = (slice->isIntra() ? 'I' : slice->isInterP() ? 'P' : 'B');
         int poc = slice->getPOC();
-        int QP_Base = slice->getSliceQpBase();
         int QP = slice->getSliceQp();
         if (!slice->isReferenced())
             c += 32; // lower case if unreferenced
-        fprintf(stderr, "\rPOC %4d ( %c-SLICE, nQP %d QP %d) %10d bits", poc, c, QP_Base, QP, bits);
+
+        char buf[1024];
+        int p;
+        p = sprintf(buf, "POC:%d %c QP %2d %10d bits", poc, c, QP, bits);
         if (param.bEnablePsnr)
-            fprintf(stderr, " [Y:%6.2lf U:%6.2lf V:%6.2lf]", psnrY, psnrU, psnrV);
+            p += sprintf(buf + p, " [Y:%6.2lf U:%6.2lf V:%6.2lf]", psnrY, psnrU, psnrV);
         if (param.bEnableSsim)
-            fprintf(stderr, "[SSIM: %.3lf]", ssim);
+            p += sprintf(buf + p, " [SSIM: %.3lfdB]", x265_ssim(ssim));
 
         if (!slice->isIntra())
         {
             int numLists = slice->isInterP() ? 1 : 2;
             for (int list = 0; list < numLists; list++)
             {
-                fprintf(stderr, " [L%d ", list);
+                p += sprintf(buf + p, " [L%d ", list);
                 for (int ref = 0; ref < slice->getNumRefIdx(list); ref++)
                 {
                     int k = slice->getRefPOC(list, ref) - slice->getLastIDR();
-                    fprintf(stderr, "%d ", k);
+                    p += sprintf(buf + p, "%d ", k);
                 }
 
-                fprintf(stderr, "]");
+                p += sprintf(buf + p, "]");
             }
         }
+        x265_log(&param, X265_LOG_DEBUG, buf);
 
         // per frame CSV logging if the file handle is valid
         if (m_csvfpt)
         {
-            fprintf(m_csvfpt, "%d, %c-SLICE, %4d, %d, %d, %10d,", m_outputCount++, c, poc, QP_Base, QP, bits);
+            fprintf(m_csvfpt, "%d, %c-SLICE, %4d, %d, %10d,", m_outputCount++, c, poc, QP, bits);
             double psnr = (psnrY * 6 + psnrU + psnrV) / 8;
             if (param.bEnablePsnr)
                 fprintf(m_csvfpt, "%.3lf, %.3lf, %.3lf, %.3lf,", psnrY, psnrU, psnrV, psnr);
diff -r a3a9e0fb1a87 -r d77a549b8061 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/encoder/frameencoder.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -414,7 +414,6 @@ void FrameEncoder::compressFrame()
     {
         qp = MAX_QP;
         slice->setSliceQp(qp);
-        slice->setSliceQpBase(qp);
     }
     slice->setSliceQpDelta(0);
     slice->setSliceQpDeltaCb(0);
diff -r a3a9e0fb1a87 -r d77a549b8061 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/encoder/ratecontrol.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -230,9 +230,7 @@ RateControl::RateControl(TEncCfg * _cfg)
 
     bitrate = cfg->param.rc.bitrate * 1000;
     frameDuration = 1.0 / cfg->param.frameRate;
-    lastNonBPictType = -1;
-    baseQp = cfg->param.rc.qp;
-    qp = baseQp;
+    qp = cfg->param.rc.qp;
     lastRceq = 1; /* handles the cmplxrsum when the previous frame cost is zero */
     totalBits = 0;
     shortTermCplxSum = 0;
@@ -320,26 +318,22 @@ RateControl::RateControl(TEncCfg * _cfg)
     bframes = cfg->param.bframes;
     bframeBits = 0;
     leadingNoBSatd = 0;
+    accumPNorm = .01;
+    /* estimated ratio that produces a reasonable QP for the first I-frame */
+    cplxrSum = .01 * pow(7.0e5, qCompress) * pow(ncu, 0.5);
+    wantedBitsWindow = bitrate * frameDuration;
 
     if (cfg->param.rc.rateControlMode == X265_RC_ABR)
     {
         /* Adjust the first frame in order to stabilize the quality level compared to the rest */
 #define ABR_INIT_QP_MIN (24 + QP_BD_OFFSET)
 #define ABR_INIT_QP_MAX (34 + QP_BD_OFFSET)
-        accumPNorm = .01;
-        accumPQp = (ABR_INIT_QP_MIN)*accumPNorm;
-        /* estimated ratio that produces a reasonable QP for the first I-frame */
-        cplxrSum = .01 * pow(7.0e5, qCompress) * pow(ncu, 0.5);
-        wantedBitsWindow = bitrate * frameDuration;
+        accumPQp = (ABR_INIT_QP_MIN)*accumPNorm;    
     }
     else if (cfg->param.rc.rateControlMode == X265_RC_CRF)
     {
 #define ABR_INIT_QP ((int)cfg->param.rc.rfConstant + QP_BD_OFFSET)
-        accumPNorm = .01;
-        accumPQp = ABR_INIT_QP * accumPNorm;
-        /* estimated ratio that produces a reasonable QP for the first I-frame */
-        cplxrSum = .01 * pow(7.0e5, qCompress) * pow(ncu, 0.5);
-        wantedBitsWindow = bitrate * frameDuration;
+        accumPQp = ABR_INIT_QP * accumPNorm;        
     }
 
     ipOffset = 6.0 * X265_LOG2(cfg->param.rc.ipFactor);
@@ -353,9 +347,9 @@ RateControl::RateControl(TEncCfg * _cfg)
 
     if (cfg->param.rc.rateControlMode == X265_RC_CQP)
     {
-        qpConstant[P_SLICE] = baseQp;
-        qpConstant[I_SLICE] = Clip3(0, MAX_MAX_QP, (int)(baseQp - ipOffset + 0.5));
-        qpConstant[B_SLICE] = Clip3(0, MAX_MAX_QP, (int)(baseQp + pbOffset + 0.5));
+        qpConstant[P_SLICE] = qp;
+        qpConstant[I_SLICE] = Clip3(0, MAX_MAX_QP, (int)(qp - ipOffset + 0.5));
+        qpConstant[B_SLICE] = Clip3(0, MAX_MAX_QP, (int)(qp + pbOffset + 0.5));
     }
 
     /* qstep - value set as encoder specific */
@@ -404,7 +398,6 @@ void RateControl::rateControlStart(TComP
     framesDone++;
     /* set the final QP to slice structure */
     curSlice->setSliceQp(qp);
-    curSlice->setSliceQpBase(qp);
     curSlice->m_avgQpRc = qp;
 }
 
diff -r a3a9e0fb1a87 -r d77a549b8061 source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/encoder/ratecontrol.h	Fri Feb 14 15:51:09 2014 -0600
@@ -79,7 +79,7 @@ struct RateControl
     int ncu;                  /* number of CUs in a frame */
     int keyFrameInterval;     /* TODO: need to initialize in init */
     int qp;                   /* updated qp for current frame */
-    int baseQp;               /* CQP base QP */
+
     double frameDuration;     /* current frame duration in seconds */
     double bitrate;
     double rateFactorConstant;
diff -r a3a9e0fb1a87 -r d77a549b8061 source/input/y4m.cpp
--- a/source/input/y4m.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/input/y4m.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -348,6 +348,8 @@ bool Y4MInput::readPicture(x265_picture&
     if (!frameStat[head])
         return false;
 
+    pic.bitDepth = 8;
+    pic.colorSpace = colorSpace;
     for (int i = 0; i < x265_cli_csps[colorSpace].planes; i++)
     {
         pic.planes[i] = plane[head][i];
diff -r a3a9e0fb1a87 -r d77a549b8061 source/input/yuv.cpp
--- a/source/input/yuv.cpp	Fri Feb 14 14:26:57 2014 +0900
+++ b/source/input/yuv.cpp	Fri Feb 14 15:51:09 2014 -0600
@@ -203,6 +203,7 @@ bool YUVInput::readPicture(x265_picture&
     if (!frameStat[head])
         return false;
 
+    pic.colorSpace = colorSpace;
     pic.bitDepth = depth;
     pic.planes[0] = buf[head];
     pic.planes[1] = (char*)(pic.planes[0]) + width * height * pixelbytes;


More information about the x265-commits mailing list