Commit cd3b6960 authored by Frank Bossen's avatar Frank Bossen

Squashed commit of the following:

commit b6dc7a27e7ad4e7092048c42d42b4cbeaa7b820c
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Thu Nov 1 04:12:44 2018 +0100

    Update EncSlice.cpp

commit cd48a172780d97d34321a04fc34a490875963f4b
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Wed Oct 31 17:34:09 2018 +0100

    Update UnitTools.cpp

commit 302b8376ac309f0933dacda05396b7f2a6215960
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:15:29 2018 +0100

    Update VLCWriter.cpp

commit 57f9db29ef7ddaaf4c6d1a5e93c30b64f53c8b57
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:14:58 2018 +0100

    Update EncSlice.cpp

commit f5a1228257a4c801486ef6e05b7eadf045082a4f
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:14:29 2018 +0100

    Update EncLib.cpp

commit e896521f4e136d0f445cbb5bf099a5c834638294
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:11:45 2018 +0100

    Update EncCu.cpp

commit 5cc65b9961b854c0d6b56d87c7b8836deed4f449
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:11:12 2018 +0100

    Update CABACWriter.cpp

commit 73a06370556b6d75d2f28aba85bd16673c3c0824
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:10:34 2018 +0100

    Update EncCu.h

commit f48f7bdd41907bd02bc7d9988050e3cdce479d39
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:09:54 2018 +0100

    Update EncCfg.h

commit 95aacd519dece1f430ca6ba13a14ba7440298d96
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:08:58 2018 +0100

    Update EncAppCfg.cpp

commit a113fb3461b96a9d02b52953909302457bbf2130
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:08:11 2018 +0100

    Update EncApp.cpp

commit a4b988779611a7c5390c21d5f406b226ae9ca7db
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:07:42 2018 +0100

    Update EncAppCfg.h

commit 6860930bbf4a38437790f66a136413b1f41ab8c9
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:06:56 2018 +0100

    Update VLCReader.cpp

commit 4e2726b0dd9a0002c662f1547b2418b6c55be493
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:06:14 2018 +0100

    Update UnitTools.cpp

commit 6f08ee7fd76fee41f30ff0f796df249fd072d5f9
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:05:24 2018 +0100

    Update Slice.cpp

commit ad97fd292506773d8ca0d5f652c5dc58394e0138
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:04:19 2018 +0100

    Update InterPrediction.cpp

commit fe00146678fc247f5844556fb94fc07722bcce5a
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:03:33 2018 +0100

    Update TypeDef.h

commit 5b7e05a0b3b26d3f99d0ee251849a835fca988cb
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:02:32 2018 +0100

    Update Slice.h

commit ad1303b63b8fd19e4fa2e50c12195976135dbbd5
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 17:59:43 2018 +0100

    Update CommonDef.h

commit b3b4949ca7f30b1821b736a4b1ed22ace5473232
Author: Xiaozhen Zheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 16:54:48 2018 +0100

    Update InterPrediction.cpp

commit 66638421cb24a4a4e701307d5a2f897b2f81316b
Merge: e72c694 25e9c3a
Author: xzheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 18:03:03 2018 +0800

    Merge branch 'L0198_L0468_L0104_ATMVP_SIMP' of https://vcgit.hhi.fraunhofer.de/XZheng/VVCSoftware_VTM into L0198_L0468_L0104_ATMVP_SIMP

commit e72c694e51301e915ecbc1afaba0237b2466330f
Author: xzheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 17:46:41 2018 +0800

    Change macro name "JVET_L0198_ATMVP_8x8SUB_BLOCK" to "JVET_L0198_L0458_L0104_ATMVP_8x8SUB_BLOCK" and modify the committed codes followed by software guideline.

commit 25beb4b25913ad09d31001d1337878b2db3da7ba
Author: xzheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 00:37:06 2018 +0800

    Fix ATMVP subblock size to 8x8 and simplify ATMVP neighbouring block scan. Integration of L0198, L0468 and L0104.

commit 25e9c3a950ecb23edbc2bd4822238c27335b10cd
Author: xzheng <xiaozhen.zheng@dji.com>
Date:   Tue Oct 30 00:37:06 2018 +0800

    Fix ATMVP subblock size to 8x8 and simplify ATMVP neighbouring block scan. Integration of L0198, L0468 and L0104.
parent 6f38f417
......@@ -225,7 +225,9 @@ void EncApp::xInitLibCfg()
#else
m_cEncLib.setSubPuMvpMode ( m_SubPuMvpMode > 0 ? 3 : 0 );
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
m_cEncLib.setSubPuMvpLog2Size ( m_SubPuMvpLog2Size );
#endif
m_cEncLib.setAffine ( m_Affine );
m_cEncLib.setAffineType ( m_AffineType );
#if !REMOVE_MV_ADAPT_PREC
......
......@@ -820,7 +820,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#else
("SubPuMvp", m_SubPuMvpMode, 0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:on) [default: off]")
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
("SubPuMvpLog2Size", m_SubPuMvpLog2Size, 2u, "Sub-PU TMVP size index: 2^n")
#endif
#if !REMOVE_MV_ADAPT_PREC
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
#endif
......@@ -1974,8 +1976,10 @@ bool EncAppCfg::xCheckParameter()
#if ENABLE_WPP_PARALLELISM
xConfirmPara( !m_AltDQPCoding && ( m_numWppThreads + m_numWppExtraLines ) > 1, "Wavefront parallel encoding only supported with AltDQPCoding" );
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
xConfirmPara( m_SubPuMvpLog2Size < MIN_CU_LOG2, "SubPuMvpLog2Size must be 2 or greater." );
xConfirmPara( m_SubPuMvpLog2Size > 6, "SubPuMvpLog2Size must be 6 or smaller." );
#endif
if( m_depQuantEnabledFlag )
{
xConfirmPara( !m_useRDOQ || !m_useRDOQTS, "RDOQ and RDOQTS must be equal to 1 if dependent quantization is enabled" );
......@@ -3159,10 +3163,12 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "AffineType:%d ", m_AffineType );
}
msg(VERBOSE, "SubPuMvp:%d+%d ", m_SubPuMvpMode & 1, (m_SubPuMvpMode & 2) == 2);
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
if (m_SubPuMvpMode != 0)
{
msg(VERBOSE, "SubPuMvpLog2Size:%d ", m_SubPuMvpLog2Size);
}
#endif
msg( VERBOSE, "QTBT:%d ", m_QTBT );
if( m_QTBT ) msg( VERBOSE, "DualITree:%d ", m_dualTree );
msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU );
......
......@@ -208,7 +208,9 @@ protected:
bool m_dualTree;
bool m_LargeCTU;
int m_SubPuMvpMode;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
unsigned m_SubPuMvpLog2Size;
#endif
bool m_Affine;
bool m_AffineType;
#if !REMOVE_MV_ADAPT_PREC
......
......@@ -418,6 +418,9 @@ static const int MAX_LADF_INTERVALS = 5; /// max n
static const int NTAPS_BILINEAR = 2; ///< Number of taps for bilinear filter
#endif
#if JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
static const int ATMVP_SUB_BLOCK_SIZE = 3; ///< sub-block size for ATMVP
#endif
// ====================================================================================================================
// Macro functions
// ====================================================================================================================
......
......@@ -282,11 +282,18 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R
int numPartLine, numPartCol, puHeight, puWidth;
{
#if JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
numPartLine = std::max(puSize.width >> ATMVP_SUB_BLOCK_SIZE, 1u);
numPartCol = std::max(puSize.height >> ATMVP_SUB_BLOCK_SIZE, 1u);
puHeight = numPartCol == 1 ? puSize.height : 1 << ATMVP_SUB_BLOCK_SIZE;
puWidth = numPartLine == 1 ? puSize.width : 1 << ATMVP_SUB_BLOCK_SIZE;
#else
const Slice& slice = *pu.cs->slice;
numPartLine = std::max(puSize.width >> slice.getSubPuMvpSubblkLog2Size(), 1u);
numPartCol = std::max(puSize.height >> slice.getSubPuMvpSubblkLog2Size(), 1u);
puHeight = numPartCol == 1 ? puSize.height : 1 << slice.getSubPuMvpSubblkLog2Size();
puWidth = numPartLine == 1 ? puSize.width : 1 << slice.getSubPuMvpSubblkLog2Size();
#endif
}
PredictionUnit subPu;
......
......@@ -125,8 +125,10 @@ Slice::Slice()
, m_temporalLayerNonReferenceFlag ( false )
, m_LFCrossSliceBoundaryFlag ( false )
, m_enableTMVPFlag ( true )
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
, m_subPuMvpSubBlkSizeSliceEnable(false)
, m_subPuMvpSubBlkLog2Size (2)
#endif
, m_encCABACTableIdx (I_SLICE)
, m_iProcessingStartTime ( 0 )
, m_dProcessingTime ( 0 )
......@@ -222,8 +224,10 @@ void Slice::initSlice()
m_cabacInitFlag = false;
m_cabacWinUpdateMode = 0;
m_enableTMVPFlag = true;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
m_subPuMvpSubBlkSizeSliceEnable = false;
m_subPuMvpSubBlkLog2Size = 2;
#endif
#if JVET_L0266_HMVP
resetMotionLUTs();
#endif
......@@ -841,8 +845,10 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_bLMvdL1Zero = pSrc->m_bLMvdL1Zero;
m_LFCrossSliceBoundaryFlag = pSrc->m_LFCrossSliceBoundaryFlag;
m_enableTMVPFlag = pSrc->m_enableTMVPFlag;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
m_subPuMvpSubBlkSizeSliceEnable = pSrc->m_subPuMvpSubBlkSizeSliceEnable;
m_subPuMvpSubBlkLog2Size = pSrc->m_subPuMvpSubBlkLog2Size;
#endif
m_maxNumMergeCand = pSrc->m_maxNumMergeCand;
#if JVET_L0632_AFFINE_MERGE
m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand;
......@@ -1779,7 +1785,9 @@ SPSNext::SPSNext( SPS& sps )
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_maxTTSize { MAX_TT_SIZE, MAX_TT_SIZE_INTER, MAX_TT_SIZE_C }
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
, m_subPuLog2Size ( 0 )
#endif
, m_subPuMrgMode ( 0 )
, m_ImvMode ( IMV_OFF )
, m_MTTMode ( 0 )
......
......@@ -851,7 +851,9 @@ private:
#endif
unsigned m_dualITree;
// sub-pu merging
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
unsigned m_subPuLog2Size;
#endif
int m_subPuMrgMode;
//imv
ImvMode m_ImvMode;
......@@ -955,8 +957,10 @@ public:
bool getUseDualITree () const { return m_dualITree; }
// sub pu tmvp
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
void setSubPuMvpLog2Size ( unsigned log2Size ) { m_subPuLog2Size = log2Size; }
unsigned getSubPuMvpLog2Size () const { return m_subPuLog2Size; }
#endif
void setImvMode(ImvMode m) { m_ImvMode = m; m_IMV = m != 0; }
ImvMode getImvMode () const { return m_ImvMode; }
......@@ -1598,8 +1602,10 @@ private:
bool m_enableTMVPFlag;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
bool m_subPuMvpSubBlkSizeSliceEnable;
int m_subPuMvpSubBlkLog2Size;
#endif
SliceType m_encCABACTableIdx; // Used to transmit table selection across slices.
......@@ -1882,10 +1888,12 @@ public:
void setEncCABACTableIdx( SliceType idx ) { m_encCABACTableIdx = idx; }
SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; }
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
void setSubPuMvpSliceSubblkSizeEnable(bool b) { m_subPuMvpSubBlkSizeSliceEnable = b; }
bool getSubPuMvpSliceSubblkSizeEnable() const { return m_subPuMvpSubBlkSizeSliceEnable; }
void setSubPuMvpSubblkLog2Size(int n) { m_subPuMvpSubBlkLog2Size = n; }
int getSubPuMvpSubblkLog2Size() const { return m_subPuMvpSubBlkLog2Size; }
#endif
void setSliceQpBase( int i ) { m_iSliceQpBase = i; }
int getSliceQpBase() const { return m_iSliceQpBase; }
......
......@@ -164,6 +164,8 @@
#endif
#define JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT 1
#define JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK 1 // Fix sub-block size to 8x8 in ATMVP as proposed in L0198, L0468 and L0104
#define JVET_L0198_ATMVP_SCAN_SIMP 1 // Simplification for scan process in ATMVP cTMv derivation
// ====================================================================================================================
// NEXT software switches
......
......@@ -3682,6 +3682,20 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
bool terminate = false;
for (unsigned currRefListId = 0; currRefListId < (slice.getSliceType() == B_SLICE ? 2 : 1) && !terminate; currRefListId++)
{
#if JVET_L0198_ATMVP_SCAN_SIMP
if ( count )
{
RefPicList currRefPicList = RefPicList(slice.getCheckLDC() ? (slice.getColFromL0Flag() ? currRefListId : 1 - currRefListId) : currRefListId);
if ((mrgCtx.interDirNeighbours[0] & (1 << currRefPicList)) && slice.getRefPic(currRefPicList, mrgCtx.mvFieldNeighbours[0 * 2 + currRefPicList].refIdx) == pColPic)
{
cTMv = mrgCtx.mvFieldNeighbours[0 * 2 + currRefPicList].mv;
terminate = true;
fetchRefPicList = currRefPicList;
break;
}
}
#else
for (int uiN = 0; uiN < count && !terminate; uiN++)
{
RefPicList currRefPicList = RefPicList(slice.getCheckLDC() ? (slice.getColFromL0Flag() ? currRefListId : 1 - currRefListId) : currRefListId);
......@@ -3694,6 +3708,7 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
break;
}
}
#endif
}
///////////////////////////////////////////////////////////////////////
......@@ -3719,10 +3734,17 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
// compute the location of the current PU
Position puPos = pu.lumaPos();
Size puSize = pu.lumaSize();
#if JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
int numPartLine = std::max(puSize.width >> ATMVP_SUB_BLOCK_SIZE, 1u);
int numPartCol = std::max(puSize.height >> ATMVP_SUB_BLOCK_SIZE, 1u);
int puHeight = numPartCol == 1 ? puSize.height : 1 << ATMVP_SUB_BLOCK_SIZE;
int puWidth = numPartLine == 1 ? puSize.width : 1 << ATMVP_SUB_BLOCK_SIZE;
#else
int numPartLine = std::max(puSize.width >> slice.getSubPuMvpSubblkLog2Size(), 1u);
int numPartCol = std::max(puSize.height >> slice.getSubPuMvpSubblkLog2Size(), 1u);
int puHeight = numPartCol == 1 ? puSize.height : 1 << slice.getSubPuMvpSubblkLog2Size();
int puWidth = numPartLine == 1 ? puSize.width : 1 << slice.getSubPuMvpSubblkLog2Size();
#endif
Mv cColMv;
// use coldir.
......
......@@ -895,8 +895,9 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
if( spsNext.getUseSubPuMvp() )
{
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
READ_CODE( 3, symbol, "log2_sub_pu_tmvp_size_minus2" ); spsNext.setSubPuMvpLog2Size( symbol + MIN_CU_LOG2 );
#endif
#if ENABLE_BMS
int subPuMode = 1;
spsNext.setSubPuMvpMode( subPuMode );
......@@ -1899,6 +1900,8 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
if( firstSliceSegmentInPic )
{
pcSlice->setDefaultClpRng( *sps );
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
if (sps->getSpsNext().getUseSubPuMvp() && !pcSlice->isIntra())
{
READ_FLAG(uiCode, "slice_atmvp_subblk_size_enable_flag");
......@@ -1913,6 +1916,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
pcSlice->setSubPuMvpSubblkLog2Size(sps->getSpsNext().getSubPuMvpLog2Size());
}
}
#endif
}
if(pps->getSliceHeaderExtensionPresentFlag())
......
......@@ -507,6 +507,7 @@ void CABACWriter::coding_tree(const CodingStructure& cs, Partitioner& partitione
cuCtx.qp = CU::predictQP( cu, cuCtx.qp );
}
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
if (!cs.slice->isIntra() && m_EncCu)
{
PredictionUnit& pu = *cu.firstPU;
......@@ -517,6 +518,7 @@ void CABACWriter::coding_tree(const CodingStructure& cs, Partitioner& partitione
m_EncCu->incrementSubMergeBlkNum(layerId, 1);
}
}
#endif
// coding unit
coding_unit( cu, partitioner, cuCtx );
......
......@@ -194,7 +194,9 @@ protected:
int m_FastInterEMT;
bool m_LargeCTU;
int m_SubPuMvpMode;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
unsigned m_SubPuMvpLog2Size;
#endif
bool m_Affine;
bool m_AffineType;
#if !REMOVE_MV_ADAPT_PREC
......@@ -632,8 +634,10 @@ public:
void setSubPuMvpMode(int n) { m_SubPuMvpMode = n; }
bool getSubPuMvpMode() const { return m_SubPuMvpMode; }
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
void setSubPuMvpLog2Size(unsigned n) { m_SubPuMvpLog2Size = n; }
unsigned getSubPuMvpLog2Size() const { return m_SubPuMvpLog2Size; }
#endif
void setAffine ( bool b ) { m_Affine = b; }
bool getAffine () const { return m_Affine; }
......
......@@ -340,7 +340,9 @@ void EncCu::init( EncLib* pcEncLib, const SPS& sps PARL_PARAM( const int tId ) )
::memset(m_subMergeBlkSize, 0, sizeof(m_subMergeBlkSize));
::memset(m_subMergeBlkNum, 0, sizeof(m_subMergeBlkNum));
m_prevPOC = MAX_UINT;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
m_clearSubMergeStatic = false;
#endif
}
// ====================================================================================================================
......
......@@ -124,7 +124,9 @@ private:
unsigned int m_subMergeBlkSize[10];
unsigned int m_subMergeBlkNum[10];
unsigned int m_prevPOC;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
bool m_clearSubMergeStatic;
#endif
#if ENABLE_SPLIT_PARALLELISM || ENABLE_WPP_PARALLELISM
EncLib* m_pcEncLib;
#endif
......@@ -153,6 +155,7 @@ public:
EncModeCtrl* getModeCtrl () { return m_modeCtrl; }
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
void clearSubMergeStatics()
{
::memset(m_subMergeBlkSize, 0, sizeof(m_subMergeBlkSize));
......@@ -172,6 +175,7 @@ public:
unsigned int getPrevPOC() { return m_prevPOC; }
void setClearSubMergeStatic(bool b) { m_clearSubMergeStatic = b; }
bool getClearSubMergeStatic() { return m_clearSubMergeStatic; }
#endif
~EncCu();
......
......@@ -838,7 +838,9 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
sps.getSpsNext().setUseDualITree ( m_dualITree );
sps.getSpsNext().setSubPuMvpMode(m_SubPuMvpMode);
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
sps.getSpsNext().setSubPuMvpLog2Size(m_SubPuMvpLog2Size);
#endif
sps.getSpsNext().setImvMode ( ImvMode(m_ImvMode) );
sps.getSpsNext().setUseIMV ( m_ImvMode != IMV_OFF );
#if !REMOVE_MV_ADAPT_PREC
......
......@@ -1191,6 +1191,7 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c
#endif
m_pcCuEncoder->getModeCtrl()->setFastDeltaQp(bFastDeltaQP);
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
if (pcSlice->getSPS()->getSpsNext().getUseSubPuMvp())
{
if (!pcSlice->isIRAP() )
......@@ -1201,6 +1202,9 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c
m_pcCuEncoder->setClearSubMergeStatic(false);
}
#if JVET_L0198_ATMVP_8x8SUB_BLOCK
pcSlice->setSubPuMvpSubblkLog2Size(ATMVP_SUB_BLOCK_SIZE);
#else
unsigned int layer = pcSlice->getDepth();
unsigned int subMergeBlkSize = m_pcCuEncoder->getSubMergeBlkSize(layer);
unsigned int subMergeBlkNum = m_pcCuEncoder->getSubMergeBlkNum(layer);
......@@ -1233,6 +1237,7 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c
{
pcSlice->setSubPuMvpSliceSubblkSizeEnable(true);
}
#endif
}
else
{
......@@ -1248,6 +1253,7 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c
}
}
}
#endif
//------------------------------------------------------------------------------
// Weighted Prediction parameters estimation.
......
......@@ -609,10 +609,12 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
}
}
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
if( spsNext.getUseSubPuMvp() )
{
WRITE_CODE( spsNext.getSubPuMvpLog2Size() - MIN_CU_LOG2, 3, "log2_sub_pu_tmvp_size_minus2" );
}
#endif
if( spsNext.getUseIMV() )
{
......@@ -1350,6 +1352,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
if (pcSlice->getSPS()->getSpsNext().getUseSubPuMvp() && !pcSlice->isIntra())
{
WRITE_FLAG(pcSlice->getSubPuMvpSliceSubblkSizeEnable(), "slice_atmvp_subblk_size_enable_flag");
......@@ -1358,6 +1361,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
WRITE_CODE(pcSlice->getSubPuMvpSubblkLog2Size() - MIN_CU_LOG2, 3, "log2_slice_sub_pu_tmvp_size_minus2");
}
}
#endif
if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
{
WRITE_UVLC(0,"slice_segment_header_extension_length");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment