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
16
Merge Requests
16
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
7341c1e7
Commit
7341c1e7
authored
Jan 27, 2019
by
Yu Han
Committed by
Frank Bossen
Jan 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M0483 change cpr to ibc tmp
parent
02116053
Changes
44
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
335 additions
and
335 deletions
+335
-335
cfg/encoder_intra_vtm.cfg
cfg/encoder_intra_vtm.cfg
+1
-1
cfg/encoder_lowdelay_P_vtm.cfg
cfg/encoder_lowdelay_P_vtm.cfg
+1
-1
cfg/encoder_lowdelay_vtm.cfg
cfg/encoder_lowdelay_vtm.cfg
+1
-1
cfg/encoder_randomaccess_vtm.cfg
cfg/encoder_randomaccess_vtm.cfg
+1
-1
source/App/EncoderApp/EncApp.cpp
source/App/EncoderApp/EncApp.cpp
+7
-7
source/App/EncoderApp/EncAppCfg.cpp
source/App/EncoderApp/EncAppCfg.cpp
+9
-9
source/App/EncoderApp/EncAppCfg.h
source/App/EncoderApp/EncAppCfg.h
+7
-7
source/Lib/CommonLib/CodingStructure.cpp
source/Lib/CommonLib/CodingStructure.cpp
+8
-8
source/Lib/CommonLib/CodingStructure.h
source/Lib/CommonLib/CodingStructure.h
+6
-6
source/Lib/CommonLib/CommonDef.h
source/Lib/CommonLib/CommonDef.h
+5
-5
source/Lib/CommonLib/ContextModelling.cpp
source/Lib/CommonLib/ContextModelling.cpp
+1
-1
source/Lib/CommonLib/IbcHashMap.cpp
source/Lib/CommonLib/IbcHashMap.cpp
+16
-16
source/Lib/CommonLib/IbcHashMap.h
source/Lib/CommonLib/IbcHashMap.h
+11
-11
source/Lib/CommonLib/InterPrediction.cpp
source/Lib/CommonLib/InterPrediction.cpp
+7
-7
source/Lib/CommonLib/InterPrediction.h
source/Lib/CommonLib/InterPrediction.h
+1
-1
source/Lib/CommonLib/RdCost.h
source/Lib/CommonLib/RdCost.h
+2
-2
source/Lib/CommonLib/Slice.cpp
source/Lib/CommonLib/Slice.cpp
+5
-5
source/Lib/CommonLib/Slice.h
source/Lib/CommonLib/Slice.h
+3
-3
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+2
-2
source/Lib/CommonLib/Unit.cpp
source/Lib/CommonLib/Unit.cpp
+2
-2
source/Lib/CommonLib/Unit.h
source/Lib/CommonLib/Unit.h
+3
-3
source/Lib/CommonLib/UnitTools.cpp
source/Lib/CommonLib/UnitTools.cpp
+70
-70
source/Lib/CommonLib/UnitTools.h
source/Lib/CommonLib/UnitTools.h
+2
-2
source/Lib/CommonLib/dtrace_blockstatistics.cpp
source/Lib/CommonLib/dtrace_blockstatistics.cpp
+1
-1
source/Lib/CommonLib/dtrace_blockstatistics.h
source/Lib/CommonLib/dtrace_blockstatistics.h
+2
-2
source/Lib/CommonLib/x86/IbcHashMapX86.h
source/Lib/CommonLib/x86/IbcHashMapX86.h
+4
-4
source/Lib/CommonLib/x86/InitX86.cpp
source/Lib/CommonLib/x86/InitX86.cpp
+4
-4
source/Lib/CommonLib/x86/sse42/CprHashmap_sse42.cpp
source/Lib/CommonLib/x86/sse42/CprHashmap_sse42.cpp
+0
-1
source/Lib/CommonLib/x86/sse42/IbcHashmap_sse42.cpp
source/Lib/CommonLib/x86/sse42/IbcHashmap_sse42.cpp
+1
-0
source/Lib/DecoderLib/CABACReader.cpp
source/Lib/DecoderLib/CABACReader.cpp
+2
-2
source/Lib/DecoderLib/DecCu.cpp
source/Lib/DecoderLib/DecCu.cpp
+5
-5
source/Lib/DecoderLib/DecLib.cpp
source/Lib/DecoderLib/DecLib.cpp
+2
-2
source/Lib/DecoderLib/VLCReader.cpp
source/Lib/DecoderLib/VLCReader.cpp
+1
-1
source/Lib/EncoderLib/CABACWriter.cpp
source/Lib/EncoderLib/CABACWriter.cpp
+1
-1
source/Lib/EncoderLib/EncCfg.h
source/Lib/EncoderLib/EncCfg.h
+21
-21
source/Lib/EncoderLib/EncCu.cpp
source/Lib/EncoderLib/EncCu.cpp
+41
-41
source/Lib/EncoderLib/EncCu.h
source/Lib/EncoderLib/EncCu.h
+6
-6
source/Lib/EncoderLib/EncGOP.cpp
source/Lib/EncoderLib/EncGOP.cpp
+5
-5
source/Lib/EncoderLib/EncLib.cpp
source/Lib/EncoderLib/EncLib.cpp
+2
-2
source/Lib/EncoderLib/EncModeCtrl.cpp
source/Lib/EncoderLib/EncModeCtrl.cpp
+23
-23
source/Lib/EncoderLib/EncModeCtrl.h
source/Lib/EncoderLib/EncModeCtrl.h
+2
-2
source/Lib/EncoderLib/InterSearch.cpp
source/Lib/EncoderLib/InterSearch.cpp
+33
-33
source/Lib/EncoderLib/InterSearch.h
source/Lib/EncoderLib/InterSearch.h
+7
-7
source/Lib/EncoderLib/VLCWriter.cpp
source/Lib/EncoderLib/VLCWriter.cpp
+1
-1
No files found.
cfg/encoder_intra_vtm.cfg
View file @
7341c1e7
...
...
@@ -111,7 +111,7 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
ALF : 1
CPR
: 0 # turned off in CTC
IBC
: 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
...
...
cfg/encoder_lowdelay_P_vtm.cfg
View file @
7341c1e7
...
...
@@ -128,7 +128,7 @@ DepQuant : 1
IMV : 2
ALF : 1
MHIntra : 1
CPR
: 0 # turned off in CTC
IBC
: 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
...
...
cfg/encoder_lowdelay_vtm.cfg
View file @
7341c1e7
...
...
@@ -131,7 +131,7 @@ GBi : 1
GBiFast : 1
MHIntra : 1
Triangle : 1
CPR
: 0 # turned off in CTC
IBC
: 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
...
...
cfg/encoder_randomaccess_vtm.cfg
View file @
7341c1e7
...
...
@@ -146,7 +146,7 @@ GBiFast : 1
BIO : 1
MHIntra : 1
Triangle : 1
CPR
: 0 # turned off in CTC
IBC
: 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
...
...
source/App/EncoderApp/EncApp.cpp
View file @
7341c1e7
...
...
@@ -258,13 +258,13 @@ void EncApp::xInitLibCfg()
m_cEncLib
.
setUseMHIntra
(
m_MHIntra
);
m_cEncLib
.
setUseTriangle
(
m_Triangle
);
m_cEncLib
.
set
CPRMode
(
m_CPR
Mode
);
m_cEncLib
.
set
CPRLocalSearchRangeX
(
m_CPR
LocalSearchRangeX
);
m_cEncLib
.
set
CPRLocalSearchRangeY
(
m_CPR
LocalSearchRangeY
);
m_cEncLib
.
set
CPRHashSearch
(
m_CPR
HashSearch
);
m_cEncLib
.
set
CPRHashSearchMaxCand
(
m_CPR
HashSearchMaxCand
);
m_cEncLib
.
set
CPRHashSearchRange4SmallBlk
(
m_CPR
HashSearchRange4SmallBlk
);
m_cEncLib
.
set
CPRFastMethod
(
m_CPR
FastMethod
);
m_cEncLib
.
set
IBCMode
(
m_IBC
Mode
);
m_cEncLib
.
set
IBCLocalSearchRangeX
(
m_IBC
LocalSearchRangeX
);
m_cEncLib
.
set
IBCLocalSearchRangeY
(
m_IBC
LocalSearchRangeY
);
m_cEncLib
.
set
IBCHashSearch
(
m_IBC
HashSearch
);
m_cEncLib
.
set
IBCHashSearchMaxCand
(
m_IBC
HashSearchMaxCand
);
m_cEncLib
.
set
IBCHashSearchRange4SmallBlk
(
m_IBC
HashSearchRange4SmallBlk
);
m_cEncLib
.
set
IBCFastMethod
(
m_IBC
FastMethod
);
m_cEncLib
.
setUseWrapAround
(
m_wrapAround
);
m_cEncLib
.
setWrapAroundOffset
(
m_wrapAroundOffset
);
...
...
source/App/EncoderApp/EncAppCfg.cpp
View file @
7341c1e7
...
...
@@ -865,13 +865,13 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
(
"MHIntra"
,
m_MHIntra
,
false
,
"Enable MHIntra mode"
)
(
"Triangle"
,
m_Triangle
,
false
,
"Enable triangular shape motion vector prediction (0:off, 1:on)"
)
(
"
CPR"
,
m_CPRMode
,
0u
,
"CPR
Mode (0x1:enabled, 0x0:disabled) [default: disabled]"
)
(
"
CPRLocalSearchRangeX"
,
m_CPRLocalSearchRangeX
,
128u
,
"Search range of CPR
local search in x direction"
)
(
"
CPRLocalSearchRangeY"
,
m_CPRLocalSearchRangeY
,
128u
,
"Search range of CPR
local search in y direction"
)
(
"
CPRHashSearch"
,
m_CPRHashSearch
,
1u
,
"Hash based CPR
search"
)
(
"
CPRHashSearchMaxCand"
,
m_CPRHashSearchMaxCand
,
256u
,
"Max candidates for hash based CPR
search"
)
(
"
CPRHashSearchRange4SmallBlk"
,
m_CPRHashSearchRange4SmallBlk
,
256u
,
"Small block search range in based CPR
search"
)
(
"
CPRFastMethod"
,
m_CPRFastMethod
,
6u
,
"Fast methods for CPR
"
)
(
"
IBC"
,
m_IBCMode
,
0u
,
"IBC
Mode (0x1:enabled, 0x0:disabled) [default: disabled]"
)
(
"
IBCLocalSearchRangeX"
,
m_IBCLocalSearchRangeX
,
128u
,
"Search range of IBC
local search in x direction"
)
(
"
IBCLocalSearchRangeY"
,
m_IBCLocalSearchRangeY
,
128u
,
"Search range of IBC
local search in y direction"
)
(
"
IBCHashSearch"
,
m_IBCHashSearch
,
1u
,
"Hash based IBC
search"
)
(
"
IBCHashSearchMaxCand"
,
m_IBCHashSearchMaxCand
,
256u
,
"Max candidates for hash based IBC
search"
)
(
"
IBCHashSearchRange4SmallBlk"
,
m_IBCHashSearchRange4SmallBlk
,
256u
,
"Small block search range in based IBC
search"
)
(
"
IBCFastMethod"
,
m_IBCFastMethod
,
6u
,
"Fast methods for IBC
"
)
(
"WrapAround"
,
m_wrapAround
,
false
,
"Enable horizontal wrap-around motion compensation for inter prediction (0:off, 1:on) [default: off]"
)
(
"WrapAroundOffset"
,
m_wrapAroundOffset
,
0u
,
"Offset in luma samples used for computing the horizontal wrap-around position"
)
...
...
@@ -1934,7 +1934,7 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara
(
m_DisableMotionCompression
,
"Disable motion data compression only allowed with NEXT profile"
);
xConfirmPara
(
m_MTT
,
"Multi type tree is only allowed with NEXT profile"
);
xConfirmPara
(
m_ImvMode
,
"IMV is only allowed with NEXT profile"
);
xConfirmPara
(
m_
CPRMode
,
"CPR
Mode only allowed with NEXT profile"
);
xConfirmPara
(
m_
IBCMode
,
"IBC
Mode only allowed with NEXT profile"
);
xConfirmPara
(
m_useFastLCTU
,
"Fast large CTU can only be applied when encoding with NEXT profile"
);
#if JVET_M0464_UNI_MTS
xConfirmPara
(
m_MTS
,
"MTS only allowed with NEXT profile"
);
...
...
@@ -3146,7 +3146,7 @@ void EncAppCfg::xPrintParameter()
msg
(
VERBOSE
,
"MHIntra:%d "
,
m_MHIntra
);
msg
(
VERBOSE
,
"Triangle:%d "
,
m_Triangle
);
}
msg
(
VERBOSE
,
"
CPR:%d "
,
m_CPR
Mode
);
msg
(
VERBOSE
,
"
IBC:%d "
,
m_IBC
Mode
);
msg
(
VERBOSE
,
"WrapAround:%d "
,
m_wrapAround
);
if
(
m_wrapAround
)
{
...
...
source/App/EncoderApp/EncAppCfg.h
View file @
7341c1e7
...
...
@@ -239,13 +239,13 @@ protected:
bool
m_Triangle
;
unsigned
m_
CPR
Mode
;
unsigned
m_
CPR
LocalSearchRangeX
;
unsigned
m_
CPR
LocalSearchRangeY
;
unsigned
m_
CPR
HashSearch
;
unsigned
m_
CPR
HashSearchMaxCand
;
unsigned
m_
CPR
HashSearchRange4SmallBlk
;
unsigned
m_
CPR
FastMethod
;
unsigned
m_
IBC
Mode
;
unsigned
m_
IBC
LocalSearchRangeX
;
unsigned
m_
IBC
LocalSearchRangeY
;
unsigned
m_
IBC
HashSearch
;
unsigned
m_
IBC
HashSearchMaxCand
;
unsigned
m_
IBC
HashSearchRange4SmallBlk
;
unsigned
m_
IBC
FastMethod
;
bool
m_wrapAround
;
unsigned
m_wrapAroundOffset
;
...
...
source/Lib/CommonLib/CodingStructure.cpp
View file @
7341c1e7
...
...
@@ -1299,7 +1299,7 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons
}
}
CprLumaCoverage
CodingStructure
::
getCpr
LumaCoverage
(
const
CompArea
&
chromaArea
)
const
IbcLumaCoverage
CodingStructure
::
getIbc
LumaCoverage
(
const
CompArea
&
chromaArea
)
const
{
CHECK
(
chType
!=
CHANNEL_TYPE_CHROMA
,
"Error"
);
...
...
@@ -1307,7 +1307,7 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
CompArea
lumaArea
=
CompArea
(
COMPONENT_Y
,
chromaArea
.
chromaFormat
,
chromaArea
.
lumaPos
(),
recalcSize
(
chromaArea
.
chromaFormat
,
CHANNEL_TYPE_CHROMA
,
CHANNEL_TYPE_LUMA
,
chromaArea
.
size
()));
lumaArea
=
clipArea
(
lumaArea
,
picture
->
block
(
COMPONENT_Y
));
const
unsigned
int
fullArea
=
lumaArea
.
area
();
unsigned
int
cpr
Area
=
0
;
unsigned
int
ibc
Area
=
0
;
for
(
SizeType
y
=
0
;
y
<
lumaArea
.
height
;
y
+=
MIN_PU_SIZE
)
{
for
(
SizeType
x
=
0
;
x
<
lumaArea
.
width
;
x
+=
MIN_PU_SIZE
)
...
...
@@ -1315,19 +1315,19 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
Position
pos
=
lumaArea
.
offset
(
x
,
y
);
if
(
picture
->
cs
->
getMotionInfo
(
pos
).
isInter
)
// need to change if inter slice allows dualtree
{
cpr
Area
+=
unitAreaSubBlock
;
ibc
Area
+=
unitAreaSubBlock
;
}
}
}
CprLumaCoverage
coverage
=
CPR
_LUMA_COVERAGE_FULL
;
if
(
cpr
Area
==
0
)
IbcLumaCoverage
coverage
=
IBC
_LUMA_COVERAGE_FULL
;
if
(
ibc
Area
==
0
)
{
coverage
=
CPR
_LUMA_COVERAGE_NONE
;
coverage
=
IBC
_LUMA_COVERAGE_NONE
;
}
else
if
(
cpr
Area
<
fullArea
)
else
if
(
ibc
Area
<
fullArea
)
{
coverage
=
CPR
_LUMA_COVERAGE_PARTIAL
;
coverage
=
IBC
_LUMA_COVERAGE_PARTIAL
;
}
return
coverage
;
...
...
source/Lib/CommonLib/CodingStructure.h
View file @
7341c1e7
...
...
@@ -58,12 +58,12 @@ enum PictureType
PIC_ORG_RESI
,
NUM_PIC_TYPES
};
enum
Cpr
LumaCoverage
enum
Ibc
LumaCoverage
{
CPR
_LUMA_COVERAGE_FULL
=
0
,
CPR
_LUMA_COVERAGE_PARTIAL
,
CPR
_LUMA_COVERAGE_NONE
,
NUM_
CPR
_LUMA_COVERAGE
,
IBC
_LUMA_COVERAGE_FULL
=
0
,
IBC
_LUMA_COVERAGE_PARTIAL
,
IBC
_LUMA_COVERAGE_NONE
,
NUM_
IBC
_LUMA_COVERAGE
,
};
extern
XUCache
g_globalUnitCache
;
...
...
@@ -154,7 +154,7 @@ public:
cCUTraverser
traverseCUs
(
const
UnitArea
&
_unit
,
const
ChannelType
_chType
)
const
;
cPUTraverser
traversePUs
(
const
UnitArea
&
_unit
,
const
ChannelType
_chType
)
const
;
cTUTraverser
traverseTUs
(
const
UnitArea
&
_unit
,
const
ChannelType
_chType
)
const
;
CprLumaCoverage
getCpr
LumaCoverage
(
const
CompArea
&
chromaArea
)
const
;
IbcLumaCoverage
getIbc
LumaCoverage
(
const
CompArea
&
chromaArea
)
const
;
// ---------------------------------------------------------------------------
// encoding search utilities
// ---------------------------------------------------------------------------
...
...
source/Lib/CommonLib/CommonDef.h
View file @
7341c1e7
...
...
@@ -396,12 +396,12 @@ 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
;
static
const
int
CPR_MAX_CAND_SIZE
=
16
;
// max block size for cpr
search
static
const
int
CPR
_NUM_CANDIDATES
=
64
;
///< Maximum number of candidates to store/test
static
const
int
IBC_MAX_CAND_SIZE
=
16
;
// max block size for ibc
search
static
const
int
IBC
_NUM_CANDIDATES
=
64
;
///< Maximum number of candidates to store/test
static
const
int
CHROMA_REFINEMENT_CANDIDATES
=
8
;
/// 8 candidates BV to choose from
static
const
int
CPR_FAST_METHOD_NOINTRA_CPR
CBF0
=
0x01
;
static
const
int
CPR
_FAST_METHOD_BUFFERBV
=
0X02
;
static
const
int
CPR
_FAST_METHOD_ADAPTIVE_SEARCHRANGE
=
0X04
;
static
const
int
IBC_FAST_METHOD_NOINTRA_IBC
CBF0
=
0x01
;
static
const
int
IBC
_FAST_METHOD_BUFFERBV
=
0X02
;
static
const
int
IBC
_FAST_METHOD_ADAPTIVE_SEARCHRANGE
=
0X04
;
// ====================================================================================================================
// Macro functions
...
...
source/Lib/CommonLib/ContextModelling.cpp
View file @
7341c1e7
...
...
@@ -472,7 +472,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu
.
mvpNum
[
REF_PIC_LIST_1
]
=
NOT_VALID
;
if
(
interDirNeighbours
[
candIdx
]
==
1
&&
pu
.
cs
->
slice
->
getRefPic
(
REF_PIC_LIST_0
,
mvFieldNeighbours
[
candIdx
<<
1
].
refIdx
)
->
getPOC
()
==
pu
.
cs
->
slice
->
getPOC
())
{
pu
.
cu
->
cpr
=
true
;
pu
.
cu
->
ibc
=
true
;
pu
.
bv
=
pu
.
mv
[
REF_PIC_LIST_0
];
pu
.
bv
.
changePrecision
(
MV_PRECISION_INTERNAL
,
MV_PRECISION_INT
);
// used for only integer resolution
}
...
...
source/Lib/CommonLib/
Cpr
HashMap.cpp
→
source/Lib/CommonLib/
Ibc
HashMap.cpp
View file @
7341c1e7
...
...
@@ -31,46 +31,46 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file
Cpr
HashMap.cpp
\brief
CPR
hash map encoder class
/** \file
Ibc
HashMap.cpp
\brief
IBC
hash map encoder class
*/
#include "CommonLib/dtrace_codingstruct.h"
#include "CommonLib/Picture.h"
#include "CommonLib/UnitTools.h"
#include "
Cpr
HashMap.h"
#include "
Ibc
HashMap.h"
using
namespace
std
;
//! \ingroup
Cpr
HashMap
//! \ingroup
Ibc
HashMap
//! \{
// ====================================================================================================================
// Constructor / destructor / create / destroy
// ====================================================================================================================
CprHashMap
::
Cpr
HashMap
()
IbcHashMap
::
Ibc
HashMap
()
{
m_picWidth
=
0
;
m_picHeight
=
0
;
m_pos2Hash
=
NULL
;
m_computeCrc32c
=
xxComputeCrc32c16bit
;
#if ENABLE_SIMD_OPT_
CPR
#if ENABLE_SIMD_OPT_
IBC
#ifdef TARGET_SIMD_X86
init
Cpr
HashMapX86
();
init
Ibc
HashMapX86
();
#endif
#endif
}
CprHashMap
::~
Cpr
HashMap
()
IbcHashMap
::~
Ibc
HashMap
()
{
destroy
();
}
void
Cpr
HashMap
::
init
(
const
int
picWidth
,
const
int
picHeight
)
void
Ibc
HashMap
::
init
(
const
int
picWidth
,
const
int
picHeight
)
{
if
(
picWidth
!=
m_picWidth
||
picHeight
!=
m_picHeight
)
{
...
...
@@ -87,7 +87,7 @@ void CprHashMap::init(const int picWidth, const int picHeight)
}
}
void
Cpr
HashMap
::
destroy
()
void
Ibc
HashMap
::
destroy
()
{
if
(
m_pos2Hash
!=
NULL
)
{
...
...
@@ -168,7 +168,7 @@ static const uint32_t crc32Table[256] = {
0xBE2DA0A5L
,
0x4C4623A6L
,
0x5F16D052L
,
0xAD7D5351L
};
uint32_t
Cpr
HashMap
::
xxComputeCrc32c16bit
(
uint32_t
crc
,
const
Pel
pel
)
uint32_t
Ibc
HashMap
::
xxComputeCrc32c16bit
(
uint32_t
crc
,
const
Pel
pel
)
{
const
void
*
buf
=
&
pel
;
const
uint8_t
*
p
=
(
const
uint8_t
*
)
buf
;
...
...
@@ -184,7 +184,7 @@ uint32_t CprHashMap::xxComputeCrc32c16bit(uint32_t crc, const Pel pel)
// CRC calculation in C code
////////////////////////////////////////////////////////
unsigned
int
Cpr
HashMap
::
xxCalcBlockHash
(
const
Pel
*
pel
,
const
int
stride
,
const
int
width
,
const
int
height
,
unsigned
int
crc
)
unsigned
int
Ibc
HashMap
::
xxCalcBlockHash
(
const
Pel
*
pel
,
const
int
stride
,
const
int
width
,
const
int
height
,
unsigned
int
crc
)
{
for
(
int
y
=
0
;
y
<
height
;
y
++
)
{
...
...
@@ -198,7 +198,7 @@ unsigned int CprHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const
}
template
<
ChromaFormat
chromaFormat
>
void
Cpr
HashMap
::
xxBuildPicHashMap
(
const
PelUnitBuf
&
pic
)
void
Ibc
HashMap
::
xxBuildPicHashMap
(
const
PelUnitBuf
&
pic
)
{
const
int
chromaScalingX
=
getChannelTypeScaleX
(
CHANNEL_TYPE_CHROMA
,
chromaFormat
);
const
int
chromaScalingY
=
getChannelTypeScaleY
(
CHANNEL_TYPE_CHROMA
,
chromaFormat
);
...
...
@@ -243,7 +243,7 @@ void CprHashMap::xxBuildPicHashMap(const PelUnitBuf& pic)
}
}
void
Cpr
HashMap
::
rebuildPicHashMap
(
const
PelUnitBuf
&
pic
)
void
Ibc
HashMap
::
rebuildPicHashMap
(
const
PelUnitBuf
&
pic
)
{
m_hash2Pos
.
clear
();
...
...
@@ -267,7 +267,7 @@ void CprHashMap::rebuildPicHashMap(const PelUnitBuf& pic)
}
}
bool
CprHashMap
::
cpr
HashMatch
(
const
Area
&
lumaArea
,
std
::
vector
<
Position
>&
cand
,
const
CodingStructure
&
cs
,
const
int
maxCand
,
const
int
searchRange4SmallBlk
)
bool
IbcHashMap
::
ibc
HashMatch
(
const
Area
&
lumaArea
,
std
::
vector
<
Position
>&
cand
,
const
CodingStructure
&
cs
,
const
int
maxCand
,
const
int
searchRange4SmallBlk
)
{
cand
.
clear
();
...
...
@@ -332,7 +332,7 @@ bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand,
return
cand
.
size
()
>
0
;
}
int
Cpr
HashMap
::
getHashHitRatio
(
const
Area
&
lumaArea
)
int
Ibc
HashMap
::
getHashHitRatio
(
const
Area
&
lumaArea
)
{
int
maxX
=
std
::
min
((
int
)(
lumaArea
.
x
+
lumaArea
.
width
),
m_picWidth
);
int
maxY
=
std
::
min
((
int
)(
lumaArea
.
y
+
lumaArea
.
height
),
m_picHeight
);
...
...
source/Lib/CommonLib/
Cpr
HashMap.h
→
source/Lib/CommonLib/
Ibc
HashMap.h
View file @
7341c1e7
...
...
@@ -31,12 +31,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file
Cpr
HashMap.h
\brief
CPR
hash map encoder class (header)
/** \file
Ibc
HashMap.h
\brief
IBC
hash map encoder class (header)
*/
#ifndef __
CPR
HASHMAP__
#define __
CPR
HASHMAP__
#ifndef __
IBC
HASHMAP__
#define __
IBC
HASHMAP__
// Include files
#include "CommonLib/CommonDef.h"
...
...
@@ -55,7 +55,7 @@
// Class definition
// ====================================================================================================================
class
Cpr
HashMap
class
Ibc
HashMap
{
private:
int
m_picWidth
;
...
...
@@ -73,23 +73,23 @@ private:
public:
uint32_t
(
*
m_computeCrc32c
)
(
uint32_t
crc
,
const
Pel
pel
);
Cpr
HashMap
();
virtual
~
Cpr
HashMap
();
Ibc
HashMap
();
virtual
~
Ibc
HashMap
();
void
init
(
const
int
picWidth
,
const
int
picHeight
);
void
destroy
();
void
rebuildPicHashMap
(
const
PelUnitBuf
&
pic
);
bool
cpr
HashMatch
(
const
Area
&
lumaArea
,
std
::
vector
<
Position
>&
cand
,
const
CodingStructure
&
cs
,
const
int
maxCand
,
const
int
searchRange4SmallBlk
);
bool
ibc
HashMatch
(
const
Area
&
lumaArea
,
std
::
vector
<
Position
>&
cand
,
const
CodingStructure
&
cs
,
const
int
maxCand
,
const
int
searchRange4SmallBlk
);
int
getHashHitRatio
(
const
Area
&
lumaArea
);
#ifdef TARGET_SIMD_X86
void
init
Cpr
HashMapX86
();
void
init
Ibc
HashMapX86
();
template
<
X86_VEXT
vext
>
void
_init
Cpr
HashMapX86
();
void
_init
Ibc
HashMapX86
();
#endif
};
//! \}
#endif // __
CPR
HASHMAP__
#endif // __
IBC
HASHMAP__
source/Lib/CommonLib/InterPrediction.cpp
View file @
7341c1e7
...
...
@@ -374,10 +374,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
int
iRefIdx
=
pu
.
refIdx
[
eRefPicList
];
Mv
mv
[
3
];
bool
is
CPR
=
false
;
bool
is
IBC
=
false
;
if
(
pu
.
cs
->
slice
->
getRefPic
(
eRefPicList
,
iRefIdx
)
->
getPOC
()
==
pu
.
cs
->
slice
->
getPOC
())
{
is
CPR
=
true
;
is
IBC
=
true
;
}
if
(
pu
.
cu
->
affine
)
{
...
...
@@ -413,7 +413,7 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
{
xPredInterBlk
(
compID
,
pu
,
pu
.
cu
->
slice
->
getRefPic
(
eRefPicList
,
iRefIdx
),
mv
[
0
],
pcYuvPred
,
bi
,
pu
.
cu
->
slice
->
clpRng
(
compID
)
,
bioApplied
,
is
CPR
,
is
IBC
);
}
...
...
@@ -524,7 +524,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
void
InterPrediction
::
xPredInterBlk
(
const
ComponentID
&
compID
,
const
PredictionUnit
&
pu
,
const
Picture
*
refPic
,
const
Mv
&
_mv
,
PelUnitBuf
&
dstPic
,
const
bool
&
bi
,
const
ClpRng
&
clpRng
,
const
bool
&
bioApplied
,
bool
is
CPR
,
bool
is
IBC
)
{
JVET_J0090_SET_REF_PICTURE
(
refPic
,
compID
);
...
...
@@ -536,7 +536,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
int
xFrac
=
_mv
.
hor
&
((
1
<<
shiftHor
)
-
1
);
int
yFrac
=
_mv
.
ver
&
((
1
<<
shiftVer
)
-
1
);
if
(
is
CPR
)
if
(
is
IBC
)
{
xFrac
=
yFrac
=
0
;
JVET_J0090_SET_CACHE_ENABLE
(
false
);
...
...
@@ -1077,7 +1077,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
,
const
bool
luma
,
const
bool
chroma
)
{
// dual tree handling for
CPR
as the only ref
// dual tree handling for
IBC
as the only ref
if
(
!
luma
||
!
chroma
)
{
if
(
!
luma
&&
chroma
)
...
...
@@ -1118,7 +1118,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
}
else
{
if
(
pu
.
mergeType
!=
MRG_TYPE_DEFAULT_N
&&
pu
.
mergeType
!=
MRG_TYPE_
CPR
)
if
(
pu
.
mergeType
!=
MRG_TYPE_DEFAULT_N
&&
pu
.
mergeType
!=
MRG_TYPE_
IBC
)
{
xSubPuMC
(
pu
,
predBuf
,
eRefPicList
);
}
...
...
source/Lib/CommonLib/InterPrediction.h
View file @
7341c1e7
...
...
@@ -110,7 +110,7 @@ protected:
void
xPredInterBi
(
PredictionUnit
&
pu
,
PelUnitBuf
&
pcYuvPred
);
void
xPredInterBlk
(
const
ComponentID
&
compID
,
const
PredictionUnit
&
pu
,
const
Picture
*
refPic
,
const
Mv
&
_mv
,
PelUnitBuf
&
dstPic
,
const
bool
&
bi
,
const
ClpRng
&
clpRng
,
const
bool
&
bioApplied
,
bool
is
CPR
,
bool
is
IBC
);
void
xAddBIOAvg4
(
const
Pel
*
src0
,
int
src0Stride
,
const
Pel
*
src1
,
int
src1Stride
,
Pel
*
dst
,
int
dstStride
,
const
Pel
*
gradX0
,
const
Pel
*
gradX1
,
const
Pel
*
gradY0
,
const
Pel
*
gradY1
,
int
gradStride
,
int
width
,
int
height
,
int
tmpx
,
int
tmpy
,
int
shift
,
int
offset
,
const
ClpRng
&
clpRng
);
...
...
source/Lib/CommonLib/RdCost.h
View file @
7341c1e7
...
...
@@ -118,7 +118,7 @@ private:
double
m_motionLambda
;
int
m_iCostScale
;
double
m_dCost
;
// for
cpr
double
m_dCost
;
// for
ibc
public:
RdCost
();
virtual
~
RdCost
();
...
...
@@ -162,7 +162,7 @@ public:
}
void
setCostScale
(
int
iCostScale
)
{
m_iCostScale
=
iCostScale
;
}
Distortion
getCost
(
uint32_t
b
)
{
return
Distortion
(
m_motionLambda
*
b
);
}
// for
cpr
// for
ibc
void
getMotionCost
(
int
add
,
bool
isTransquantBypass
)
{
m_dCost
=
m_dLambdaMotionSAD
[(
isTransquantBypass
&&
m_costMode
==
COST_MIXED_LOSSLESS_LOSSY_CODING
)
?
1
:
0
]
+
add
;
}
void
setPredictors
(
Mv
*
pcMv
)
...
...
source/Lib/CommonLib/Slice.cpp
View file @
7341c1e7
...
...
@@ -432,7 +432,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
pcRefPic
=
xGetLongTermRefPic
(
rcListPic
,
m_pRPS
->
getPOC
(
i
),
m_pRPS
->
getCheckLTMSBPresent
(
i
));
}
}
if
(
getSPS
()
->
getSpsNext
().
get
CPR
Mode
())
if
(
getSPS
()
->
getSpsNext
().
get
IBC
Mode
())
{
RefPicSetLtCurr
[
NumPicLtCurr
]
=
getPic
();
//getPic()->setIsLongTerm(true);
...
...
@@ -451,7 +451,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
// - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
if
(
getRapPicFlag
())
{
if
(
getSPS
()
->
getSpsNext
().
get
CPR
Mode
())
if
(
getSPS
()
->
getSpsNext
().
get
IBC
Mode
())
{
CHECK
(
numPicTotalCurr
!=
1
,
"Invalid state"
);
}
...
...
@@ -526,7 +526,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
m_bIsUsedAsLongTerm
[
REF_PIC_LIST_1
][
rIdx
]
=
(
cIdx
>=
NumPicStCurr0
+
NumPicStCurr1
);
}
}
if
(
getSPS
()
->
getSpsNext
().
get
CPR
Mode
())
if
(
getSPS
()
->
getSpsNext
().
get
IBC
Mode
())
{
m_apcRefPicList
[
REF_PIC_LIST_0
][
m_aiNumRefIdx
[
REF_PIC_LIST_0
]
-
1
]
=
getPic
();
m_bIsUsedAsLongTerm
[
REF_PIC_LIST_0
][
m_aiNumRefIdx
[
REF_PIC_LIST_0
]
-
1
]
=
true
;
...
...
@@ -561,7 +561,7 @@ int Slice::getNumRpsCurrTempList() const
numRpsCurrTempList
++
;
}
}
if
(
getSPS
()
->
getSpsNext
().
get
CPR
Mode
())
if
(
getSPS
()
->
getSpsNext
().
get
IBC
Mode
())
{
return
numRpsCurrTempList
+
1
;
}
...
...
@@ -1781,7 +1781,7 @@ SPSNext::SPSNext( SPS& sps )
,
m_ImvMode
(
IMV_OFF
)
,
m_MTTMode
(
0
)
,
m_compositeRefEnabled
(
false
)
,
m_
CPR
Mode
(
0
)
,
m_
IBC
Mode
(
0
)
// ADD_NEW_TOOL : (sps extension) add tool enabling flags here (with "false" as default values)
{
}
...
...
source/Lib/CommonLib/Slice.h
View file @
7341c1e7
...
...
@@ -842,7 +842,7 @@ private:
unsigned
m_MTTMode
;
bool
m_compositeRefEnabled
;
//composite longterm reference
unsigned
m_
CPR
Mode
;
unsigned
m_
IBC
Mode
;
public:
SPSNext
(
SPS
&
sps
);
...
...
@@ -914,8 +914,8 @@ public:
bool
getUseMHIntra
()
const
{
return
m_MHIntra
;
}
void
setUseTriangle
(
bool
b
)
{
m_Triangle
=
b
;
}
bool
getUseTriangle
()
const
{
return
m_Triangle
;
}
void
set
CPRMode
(
unsigned
CPRMode
)
{
m_CPRMode
=
CPR
Mode
;
}
unsigned
get
CPRMode
()
const
{
return
m_CPR
Mode
;
}
void
set
IBCMode
(
unsigned
IBCMode
)
{
m_IBCMode
=
IBC
Mode
;
}
unsigned
get
IBCMode
()
const
{
return
m_IBC
Mode
;
}
};
...
...
source/Lib/CommonLib/TypeDef.h
View file @
7341c1e7
...
...
@@ -60,7 +60,7 @@
#define JVET_M0502_PRED_MODE_CTX 1
#define JVET_M0407_
CPR_RANGE 1 // extend CPR
search range to some part of left CTU
#define JVET_M0407_
IBC_RANGE 1 // extend IBC
search range to some part of left CTU
#define JVET_M0464_UNI_MTS 1
#define JVET_M0068_M0171_MMVD_CLEANUP 1 // MMVD cleanup with 1) flip removal, 2) L1 zero vector fix, 3) bi-pred restriction after merge/MMVD
...
...
@@ -867,7 +867,7 @@ enum MergeType
{
MRG_TYPE_DEFAULT_N
=
0
,
// 0
MRG_TYPE_SUBPU_ATMVP
,
MRG_TYPE_
CPR
,
MRG_TYPE_
IBC
,
NUM_MRG_TYPE
// 5
};
...
...
source/Lib/CommonLib/Unit.cpp
View file @
7341c1e7
...
...
@@ -272,7 +272,7 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
GBiIdx
=
other
.
GBiIdx
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
refIdxBi
[
i
]
=
other
.
refIdxBi
[
i
];
cpr
=
other
.
cpr
;
ibc
=
other
.
ibc
;
#if JVET_M0444_SMVD
smvdMode
=
other
.
smvdMode
;
#endif
...
...
@@ -309,7 +309,7 @@ void CodingUnit::initData()
GBiIdx
=
GBI_DEFAULT
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
refIdxBi
[
i
]
=
-
1
;
cpr
=
false
;
ibc
=
false
;
#if JVET_M0444_SMVD
smvdMode
=
0
;
#endif
...
...
source/Lib/CommonLib/Unit.h
View file @
7341c1e7
...
...
@@ -312,7 +312,7 @@ struct CodingUnit : public UnitArea
int
refIdxBi
[
2
];
// needed for fast imv mode decisions
int8_t
imvNumCand
;
bool
cpr
;
bool
ibc
;
#if JVET_M0444_SMVD
uint8_t
smvdMode
;
#endif
...
...
@@ -366,8 +366,8 @@ struct InterPredictionData
Mv
mvdAffi
[
NUM_REF_PIC_LIST_01
][
3
];
Mv
mvAffi
[
NUM_REF_PIC_LIST_01
][
3
];
bool
mhIntraFlag
;
Mv
bv
;
// block vector for
CPR
Mv
bvd
;
// block vector difference for
CPR
Mv
bv
;
// block vector for
IBC
Mv
bvd
;
// block vector difference for
IBC
};
struct
PredictionUnit
:
public
UnitArea
,
public
IntraPredictionData
,
public
InterPredictionData
...
...
source/Lib/CommonLib/UnitTools.cpp
View file @
7341c1e7
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/UnitTools.h
View file @
7341c1e7
...
...
@@ -139,7 +139,7 @@ namespace PU
);
bool
getInterMergeSubPuMvpCand
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
bool
&
LICFlag
,
const
int
count
,
int
mmvdList
,
const
int
count
CPR
,
const
int
count
IBC
);
bool
getInterMergeSubPuRecurCand
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
const
int
count
);
bool
isBiPredFromDifferentDir
(
const
PredictionUnit
&
pu
);
...
...
@@ -158,7 +158,7 @@ namespace PU