[x265-commits] [x265] port TEncCU functions into analysis structure

Deepthi Nandakumar deepthi at multicorewareinc.com
Thu Jul 17 03:33:50 CEST 2014


details:   http://hg.videolan.org/x265/rev/76eb82b31c37
branches:  
changeset: 7394:76eb82b31c37
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Tue Jul 15 14:09:31 2014 +0530
description:
port TEncCU functions into analysis structure

1. Rename TEncCU to Analysis
2. Remove warnings (/wd4244 /wd4389 /wd4018) from TEncCU
3. Roll over compress.cpp into analysis.cpp
4. Rename TEncCU to Analysis
5. Remove hungarian notation function names
Subject: [x265] entropy: nits

details:   http://hg.videolan.org/x265/rev/d850cbf81e0f
branches:  
changeset: 7395:d850cbf81e0f
user:      Steve Borho <steve at borho.org>
date:      Tue Jul 15 22:47:54 2014 -0500
description:
entropy: nits
Subject: [x265] slice: Cleanup TComReferencePictureSet, prune the notion of long-term-pictures

details:   http://hg.videolan.org/x265/rev/afcfff7f654c
branches:  
changeset: 7396:afcfff7f654c
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 00:06:19 2014 -0500
description:
slice: Cleanup TComReferencePictureSet, prune the notion of long-term-pictures
Subject: [x265] brace nits

details:   http://hg.videolan.org/x265/rev/f28129d63336
branches:  
changeset: 7397:f28129d63336
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 00:06:52 2014 -0500
description:
brace nits
Subject: [x265] slice: remove unused PPS ID

details:   http://hg.videolan.org/x265/rev/06ceed0047c1
branches:  
changeset: 7398:06ceed0047c1
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 00:13:10 2014 -0500
description:
slice: remove unused PPS ID
Subject: [x265] slice: finish cleanup of TComReferencePictureSet

details:   http://hg.videolan.org/x265/rev/ab3e3c2b806f
branches:  
changeset: 7399:ab3e3c2b806f
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 00:16:29 2014 -0500
description:
slice: finish cleanup of TComReferencePictureSet
Subject: [x265] vui: prune set/get methods and unsignaled fields

details:   http://hg.videolan.org/x265/rev/cb5f30c19ccc
branches:  
changeset: 7400:cb5f30c19ccc
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 00:48:31 2014 -0500
description:
vui: prune set/get methods and unsignaled fields
Subject: [x265] bitstream: change writeFlag() to take a bool to avoid int conversions

details:   http://hg.videolan.org/x265/rev/2737d0b05b72
branches:  
changeset: 7401:2737d0b05b72
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 01:20:29 2014 -0500
description:
bitstream: change writeFlag() to take a bool to avoid int conversions
Subject: [x265] rest: fix documented default AQ mode

details:   http://hg.videolan.org/x265/rev/c45eda4d780f
branches:  
changeset: 7402:c45eda4d780f
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 12:09:04 2014 -0500
description:
rest: fix documented default AQ mode

As noted by Alex Ramsey
Subject: [x265] slice: convert Window to struct, simplify names

details:   http://hg.videolan.org/x265/rev/26f94fc58d5a
branches:  
changeset: 7403:26f94fc58d5a
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 12:50:22 2014 -0500
description:
slice: convert Window to struct, simplify names
Subject: [x265] slice: start to clean up scaling list struct

details:   http://hg.videolan.org/x265/rev/04601befb930
branches:  
changeset: 7404:04601befb930
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 13:36:19 2014 -0500
description:
slice: start to clean up scaling list struct
Subject: [x265] rest: fix crf min/max option names

details:   http://hg.videolan.org/x265/rev/9213f5dea023
branches:  
changeset: 7405:9213f5dea023
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 15:54:58 2014 -0500
description:
rest: fix crf min/max option names
Subject: [x265] slice: remove unsignaled m_temporalLayerNonReferenceFlag

details:   http://hg.videolan.org/x265/rev/b3db2d76500b
branches:  
changeset: 7406:b3db2d76500b
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 17:11:52 2014 -0500
description:
slice: remove unsignaled m_temporalLayerNonReferenceFlag
Subject: [x265] slice: remove trivial set/get methods, move all relavent functions to the class

details:   http://hg.videolan.org/x265/rev/164b43bfdf7a
branches:  
changeset: 7407:164b43bfdf7a
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 17:49:42 2014 -0500
description:
slice: remove trivial set/get methods, move all relavent functions to the class
Subject: [x265] slice: nits

details:   http://hg.videolan.org/x265/rev/891f975f1ba5
branches:  
changeset: 7408:891f975f1ba5
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 17:49:49 2014 -0500
description:
slice: nits
Subject: [x265] slice: remove redundant/unused scaling lists from SPS, PPS, and Slice

details:   http://hg.videolan.org/x265/rev/8969598e1d91
branches:  
changeset: 7409:8969598e1d91
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 18:19:39 2014 -0500
description:
slice: remove redundant/unused scaling lists from SPS, PPS, and Slice

The SPS and PPS were allocating their own scaling list instances and never using
them; with the recent refactors only their status flags were coded.  TComSlice
had a pointer to the top-level scaling list, but never used it.

"There can be only one!"
Subject: [x265] nits

details:   http://hg.videolan.org/x265/rev/92f32f4492f0
branches:  
changeset: 7410:92f32f4492f0
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 18:19:59 2014 -0500
description:
nits
Subject: [x265] remove hard-coded pps->getSliceHeaderExtensionPresentFlag()

details:   http://hg.videolan.org/x265/rev/ba3146812b42
branches:  
changeset: 7411:ba3146812b42
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 18:22:52 2014 -0500
description:
remove hard-coded pps->getSliceHeaderExtensionPresentFlag()
Subject: [x265] pps: remove hard-coded getLog2ParallelMergeLevelMinus2(0)

details:   http://hg.videolan.org/x265/rev/b9bb54fd5478
branches:  
changeset: 7412:b9bb54fd5478
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 18:32:18 2014 -0500
description:
pps: remove hard-coded getLog2ParallelMergeLevelMinus2(0)

and snuck in some other nits
Subject: [x265] vps: class to struct and other nits

details:   http://hg.videolan.org/x265/rev/9f906f877ba8
branches:  
changeset: 7413:9f906f877ba8
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 19:08:50 2014 -0500
description:
vps: class to struct and other nits
Subject: [x265] sps: remove set/get methods, remove members with hard-coded values

details:   http://hg.videolan.org/x265/rev/e288df705bf3
branches:  
changeset: 7414:e288df705bf3
user:      Steve Borho <steve at borho.org>
date:      Wed Jul 16 20:29:46 2014 -0500
description:
sps: remove set/get methods, remove members with hard-coded values

Note all the SPS members that could be replaced by direct access to param.
Removes m_vps pointer from slice, it was never set or referenced

diffstat:

 doc/reST/cli.rst                                    |     8 +-
 source/Lib/TLibCommon/TComDataCU.cpp                |   136 +-
 source/Lib/TLibCommon/TComLoopFilter.cpp            |     2 +-
 source/Lib/TLibCommon/TComPattern.cpp               |     2 +-
 source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp  |     4 +-
 source/Lib/TLibCommon/TComSlice.cpp                 |   504 +---
 source/Lib/TLibCommon/TComSlice.h                   |   626 +----
 source/Lib/TLibCommon/TComTrQuant.cpp               |     8 +-
 source/Lib/TLibEncoder/TEncCu.cpp                   |  1445 ------------
 source/Lib/TLibEncoder/TEncCu.h                     |   163 -
 source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp |     5 +-
 source/Lib/TLibEncoder/TEncSearch.cpp               |    85 +-
 source/Lib/TLibEncoder/TEncSearch.h                 |     1 -
 source/common/bitstream.h                           |     4 +-
 source/common/common.h                              |     3 +
 source/common/frame.cpp                             |     1 -
 source/common/frame.h                               |     6 -
 source/encoder/CMakeLists.txt                       |     4 +-
 source/encoder/analysis.cpp                         |  2227 +++++++++++++++++++
 source/encoder/analysis.h                           |   143 +
 source/encoder/compress.cpp                         |   939 --------
 source/encoder/cturow.h                             |     4 +-
 source/encoder/dpb.cpp                              |   174 +-
 source/encoder/dpb.h                                |     2 -
 source/encoder/encoder.cpp                          |   173 +-
 source/encoder/encoder.h                            |    23 +-
 source/encoder/entropy.cpp                          |   392 +--
 source/encoder/entropy.h                            |     2 -
 source/encoder/frameencoder.cpp                     |    54 +-
 source/encoder/frameencoder.h                       |     2 +-
 source/encoder/ratecontrol.cpp                      |    18 +-
 source/encoder/sei.h                                |    19 +-
 32 files changed, 2920 insertions(+), 4259 deletions(-)

diffs (truncated from 8836 to 300 lines):

diff -r 6cf3a2414461 -r e288df705bf3 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Tue Jul 15 21:28:53 2014 -0500
+++ b/doc/reST/cli.rst	Wed Jul 16 20:29:46 2014 -0500
@@ -636,14 +636,14 @@ Quality, rate control and rate distortio
 	The higher the rate factor the higher the quantization and the lower
 	the quality. Default rate factor is 28.0.
 
-.. option:: --max-crf <0..51.0>
+.. option:: --crf-max <0..51.0>
 
 	Specify an upper limit to the rate factor which may be assigned to
 	any given frame (ensuring a max QP).  This is dangerous when CRF is
 	used in combination with VBV as it may result in buffer underruns.
 	Default disabled
         
-.. option:: --min-crf <0..51.0>
+.. option:: --crf-min <0..51.0>
 
 	Specify an lower limit to the rate factor which may be assigned to
 	any given frame (ensuring a min QP).  This is dangerous when CRF is
@@ -713,8 +713,8 @@ Quality, rate control and rate distortio
 	and not enough in flat areas.
 
 	0. disabled
-	1. AQ enabled **(default)**
-	2. AQ enabled with auto-variance
+	1. AQ enabled
+	2. AQ enabled with auto-variance **(default)**
 
 .. option:: --aq-strength <float>
 
diff -r 6cf3a2414461 -r e288df705bf3 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Tue Jul 15 21:28:53 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Wed Jul 16 20:29:46 2014 -0500
@@ -825,10 +825,8 @@ TComDataCU* TComDataCU::getPUAboveRight(
     uint32_t absPartIdxRT    = g_zscanToRaster[curPartUnitIdx];
     uint32_t numPartInCUSize = m_pic->getNumPartInCUSize();
 
-    if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxRT] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicWidthInLumaSamples())
-    {
+    if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxRT] + m_pic->getUnitSize()) >= m_slice->getSPS()->m_picWidthInLumaSamples)
         return NULL;
-    }
 
     if (RasterAddress::lessThanCol(absPartIdxRT, numPartInCUSize - 1, numPartInCUSize))
     {
@@ -867,7 +865,7 @@ TComDataCU* TComDataCU::getPUBelowLeft(u
 {
     uint32_t absPartIdxLB     = g_zscanToRaster[curPartUnitIdx];
 
-    if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxLB] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicHeightInLumaSamples())
+    if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxLB] + m_pic->getUnitSize()) >= m_slice->getSPS()->m_picHeightInLumaSamples)
     {
         return NULL;
     }
@@ -906,7 +904,7 @@ TComDataCU* TComDataCU::getPUBelowLeftAd
     uint32_t absPartIdxLB     = g_zscanToRaster[curPartUnitIdx];
 
     if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxLB] + (partUnitOffset << m_pic->getLog2UnitSize())) >=
-        m_slice->getSPS()->getPicHeightInLumaSamples())
+        m_slice->getSPS()->m_picHeightInLumaSamples)
     {
         return NULL;
     }
@@ -949,7 +947,7 @@ TComDataCU* TComDataCU::getPUAboveRightA
     uint32_t absPartIdxRT    = g_zscanToRaster[curPartUnitIdx];
 
     if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxRT] + (partUnitOffset << m_pic->getLog2UnitSize())) >=
-        m_slice->getSPS()->getPicWidthInLumaSamples())
+        m_slice->getSPS()->m_picWidthInLumaSamples)
     {
         return NULL;
     }
@@ -1212,25 +1210,25 @@ uint32_t TComDataCU::getQuadtreeTULog2Mi
 {
     uint32_t log2CUSize = getLog2CUSize(absPartIdx);
     PartSize partSize   = getPartitionSize(absPartIdx);
-    uint32_t quadtreeTUMaxDepth = getPredictionMode(absPartIdx) == MODE_INTRA ? m_slice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_slice->getSPS()->getQuadtreeTUMaxDepthInter();
+    uint32_t quadtreeTUMaxDepth = getPredictionMode(absPartIdx) == MODE_INTRA ? m_slice->getSPS()->m_quadtreeTUMaxDepthIntra : m_slice->getSPS()->m_quadtreeTUMaxDepthInter;
     int intraSplitFlag = (getPredictionMode(absPartIdx) == MODE_INTRA && partSize == SIZE_NxN) ? 1 : 0;
     int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode(absPartIdx) == MODE_INTER) && (partSize != SIZE_2Nx2N));
 
     uint32_t log2MinTUSizeInCU = 0;
 
-    if (log2CUSize < (m_slice->getSPS()->getQuadtreeTULog2MinSize() + quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag))
+    if (log2CUSize < (m_slice->getSPS()->m_quadtreeTULog2MinSize + quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag))
     {
         // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is < QuadtreeTULog2MinSize
-        log2MinTUSizeInCU = m_slice->getSPS()->getQuadtreeTULog2MinSize();
+        log2MinTUSizeInCU = m_slice->getSPS()->m_quadtreeTULog2MinSize;
     }
     else
     {
         // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is still >= QuadtreeTULog2MinSize
         log2MinTUSizeInCU = log2CUSize - (quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag); // stop when trafoDepth == hierarchy_depth = splitFlag
-        if (log2MinTUSizeInCU > m_slice->getSPS()->getQuadtreeTULog2MaxSize())
+        if (log2MinTUSizeInCU > m_slice->getSPS()->m_quadtreeTULog2MaxSize)
         {
             // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is still > QuadtreeTULog2MaxSize
-            log2MinTUSizeInCU = m_slice->getSPS()->getQuadtreeTULog2MaxSize();
+            log2MinTUSizeInCU = m_slice->getSPS()->m_quadtreeTULog2MaxSize;
         }
     }
     return log2MinTUSizeInCU;
@@ -2032,10 +2030,10 @@ void TComDataCU::getInterMergeCandidates
         int refIdx;
         int lcuIdx = -1;
 
-        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicWidthInLumaSamples())  // image boundary check
+        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->getSPS()->m_picWidthInLumaSamples)  // image boundary check
         {
         }
-        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicHeightInLumaSamples())
+        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->getSPS()->m_picHeightInLumaSamples)
         {
         }
         else
@@ -2177,16 +2175,12 @@ void TComDataCU::getInterMergeCandidates
  */
 bool TComDataCU::isDiffMER(int xN, int yN, int xP, int yP)
 {
-    uint32_t plevel = this->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() + 2;
+    uint32_t plevel = 2;
 
     if ((xN >> plevel) != (xP >> plevel))
-    {
         return true;
-    }
     if ((yN >> plevel) != (yP >> plevel))
-    {
         return true;
-    }
     return false;
 }
 
@@ -2370,10 +2364,10 @@ int TComDataCU::fillMvpCand(uint32_t par
         //----  co-located RightBottom Temporal Predictor (H) ---//
         absPartIdx = g_zscanToRaster[partIdxRB];
         int lcuIdx = -1;
-        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdx] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicWidthInLumaSamples())  // image boundary check
+        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdx] + m_pic->getUnitSize()) >= m_slice->getSPS()->m_picWidthInLumaSamples)  // image boundary check
         {
         }
-        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdx] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicHeightInLumaSamples())
+        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdx] + m_pic->getUnitSize()) >= m_slice->getSPS()->m_picHeightInLumaSamples)
         {
         }
         else
@@ -2436,10 +2430,10 @@ void TComDataCU::clipMv(MV& outMV)
 {
     int mvshift = 2;
     int offset = 8;
-    int xmax = (m_slice->getSPS()->getPicWidthInLumaSamples() + offset - m_cuPelX - 1) << mvshift;
+    int xmax = (m_slice->getSPS()->m_picWidthInLumaSamples + offset - m_cuPelX - 1) << mvshift;
     int xmin = (-(int)g_maxCUSize - offset - (int)m_cuPelX + 1) << mvshift;
 
-    int ymax = (m_slice->getSPS()->getPicHeightInLumaSamples() + offset - m_cuPelY - 1) << mvshift;
+    int ymax = (m_slice->getSPS()->m_picHeightInLumaSamples + offset - m_cuPelY - 1) << mvshift;
     int ymin = (-(int)g_maxCUSize - offset - (int)m_cuPelY + 1) << mvshift;
 
     outMV.x = X265_MIN(xmax, X265_MAX(xmin, (int)outMV.x));
@@ -2559,49 +2553,28 @@ bool TComDataCU::xAddMVPCandOrder(MV& ou
 
     int refPicList2nd = REF_PIC_LIST_0;
     if (picList == REF_PIC_LIST_0)
-    {
         refPicList2nd = REF_PIC_LIST_1;
-    }
     else if (picList == REF_PIC_LIST_1)
-    {
         refPicList2nd = REF_PIC_LIST_0;
-    }
 
     int curPOC = m_slice->getPOC();
     int curRefPOC = m_slice->getRefPic(picList, refIdx)->getPOC();
     int neibPOC = curPOC;
     int neibRefPOC;
 
-    bool bIsCurrRefLongTerm = m_slice->getRefPic(picList, refIdx)->getIsLongTerm();
-    bool bIsNeibRefLongTerm = false;
-
     //---------------  V1 (END) ------------------//
     if (tmpCU->getCUMvField(picList)->getRefIdx(idx) >= 0)
     {
         neibRefPOC = tmpCU->getSlice()->getRefPOC(picList, tmpCU->getCUMvField(picList)->getRefIdx(idx));
         MV mvp = tmpCU->getCUMvField(picList)->getMv(idx);
 
-        bIsNeibRefLongTerm = tmpCU->getSlice()->getRefPic(picList, tmpCU->getCUMvField(picList)->getRefIdx(idx))->getIsLongTerm();
-        if (bIsCurrRefLongTerm == bIsNeibRefLongTerm)
-        {
-            if (bIsCurrRefLongTerm || bIsNeibRefLongTerm)
-            {
-                outMV = mvp;
-            }
-            else
-            {
-                int scale = xGetDistScaleFactor(curPOC, curRefPOC, neibPOC, neibRefPOC);
-                if (scale == 4096)
-                {
-                    outMV = mvp;
-                }
-                else
-                {
-                    outMV = scaleMv(mvp, scale);
-                }
-            }
-            return true;
-        }
+        int scale = xGetDistScaleFactor(curPOC, curRefPOC, neibPOC, neibRefPOC);
+        if (scale == 4096)
+            outMV = mvp;
+        else
+            outMV = scaleMv(mvp, scale);
+
+        return true;
     }
 
     //---------------------- V2(END) --------------------//
@@ -2610,28 +2583,15 @@ bool TComDataCU::xAddMVPCandOrder(MV& ou
         neibRefPOC = tmpCU->getSlice()->getRefPOC(refPicList2nd, tmpCU->getCUMvField(refPicList2nd)->getRefIdx(idx));
         MV mvp = tmpCU->getCUMvField(refPicList2nd)->getMv(idx);
 
-        bIsNeibRefLongTerm = tmpCU->getSlice()->getRefPic(refPicList2nd, tmpCU->getCUMvField(refPicList2nd)->getRefIdx(idx))->getIsLongTerm();
-        if (bIsCurrRefLongTerm == bIsNeibRefLongTerm)
-        {
-            if (bIsCurrRefLongTerm || bIsNeibRefLongTerm)
-            {
-                outMV = mvp;
-            }
-            else
-            {
-                int scale = xGetDistScaleFactor(curPOC, curRefPOC, neibPOC, neibRefPOC);
-                if (scale == 4096)
-                {
-                    outMV = mvp;
-                }
-                else
-                {
-                    outMV = scaleMv(mvp, scale);
-                }
-            }
-            return true;
-        }
+        int scale = xGetDistScaleFactor(curPOC, curRefPOC, neibPOC, neibRefPOC);
+        if (scale == 4096)
+            outMV = mvp;
+        else
+            outMV = scaleMv(mvp, scale);
+
+        return true;
     }
+
     //---------------------- V3(END) --------------------//
     return false;
 }
@@ -2663,9 +2623,8 @@ bool TComDataCU::xGetColMVP(int picList,
     colPOC = colCU->getSlice()->getPOC();
 
     if (colCU->isIntra(absPartAddr))
-    {
         return false;
-    }
+
     colRefPicList = getSlice()->getCheckLDC() ? picList : getSlice()->getColFromL0Flag();
 
     int colRefIdx = colCU->getCUMvField(colRefPicList)->getRefIdx(absPartAddr);
@@ -2676,9 +2635,7 @@ bool TComDataCU::xGetColMVP(int picList,
         colRefIdx = colCU->getCUMvField(colRefPicList)->getRefIdx(absPartAddr);
 
         if (colRefIdx < 0)
-        {
             return false;
-        }
     }
 
     // Scale the vector.
@@ -2686,30 +2643,13 @@ bool TComDataCU::xGetColMVP(int picList,
     colmv = colCU->getCUMvField(colRefPicList)->getMv(absPartAddr);
 
     curRefPOC = m_slice->getRefPic(picList, outRefIdx)->getPOC();
-    bool bIsCurrRefLongTerm = m_slice->getRefPic(picList, outRefIdx)->getIsLongTerm();
-    bool bIsColRefLongTerm = colCU->getSlice()->getIsUsedAsLongTerm(colRefPicList, colRefIdx);
 
-    if (bIsCurrRefLongTerm != bIsColRefLongTerm)
-    {
-        return false;
-    }
+    scale = xGetDistScaleFactor(curPOC, curRefPOC, colPOC, colRefPOC);
+    if (scale == 4096)
+        outMV = colmv;
+    else
+        outMV = scaleMv(colmv, scale);
 
-    if (bIsCurrRefLongTerm || bIsColRefLongTerm)
-    {
-        outMV = colmv;
-    }
-    else
-    {
-        scale = xGetDistScaleFactor(curPOC, curRefPOC, colPOC, colRefPOC);


More information about the x265-commits mailing list