[x265-commits] [x265] nits

Steve Borho steve at borho.org
Fri Jul 18 03:54:54 CEST 2014


details:   http://hg.videolan.org/x265/rev/6d0c8efbe3ed
branches:  
changeset: 7424:6d0c8efbe3ed
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 02:38:35 2014 -0500
description:
nits
Subject: [x265] pps: simplify deblocking signaling, disable slice override

details:   http://hg.videolan.org/x265/rev/3e4616cffc90
branches:  
changeset: 7425:3e4616cffc90
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 12:48:45 2014 -0500
description:
pps: simplify deblocking signaling, disable slice override

Disable slice override of deblock-enable state and offsets - we do no such thing
and attempts at using these in the past have not been effective.
Subject: [x265] slice: rename wpScalingParam -> WeightParam

details:   http://hg.videolan.org/x265/rev/575d4a0d849b
branches:  
changeset: 7426:575d4a0d849b
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:13:06 2014 -0500
description:
slice: rename wpScalingParam -> WeightParam
Subject: [x265] nit

details:   http://hg.videolan.org/x265/rev/675a22d901af
branches:  
changeset: 7427:675a22d901af
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:13:10 2014 -0500
description:
nit
Subject: [x265] slice: remove get/set methods for SPS and PPS, make pointers const

details:   http://hg.videolan.org/x265/rev/419d1a1b0d39
branches:  
changeset: 7428:419d1a1b0d39
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:29:22 2014 -0500
description:
slice: remove get/set methods for SPS and PPS, make pointers const

Nearly everywhere, SPS and PPS are used read-only, so making the pointers const
enforces this at compile time and allows the compiler to make some optimizations.
The few places that initialize or change the headers are passed the original
objects belonging to the top-level encoder.
Subject: [x265] slice: hoist constructor to header (it will be removed in later commits)

details:   http://hg.videolan.org/x265/rev/08232a102124
branches:  
changeset: 7429:08232a102124
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:31:12 2014 -0500
description:
slice: hoist constructor to header (it will be removed in later commits)
Subject: [x265] slice: TComReferencePictureSet -> RPS

details:   http://hg.videolan.org/x265/rev/e6a8280a3c1a
branches:  
changeset: 7430:e6a8280a3c1a
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:34:19 2014 -0500
description:
slice: TComReferencePictureSet -> RPS
Subject: [x265] slice: we only use a slice-local RPS (none signaled in SPS)

details:   http://hg.videolan.org/x265/rev/f5352780ad35
branches:  
changeset: 7431:f5352780ad35
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:44:10 2014 -0500
description:
slice: we only use a slice-local RPS (none signaled in SPS)
Subject: [x265] nits

details:   http://hg.videolan.org/x265/rev/134406df4863
branches:  
changeset: 7432:134406df4863
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:44:13 2014 -0500
description:
nits
Subject: [x265] slice: remove unused slice QP deltas

details:   http://hg.videolan.org/x265/rev/b5abd96ccc90
branches:  
changeset: 7433:b5abd96ccc90
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 13:53:15 2014 -0500
description:
slice: remove unused slice QP deltas
Subject: [x265] slice: remove unused deblock data, directly use status/offsets from PPS

details:   http://hg.videolan.org/x265/rev/ba028e8d4115
branches:  
changeset: 7434:ba028e8d4115
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:04:39 2014 -0500
description:
slice: remove unused deblock data, directly use status/offsets from PPS

nits: reorder TComSlice for better clarity and remove initializer list from
constructor
Subject: [x265] rc: HRD must be initialized prior to calling init()

details:   http://hg.videolan.org/x265/rev/c06b0b9d3501
branches:  
changeset: 7435:c06b0b9d3501
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:21:38 2014 -0500
description:
rc: HRD must be initialized prior to calling init()
Subject: [x265] slice: temporal MVP was never disabled

details:   http://hg.videolan.org/x265/rev/6e45eff6d2b3
branches:  
changeset: 7436:6e45eff6d2b3
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:29:54 2014 -0500
description:
slice: temporal MVP was never disabled
Subject: [x265] slice: remove get/set methods for m_pic

details:   http://hg.videolan.org/x265/rev/72e3bd69cb70
branches:  
changeset: 7437:72e3bd69cb70
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:33:38 2014 -0500
description:
slice: remove get/set methods for m_pic

This cleaned up TComDataCU::getPic() as a side-effect.
Subject: [x265] slice: cleanup m_nalUnitType and helper methods

details:   http://hg.videolan.org/x265/rev/4c49302d8b19
branches:  
changeset: 7438:4c49302d8b19
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:39:50 2014 -0500
description:
slice: cleanup m_nalUnitType and helper methods
Subject: [x265] slice: nits

details:   http://hg.videolan.org/x265/rev/901252fe8a16
branches:  
changeset: 7439:901252fe8a16
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:39:53 2014 -0500
description:
slice: nits
Subject: [x265] rc: fix vbvBufferSize calculation

details:   http://hg.videolan.org/x265/rev/930003de2009
branches:  
changeset: 7440:930003de2009
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:43:39 2014 -0500
description:
rc: fix vbvBufferSize calculation
Subject: [x265] sao: (bool == 1? ? true : false  -> wat?

details:   http://hg.videolan.org/x265/rev/0233b8965906
branches:  
changeset: 7441:0233b8965906
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:45:57 2014 -0500
description:
sao: (bool == 1? ? true : false  -> wat?
Subject: [x265] sao: combine if(){} expressions

details:   http://hg.videolan.org/x265/rev/a5d5d329daf1
branches:  
changeset: 7442:a5d5d329daf1
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 14:47:57 2014 -0500
description:
sao: combine if(){} expressions
Subject: [x265] slice: remove m_saoEnabledFlag, m_saoEnabledFlagChroma - use saoParams

details:   http://hg.videolan.org/x265/rev/fd4297676f76
branches:  
changeset: 7443:fd4297676f76
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 15:21:23 2014 -0500
description:
slice: remove m_saoEnabledFlag, m_saoEnabledFlagChroma - use saoParams

SBac::encodeSliceHeader() was already using saoParams for chroma but not for
luma (inexplicably)
Subject: [x265] slice: remove m_sliceSegmentBits and get/set methods for max-merge

details:   http://hg.videolan.org/x265/rev/bf060c902d24
branches:  
changeset: 7444:bf060c902d24
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 16:31:08 2014 -0500
description:
slice: remove m_sliceSegmentBits and get/set methods for max-merge
Subject: [x265] nits

details:   http://hg.videolan.org/x265/rev/67c9a0c5ec56
branches:  
changeset: 7445:67c9a0c5ec56
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 16:31:11 2014 -0500
description:
nits
Subject: [x265] slice: remove get/set methods for m_poc

details:   http://hg.videolan.org/x265/rev/98b7f7a776b1
branches:  
changeset: 7446:98b7f7a776b1
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 16:41:48 2014 -0500
description:
slice: remove get/set methods for m_poc
Subject: [x265] slice: remove slice bit counter

details:   http://hg.videolan.org/x265/rev/79c839303e2a
branches:  
changeset: 7447:79c839303e2a
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 16:47:02 2014 -0500
description:
slice: remove slice bit counter
Subject: [x265] slice: remove m_numEntryPointOffsets, it was write-only

details:   http://hg.videolan.org/x265/rev/3a6a0307f6c6
branches:  
changeset: 7448:3a6a0307f6c6
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 16:54:13 2014 -0500
description:
slice: remove m_numEntryPointOffsets, it was write-only
Subject: [x265] slice: remove m_cabacInitFlag, it was write-only

details:   http://hg.videolan.org/x265/rev/39f9cb10090a
branches:  
changeset: 7449:39f9cb10090a
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 17:47:05 2014 -0500
description:
slice: remove m_cabacInitFlag, it was write-only
Subject: [x265] nit

details:   http://hg.videolan.org/x265/rev/95a35fd1c0b7
branches:  
changeset: 7450:95a35fd1c0b7
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 17:47:08 2014 -0500
description:
nit
Subject: [x265] slice: remove get/set methods for m_sliceType

details:   http://hg.videolan.org/x265/rev/880285f10294
branches:  
changeset: 7451:880285f10294
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 17:52:32 2014 -0500
description:
slice: remove get/set methods for m_sliceType
Subject: [x265] slice: remove get/set methods for m_bReferenced

details:   http://hg.videolan.org/x265/rev/aa785acc0d5f
branches:  
changeset: 7452:aa785acc0d5f
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 18:01:42 2014 -0500
description:
slice: remove get/set methods for m_bReferenced
Subject: [x265] slice: remove get/set methods for slice QP and lastIDR

details:   http://hg.videolan.org/x265/rev/3f024a5a40f0
branches:  
changeset: 7453:3f024a5a40f0
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 18:54:31 2014 -0500
description:
slice: remove get/set methods for slice QP and lastIDR
Subject: [x265] slice: remove unused getNumRpsCurrTempList() method

details:   http://hg.videolan.org/x265/rev/0f5cfda6a764
branches:  
changeset: 7454:0f5cfda6a764
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 18:55:14 2014 -0500
description:
slice: remove unused getNumRpsCurrTempList() method
Subject: [x265] slice: removed unused setRefPic() and setRefPOC() methods

details:   http://hg.videolan.org/x265/rev/c7846351fc9f
branches:  
changeset: 7455:c7846351fc9f
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 18:57:01 2014 -0500
description:
slice: removed unused setRefPic() and setRefPOC() methods
Subject: [x265] slice: remove getNumRefIdx() access method

details:   http://hg.videolan.org/x265/rev/785217b5ed5c
branches:  
changeset: 7456:785217b5ed5c
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 19:13:38 2014 -0500
description:
slice: remove getNumRefIdx() access method
Subject: [x265] slice: remove getColFromL0Flag()

details:   http://hg.videolan.org/x265/rev/1268011090f0
branches:  
changeset: 7457:1268011090f0
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 19:17:53 2014 -0500
description:
slice: remove getColFromL0Flag()
Subject: [x265] slice: remove getMvdL1ZeroFlag/setMvdL1ZeroFlag

details:   http://hg.videolan.org/x265/rev/b2ac589c522e
branches:  
changeset: 7458:b2ac589c522e
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 19:20:38 2014 -0500
description:
slice: remove getMvdL1ZeroFlag/setMvdL1ZeroFlag
Subject: [x265] slice: remove set/get for m_colRefIdx and m_sliceCurEndCUAddr

details:   http://hg.videolan.org/x265/rev/4701e921b33d
branches:  
changeset: 7459:4701e921b33d
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 19:33:41 2014 -0500
description:
slice: remove set/get for m_colRefIdx and m_sliceCurEndCUAddr
Subject: [x265] slice: remove setNumRefIdx

details:   http://hg.videolan.org/x265/rev/ce65e2bd2f12
branches:  
changeset: 7460:ce65e2bd2f12
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 19:41:53 2014 -0500
description:
slice: remove setNumRefIdx
Subject: [x265] slice: remove getRefPic(l,r)

details:   http://hg.videolan.org/x265/rev/e2f90ba1de4a
branches:  
changeset: 7461:e2f90ba1de4a
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:02:14 2014 -0500
description:
slice: remove getRefPic(l,r)
Subject: [x265] dpb: perform setRefPOCList() directly after setRefPicList()

details:   http://hg.videolan.org/x265/rev/c1acfb981082
branches:  
changeset: 7462:c1acfb981082
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:05:31 2014 -0500
description:
dpb: perform setRefPOCList() directly after setRefPicList()

A precursor to combining the two functions
Subject: [x265] slice: remove getRefPOC

details:   http://hg.videolan.org/x265/rev/eb2278d72afa
branches:  
changeset: 7463:eb2278d72afa
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:13:22 2014 -0500
description:
slice: remove getRefPOC
Subject: [x265] slice: merge setRefPOCList() into setRefPicList()

details:   http://hg.videolan.org/x265/rev/51caccd3b359
branches:  
changeset: 7464:51caccd3b359
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:16:46 2014 -0500
description:
slice: merge setRefPOCList() into setRefPicList()

Now both lists are always aligned so it is always safe to use the POC table
Subject: [x265] replace slice->m_refPicList[][]->getPOC() with slice->m_refPOCList[][]

details:   http://hg.videolan.org/x265/rev/4c14b90fad83
branches:  
changeset: 7465:4c14b90fad83
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:20:09 2014 -0500
description:
replace slice->m_refPicList[][]->getPOC() with slice->m_refPOCList[][]
Subject: [x265] nit

details:   http://hg.videolan.org/x265/rev/57f8e7264e9e
branches:  
changeset: 7466:57f8e7264e9e
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:20:11 2014 -0500
description:
nit
Subject: [x265] slice: remove substream array, move to frame encoder

details:   http://hg.videolan.org/x265/rev/5cbdfc4532d9
branches:  
changeset: 7467:5cbdfc4532d9
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:29:19 2014 -0500
description:
slice: remove substream array, move to frame encoder

\0/ the slice structure no longer allocates memory
Subject: [x265] wpp: generate stream size array as coded (in bytes) and pre-calculate max offset

details:   http://hg.videolan.org/x265/rev/93ab6ed75b01
branches:  
changeset: 7468:93ab6ed75b01
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 17 20:54:19 2014 -0500
description:
wpp: generate stream size array as coded (in bytes) and pre-calculate max offset

removes another per-frame alloc/free and redundant work

diffstat:

 source/Lib/TLibCommon/TComDataCU.cpp               |  127 ++++----
 source/Lib/TLibCommon/TComDataCU.h                 |    4 +-
 source/Lib/TLibCommon/TComLoopFilter.cpp           |   49 +-
 source/Lib/TLibCommon/TComLoopFilter.h             |    2 +-
 source/Lib/TLibCommon/TComPattern.cpp              |   22 +-
 source/Lib/TLibCommon/TComPrediction.cpp           |   50 +--
 source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp |   12 +-
 source/Lib/TLibCommon/TComSlice.cpp                |  139 +--------
 source/Lib/TLibCommon/TComSlice.h                  |  290 +++++---------------
 source/Lib/TLibCommon/TComTrQuant.cpp              |    8 +-
 source/Lib/TLibCommon/TComWeightPrediction.cpp     |   22 +-
 source/Lib/TLibCommon/TComWeightPrediction.h       |   10 +-
 source/Lib/TLibEncoder/TEncSearch.cpp              |  296 ++++++++++----------
 source/encoder/analysis.cpp                        |  138 ++++-----
 source/encoder/cturow.cpp                          |    1 +
 source/encoder/dpb.cpp                             |  103 +++----
 source/encoder/dpb.h                               |    4 +-
 source/encoder/encoder.cpp                         |   46 +-
 source/encoder/encoder.h                           |   11 +-
 source/encoder/entropy.cpp                         |  222 ++++++---------
 source/encoder/entropy.h                           |    6 +-
 source/encoder/frameencoder.cpp                    |  149 ++++------
 source/encoder/frameencoder.h                      |    1 +
 source/encoder/framefilter.cpp                     |    2 +-
 source/encoder/nal.cpp                             |   12 +-
 source/encoder/nal.h                               |    2 +-
 source/encoder/ratecontrol.cpp                     |   79 ++--
 source/encoder/ratecontrol.h                       |    2 +-
 source/encoder/reference.cpp                       |    2 +-
 source/encoder/reference.h                         |    4 +-
 source/encoder/sei.cpp                             |    2 +-
 source/encoder/sei.h                               |   22 +-
 source/encoder/slicetype.cpp                       |   16 +-
 source/encoder/slicetype.h                         |    4 +-
 source/encoder/weightPrediction.cpp                |   24 +-
 35 files changed, 754 insertions(+), 1129 deletions(-)

diffs (truncated from 5020 to 300 lines):

diff -r f0d157944c55 -r 93ab6ed75b01 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Thu Jul 17 00:37:00 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Thu Jul 17 20:54:19 2014 -0500
@@ -363,7 +363,7 @@ void TComDataCU::initCU(Frame* pic, uint
     m_cuMvField[0].clearMvField();
     m_cuMvField[1].clearMvField();
 
-    if (getSlice()->getPPS()->bTransquantBypassEnabled)
+    if (getSlice()->m_pps->bTransquantBypassEnabled)
     {
         uint32_t y_tmp = 1 << (g_maxLog2CUSize * 2);
         uint32_t c_tmp = 1 << (g_maxLog2CUSize * 2 - m_hChromaShift - m_vChromaShift);
@@ -402,7 +402,7 @@ void TComDataCU::initSubCU(TComDataCU* c
     uint8_t log2CUSize = g_maxLog2CUSize - depth;
     uint32_t partOffset = (cu->getTotalNumPart() >> 2) * partUnitIdx;
 
-    m_pic              = cu->getPic();
+    m_pic              = cu->m_pic;
     m_slice            = m_pic->getSlice();
     m_cuAddr           = cu->getAddr();
     m_absIdxInLCU      = cu->getZorderIdxInCU() + partOffset;
@@ -447,7 +447,7 @@ void TComDataCU::initSubCU(TComDataCU* c
     memset(m_skipFlag,           false, sizeInBool);
     memset(m_cuTransquantBypass, false, sizeInBool);
 
-    if (getSlice()->getSliceType() != I_SLICE)
+    if (getSlice()->m_sliceType != I_SLICE)
     {
         memset(m_bMergeFlags,      0, sizeInBool);
         memset(m_interDir,         0, sizeInChar);
@@ -468,7 +468,7 @@ void TComDataCU::copyToSubCU(TComDataCU*
 
     uint32_t partOffset = (cu->getTotalNumPart() >> 2) * partUnitIdx;
 
-    m_pic              = cu->getPic();
+    m_pic              = cu->m_pic;
     m_slice            = m_pic->getSlice();
     m_cuAddr           = cu->getAddr();
     m_absIdxInLCU      = cu->getZorderIdxInCU() + partOffset;
@@ -566,7 +566,7 @@ void TComDataCU::copyPartFrom(TComDataCU
     memcpy(m_trCoeff[1] + tmpC2, cu->m_trCoeff[1], sizeof(coeff_t) * tmpC);
     memcpy(m_trCoeff[2] + tmpC2, cu->m_trCoeff[2], sizeof(coeff_t) * tmpC);
 
-    if (getSlice()->getPPS()->bTransquantBypassEnabled)
+    if (getSlice()->m_pps->bTransquantBypassEnabled)
     {
         memcpy(m_tqBypassOrigYuv[0] + tmp2, cu->getLumaOrigYuv(), sizeof(pixel) * tmp);
 
@@ -630,7 +630,7 @@ void TComDataCU::copyToPic(uint8_t depth
     memcpy(cu->m_trCoeff[1] + tmpC2, m_trCoeff[1], sizeof(coeff_t) * tmpC);
     memcpy(cu->m_trCoeff[2] + tmpC2, m_trCoeff[2], sizeof(coeff_t) * tmpC);
 
-    if (getSlice()->getPPS()->bTransquantBypassEnabled)
+    if (getSlice()->m_pps->bTransquantBypassEnabled)
     {
         uint32_t tmp  = 1 << ((g_maxLog2CUSize - depth) * 2);
         uint32_t tmp2 = m_absIdxInLCU << m_pic->getLog2UnitSize() * 2;
@@ -721,7 +721,7 @@ void TComDataCU::copyToPic(uint8_t depth
     memcpy(cu->m_trCoeff[1] + tmpC2, m_trCoeff[1], sizeof(coeff_t) * tmpC);
     memcpy(cu->m_trCoeff[2] + tmpC2, m_trCoeff[2], sizeof(coeff_t) * tmpC);
 
-    if (getSlice()->getPPS()->bTransquantBypassEnabled)
+    if (getSlice()->m_pps->bTransquantBypassEnabled)
     {
         memcpy(cu->getLumaOrigYuv() + tmpY2, m_tqBypassOrigYuv[0], sizeof(pixel) * tmpY);
 
@@ -806,7 +806,7 @@ TComDataCU* TComDataCU::getPUAboveLeft(u
                 return this;
             }
         }
-        alPartUnitIdx = g_rasterToZscan[absPartIdx + getPic()->getNumPartInCU() - numPartInCUSize - 1];
+        alPartUnitIdx = g_rasterToZscan[absPartIdx + m_pic->getNumPartInCU() - numPartInCUSize - 1];
         return m_cuAbove;
     }
 
@@ -825,7 +825,7 @@ 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()->picWidthInLumaSamples)
+    if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxRT] + m_pic->getUnitSize()) >= m_slice->m_sps->picWidthInLumaSamples)
         return NULL;
 
     if (RasterAddress::lessThanCol(absPartIdxRT, numPartInCUSize - 1, numPartInCUSize))
@@ -865,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()->picHeightInLumaSamples)
+    if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxLB] + m_pic->getUnitSize()) >= m_slice->m_sps->picHeightInLumaSamples)
     {
         return NULL;
     }
@@ -904,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()->picHeightInLumaSamples)
+        m_slice->m_sps->picHeightInLumaSamples)
     {
         return NULL;
     }
@@ -947,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()->picWidthInLumaSamples)
+        m_slice->m_sps->picWidthInLumaSamples)
     {
         return NULL;
     }
@@ -1004,8 +1004,8 @@ TComDataCU* TComDataCU::getPUAboveRightA
 TComDataCU* TComDataCU::getQpMinCuLeft(uint32_t& lPartUnitIdx, uint32_t curAbsIdxInLCU)
 {
     uint32_t numPartInCUSize = m_pic->getNumPartInCUSize();
-    uint32_t absZorderQpMinCUIdx = (curAbsIdxInLCU >> ((g_maxCUDepth - getSlice()->getPPS()->maxCuDQPDepth) << 1)) <<
-        ((g_maxCUDepth - getSlice()->getPPS()->maxCuDQPDepth) << 1);
+    uint32_t absZorderQpMinCUIdx = (curAbsIdxInLCU >> ((g_maxCUDepth - getSlice()->m_pps->maxCuDQPDepth) << 1)) <<
+        ((g_maxCUDepth - getSlice()->m_pps->maxCuDQPDepth) << 1);
     uint32_t absRorderQpMinCUIdx = g_zscanToRaster[absZorderQpMinCUIdx];
 
     // check for left LCU boundary
@@ -1029,8 +1029,8 @@ TComDataCU* TComDataCU::getQpMinCuLeft(u
 TComDataCU* TComDataCU::getQpMinCuAbove(uint32_t& aPartUnitIdx, uint32_t curAbsIdxInLCU)
 {
     uint32_t numPartInCUSize = m_pic->getNumPartInCUSize();
-    uint32_t absZorderQpMinCUIdx = (curAbsIdxInLCU >> ((g_maxCUDepth - getSlice()->getPPS()->maxCuDQPDepth) << 1)) <<
-        ((g_maxCUDepth - getSlice()->getPPS()->maxCuDQPDepth) << 1);
+    uint32_t absZorderQpMinCUIdx = (curAbsIdxInLCU >> ((g_maxCUDepth - getSlice()->m_pps->maxCuDQPDepth) << 1)) <<
+        ((g_maxCUDepth - getSlice()->m_pps->maxCuDQPDepth) << 1);
     uint32_t absRorderQpMinCUIdx = g_zscanToRaster[absZorderQpMinCUIdx];
 
     // check for top LCU boundary
@@ -1074,7 +1074,7 @@ int TComDataCU::getLastValidPartIdx(int 
 
 char TComDataCU::getLastCodedQP(uint32_t absPartIdx)
 {
-    uint32_t quPartIdxMask = ~((1 << ((g_maxCUDepth - getSlice()->getPPS()->maxCuDQPDepth) << 1)) - 1);
+    uint32_t quPartIdxMask = ~((1 << ((g_maxCUDepth - getSlice()->m_pps->maxCuDQPDepth) << 1)) - 1);
     int lastValidPartIdx = getLastValidPartIdx(absPartIdx & quPartIdxMask);
 
     if (lastValidPartIdx >= 0)
@@ -1085,16 +1085,16 @@ char TComDataCU::getLastCodedQP(uint32_t
     {
         if (getZorderIdxInCU() > 0)
         {
-            return getPic()->getCU(getAddr())->getLastCodedQP(getZorderIdxInCU());
+            return m_pic->getCU(getAddr())->getLastCodedQP(getZorderIdxInCU());
         }
-        else if (getAddr() > 0 && !(getSlice()->getPPS()->bEntropyCodingSyncEnabled &&
-                                    getAddr() % getPic()->getFrameWidthInCU() == 0))
+        else if (getAddr() > 0 && !(getSlice()->m_pps->bEntropyCodingSyncEnabled &&
+                                    getAddr() % m_pic->getFrameWidthInCU() == 0))
         {
-            return getPic()->getCU(getAddr() - 1)->getLastCodedQP(getPic()->getNumPartInCU());
+            return m_pic->getCU(getAddr() - 1)->getLastCodedQP(m_pic->getNumPartInCU());
         }
         else
         {
-            return getSlice()->getSliceQp();
+            return getSlice()->m_sliceQp;
         }
     }
 }
@@ -1105,7 +1105,7 @@ char TComDataCU::getLastCodedQP(uint32_t
  */
 bool TComDataCU::isLosslessCoded(uint32_t absPartIdx)
 {
-    return getSlice()->getPPS()->bTransquantBypassEnabled && getCUTransquantBypass(absPartIdx);
+    return getSlice()->m_pps->bTransquantBypassEnabled && getCUTransquantBypass(absPartIdx);
 }
 
 /** Get allowed chroma intra modes
@@ -1210,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()->quadtreeTUMaxDepthIntra : m_slice->getSPS()->quadtreeTUMaxDepthInter;
+    uint32_t quadtreeTUMaxDepth = getPredictionMode(absPartIdx) == MODE_INTRA ? m_slice->m_sps->quadtreeTUMaxDepthIntra : m_slice->m_sps->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()->quadtreeTULog2MinSize + quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag))
+    if (log2CUSize < (m_slice->m_sps->quadtreeTULog2MinSize + quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag))
     {
         // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is < QuadtreeTULog2MinSize
-        log2MinTUSizeInCU = m_slice->getSPS()->quadtreeTULog2MinSize;
+        log2MinTUSizeInCU = m_slice->m_sps->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()->quadtreeTULog2MaxSize)
+        if (log2MinTUSizeInCU > m_slice->m_sps->quadtreeTULog2MaxSize)
         {
             // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is still > QuadtreeTULog2MaxSize
-            log2MinTUSizeInCU = m_slice->getSPS()->quadtreeTULog2MaxSize;
+            log2MinTUSizeInCU = m_slice->m_sps->quadtreeTULog2MaxSize;
         }
     }
     return log2MinTUSizeInCU;
@@ -1866,7 +1866,7 @@ void TComDataCU::getInterMergeCandidates
     uint32_t absPartAddr = m_absIdxInLCU + absPartIdx;
     const bool isInterB = getSlice()->isInterB();
 
-    maxNumMergeCand = getSlice()->getMaxNumMergeCand();
+    maxNumMergeCand = getSlice()->m_maxNumMergeCand;
 
     for (uint32_t i = 0; i < maxNumMergeCand; ++i)
     {
@@ -2016,7 +2016,7 @@ void TComDataCU::getInterMergeCandidates
             }
         }
     }
-    if (getSlice()->getEnableTMVPFlag())
+    // TMVP always enabled
     {
         //>> MTK colocated-RightBottom
         uint32_t partIdxRB;
@@ -2030,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()->picWidthInLumaSamples)  // image boundary check
+        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[uiAbsPartIdxTmp] + 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->getSPS()->picHeightInLumaSamples)
+        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[uiAbsPartIdxTmp] + m_pic->getUnitSize()) >= m_slice->m_sps->picHeightInLumaSamples)
         {
         }
         else
@@ -2124,8 +2124,8 @@ void TComDataCU::getInterMergeCandidates
                 // get Mv from cand[i] and cand[j]
                 int refIdxL0 = mvFieldNeighbours[i][0].refIdx;
                 int refIdxL1 = mvFieldNeighbours[j][1].refIdx;
-                int refPOCL0 = m_slice->getRefPOC(REF_PIC_LIST_0, refIdxL0);
-                int refPOCL1 = m_slice->getRefPOC(REF_PIC_LIST_1, refIdxL1);
+                int refPOCL0 = m_slice->m_refPOCList[0][refIdxL0];
+                int refPOCL1 = m_slice->m_refPOCList[1][refIdxL1];
                 if (!(refPOCL0 == refPOCL1 && mvFieldNeighbours[i][0].mv == mvFieldNeighbours[j][1].mv))
                 {
                     mvFieldNeighbours[arrayAddr][0].setMvField(mvFieldNeighbours[i][0].mv, refIdxL0);
@@ -2142,7 +2142,7 @@ void TComDataCU::getInterMergeCandidates
             }
         }
     }
-    int numRefIdx = (isInterB) ? X265_MIN(m_slice->getNumRefIdx(REF_PIC_LIST_0), m_slice->getNumRefIdx(REF_PIC_LIST_1)) : m_slice->getNumRefIdx(REF_PIC_LIST_0);
+    int numRefIdx = (isInterB) ? X265_MIN(m_slice->m_numRefIdx[0], m_slice->m_numRefIdx[1]) : m_slice->m_numRefIdx[0];
     int r = 0;
     int refcnt = 0;
     while (arrayAddr < maxNumMergeCand)
@@ -2349,7 +2349,7 @@ int TComDataCU::fillMvpCand(uint32_t par
         }
     }
 
-    if (getSlice()->getEnableTMVPFlag())
+    // TMVP always enabled
     {
         // Get Temporal Motion Predictor
         int refIdxCol = refIdx;
@@ -2364,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()->picWidthInLumaSamples)  // image boundary check
+        if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdx] + m_pic->getUnitSize()) >= m_slice->m_sps->picWidthInLumaSamples)  // image boundary check
         {
         }
-        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdx] + m_pic->getUnitSize()) >= m_slice->getSPS()->picHeightInLumaSamples)
+        else if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdx] + m_pic->getUnitSize()) >= m_slice->m_sps->picHeightInLumaSamples)
         {
         }
         else
@@ -2430,10 +2430,10 @@ void TComDataCU::clipMv(MV& outMV)
 {
     int mvshift = 2;
     int offset = 8;
-    int xmax = (m_slice->getSPS()->picWidthInLumaSamples + offset - m_cuPelX - 1) << mvshift;
+    int xmax = (m_slice->m_sps->picWidthInLumaSamples + offset - m_cuPelX - 1) << mvshift;
     int xmin = (-(int)g_maxCUSize - offset - (int)m_cuPelX + 1) << mvshift;
 
-    int ymax = (m_slice->getSPS()->picHeightInLumaSamples + offset - m_cuPelY - 1) << mvshift;
+    int ymax = (m_slice->m_sps->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));
@@ -2482,28 +2482,26 @@ bool TComDataCU::xAddMVPCand(MV& mvp, in
     if (!tmpCU)
         return false;
 
-    if (tmpCU->getCUMvField(picList)->getRefIdx(idx) >= 0 && m_slice->getRefPic(picList, refIdx)->getPOC() == tmpCU->getSlice()->getRefPOC(picList, tmpCU->getCUMvField(picList)->getRefIdx(idx)))
+    int refPOC = m_slice->m_refPOCList[picList][refIdx];
+    int otherPOC = tmpCU->getSlice()->m_refPOCList[picList][tmpCU->getCUMvField(picList)->getRefIdx(idx)];
+    if (tmpCU->getCUMvField(picList)->getRefIdx(idx) >= 0 && refPOC == otherPOC)
     {
         mvp = tmpCU->getCUMvField(picList)->getMv(idx);


More information about the x265-commits mailing list