Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
VVCSoftware_VTM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
jvet
VVCSoftware_VTM
Commits
bacf32ad
Commit
bacf32ad
authored
Jan 18, 2019
by
Karsten Suehring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove macro JVET_L0054_MMVD
parent
1405a98b
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
21 additions
and
366 deletions
+21
-366
source/Lib/CommonLib/CommonDef.h
source/Lib/CommonLib/CommonDef.h
+0
-2
source/Lib/CommonLib/ContextModelling.cpp
source/Lib/CommonLib/ContextModelling.cpp
+0
-4
source/Lib/CommonLib/ContextModelling.h
source/Lib/CommonLib/ContextModelling.h
+0
-2
source/Lib/CommonLib/Contexts.cpp
source/Lib/CommonLib/Contexts.cpp
+0
-2
source/Lib/CommonLib/Contexts.h
source/Lib/CommonLib/Contexts.h
+0
-2
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+0
-1
source/Lib/CommonLib/Unit.cpp
source/Lib/CommonLib/Unit.cpp
+0
-10
source/Lib/CommonLib/Unit.h
source/Lib/CommonLib/Unit.h
+0
-4
source/Lib/CommonLib/UnitTools.cpp
source/Lib/CommonLib/UnitTools.cpp
+19
-43
source/Lib/CommonLib/UnitTools.h
source/Lib/CommonLib/UnitTools.h
+2
-32
source/Lib/CommonLib/dtrace_blockstatistics.cpp
source/Lib/CommonLib/dtrace_blockstatistics.cpp
+0
-14
source/Lib/CommonLib/dtrace_blockstatistics.h
source/Lib/CommonLib/dtrace_blockstatistics.h
+0
-4
source/Lib/DecoderLib/CABACReader.cpp
source/Lib/DecoderLib/CABACReader.cpp
+0
-16
source/Lib/DecoderLib/CABACReader.h
source/Lib/DecoderLib/CABACReader.h
+0
-2
source/Lib/DecoderLib/DecCu.cpp
source/Lib/DecoderLib/DecCu.cpp
+0
-14
source/Lib/EncoderLib/CABACWriter.cpp
source/Lib/EncoderLib/CABACWriter.cpp
+0
-14
source/Lib/EncoderLib/CABACWriter.h
source/Lib/EncoderLib/CABACWriter.h
+0
-2
source/Lib/EncoderLib/EncCu.cpp
source/Lib/EncoderLib/EncCu.cpp
+0
-182
source/Lib/EncoderLib/EncCu.h
source/Lib/EncoderLib/EncCu.h
+0
-4
source/Lib/EncoderLib/EncModeCtrl.cpp
source/Lib/EncoderLib/EncModeCtrl.cpp
+0
-4
source/Lib/EncoderLib/EncModeCtrl.h
source/Lib/EncoderLib/EncModeCtrl.h
+0
-4
source/Lib/EncoderLib/InterSearch.cpp
source/Lib/EncoderLib/InterSearch.cpp
+0
-4
No files found.
source/Lib/CommonLib/CommonDef.h
View file @
bacf32ad
...
...
@@ -298,14 +298,12 @@ static const int MAX_GR_ORDER_RESIDUAL = 10;
static
const
int
AFFINE_MIN_BLOCK_SIZE
=
4
;
///< Minimum affine MC block size
#if JVET_L0054_MMVD
static
const
int
MMVD_REFINE_STEP
=
8
;
///< max number of distance step
static
const
int
MMVD_MAX_REFINE_NUM
=
(
MMVD_REFINE_STEP
*
4
);
///< max number of candidate from a base candidate
static
const
int
MMVD_BASE_MV_NUM
=
2
;
///< max number of base candidate
static
const
int
MMVD_ADD_NUM
=
(
MMVD_MAX_REFINE_NUM
*
MMVD_BASE_MV_NUM
);
///< total number of mmvd candidate
static
const
int
MMVD_MRG_MAX_RD_NUM
=
MRG_MAX_NUM_CANDS
;
static
const
int
MMVD_MRG_MAX_RD_BUF_NUM
=
(
MMVD_MRG_MAX_RD_NUM
+
1
);
///< increase buffer size by 1
#endif
#if JVET_L0274
static
const
int
MAX_NUM_REG_BINS_4x4SUBBLOCK
=
32
;
///< max number of context-coded bins (incl. gt2 bins) per 4x4 subblock
...
...
source/Lib/CommonLib/ContextModelling.cpp
View file @
bacf32ad
...
...
@@ -350,9 +350,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
CHECK
(
candIdx
>=
numValidMergeCand
,
"Merge candidate does not exist"
);
pu
.
mergeFlag
=
true
;
#if JVET_L0054_MMVD
pu
.
mmvdMergeFlag
=
false
;
#endif
pu
.
interDir
=
interDirNeighbours
[
candIdx
];
pu
.
mergeIdx
=
candIdx
;
pu
.
mergeType
=
mrgTypeNeighbours
[
candIdx
];
...
...
@@ -379,7 +377,6 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
#endif
}
#if JVET_L0054_MMVD
void
MergeCtx
::
setMmvdMergeCandiInfo
(
PredictionUnit
&
pu
,
int
candIdx
)
{
const
Slice
&
slice
=
*
pu
.
cs
->
slice
;
...
...
@@ -523,4 +520,3 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
pu
.
cu
->
GBiIdx
=
(
interDirNeighbours
[
fPosBaseIdx
]
==
3
)
?
GBiIdx
[
fPosBaseIdx
]
:
GBI_DEFAULT
;
#endif
}
#endif
source/Lib/CommonLib/ContextModelling.h
View file @
bacf32ad
...
...
@@ -309,10 +309,8 @@ public:
MotionBuf
subPuMvpMiBuf
;
MotionBuf
subPuMvpExtMiBuf
;
#if JVET_L0054_MMVD
MvField
mmvdBaseMv
[
MMVD_BASE_MV_NUM
][
2
];
void
setMmvdMergeCandiInfo
(
PredictionUnit
&
pu
,
int
candIdx
);
#endif
void
setMergeInfo
(
PredictionUnit
&
pu
,
int
candIdx
);
};
...
...
source/Lib/CommonLib/Contexts.cpp
View file @
bacf32ad
...
...
@@ -343,7 +343,6 @@ const CtxSet ContextSetCfg::MergeIdx = ContextSetCfg::addCtxSet
{
CNU
,
CNU
,
CNU
,
CNU
,
CNU
,},
#endif
});
#if JVET_L0054_MMVD
const
CtxSet
ContextSetCfg
::
MmvdFlag
=
ContextSetCfg
::
addCtxSet
({
#if TRAINED_CABAC_INIT_TABLES
...
...
@@ -382,7 +381,6 @@ const CtxSet ContextSetCfg::MmvdStepMvpIdx = ContextSetCfg::addCtxSet
{
CNU
,
},
#endif
});
#endif
const
CtxSet
ContextSetCfg
::
PartSize
=
ContextSetCfg
::
addCtxSet
({
{
154
,
139
,
154
,
154
,},
...
...
source/Lib/CommonLib/Contexts.h
View file @
bacf32ad
...
...
@@ -169,11 +169,9 @@ public:
static
const
CtxSet
DeltaQP
;
static
const
CtxSet
InterDir
;
static
const
CtxSet
RefPic
;
#if JVET_L0054_MMVD
static
const
CtxSet
MmvdFlag
;
static
const
CtxSet
MmvdMergeIdx
;
static
const
CtxSet
MmvdStepMvpIdx
;
#endif
static
const
CtxSet
AffineFlag
;
static
const
CtxSet
AffineType
;
#if JVET_L0632_AFFINE_MERGE
...
...
source/Lib/CommonLib/TypeDef.h
View file @
bacf32ad
...
...
@@ -67,7 +67,6 @@
#define JVET_L0090_PAIR_AVG 1 // Add pairwise average candidates, replace HEVC combined candidates
#define JVET_L0054_MMVD 1
#define JVET_L0392_ALF_INIT_STATE 1
...
...
source/Lib/CommonLib/Unit.cpp
View file @
bacf32ad
...
...
@@ -252,9 +252,7 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
mtDepth
=
other
.
mtDepth
;
splitSeries
=
other
.
splitSeries
;
skip
=
other
.
skip
;
#if JVET_L0054_MMVD
mmvdSkip
=
other
.
mmvdSkip
;
#endif
affine
=
other
.
affine
;
affineType
=
other
.
affineType
;
triangle
=
other
.
triangle
;
...
...
@@ -289,9 +287,7 @@ void CodingUnit::initData()
mtDepth
=
0
;
splitSeries
=
0
;
skip
=
false
;
#if JVET_L0054_MMVD
mmvdSkip
=
false
;
#endif
affine
=
false
;
affineType
=
0
;
triangle
=
false
;
...
...
@@ -336,10 +332,8 @@ void PredictionUnit::initData()
// inter data
mergeFlag
=
false
;
mergeIdx
=
MAX_UCHAR
;
#if JVET_L0054_MMVD
mmvdMergeFlag
=
false
;
mmvdMergeIdx
=
MAX_UINT
;
#endif
interDir
=
MAX_UCHAR
;
mergeType
=
MRG_TYPE_DEFAULT_N
;
#if JVET_L0293_CPR
...
...
@@ -384,10 +378,8 @@ PredictionUnit& PredictionUnit::operator=(const InterPredictionData& predData)
{
mergeFlag
=
predData
.
mergeFlag
;
mergeIdx
=
predData
.
mergeIdx
;
#if JVET_L0054_MMVD
mmvdMergeFlag
=
predData
.
mmvdMergeFlag
;
mmvdMergeIdx
=
predData
.
mmvdMergeIdx
;
#endif
interDir
=
predData
.
interDir
;
mergeType
=
predData
.
mergeType
;
#if JVET_L0293_CPR
...
...
@@ -429,10 +421,8 @@ PredictionUnit& PredictionUnit::operator=( const PredictionUnit& other )
mergeFlag
=
other
.
mergeFlag
;
mergeIdx
=
other
.
mergeIdx
;
#if JVET_L0054_MMVD
mmvdMergeFlag
=
other
.
mmvdMergeFlag
;
mmvdMergeIdx
=
other
.
mmvdMergeIdx
;
#endif
interDir
=
other
.
interDir
;
mergeType
=
other
.
mergeType
;
#if JVET_L0293_CPR
...
...
source/Lib/CommonLib/Unit.h
View file @
bacf32ad
...
...
@@ -294,9 +294,7 @@ struct CodingUnit : public UnitArea
int8_t
qp
;
SplitSeries
splitSeries
;
bool
skip
;
#if JVET_L0054_MMVD
bool
mmvdSkip
;
#endif
bool
affine
;
int
affineType
;
bool
triangle
;
...
...
@@ -357,10 +355,8 @@ struct InterPredictionData
{
bool
mergeFlag
;
uint8_t
mergeIdx
;
#if JVET_L0054_MMVD
bool
mmvdMergeFlag
;
uint32_t
mmvdMergeIdx
;
#endif
uint8_t
interDir
;
uint8_t
mvpIdx
[
NUM_REF_PIC_LIST_01
];
uint8_t
mvpNum
[
NUM_REF_PIC_LIST_01
];
...
...
source/Lib/CommonLib/UnitTools.cpp
View file @
bacf32ad
...
...
@@ -725,20 +725,20 @@ bool PU::xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const
#if JVET_L0090_PAIR_AVG
bool
PU
::
addMergeHMVPCand
(
const
Slice
&
slice
,
MergeCtx
&
mrgCtx
,
bool
canFastExit
,
const
int
&
mrgCandIdx
,
const
uint32_t
maxNumMergeCandMin1
,
int
&
cnt
,
const
int
prevCnt
,
bool
isAvailableSubPu
,
unsigned
subPuMvpPos
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
int
mmvdList
#endif
)
#else
bool
PU
::
addMergeHMVPCand
(
const
Slice
&
slice
,
MergeCtx
&
mrgCtx
,
bool
isCandInter
[
MRG_MAX_NUM_CANDS
],
bool
canFastExit
,
const
int
&
mrgCandIdx
,
const
uint32_t
maxNumMergeCandMin1
,
int
&
cnt
,
const
int
prevCnt
,
bool
isAvailableSubPu
,
unsigned
subPuMvpPos
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
int
mmvdList
#endif
)
#endif
{
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
int
mrgCandIdxCPR
=
mrgCandIdx
;
#endif
MotionInfo
miNeighbor
;
...
...
@@ -767,16 +767,10 @@ bool PU::addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool isCandInter
if
(
miNeighbor
.
interDir
==
1
&&
slice
.
getRefPic
(
REF_PIC_LIST_0
,
miNeighbor
.
refIdx
[
0
])
->
getPOC
()
==
slice
.
getPOC
())
{
mrgCtx
.
mrgTypeNeighbours
[
cnt
]
=
MRG_TYPE_CPR
;
#if JVET_L0054_MMVD
if
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
mrgCandIdxCPR
++
;
#endif
}
#if JVET_L0054_MMVD
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
#endif
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
#endif
...
...
@@ -794,9 +788,7 @@ bool PU::addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool isCandInter
}
void
PU
::
getInterMergeCandidates
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
#if JVET_L0054_MMVD
int
mmvdList
,
#endif
const
int
&
mrgCandIdx
)
{
const
CodingStructure
&
cs
=
*
pu
.
cs
;
...
...
@@ -829,7 +821,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
int
cnt
=
0
;
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
int
mrgCandIdxCPR
=
mrgCandIdx
;
#endif
#if JVET_L0293_CPR && !JVET_L0369_SUBBLOCK_MERGE
...
...
@@ -869,7 +861,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
cntCPR
++
;
#endif
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
mrgCandIdxCPR
++
;
#endif
...
...
@@ -881,7 +873,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
{
mrgCtx
.
mvFieldNeighbours
[(
cnt
<<
1
)
+
1
].
setMvField
(
miLeft
.
mv
[
1
],
miLeft
.
refIdx
[
1
]);
}
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
...
...
@@ -929,7 +921,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
cntCPR
++
;
#endif
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
mrgCandIdxCPR
++
;
#endif
...
...
@@ -941,7 +933,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
{
mrgCtx
.
mvFieldNeighbours
[(
cnt
<<
1
)
+
1
].
setMvField
(
miAbove
.
mv
[
1
],
miAbove
.
refIdx
[
1
]
);
}
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
...
...
@@ -993,7 +985,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
cntCPR
++
;
#endif
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
mrgCandIdxCPR
++
;
#endif
...
...
@@ -1006,7 +998,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
mrgCtx
.
mvFieldNeighbours
[(
cnt
<<
1
)
+
1
].
setMvField
(
miAboveRight
.
mv
[
1
],
miAboveRight
.
refIdx
[
1
]
);
}
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
...
...
@@ -1057,7 +1049,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
cntCPR
++
;
#endif
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
mrgCandIdxCPR
++
;
#endif
...
...
@@ -1070,7 +1062,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
mrgCtx
.
mvFieldNeighbours
[(
cnt
<<
1
)
+
1
].
setMvField
(
miBelowLeft
.
mv
[
1
],
miBelowLeft
.
refIdx
[
1
]
);
}
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
...
...
@@ -1108,7 +1100,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
if
(
enableSubPuMvp
&&
slice
.
getEnableTMVPFlag
()
)
{
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
bool
bMrgIdxMatchATMVPCan
=
(
mrgCandIdxCPR
==
cnt
);
#else
bool
bMrgIdxMatchATMVPCan
=
(
mrgCandIdx
==
cnt
);
...
...
@@ -1117,9 +1109,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
isAvailableSubPu
=
cs
.
sps
->
getSpsNext
().
getUseATMVP
()
&&
getInterMergeSubPuMvpCand
(
pu
,
mrgCtx
,
tmpLICFlag
,
cnt
#if JVET_L0054_MMVD
,
mmvdList
#endif
#if JVET_L0293_CPR
,
cntCPR
#endif
...
...
@@ -1188,7 +1178,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
cntCPR
++
;
#endif
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
mrgCandIdxCPR
++
;
#endif
...
...
@@ -1201,7 +1191,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
mrgCtx
.
mvFieldNeighbours
[(
cnt
<<
1
)
+
1
].
setMvField
(
miAboveLeft
.
mv
[
1
],
miAboveLeft
.
refIdx
[
1
]
);
}
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
...
...
@@ -1338,7 +1328,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if JVET_L0646_GBI
mrgCtx
.
GBiIdx
[
uiArrayAddr
]
=
GBI_DEFAULT
;
#endif
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
if
(
mrgCandIdxCPR
==
cnt
&&
canFastExit
)
#else
if
(
mrgCandIdx
==
cnt
&&
canFastExit
)
...
...
@@ -1367,13 +1357,13 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#endif
#if JVET_L0090_PAIR_AVG
bool
bFound
=
addMergeHMVPCand
(
slice
,
mrgCtx
,
canFastExit
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
(
mmvdList
!=
0
&&
mrgCandIdx
!=
-
1
)
?
(
const
int
)
mrgCandIdxCPR
:
mrgCandIdx
#else
,
mrgCandIdx
#endif
,
maxNumMergeCandMin1
,
cnt
,
cnt
,
isAvailableSubPu
,
subPuMvpPos
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
mmvdList
#endif
);
...
...
@@ -1385,7 +1375,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
,
mrgCandIdx
#endif
,
maxNumMergeCandMin1
,
cnt
,
cnt
,
isAvailableSubPu
,
subPuMvpPos
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
mmvdList
#endif
);
...
...
@@ -1661,7 +1651,6 @@ static int xGetDistScaleFactor(const int &iCurrPOC, const int &iCurrRefPOC, cons
return
iScale
;
}
}
#if JVET_L0054_MMVD
int
PU
::
getDistScaleFactor
(
const
int
&
currPOC
,
const
int
&
currRefPOC
,
const
int
&
colPOC
,
const
int
&
colRefPOC
)
{
return
xGetDistScaleFactor
(
currPOC
,
currRefPOC
,
colPOC
,
colRefPOC
);
...
...
@@ -1713,7 +1702,6 @@ void PU::getInterMMVDMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx,
}
}
}
#endif
bool
PU
::
getColocatedMVP
(
const
PredictionUnit
&
pu
,
const
RefPicList
&
eRefPicList
,
const
Position
&
_pos
,
Mv
&
rcMv
,
const
int
&
refIdx
)
{
// don't perform MV compression when generally disabled or subPuMvp is used
...
...
@@ -3220,9 +3208,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
mrgCtx
.
numValidMergeCand
=
pos
;
isAvailableSubPu
=
getInterMergeSubPuMvpCand
(
pu
,
mrgCtx
,
tmpLICFlag
,
pos
#if JVET_L0054_MMVD
,
0
#endif
#if JVET_L0293_CPR
,
cntCPR
#endif
...
...
@@ -3810,9 +3796,7 @@ void clipColBlkMv(int& mvX, int& mvY, const PredictionUnit& pu)
#endif
bool
PU
::
getInterMergeSubPuMvpCand
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
bool
&
LICFlag
,
const
int
count
#if JVET_L0054_MMVD
,
int
mmvdList
#endif
#if JVET_L0293_CPR
,
const
int
countCPR
#endif
...
...
@@ -3964,10 +3948,8 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
{
return
false
;
}
#if JVET_L0054_MMVD
if
(
mmvdList
!=
1
)
{
#endif
#if JVET_L0257_ATMVP_COLBLK_CLIP
int
xOff
=
(
puWidth
>>
1
)
+
tempX
;
int
yOff
=
(
puHeight
>>
1
)
+
tempY
;
...
...
@@ -4045,9 +4027,7 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
mb
.
subBuf
(
g_miScaling
.
scale
(
Position
{
x
,
y
}
-
pu
.
lumaPos
()),
g_miScaling
.
scale
(
Size
(
puWidth
,
puHeight
))).
fill
(
mi
);
}
}
#if JVET_L0054_MMVD
}
#endif
return
true
;
}
...
...
@@ -4178,9 +4158,7 @@ void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interP
// this function is never called for merge
THROW
(
"unexpected"
);
PU
::
getInterMergeCandidates
(
pu
,
mrgCtx
#if JVET_L0054_MMVD
,
0
#endif
);
PU
::
restrictBiPredMergeCands
(
pu
,
mrgCtx
);
...
...
@@ -4785,9 +4763,7 @@ void CU::resetMVDandMV2Int( CodingUnit& cu, InterPrediction *interPred )
else
{
PU
::
getInterMergeCandidates
(
pu
,
mrgCtx
#if JVET_L0054_MMVD
,
0
#endif
);
PU
::
restrictBiPredMergeCands
(
pu
,
mrgCtx
);
...
...
source/Lib/CommonLib/UnitTools.h
View file @
bacf32ad
...
...
@@ -111,14 +111,10 @@ namespace PU
void
getIntraChromaCandModes
(
const
PredictionUnit
&
pu
,
unsigned
modeList
[
NUM_CHROMA_MODE
]);
uint32_t
getFinalIntraMode
(
const
PredictionUnit
&
pu
,
const
ChannelType
&
chType
);
void
getInterMergeCandidates
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
#if JVET_L0054_MMVD
int
mmvdList
,
#endif
const
int
&
mrgCandIdx
=
-
1
);
#if JVET_L0054_MMVD
void
getInterMMVDMergeCandidates
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
const
int
&
mrgCandIdx
=
-
1
);
int
getDistScaleFactor
(
const
int
&
currPOC
,
const
int
&
currRefPOC
,
const
int
&
colPOC
,
const
int
&
colRefPOC
);
#endif
bool
isDiffMER
(
const
PredictionUnit
&
pu
,
const
PredictionUnit
&
pu2
);
bool
getColocatedMVP
(
const
PredictionUnit
&
pu
,
const
RefPicList
&
eRefPicList
,
const
Position
&
pos
,
Mv
&
rcMv
,
const
int
&
refIdx
);
void
fillMvpCand
(
PredictionUnit
&
pu
,
const
RefPicList
&
eRefPicList
,
const
int
&
refIdx
,
AMVPInfo
&
amvpInfo
);
...
...
@@ -129,13 +125,13 @@ namespace PU
bool
xCheckSimilarMotion
(
const
int
mergeCandIndex
,
const
int
prevCnt
,
const
MergeCtx
mergeCandList
,
bool
hasPruned
[
MRG_MAX_NUM_CANDS
]);
#if JVET_L0090_PAIR_AVG
bool
addMergeHMVPCand
(
const
Slice
&
slice
,
MergeCtx
&
mrgCtx
,
bool
canFastExit
,
const
int
&
mrgCandIdx
,
const
uint32_t
maxNumMergeCandMin1
,
int
&
cnt
,
const
int
prevCnt
,
bool
isAvailableSubPu
,
unsigned
subPuMvpPos
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
int
mmvdList
#endif
);
#else
bool
addMergeHMVPCand
(
const
Slice
&
slice
,
MergeCtx
&
mrgCtx
,
bool
isCandInter
[
MRG_MAX_NUM_CANDS
],
bool
canFastExit
,
const
int
&
mrgCandIdx
,
const
uint32_t
maxNumMergeCandMin1
,
int
&
cnt
,
const
int
prevCnt
,
bool
isAvailableSubPu
,
unsigned
subPuMvpPos
#if JVET_L0293_CPR
&& JVET_L0054_MMVD
#if JVET_L0293_CPR
,
int
mmvdList
#endif
);
...
...
@@ -163,9 +159,7 @@ namespace PU
,
bool
setHighPrec
=
false
);
bool
getInterMergeSubPuMvpCand
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
bool
&
LICFlag
,
const
int
count
#if JVET_L0054_MMVD
,
int
mmvdList
#endif
#if JVET_L0293_CPR
,
const
int
countCPR
#endif
...
...
@@ -220,19 +214,11 @@ namespace TU
uint32_t
getCtuAddr
(
const
Position
&
pos
,
const
PreCalcValues
&
pcv
);
template
<
typename
T
,
size_t
N
>
#if JVET_L0054_MMVD
uint32_t
updateCandList
(
T
uiMode
,
double
uiCost
,
static_vector
<
T
,
N
>&
candModeList
,
static_vector
<
double
,
N
>&
candCostList
#if JVET_L0283_MULTI_REF_LINE
,
static_vector
<
int
,
N
>&
extendRefList
,
int
extendRef
#endif
,
size_t
uiFastCandNum
=
N
,
int
*
iserttPos
=
nullptr
)
#else
uint32_t
updateCandList
(
T
uiMode
,
double
uiCost
,
static_vector
<
T
,
N
>&
candModeList
,
static_vector
<
double
,
N
>&
candCostList
#if JVET_L0283_MULTI_REF_LINE
,
static_vector
<
int
,
N
>&
extendRefList
,
int
extendRef
#endif
,
size_t
uiFastCandNum
=
N
)
#endif
{
CHECK
(
std
::
min
(
uiFastCandNum
,
candModeList
.
size
()
)
!=
std
::
min
(
uiFastCandNum
,
candCostList
.
size
()
),
"Sizes do not match!"
);
CHECK
(
uiFastCandNum
>
candModeList
.
capacity
(),
"The vector is to small to hold all the candidates!"
);
...
...
@@ -267,12 +253,10 @@ uint32_t updateCandList( T uiMode, double uiCost, static_vector<T, N>& candModeL
extendRefList
[
currSize
-
shift
]
=
extendRef
;
}
#endif
#if JVET_L0054_MMVD
if
(
iserttPos
!=
nullptr
)
{
*
iserttPos
=
int
(
currSize
-
shift
);
}
#endif
return
1
;
}
else
if
(
currSize
<
uiFastCandNum
)
...
...
@@ -285,29 +269,21 @@ uint32_t updateCandList( T uiMode, double uiCost, static_vector<T, N>& candModeL
extendRefList
.
insert
(
extendRefList
.
end
()
-
shift
,
extendRef
);
}
#endif
#if JVET_L0054_MMVD
if
(
iserttPos
!=
nullptr
)
{
*
iserttPos
=
int
(
candModeList
.
size
()
-
shift
-
1
);
}
#endif
return
1
;
}
#if JVET_L0054_MMVD
if
(
iserttPos
!=
nullptr
)
{
*
iserttPos
=
-
1
;
}
#endif
return
0
;
}
template
<
typename
T
,
size_t
N
>
#if JVET_L0054_MMVD
uint32_t
updateDoubleCandList
(
T
mode
,
double
cost
,
static_vector
<
T
,
N
>&
candModeList
,
static_vector
<
double
,
N
>&
candCostList
,
static_vector
<
T
,
N
>&
candModeList2
,
T
mode2
,
size_t
fastCandNum
=
N
,
int
*
iserttPos
=
nullptr
)
#else
uint32_t
updateDoubleCandList
(
T
mode
,
double
cost
,
static_vector
<
T
,
N
>&
candModeList
,
static_vector
<
double
,
N
>&
candCostList
,
static_vector
<
T
,
N
>&
candModeList2
,
T
mode2
,
size_t
fastCandNum
=
N
)
#endif
{
CHECK
(
std
::
min
(
fastCandNum
,
candModeList
.
size
())
!=
std
::
min
(
fastCandNum
,
candCostList
.
size
()),
"Sizes do not match!"
);
CHECK
(
fastCandNum
>
candModeList
.
capacity
(),
"The vector is to small to hold all the candidates!"
);
...
...
@@ -332,12 +308,10 @@ uint32_t updateDoubleCandList(T mode, double cost, static_vector<T, N>& candMode
candModeList
[
currSize
-
shift
]
=
mode
;
candModeList2
[
currSize
-
shift
]
=
mode2
;
candCostList
[
currSize
-
shift
]
=
cost
;
#if JVET_L0054_MMVD
if
(
iserttPos
!=
nullptr
)
{
*
iserttPos
=
int
(
currSize
-
shift
);
}
#endif
return
1
;
}
else
if
(
currSize
<
fastCandNum
)
...
...
@@ -345,21 +319,17 @@ uint32_t updateDoubleCandList(T mode, double cost, static_vector<T, N>& candMode
candModeList
.
insert
(
candModeList
.
end
()
-
shift
,
mode
);
candModeList2
.
insert
(
candModeList2
.
end
()
-
shift
,
mode2
);
candCostList
.
insert
(
candCostList
.
end
()
-
shift
,
cost
);
#if JVET_L0054_MMVD
if
(
iserttPos
!=
nullptr
)
{
*
iserttPos
=
int
(
candModeList
.
size
()
-
shift
-
1
);
}
#endif
return
1
;
}
#if JVET_L0054_MMVD
if
(
iserttPos
!=
nullptr
)
{
*
iserttPos
=
-
1
;
}
#endif
return
0
;
}
...
...
source/Lib/CommonLib/dtrace_blockstatistics.cpp
View file @
bacf32ad
...
...
@@ -441,9 +441,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
cu
,
GetBlockStatisticName
(
BlockStatistic
::
EMTFlag
),
cu
.
emtFlag
);
}
#if JVET_L0054_MMVD
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
cu
,
GetBlockStatisticName
(
BlockStatistic
::
MMVDSkipFlag
),
cu
.
mmvdSkip
);
#endif
}
else
if
(
chType
==
CHANNEL_TYPE_CHROMA
)
{
...
...
@@ -481,13 +479,11 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MergeIdx
),
pu
.
mergeIdx
);
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MergeType
),
pu
.
mergeType
);
#if JVET_L0054_MMVD
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MMVDMergeFlag
),
pu
.
mmvdMergeFlag
);
if
(
cu
.
mmvdSkip
||
pu
.
mmvdMergeFlag
)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MMVDMergeIdx
),
pu
.
mmvdMergeIdx
);
}
#endif
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_ALL
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MHIntraFlag
),
pu
.
mhIntraFlag
);
if
(
pu
.
mhIntraFlag
)
{
...
...
@@ -780,14 +776,10 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
#endif
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
cu
,
GetBlockStatisticName
(
BlockStatistic
::
SkipFlag
),
cu
.
skip
);
#if JVET_L0054_MMVD
if
(
cu
.
skip
)
{
#if JVET_L0054_MMVD
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
cu
,
GetBlockStatisticName
(
BlockStatistic
::
MMVDSkipFlag
),
cu
.
mmvdSkip
);
#endif
}
#endif
}
// prediction mode and partitioning data
...
...
@@ -857,27 +849,21 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MergeIdx
),
pu
.
mergeIdx
);
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MergeType
),
pu
.
mergeType
);
#if JVET_L0054_MMVD
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MMVDMergeFlag
),
pu
.
mmvdMergeFlag
);
if
(
pu
.
mmvdMergeFlag
)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MMVDMergeIdx
),
pu
.
mmvdMergeIdx
);
}
#endif
#if JVET_L0369_SUBBLOCK_MERGE
if
(
!
cu
.
cs
->
slice
->
isIntra
()
&&
cu
.
cs
->
sps
->
getSpsNext
().
getUseAffine
()
&&
cu
.
lumaSize
().
width
>=
8
&&
cu
.
lumaSize
().
height
>=
8
#if JVET_L0054_MMVD
&&
!
pu
.
mmvdMergeFlag
&&
!
cu
.
mmvdSkip
#endif
)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
AffineFlag
),
pu
.
cu
->
affine
);
}
#endif
if
(
pu
.
cs
->
sps
->
getSpsNext
().
getUseMHIntra
()
&&
!
pu
.
cu
->
skip
&&
!
pu
.
cu
->
affine
&&
!
(
pu
.
cu
->
lwidth
()
*
pu
.
cu
->
lheight
()
<
64
||
pu
.
cu
->
lwidth
()
>=
MAX_CU_SIZE
||
pu
.
cu
->
lheight
()
>=
MAX_CU_SIZE
)
#if JVET_L0054_MMVD
&&
!
pu
.
mmvdMergeFlag
#endif
)
{
DTRACE_BLOCK_SCALAR
(
g_trace_ctx
,
D_BLOCK_STATISTICS_CODED
,
pu
,
GetBlockStatisticName
(
BlockStatistic
::
MHIntraFlag
),
pu
.
mhIntraFlag
);
...
...
source/Lib/CommonLib/dtrace_blockstatistics.h
View file @
bacf32ad
...
...
@@ -101,11 +101,9 @@ enum class BlockStatistic {
AffineMVL0
,
AffineMVL1
,
AffineType
,