[x265-commits] [x265] rc: fix crashes in vbv with 2 pass

Aarthi at videolan.org Aarthi at videolan.org
Sun Jul 27 06:53:39 CEST 2014


details:   http://hg.videolan.org/x265/rev/d3e2e487a488
branches:  
changeset: 7555:d3e2e487a488
user:      Aarthi Thirumalai
date:      Fri Jul 25 18:53:18 2014 +0530
description:
rc: fix crashes in vbv with 2 pass
Subject: [x265] rest: better document configuration options of --vbv-init

details:   http://hg.videolan.org/x265/rev/66ed81577483
branches:  
changeset: 7556:66ed81577483
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 13:47:16 2014 -0500
description:
rest: better document configuration options of --vbv-init
Subject: [x265] encoder: remove unused m_maxRefPicNum and m_maxNumOffsetsPerPic

details:   http://hg.videolan.org/x265/rev/e6ff719bd703
branches:  
changeset: 7557:e6ff719bd703
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 17:15:58 2014 -0500
description:
encoder: remove unused m_maxRefPicNum and m_maxNumOffsetsPerPic
Subject: [x265] entropy: nit

details:   http://hg.videolan.org/x265/rev/a581b22e70e4
branches:  
changeset: 7558:a581b22e70e4
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 17:16:05 2014 -0500
description:
entropy: nit
Subject: [x265] cudata: nits

details:   http://hg.videolan.org/x265/rev/50e015720392
branches:  
changeset: 7559:50e015720392
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 17:54:07 2014 -0500
description:
cudata: nits
Subject: [x265] analysis: cleanup early-skip

details:   http://hg.videolan.org/x265/rev/dc595d2bfa36
branches:  
changeset: 7560:dc595d2bfa36
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 22:19:00 2014 -0500
description:
analysis: cleanup early-skip
Subject: [x265] api: improve documentation of x265_encoder_encode

details:   http://hg.videolan.org/x265/rev/f73c0902079f
branches:  
changeset: 7561:f73c0902079f
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 21:33:26 2014 -0500
description:
api: improve documentation of x265_encoder_encode
Subject: [x265] slice: move coloc/tmvp flag setting all to one place

details:   http://hg.videolan.org/x265/rev/d65c665f15f8
branches:  
changeset: 7562:d65c665f15f8
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 14:25:53 2014 -0500
description:
slice: move coloc/tmvp flag setting all to one place
Subject: [x265] slice: remove redundant initSlice(), m_numRefIdx[] is set by DPB unconditionally

details:   http://hg.videolan.org/x265/rev/b573c299fb31
branches:  
changeset: 7563:b573c299fb31
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 14:53:27 2014 -0500
description:
slice: remove redundant initSlice(), m_numRefIdx[] is set by DPB unconditionally
Subject: [x265] move slice setup together into one function, reorder functions for clarity

details:   http://hg.videolan.org/x265/rev/509fe705ed8d
branches:  
changeset: 7564:509fe705ed8d
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 15:14:18 2014 -0500
description:
move slice setup together into one function, reorder functions for clarity
Subject: [x265] frameencoder: remove getSAO() access method; delay allocation of SAOParam

details:   http://hg.videolan.org/x265/rev/606b6ebed3b8
branches:  
changeset: 7565:606b6ebed3b8
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 15:43:57 2014 -0500
description:
frameencoder: remove getSAO() access method; delay allocation of SAOParam
Subject: [x265] framefilter: initialize saoRowDelay just once

details:   http://hg.videolan.org/x265/rev/6ca9f09455ca
branches:  
changeset: 7566:6ca9f09455ca
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 15:45:10 2014 -0500
description:
framefilter: initialize saoRowDelay just once
Subject: [x265] search: move all init code into TEncSearch::initSearch()

details:   http://hg.videolan.org/x265/rev/915397565c05
branches:  
changeset: 7567:915397565c05
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 02:38:13 2014 -0500
description:
search: move all init code into TEncSearch::initSearch()

TEncSearch owns all the objects being initialized
Subject: [x265] search: simplify verbage, fix white-space, no logic change

details:   http://hg.videolan.org/x265/rev/7a8e7a87c9a2
branches:  
changeset: 7568:7a8e7a87c9a2
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 02:54:08 2014 -0500
description:
search: simplify verbage, fix white-space, no logic change
Subject: [x265] white-space and brace nits

details:   http://hg.videolan.org/x265/rev/fef8314f730b
branches:  
changeset: 7569:fef8314f730b
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 13:17:32 2014 -0500
description:
white-space and brace nits
Subject: [x265] quant: do not malloc the EstBitsSbac structure, pass by reference

details:   http://hg.videolan.org/x265/rev/82279c006a70
branches:  
changeset: 7570:82279c006a70
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 14:20:37 2014 -0500
description:
quant: do not malloc the EstBitsSbac structure, pass by reference
Subject: [x265] quant: remove dead comment

details:   http://hg.videolan.org/x265/rev/08de42d0b4a0
branches:  
changeset: 7571:08de42d0b4a0
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 21:36:08 2014 -0500
description:
quant: remove dead comment
Subject: [x265] quant: simplify setQPforQuant

details:   http://hg.videolan.org/x265/rev/3f205a75877b
branches:  
changeset: 7572:3f205a75877b
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 21:38:00 2014 -0500
description:
quant: simplify setQPforQuant
Subject: [x265] quant: cleanup signBitHidingHDQ()

details:   http://hg.videolan.org/x265/rev/50db97f20e61
branches:  
changeset: 7573:50db97f20e61
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 21:44:07 2014 -0500
description:
quant: cleanup signBitHidingHDQ()
Subject: [x265] quant: cleanups

details:   http://hg.videolan.org/x265/rev/b60d35a06d3a
branches:  
changeset: 7574:b60d35a06d3a
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 23:48:13 2014 -0500
description:
quant: cleanups
Subject: [x265] quant: nits

details:   http://hg.videolan.org/x265/rev/a28a01820e30
branches:  
changeset: 7575:a28a01820e30
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 00:13:53 2014 -0500
description:
quant: nits
Subject: [x265] quant: cleanup initialization; catch malloc failures. rename m_tmpCoeff

details:   http://hg.videolan.org/x265/rev/db5642f2e4b7
branches:  
changeset: 7576:db5642f2e4b7
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 23:23:08 2014 -0500
description:
quant: cleanup initialization; catch malloc failures. rename m_tmpCoeff
Subject: [x265] param: move all consistency param tweaks into Encoder::configure()

details:   http://hg.videolan.org/x265/rev/a86d9aaaa7d7
branches:  
changeset: 7577:a86d9aaaa7d7
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 25 21:02:46 2014 -0500
description:
param: move all consistency param tweaks into Encoder::configure()

x265_check_params() shouldn't be modifying the param structure; it's role is to
spot invalid configurations and prevent crashes in encoder creation.
Subject: [x265] quant: don't pass m_resiDctCoeff to member methods

details:   http://hg.videolan.org/x265/rev/00c127bd42e7
branches:  
changeset: 7578:00c127bd42e7
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 26 23:41:51 2014 -0500
description:
quant: don't pass m_resiDctCoeff to member methods

diffstat:

 doc/reST/cli.rst                                  |   11 +-
 source/Lib/TLibCommon/TComDataCU.cpp              |   99 +--
 source/Lib/TLibCommon/TComPicSym.cpp              |    5 +-
 source/Lib/TLibCommon/TComSampleAdaptiveOffset.h  |    1 -
 source/Lib/TLibCommon/TComTrQuant.cpp             |  578 ++++++---------------
 source/Lib/TLibCommon/TComTrQuant.h               |   48 +-
 source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h |    3 -
 source/Lib/TLibEncoder/TEncSearch.cpp             |   85 +-
 source/Lib/TLibEncoder/TEncSearch.h               |    7 +-
 source/common/param.cpp                           |   34 -
 source/common/slice.h                             |    9 -
 source/encoder/analysis.cpp                       |   42 +-
 source/encoder/analysis.h                         |    1 -
 source/encoder/cturow.cpp                         |    2 +-
 source/encoder/dpb.cpp                            |   11 +
 source/encoder/encoder.cpp                        |   49 +-
 source/encoder/encoder.h                          |   18 +-
 source/encoder/entropy.cpp                        |   68 +-
 source/encoder/entropy.h                          |   10 +-
 source/encoder/frameencoder.cpp                   |  167 ++---
 source/encoder/frameencoder.h                     |   17 +-
 source/encoder/framefilter.cpp                    |   43 +-
 source/encoder/ratecontrol.cpp                    |  112 ++--
 source/x265.h                                     |    7 +-
 24 files changed, 517 insertions(+), 910 deletions(-)

diffs (truncated from 3172 to 300 lines):

diff -r 8aa4132d3097 -r 00c127bd42e7 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Fri Jul 25 01:29:21 2014 -0500
+++ b/doc/reST/cli.rst	Sat Jul 26 23:41:51 2014 -0500
@@ -710,9 +710,16 @@ Quality, rate control and rate distortio
 
 	Initial buffer occupancy. The portion of the decode buffer which
 	must be full before the decoder will begin decoding.  Determines
-	absolute maximum frame size. Default 0.9
+	absolute maximum frame size. May be specified as a fractional value
+	between 0 and 1, or in kbits. In other words these two option pairs
+	are equivalent::
 
-	**Range of values:** 0 - 1.0
+	:option:`--vbv-bufsize` 1000 :option:`--vbv-init` 900
+	:option:`--vbv-bufsize` 1000 :option:`--vbv-init` 0.9
+
+	Default 0.9
+
+	**Range of values:** fractional: 0 - 1.0, or kbits: 2 .. bufsize
 
 .. option:: --qp, -q <integer>
 
diff -r 8aa4132d3097 -r 00c127bd42e7 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Fri Jul 25 01:29:21 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Sat Jul 26 23:41:51 2014 -0500
@@ -1721,15 +1721,12 @@ void TComDataCU::getInterMergeCandidates
         // get Mv from Left
         cuLeft->getMvField(cuLeft, leftPartIdx, REF_PIC_LIST_0, mvFieldNeighbours[count][0]);
         if (isInterB)
-        {
             cuLeft->getMvField(cuLeft, leftPartIdx, REF_PIC_LIST_1, mvFieldNeighbours[count][1]);
-        }
+
         count++;
-        // early termination
+    
         if (count == maxNumMergeCand)
-        {
             return;
-        }
     }
 
     deriveLeftRightTopIdx(puIdx, partIdxLT, partIdxRT);
@@ -1749,15 +1746,12 @@ void TComDataCU::getInterMergeCandidates
         // get Mv from Left
         cuAbove->getMvField(cuAbove, abovePartIdx, REF_PIC_LIST_0, mvFieldNeighbours[count][0]);
         if (isInterB)
-        {
             cuAbove->getMvField(cuAbove, abovePartIdx, REF_PIC_LIST_1, mvFieldNeighbours[count][1]);
-        }
+
         count++;
-        // early termination
+   
         if (count == maxNumMergeCand)
-        {
             return;
-        }
     }
 
     // above right
@@ -1774,18 +1768,15 @@ void TComDataCU::getInterMergeCandidates
         // get Mv from Left
         cuAboveRight->getMvField(cuAboveRight, aboveRightPartIdx, REF_PIC_LIST_0, mvFieldNeighbours[count][0]);
         if (isInterB)
-        {
             cuAboveRight->getMvField(cuAboveRight, aboveRightPartIdx, REF_PIC_LIST_1, mvFieldNeighbours[count][1]);
-        }
+
         count++;
-        // early termination
+
         if (count == maxNumMergeCand)
-        {
             return;
-        }
     }
 
-    //left bottom
+    // left bottom
     uint32_t leftBottomPartIdx = 0;
     TComDataCU* cuLeftBottom = 0;
     cuLeftBottom = this->getPUBelowLeft(leftBottomPartIdx, partIdxLB);
@@ -1799,15 +1790,12 @@ void TComDataCU::getInterMergeCandidates
         // get Mv from Left
         cuLeftBottom->getMvField(cuLeftBottom, leftBottomPartIdx, REF_PIC_LIST_0, mvFieldNeighbours[count][0]);
         if (isInterB)
-        {
             cuLeftBottom->getMvField(cuLeftBottom, leftBottomPartIdx, REF_PIC_LIST_1, mvFieldNeighbours[count][1]);
-        }
+
         count++;
-        // early termination
+
         if (count == maxNumMergeCand)
-        {
             return;
-        }
     }
 
     // above left
@@ -1827,15 +1815,12 @@ void TComDataCU::getInterMergeCandidates
             // get Mv from Left
             cuAboveLeft->getMvField(cuAboveLeft, aboveLeftPartIdx, REF_PIC_LIST_0, mvFieldNeighbours[count][0]);
             if (isInterB)
-            {
                 cuAboveLeft->getMvField(cuAboveLeft, aboveLeftPartIdx, REF_PIC_LIST_1, mvFieldNeighbours[count][1]);
-            }
+
             count++;
-            // early termination
+
             if (count == maxNumMergeCand)
-            {
                 return;
-            }
         }
     }
     // TMVP always enabled
@@ -1845,54 +1830,47 @@ void TComDataCU::getInterMergeCandidates
 
         deriveRightBottomIdx(puIdx, partIdxRB);
 
-        uint32_t uiAbsPartIdxTmp = g_zscanToRaster[partIdxRB];
+        uint32_t absPartIdxTmp = g_zscanToRaster[partIdxRB];
         uint32_t numPartInCUSize = m_pic->getNumPartInCUSize();
 
         MV colmv;
         int refIdx;
         int lcuIdx = -1;
 
-        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->m_sps->picWidthInLumaSamples)  // image boundary check
+        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->m_sps->picWidthInLumaSamples)  // image boundary check
         {
         }
-        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->m_sps->picHeightInLumaSamples)
+        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->m_sps->picHeightInLumaSamples)
         {
         }
         else
         {
-            if ((uiAbsPartIdxTmp % numPartInCUSize < numPartInCUSize - 1) &&        // is not at the last column of LCU
-                (uiAbsPartIdxTmp / numPartInCUSize < numPartInCUSize - 1)) // is not at the last row    of LCU
+            if ((absPartIdxTmp % numPartInCUSize < numPartInCUSize - 1) &&        // is not at the last column of LCU
+                (absPartIdxTmp / numPartInCUSize < numPartInCUSize - 1)) // is not at the last row    of LCU
             {
-                absPartAddr = g_rasterToZscan[uiAbsPartIdxTmp + numPartInCUSize + 1];
+                absPartAddr = g_rasterToZscan[absPartIdxTmp + numPartInCUSize + 1];
                 lcuIdx = getAddr();
             }
-            else if (uiAbsPartIdxTmp % numPartInCUSize < numPartInCUSize - 1)       // is not at the last column of LCU But is last row of LCU
+            else if (absPartIdxTmp % numPartInCUSize < numPartInCUSize - 1)       // is not at the last column of LCU But is last row of LCU
+                absPartAddr = g_rasterToZscan[(absPartIdxTmp + numPartInCUSize + 1) % m_pic->getNumPartInCU()];
+            else if (absPartIdxTmp / numPartInCUSize < numPartInCUSize - 1) // is not at the last row of LCU But is last column of LCU
             {
-                absPartAddr = g_rasterToZscan[(uiAbsPartIdxTmp + numPartInCUSize + 1) % m_pic->getNumPartInCU()];
-            }
-            else if (uiAbsPartIdxTmp / numPartInCUSize < numPartInCUSize - 1) // is not at the last row of LCU But is last column of LCU
-            {
-                absPartAddr = g_rasterToZscan[uiAbsPartIdxTmp + 1];
+                absPartAddr = g_rasterToZscan[absPartIdxTmp + 1];
                 lcuIdx = getAddr() + 1;
             }
             else //is the right bottom corner of LCU
-            {
                 absPartAddr = 0;
-            }
         }
 
         refIdx = 0;
-        bool bExistMV = false;
         uint32_t partIdxCenter;
         uint32_t curLCUIdx = getAddr();
         int dir = 0;
         uint32_t arrayAddr = count;
         xDeriveCenterIdx(puIdx, partIdxCenter);
-        bExistMV = lcuIdx >= 0 && xGetColMVP(REF_PIC_LIST_0, lcuIdx, absPartAddr, colmv, refIdx);
-        if (bExistMV == false)
-        {
+        bool bExistMV = lcuIdx >= 0 && xGetColMVP(REF_PIC_LIST_0, lcuIdx, absPartAddr, colmv, refIdx);
+        if (!bExistMV)
             bExistMV = xGetColMVP(REF_PIC_LIST_0, curLCUIdx, partIdxCenter, colmv, refIdx);
-        }
         if (bExistMV)
         {
             dir |= 1;
@@ -1902,10 +1880,9 @@ void TComDataCU::getInterMergeCandidates
         if (isInterB)
         {
             bExistMV = lcuIdx >= 0 && xGetColMVP(REF_PIC_LIST_1, lcuIdx, absPartAddr, colmv, refIdx);
-            if (bExistMV == false)
-            {
+            if (!bExistMV)
                 bExistMV = xGetColMVP(REF_PIC_LIST_1, curLCUIdx, partIdxCenter, colmv, refIdx);
-            }
+
             if (bExistMV)
             {
                 dir |= 2;
@@ -1918,11 +1895,9 @@ void TComDataCU::getInterMergeCandidates
             interDirNeighbours[arrayAddr] = dir;
 
             count++;
-            // early termination
+        
             if (count == maxNumMergeCand)
-            {
                 return;
-            }
         }
     }
 
@@ -1955,11 +1930,9 @@ void TComDataCU::getInterMergeCandidates
                     interDirNeighbours[arrayAddr] = 3;
 
                     arrayAddr++;
-                    // early termination
+
                     if (arrayAddr == maxNumMergeCand)
-                    {
                         return;
-                    }
                 }
             }
         }
@@ -1977,11 +1950,11 @@ void TComDataCU::getInterMergeCandidates
             interDirNeighbours[arrayAddr] = 3;
             mvFieldNeighbours[arrayAddr][1].setMvField(MV(0, 0), r);
         }
+
         arrayAddr++;
+
         if (refcnt == numRefIdx - 1)
-        {
             r = 0;
-        }
         else
         {
             ++r;
@@ -2104,25 +2077,19 @@ int TComDataCU::fillMvpCand(uint32_t par
     for (int dir = MD_LEFT; dir <= MD_ABOVE_LEFT; dir++)
     {
         if (valid[dir] && mv[dir].notZero())
-        {
             mvc[numMvc++] = mv[dir];
-        }
+
         if (validOrder[dir] && mvOrder[dir].notZero())
-        {
             mvc[numMvc++] = mvOrder[dir];
-        }
     }
 
     if (info->m_num == 2)
     {
         if (info->m_mvCand[0] == info->m_mvCand[1])
-        {
             info->m_num = 1;
-        }
         else
-        {
+            /* AMVP_MAX_NUM_CANDS = 2 */
             return numMvc;
-        }
     }
 
     // TMVP always enabled
@@ -2156,18 +2123,14 @@ int TComDataCU::fillMvpCand(uint32_t par
                 lcuIdx = getAddr();
             }
             else if (absPartIdx % numPartInCUSize < numPartInCUSize - 1) // is not at the last column of LCU But is last row of LCU
-            {
                 absPartAddr = g_rasterToZscan[(absPartIdx + numPartInCUSize + 1) % m_pic->getNumPartInCU()];
-            }
             else if (absPartIdx / numPartInCUSize < numPartInCUSize - 1) // is not at the last row of LCU But is last column of LCU
             {
                 absPartAddr = g_rasterToZscan[absPartIdx + 1];
                 lcuIdx = getAddr() + 1;
             }
             else // is the right bottom corner of LCU
-            {
                 absPartAddr = 0;
-            }
         }
         if (lcuIdx >= 0 && xGetColMVP(picList, lcuIdx, absPartAddr, colmv, refIdxCol))
         {
diff -r 8aa4132d3097 -r 00c127bd42e7 source/Lib/TLibCommon/TComPicSym.cpp
--- a/source/Lib/TLibCommon/TComPicSym.cpp	Fri Jul 25 01:29:21 2014 -0500
+++ b/source/Lib/TLibCommon/TComPicSym.cpp	Sat Jul 26 23:41:51 2014 -0500
@@ -57,13 +57,14 @@ TComPicSym::TComPicSym()
     , m_numCUsInFrame(0)
     , m_slice(NULL)
     , m_cuData(NULL)
-{}
+{
+    m_saoParam = NULL;
+}
 
 bool TComPicSym::create(x265_param *param)
 {


More information about the x265-commits mailing list