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
13
Merge Requests
13
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
3fdc7d65
Commit
3fdc7d65
authored
Nov 01, 2018
by
rlliao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L0124 & L0208 Triangular shape prediction unit with the bug fix
parent
ccaa3ca0
Changes
37
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1818 additions
and
1 deletion
+1818
-1
cfg/encoder_lowdelay_vtm.cfg
cfg/encoder_lowdelay_vtm.cfg
+1
-0
cfg/encoder_randomaccess_vtm.cfg
cfg/encoder_randomaccess_vtm.cfg
+1
-0
source/App/EncoderApp/EncApp.cpp
source/App/EncoderApp/EncApp.cpp
+3
-0
source/App/EncoderApp/EncAppCfg.cpp
source/App/EncoderApp/EncAppCfg.cpp
+9
-0
source/App/EncoderApp/EncAppCfg.h
source/App/EncoderApp/EncAppCfg.h
+3
-0
source/Lib/CommonLib/CodingStatistics.h
source/Lib/CommonLib/CodingStatistics.h
+8
-0
source/Lib/CommonLib/CommonDef.h
source/Lib/CommonLib/CommonDef.h
+8
-0
source/Lib/CommonLib/ContextModelling.cpp
source/Lib/CommonLib/ContextModelling.cpp
+16
-0
source/Lib/CommonLib/ContextModelling.h
source/Lib/CommonLib/ContextModelling.h
+3
-0
source/Lib/CommonLib/Contexts.cpp
source/Lib/CommonLib/Contexts.cpp
+16
-0
source/Lib/CommonLib/Contexts.h
source/Lib/CommonLib/Contexts.h
+4
-0
source/Lib/CommonLib/InterPrediction.cpp
source/Lib/CommonLib/InterPrediction.cpp
+684
-0
source/Lib/CommonLib/InterPrediction.h
source/Lib/CommonLib/InterPrediction.h
+8
-0
source/Lib/CommonLib/Rom.cpp
source/Lib/CommonLib/Rom.cpp
+84
-0
source/Lib/CommonLib/Rom.h
source/Lib/CommonLib/Rom.h
+10
-0
source/Lib/CommonLib/Slice.cpp
source/Lib/CommonLib/Slice.cpp
+6
-0
source/Lib/CommonLib/Slice.h
source/Lib/CommonLib/Slice.h
+7
-0
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+10
-0
source/Lib/CommonLib/Unit.cpp
source/Lib/CommonLib/Unit.cpp
+6
-0
source/Lib/CommonLib/Unit.h
source/Lib/CommonLib/Unit.h
+3
-0
source/Lib/CommonLib/UnitTools.cpp
source/Lib/CommonLib/UnitTools.cpp
+489
-0
source/Lib/CommonLib/UnitTools.h
source/Lib/CommonLib/UnitTools.h
+7
-0
source/Lib/DecoderLib/CABACReader.cpp
source/Lib/DecoderLib/CABACReader.cpp
+39
-0
source/Lib/DecoderLib/CABACReader.h
source/Lib/DecoderLib/CABACReader.h
+3
-0
source/Lib/DecoderLib/DecCu.cpp
source/Lib/DecoderLib/DecCu.cpp
+27
-0
source/Lib/DecoderLib/DecCu.h
source/Lib/DecoderLib/DecCu.h
+4
-0
source/Lib/DecoderLib/VLCReader.cpp
source/Lib/DecoderLib/VLCReader.cpp
+3
-0
source/Lib/EncoderLib/CABACWriter.cpp
source/Lib/EncoderLib/CABACWriter.cpp
+37
-0
source/Lib/EncoderLib/CABACWriter.h
source/Lib/EncoderLib/CABACWriter.h
+3
-0
source/Lib/EncoderLib/EncCfg.h
source/Lib/EncoderLib/EncCfg.h
+7
-0
source/Lib/EncoderLib/EncCu.cpp
source/Lib/EncoderLib/EncCu.cpp
+260
-0
source/Lib/EncoderLib/EncCu.h
source/Lib/EncoderLib/EncCu.h
+13
-0
source/Lib/EncoderLib/EncLib.cpp
source/Lib/EncoderLib/EncLib.cpp
+3
-0
source/Lib/EncoderLib/EncModeCtrl.cpp
source/Lib/EncoderLib/EncModeCtrl.cpp
+18
-1
source/Lib/EncoderLib/EncModeCtrl.h
source/Lib/EncoderLib/EncModeCtrl.h
+6
-0
source/Lib/EncoderLib/InterSearch.cpp
source/Lib/EncoderLib/InterSearch.cpp
+6
-0
source/Lib/EncoderLib/VLCWriter.cpp
source/Lib/EncoderLib/VLCWriter.cpp
+3
-0
No files found.
cfg/encoder_lowdelay_vtm.cfg
View file @
3fdc7d65
...
...
@@ -130,6 +130,7 @@ ALF : 1
GBi : 1
GBiFast : 1
MHIntra : 1
Triangle : 1
# Fast tools
PBIntraFast : 1
...
...
cfg/encoder_randomaccess_vtm.cfg
View file @
3fdc7d65
...
...
@@ -145,6 +145,7 @@ GBi : 1
GBiFast : 1
BIO : 1
MHIntra : 1
Triangle : 1
# Fast tools
PBIntraFast : 1
...
...
source/App/EncoderApp/EncApp.cpp
View file @
3fdc7d65
...
...
@@ -263,6 +263,9 @@ void EncApp::xInitLibCfg()
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
m_cEncLib
.
setUseMHIntra
(
m_MHIntra
);
#endif
#if JVET_L0124_L0208_TRIANGLE
m_cEncLib
.
setUseTriangle
(
m_Triangle
);
#endif
// ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here
...
...
source/App/EncoderApp/EncAppCfg.cpp
View file @
3fdc7d65
...
...
@@ -868,6 +868,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
(
"MHIntra"
,
m_MHIntra
,
false
,
"Enable MHIntra mode"
)
#endif
#if JVET_L0124_L0208_TRIANGLE
(
"Triangle"
,
m_Triangle
,
false
,
"Enable triangular shape motion vector prediction (0:off, 1:on) [default: on]"
)
#endif
// ADD_NEW_TOOL : (encoder app) add parsing parameters here
...
...
@@ -1966,6 +1969,9 @@ bool EncAppCfg::xCheckParameter()
#if JVET_L0646_GBI
xConfirmPara
(
m_GBi
,
"GBi is only allowed with NEXT profile"
);
xConfirmPara
(
m_GBiFast
,
"GBiFast is only allowed with NEXT profile"
);
#endif
#if JVET_L0124_L0208_TRIANGLE
xConfirmPara
(
m_Triangle
,
"Triangle is only allowed with NEXT profile"
);
#endif
// ADD_NEW_TOOL : (parameter check) add a check for next tools here
}
...
...
@@ -3191,6 +3197,9 @@ void EncAppCfg::xPrintParameter()
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
msg
(
VERBOSE
,
"MHIntra:%d "
,
m_MHIntra
);
#endif
#if JVET_L0124_L0208_TRIANGLE
msg
(
VERBOSE
,
"Triangle:%d "
,
m_Triangle
);
#endif
}
// ADD_NEW_TOOL (add some output indicating the usage of tools)
...
...
source/App/EncoderApp/EncAppCfg.h
View file @
3fdc7d65
...
...
@@ -240,6 +240,9 @@ protected:
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
bool
m_MHIntra
;
#endif
#if JVET_L0124_L0208_TRIANGLE
bool
m_Triangle
;
#endif
// ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here
...
...
source/Lib/CommonLib/CodingStatistics.h
View file @
3fdc7d65
...
...
@@ -108,6 +108,10 @@ enum CodingStatisticsType
STATS__TOOL_EMT
,
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
STATS__CABAC_BITS__MH_INTRA_FLAG
,
#endif
#if JVET_L0124_L0208_TRIANGLE
STATS__CABAC_BITS__TRIANGLE_FLAG
,
STATS__CABAC_BITS__TRIANGLE_INDEX
,
#endif
STATS__TOOL_TOTAL
,
STATS__NUM_STATS
...
...
@@ -183,6 +187,10 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__EMT_TU_INDX"
,
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
"CABAC_BITS__MH_INTRA_FLAG"
,
#endif
#if JVET_L0124_L0208_TRIANGLE
"CABAC_BITS__TRIANGLE_FLAG"
,
"CABAC_BITS__TRIANGLE_INDEX"
,
#endif
"CABAC_BITS__OTHER"
,
"CABAC_BITS__INVALID"
,
...
...
source/Lib/CommonLib/CommonDef.h
View file @
3fdc7d65
...
...
@@ -415,6 +415,14 @@ static const int MAX_LADF_INTERVALS = 5; /// max n
static
const
int
NTAPS_BILINEAR
=
2
;
///< Number of taps for bilinear filter
#endif
#if JVET_L0124_L0208_TRIANGLE
static
const
int
TRIANGLE_MAX_NUM_UNI_CANDS
=
5
;
static
const
int
TRIANGLE_MAX_NUM_CANDS_MEM
=
7
;
static
const
int
TRIANGLE_MAX_NUM_CANDS
=
40
;
static
const
int
TRIANGLE_MAX_NUM_SATD_CANDS
=
3
;
static
const
int
TRIANGLE_MIN_SIZE
=
8
*
8
;
#endif
// ====================================================================================================================
// Macro functions
// ====================================================================================================================
...
...
source/Lib/CommonLib/ContextModelling.cpp
View file @
3fdc7d65
...
...
@@ -359,6 +359,22 @@ unsigned DeriveCtx::CtxBTsplit(const CodingStructure& cs, Partitioner& partition
return
ctx
;
}
#if JVET_L0124_L0208_TRIANGLE
unsigned
DeriveCtx
::
CtxTriangleFlag
(
const
CodingUnit
&
cu
)
{
const
CodingStructure
*
cs
=
cu
.
cs
;
unsigned
ctxId
=
0
;
const
CodingUnit
*
cuLeft
=
cs
->
getCURestricted
(
cu
.
lumaPos
().
offset
(
-
1
,
0
),
cu
,
CH_L
);
ctxId
=
(
cuLeft
&&
cuLeft
->
triangle
)
?
1
:
0
;
const
CodingUnit
*
cuAbove
=
cs
->
getCURestricted
(
cu
.
lumaPos
().
offset
(
0
,
-
1
),
cu
,
CH_L
);
ctxId
+=
(
cuAbove
&&
cuAbove
->
triangle
)
?
1
:
0
;
return
ctxId
;
}
#endif
void
MergeCtx
::
setMergeInfo
(
PredictionUnit
&
pu
,
int
candIdx
)
{
...
...
source/Lib/CommonLib/ContextModelling.h
View file @
3fdc7d65
...
...
@@ -353,6 +353,9 @@ unsigned CtxInterDir ( const PredictionUnit& pu );
unsigned
CtxSkipFlag
(
const
CodingUnit
&
cu
);
unsigned
CtxIMVFlag
(
const
CodingUnit
&
cu
);
unsigned
CtxAffineFlag
(
const
CodingUnit
&
cu
);
#if JVET_L0124_L0208_TRIANGLE
unsigned
CtxTriangleFlag
(
const
CodingUnit
&
cu
);
#endif
}
#endif // __CONTEXTMODELLING__
source/Lib/CommonLib/Contexts.cpp
View file @
3fdc7d65
...
...
@@ -823,6 +823,22 @@ const CtxSet ContextSetCfg::MHIntraPredMode = ContextSetCfg::addCtxSet
});
#endif
#if JVET_L0124_L0208_TRIANGLE
const
CtxSet
ContextSetCfg
::
TriangleFlag
=
ContextSetCfg
::
addCtxSet
({
{
151
,
137
,
154
,
},
{
151
,
137
,
154
,
},
{
CNU
,
CNU
,
CNU
,
},
});
const
CtxSet
ContextSetCfg
::
TriangleIdx
=
ContextSetCfg
::
addCtxSet
({
{
140
,
},
{
140
,
},
{
CNU
,
},
});
#endif
const
unsigned
ContextSetCfg
::
NumberOfContexts
=
(
unsigned
)
ContextSetCfg
::
sm_InitTables
[
0
].
size
();
...
...
source/Lib/CommonLib/Contexts.h
View file @
3fdc7d65
...
...
@@ -206,6 +206,10 @@ public:
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
static
const
CtxSet
MHIntraFlag
;
static
const
CtxSet
MHIntraPredMode
;
#endif
#if JVET_L0124_L0208_TRIANGLE
static
const
CtxSet
TriangleFlag
;
static
const
CtxSet
TriangleIdx
;
#endif
static
const
unsigned
NumberOfContexts
;
...
...
source/Lib/CommonLib/InterPrediction.cpp
View file @
3fdc7d65
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/InterPrediction.h
View file @
3fdc7d65
...
...
@@ -91,6 +91,9 @@ protected:
RdCost
*
m_pcRdCost
;
int
m_iRefListIdx
;
#if JVET_L0124_L0208_TRIANGLE
PelStorage
m_tmpTriangleBuf
;
#endif
#if JVET_L0265_AFF_MINIMUM4X4
Mv
*
m_storedMv
;
#endif
...
...
@@ -149,6 +152,11 @@ public:
void
motionCompensation
(
CodingUnit
&
cu
,
const
RefPicList
&
eRefPicList
=
REF_PIC_LIST_X
);
#if JVET_L0124_L0208_TRIANGLE
void
motionCompensation4Triangle
(
CodingUnit
&
cu
,
MergeCtx
&
TriangleMrgCtx
,
const
bool
SplitDir
,
const
uint8_t
CandIdx0
,
const
uint8_t
CandIdx1
);
void
TriangleWeighting
(
PredictionUnit
&
pu
,
bool
ehanced
,
const
bool
SplitDir
,
int32_t
channel
,
PelUnitBuf
&
PredDst
,
PelUnitBuf
&
PredSrc0
,
PelUnitBuf
&
PredSrc1
);
#endif
#if JVET_J0090_MEMORY_BANDWITH_MEASURE
void
cacheAssign
(
CacheModel
*
cache
);
#endif
...
...
source/Lib/CommonLib/Rom.cpp
View file @
3fdc7d65
...
...
@@ -528,6 +528,30 @@ void initROM()
//--------------------------------------------------------------------------------------------------
}
}
#if JVET_L0124_L0208_TRIANGLE
for
(
int
IdxH
=
MAX_CU_DEPTH
-
MIN_CU_LOG2
;
IdxH
>=
0
;
--
IdxH
)
{
for
(
int
IdxW
=
MAX_CU_DEPTH
-
MIN_CU_LOG2
;
IdxW
>=
0
;
--
IdxW
)
{
int
numW
=
1
<<
IdxW
;
int
numH
=
1
<<
IdxH
;
int
ratioW
=
std
::
max
(
0
,
IdxW
-
IdxH
);
int
ratioH
=
std
::
max
(
0
,
IdxH
-
IdxW
);
int
sum
=
std
::
max
(
(
numW
>>
ratioW
),
(
numH
>>
ratioH
)
)
-
1
;
for
(
int
y
=
0
;
y
<
numH
;
y
++
)
{
int
IdxY
=
y
>>
ratioH
;
for
(
int
x
=
0
;
x
<
numW
;
x
++
)
{
int
IdxX
=
x
>>
ratioW
;
g_TriangleMvStorage
[
TRIANGLE_DIR_135
][
IdxH
][
IdxW
][
y
][
x
]
=
(
IdxX
==
IdxY
)
?
2
:
(
IdxX
>
IdxY
?
0
:
1
);
g_TriangleMvStorage
[
TRIANGLE_DIR_45
][
IdxH
][
IdxW
][
y
][
x
]
=
(
IdxX
+
IdxY
==
sum
)
?
2
:
(
IdxX
+
IdxY
>
sum
?
1
:
0
);
}
}
}
}
#endif
}
void
destroyROM
()
...
...
@@ -883,5 +907,65 @@ const uint8_t g_NonMPM[257] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
8
};
#if JVET_L0124_L0208_TRIANGLE
const
Pel
g_TrianglePelWeightedLuma
[
TRIANGLE_DIR_NUM
][
2
][
7
]
=
{
{
// TRIANGLE_DIR_135
{
1
,
2
,
4
,
6
,
7
,
0
,
0
},
{
1
,
2
,
3
,
4
,
5
,
6
,
7
}
},
{
// TRIANGLE_DIR_45
{
7
,
6
,
4
,
2
,
1
,
0
,
0
},
{
7
,
6
,
5
,
4
,
3
,
2
,
1
}
}
};
const
Pel
g_TrianglePelWeightedChroma
[
2
][
TRIANGLE_DIR_NUM
][
2
][
7
]
=
{
{
// 444 format
{
// TRIANGLE_DIR_135
{
1
,
2
,
4
,
6
,
7
,
0
,
0
},
{
1
,
2
,
3
,
4
,
5
,
6
,
7
}
},
{
// TRIANGLE_DIR_45
{
7
,
6
,
4
,
2
,
1
,
0
,
0
},
{
7
,
6
,
5
,
4
,
3
,
2
,
1
}
}
},
{
// 420 format
{
// TRIANGLE_DIR_135
{
1
,
4
,
7
,
0
,
0
,
0
,
0
},
{
2
,
4
,
6
,
0
,
0
,
0
,
0
}
},
{
// TRIANGLE_DIR_45
{
7
,
4
,
1
,
0
,
0
,
0
,
0
},
{
6
,
4
,
2
,
0
,
0
,
0
,
0
}
}
}
};
const
uint8_t
g_TriangleWeightLengthLuma
[
2
]
=
{
5
,
7
};
const
uint8_t
g_TriangleWeightLengthChroma
[
2
][
2
]
=
{
{
5
,
7
},
{
3
,
3
}
};
uint8_t
g_TriangleMvStorage
[
TRIANGLE_DIR_NUM
][
MAX_CU_DEPTH
-
MIN_CU_LOG2
+
1
][
MAX_CU_DEPTH
-
MIN_CU_LOG2
+
1
][
MAX_CU_SIZE
>>
MIN_CU_LOG2
][
MAX_CU_SIZE
>>
MIN_CU_LOG2
];
const
uint8_t
g_TriangleCombination
[
TRIANGLE_MAX_NUM_CANDS
][
3
]
=
{
{
0
,
1
,
0
},
{
1
,
0
,
1
},
{
1
,
0
,
2
},
{
0
,
0
,
1
},
{
0
,
2
,
0
},
{
1
,
0
,
3
},
{
1
,
0
,
4
},
{
1
,
1
,
0
},
{
0
,
3
,
0
},
{
0
,
4
,
0
},
{
0
,
0
,
2
},
{
0
,
1
,
2
},
{
1
,
1
,
2
},
{
0
,
0
,
4
},
{
0
,
0
,
3
},
{
0
,
1
,
3
},
{
0
,
1
,
4
},
{
1
,
1
,
4
},
{
1
,
1
,
3
},
{
1
,
2
,
1
},
{
1
,
2
,
0
},
{
0
,
2
,
1
},
{
0
,
4
,
3
},
{
1
,
3
,
0
},
{
1
,
3
,
2
},
{
1
,
3
,
4
},
{
1
,
4
,
0
},
{
1
,
3
,
1
},
{
1
,
2
,
3
},
{
1
,
4
,
1
},
{
0
,
4
,
1
},
{
0
,
2
,
3
},
{
1
,
4
,
2
},
{
0
,
3
,
2
},
{
1
,
4
,
3
},
{
0
,
3
,
1
},
{
0
,
2
,
4
},
{
1
,
2
,
4
},
{
0
,
4
,
2
},
{
0
,
3
,
4
},
};
const
uint8_t
g_TriangleIdxBins
[
TRIANGLE_MAX_NUM_CANDS
]
=
{
2
,
2
,
4
,
4
,
4
,
4
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
};
#endif
//! \}
source/Lib/CommonLib/Rom.h
View file @
3fdc7d65
...
...
@@ -270,5 +270,15 @@ constexpr uint8_t g_tbMax[257] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
//! \}
#if JVET_L0124_L0208_TRIANGLE
extern
const
Pel
g_TrianglePelWeightedLuma
[
TRIANGLE_DIR_NUM
][
2
][
7
];
extern
const
Pel
g_TrianglePelWeightedChroma
[
2
][
TRIANGLE_DIR_NUM
][
2
][
7
];
extern
const
uint8_t
g_TriangleWeightLengthLuma
[
2
];
extern
const
uint8_t
g_TriangleWeightLengthChroma
[
2
][
2
];
extern
uint8_t
g_TriangleMvStorage
[
TRIANGLE_DIR_NUM
][
MAX_CU_DEPTH
-
MIN_CU_LOG2
+
1
][
MAX_CU_DEPTH
-
MIN_CU_LOG2
+
1
][
MAX_CU_SIZE
>>
MIN_CU_LOG2
][
MAX_CU_SIZE
>>
MIN_CU_LOG2
];
extern
const
uint8_t
g_TriangleCombination
[
TRIANGLE_MAX_NUM_CANDS
][
3
];
extern
const
uint8_t
g_TriangleIdxBins
[
TRIANGLE_MAX_NUM_CANDS
];
#endif
#endif //__TCOMROM__
source/Lib/CommonLib/Slice.cpp
View file @
3fdc7d65
...
...
@@ -1651,6 +1651,9 @@ void Slice::updateMotionLUTs(LutMotionCand* lutMC, CodingUnit & cu)
{
PredictionUnit
*
selectedPU
=
cu
.
firstPU
;
if
(
cu
.
affine
)
{
return
;
}
#if JVET_L0124_L0208_TRIANGLE
if
(
cu
.
triangle
)
{
return
;
}
#endif
MotionInfo
newMi
=
selectedPU
->
getMotionInfo
();
addMotionInfoToLUTs
(
lutMC
,
newMi
);
...
...
@@ -1757,6 +1760,9 @@ SPSNext::SPSNext( SPS& sps )
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
,
m_MHIntra
(
false
)
#endif
#if JVET_L0124_L0208_TRIANGLE
,
m_Triangle
(
false
)
#endif
#if ENABLE_WPP_PARALLELISM
,
m_NextDQP
(
false
)
#endif
...
...
source/Lib/CommonLib/Slice.h
View file @
3fdc7d65
...
...
@@ -823,6 +823,9 @@ private:
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
bool
m_MHIntra
;
#endif
#if JVET_L0124_L0208_TRIANGLE
bool
m_Triangle
;
#endif
#if ENABLE_WPP_PARALLELISM
bool
m_NextDQP
;
#endif
...
...
@@ -972,6 +975,10 @@ public:
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
void
setUseMHIntra
(
bool
b
)
{
m_MHIntra
=
b
;
}
bool
getUseMHIntra
()
const
{
return
m_MHIntra
;
}
#endif
#if JVET_L0124_L0208_TRIANGLE
void
setUseTriangle
(
bool
b
)
{
m_Triangle
=
b
;
}
bool
getUseTriangle
()
const
{
return
m_Triangle
;
}
#endif
// ADD_NEW_TOOL : (sps extension) add access functions for tool enabling flags and associated parameters here
...
...
source/Lib/CommonLib/TypeDef.h
View file @
3fdc7d65
...
...
@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_L0124_L0208_TRIANGLE 1 // triangular shape prediction unit
#define JVET_L0059_MTS_SIMP 1 // Simpification on MTS signaling
#define JVET_L0100_MULTI_HYPOTHESIS_INTRA 1 // Combine intra mode with an extra merge indexed prediction
...
...
@@ -942,6 +944,14 @@ enum MergeType
NUM_MRG_TYPE
// 5
};
#if JVET_L0124_L0208_TRIANGLE
enum
TriangleSplit
{
TRIANGLE_DIR_135
=
0
,
TRIANGLE_DIR_45
,
TRIANGLE_DIR_NUM
};
#endif
//////////////////////////////////////////////////////////////////////////
// Encoder modes to try out
...
...
source/Lib/CommonLib/Unit.cpp
View file @
3fdc7d65
...
...
@@ -258,6 +258,9 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
#endif
affine
=
other
.
affine
;
affineType
=
other
.
affineType
;
#if JVET_L0124_L0208_TRIANGLE
triangle
=
other
.
triangle
;
#endif
transQuantBypass
=
other
.
transQuantBypass
;
ipcm
=
other
.
ipcm
;
qp
=
other
.
qp
;
...
...
@@ -292,6 +295,9 @@ void CodingUnit::initData()
#endif
affine
=
false
;
affineType
=
0
;
#if JVET_L0124_L0208_TRIANGLE
triangle
=
false
;
#endif
transQuantBypass
=
false
;
ipcm
=
false
;
qp
=
0
;
...
...
source/Lib/CommonLib/Unit.h
View file @
3fdc7d65
...
...
@@ -300,6 +300,9 @@ struct CodingUnit : public UnitArea
#endif
bool
affine
;
int
affineType
;
#if JVET_L0124_L0208_TRIANGLE
bool
triangle
;
#endif
bool
transQuantBypass
;
bool
ipcm
;
uint8_t
imv
;
...
...
source/Lib/CommonLib/UnitTools.cpp
View file @
3fdc7d65
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/UnitTools.h
View file @
3fdc7d65
...
...
@@ -173,6 +173,13 @@ namespace PU
int
getMHIntraMPMs
(
const
PredictionUnit
&
pu
,
unsigned
*
mpm
,
const
ChannelType
&
channelType
=
CHANNEL_TYPE_LUMA
,
const
bool
isChromaMDMS
=
false
,
const
unsigned
startIdx
=
0
);
int
getNarrowShape
(
const
int
width
,
const
int
height
);
#endif
#if JVET_L0124_L0208_TRIANGLE
void
getTriangleMergeCandidates
(
const
PredictionUnit
&
pu
,
MergeCtx
&
TriangleMrgCtx
);
bool
isUniqueTriangleCandidates
(
const
PredictionUnit
&
pu
,
MergeCtx
&
TriangleMrgCtx
);
bool
isTriangleEhancedWeight
(
const
PredictionUnit
&
pu
,
MergeCtx
&
TriangleMrgCtx
,
const
uint8_t
CandIdx0
,
const
uint8_t
CandIdx1
);
void
spanTriangleMotionInfo
(
PredictionUnit
&
pu
,
MergeCtx
&
TriangleMrgCtx
,
const
uint8_t
MergeIdx
,
const
bool
SplitDir
,
const
uint8_t
CandIdx0
,
const
uint8_t
CandIdx1
);
int32_t
mappingRefPic
(
const
PredictionUnit
&
pu
,
int32_t
refPicPoc
,
bool
targetRefPicList
);
#endif
}
// TU tools
...
...
source/Lib/DecoderLib/CABACReader.cpp
View file @
3fdc7d65
...
...
@@ -1172,6 +1172,9 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
pu
.
intraDir
[
1
]
=
DM_CHROMA_IDX
;
}
#endif
#if JVET_L0124_L0208_TRIANGLE
triangle_mode
(
*
pu
.
cu
);
#endif
#if JVET_L0054_MMVD
if
(
pu
.
mmvdMergeFlag
)
{
...
...
@@ -1413,6 +1416,25 @@ void CABACReader::merge_idx( PredictionUnit& pu )
#endif
int
numCandminus1
=
int
(
pu
.
cs
->
slice
->
getMaxNumMergeCand
()
)
-
1
;
pu
.
mergeIdx
=
0
;
#if JVET_L0124_L0208_TRIANGLE
if
(
pu
.
cu
->
triangle
)
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET
(
STATS__CABAC_BITS__TRIANGLE_INDEX
);
if
(
m_BinDecoder
.
decodeBin
(
Ctx
::
TriangleIdx
()
)
==
0
)
{
pu
.
mergeIdx
+=
m_BinDecoder
.
decodeBinEP
();
}
else
{
pu
.
mergeIdx
+=
exp_golomb_eqprob
(
2
)
+
2
;
}
DTRACE
(
g_trace_ctx
,
D_SYNTAX
,
"merge_idx() triangle_idx=%d
\n
"
,
pu
.
mergeIdx
);
return
;
}
#endif
if
(
numCandminus1
>
0
)
{
if
(
m_BinDecoder
.
decodeBin
(
Ctx
::
MergeIdx
()
)
)
...
...
@@ -1728,6 +1750,23 @@ void CABACReader::MHIntra_luma_pred_modes(CodingUnit &cu)
}
#endif
#if JVET_L0124_L0208_TRIANGLE
void
CABACReader
::
triangle_mode
(
CodingUnit
&
cu
)
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET
(
STATS__CABAC_BITS__TRIANGLE_FLAG
);
if
(
!
cu
.
cs
->
slice
->
getSPS
()
->
getSpsNext
().
getUseTriangle
()
||
!
cu
.
cs
->
slice
->
isInterB
()
||
cu
.
lwidth
()
*
cu
.
lheight
()
<
TRIANGLE_MIN_SIZE
||
cu
.
affine
)
{
return
;
}
unsigned
flag_idx
=
DeriveCtx
::
CtxTriangleFlag
(
cu
);
cu
.
triangle
=
m_BinDecoder
.
decodeBin
(
Ctx
::
TriangleFlag
(
flag_idx
)
);
DTRACE
(
g_trace_ctx
,
D_SYNTAX
,
"triangle_mode() triangle_mode=%d pos=(%d,%d) size: %dx%d
\n
"
,
cu
.
triangle
,
cu
.
Y
().
x
,
cu
.
Y
().
y
,
cu
.
lumaSize
().
width
,
cu
.
lumaSize
().
height
);
}
#endif
//================================================================================
// clause 7.3.8.7
...
...
source/Lib/DecoderLib/CABACReader.h
View file @
3fdc7d65
...
...
@@ -111,6 +111,9 @@ public:
void
MHIntra_flag
(
PredictionUnit
&
pu
);
void
MHIntra_luma_pred_modes
(
CodingUnit
&
cu
);
#endif
#if JVET_L0124_L0208_TRIANGLE
void
triangle_mode
(
CodingUnit
&
cu
);
#endif
// pcm samples (clause 7.3.8.7)
void
pcm_samples
(
TransformUnit
&
tu
);
...
...
source/Lib/DecoderLib/DecCu.cpp
View file @
3fdc7d65
...
...
@@ -314,12 +314,28 @@ void DecCu::xFillPCMBuffer(CodingUnit &cu)
void
DecCu
::
xReconInter
(
CodingUnit
&
cu
)
{
#if JVET_L0124_L0208_TRIANGLE
if
(
cu
.
triangle
)
{
const
uint8_t
mergeIdx
=
cu
.
firstPU
->
mergeIdx
;
const
bool
SplitDir
=
g_TriangleCombination
[
mergeIdx
][
0
];
const
uint8_t
CandIdx0
=
g_TriangleCombination
[
mergeIdx
][
1
];
const
uint8_t
CandIdx1
=
g_TriangleCombination
[
mergeIdx
][
2
];
m_pcInterPred
->
motionCompensation4Triangle
(
cu
,
m_TriangleMrgCtx
,
SplitDir
,
CandIdx0
,
CandIdx1
);
PU
::
spanTriangleMotionInfo
(
*
cu
.
firstPU
,
m_TriangleMrgCtx
,
mergeIdx
,
SplitDir
,
CandIdx0
,
CandIdx1
);
}
else
{
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
m_pcIntraPred
->
geneIntrainterPred
(
cu
);
#endif
// inter prediction
m_pcInterPred
->
motionCompensation
(
cu
);
#if JVET_L0124_L0208_TRIANGLE
}
#endif
#if JVET_L0266_HMVP
cu
.
slice
->
updateMotionLUTs
(
cu
.
slice
->
getMotionLUTs
(),
cu
);
#endif
...
...
@@ -486,6 +502,14 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
{
#endif
{
#if JVET_L0124_L0208_TRIANGLE
if
(
pu
.
cu
->
triangle
)
{
PU
::
getTriangleMergeCandidates
(
pu
,
m_TriangleMrgCtx
);
}
else
{
#endif
if
(
pu
.
cu
->
affine
)
{
#if JVET_L0632_AFFINE_MERGE
...
...
@@ -593,6 +617,9 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
PU
::
spanMotionInfo
(
pu
,
mrgCtx
);
}
#if JVET_L0124_L0208_TRIANGLE
}
#endif
}
#if JVET_L0054_MMVD
}
...
...
source/Lib/DecoderLib/DecCu.h
View file @
3fdc7d65
...
...
@@ -92,6 +92,10 @@ private:
MotionInfo
m_SubPuMiBuf
[(
MAX_CU_SIZE
*
MAX_CU_SIZE
)
>>
(
MIN_CU_LOG2
<<
1
)];
#if JVET_L0124_L0208_TRIANGLE
MergeCtx
m_TriangleMrgCtx
;
#endif
};
//! \}
...
...
source/Lib/DecoderLib/VLCReader.cpp
View file @
3fdc7d65
...
...
@@ -818,6 +818,9 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
READ_FLAG
(
symbol
,
"mhintra_flag"
);
spsNext
.
setUseMHIntra
(
symbol
!=
0
);
#endif
#if JVET_L0124_L0208_TRIANGLE
READ_FLAG
(
symbol
,
"triangle_flag"
);
spsNext
.
setUseTriangle
(
symbol
!=
0
);
#endif
#if ENABLE_WPP_PARALLELISM
READ_FLAG
(
symbol
,
"next_dqp_enabled_flag"
);
spsNext
.
setUseNextDQP
(
symbol
!=
0
);
#else
...
...
source/Lib/EncoderLib/CABACWriter.cpp
View file @
3fdc7d65
...
...
@@ -1132,6 +1132,9 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
MHIntra_luma_pred_modes
(
*
pu
.
cu
);
}
#endif
#if JVET_L0124_L0208_TRIANGLE
triangle_mode
(
*
pu
.
cu
);
#endif
#if JVET_L0054_MMVD
if
(
pu
.
mmvdMergeFlag
)
{
...
...
@@ -1354,6 +1357,24 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
}
else
{
#endif
#if JVET_L0124_L0208_TRIANGLE
if
(
pu
.
cu
->
triangle
)
{
if
(
pu
.
mergeIdx
<
2
)
{
m_BinEncoder
.
encodeBin
(
0
,
Ctx
::
TriangleIdx
()
);
m_BinEncoder
.
encodeBinEP
(
pu
.
mergeIdx
);
}
else
{
m_BinEncoder
.
encodeBin
(
1
,
Ctx
::
TriangleIdx
()
);
exp_golomb_eqprob
(
pu
.
mergeIdx
-
2
,
2
);
}
DTRACE
(
g_trace_ctx
,
D_SYNTAX
,
"merge_idx() triangle_idx=%d
\n
"
,
pu
.
mergeIdx
);
return
;
}
#endif
int
numCandminus1
=
int
(
pu
.
cs
->
slice
->
getMaxNumMergeCand
()
)
-
1
;
if
(
numCandminus1
>
0
)
...
...
@@ -1618,6 +1639,22 @@ void CABACWriter::MHIntra_luma_pred_modes(const CodingUnit& cu)
}
#endif
#if JVET_L0124_L0208_TRIANGLE
void
CABACWriter
::
triangle_mode
(
const
CodingUnit
&
cu
)
{
if
(
!
cu
.
cs
->
slice
->
getSPS
()
->
getSpsNext
().
getUseTriangle
()
||
!
cu
.
cs
->
slice
->
isInterB
()
||
cu
.
lwidth
()
*
cu
.
lheight
()
<
TRIANGLE_MIN_SIZE
||
cu
.
affine
)