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_BMS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jvet
VVCSoftware_BMS
Commits
c180eab1
Commit
c180eab1
authored
Oct 11, 2018
by
Johannes Sauer
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'hhi_git/master' into K0149_Blockstatistics_bms2.1
parents
cda56abf
4cca058b
Changes
41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
1005 additions
and
319 deletions
+1005
-319
cfg/encoder_intra_bms.cfg
cfg/encoder_intra_bms.cfg
+1
-1
cfg/encoder_intra_vtm.cfg
cfg/encoder_intra_vtm.cfg
+1
-1
cfg/encoder_lowdelay_P_bms.cfg
cfg/encoder_lowdelay_P_bms.cfg
+1
-1
cfg/encoder_lowdelay_P_vtm.cfg
cfg/encoder_lowdelay_P_vtm.cfg
+1
-1
cfg/encoder_lowdelay_bms.cfg
cfg/encoder_lowdelay_bms.cfg
+1
-1
cfg/encoder_lowdelay_vtm.cfg
cfg/encoder_lowdelay_vtm.cfg
+1
-1
cfg/encoder_randomaccess_bms.cfg
cfg/encoder_randomaccess_bms.cfg
+2
-2
cfg/encoder_randomaccess_vtm.cfg
cfg/encoder_randomaccess_vtm.cfg
+1
-1
source/App/EncoderApp/EncApp.cpp
source/App/EncoderApp/EncApp.cpp
+2
-0
source/App/EncoderApp/EncAppCfg.cpp
source/App/EncoderApp/EncAppCfg.cpp
+14
-4
source/Lib/CommonLib/CodingStructure.cpp
source/Lib/CommonLib/CodingStructure.cpp
+1
-7
source/Lib/CommonLib/ContextModelling.cpp
source/Lib/CommonLib/ContextModelling.cpp
+6
-0
source/Lib/CommonLib/InterPrediction.cpp
source/Lib/CommonLib/InterPrediction.cpp
+228
-55
source/Lib/CommonLib/InterPrediction.h
source/Lib/CommonLib/InterPrediction.h
+5
-2
source/Lib/CommonLib/LoopFilter.cpp
source/Lib/CommonLib/LoopFilter.cpp
+11
-3
source/Lib/CommonLib/Mv.cpp
source/Lib/CommonLib/Mv.cpp
+8
-3
source/Lib/CommonLib/Mv.h
source/Lib/CommonLib/Mv.h
+45
-11
source/Lib/CommonLib/Quant.cpp
source/Lib/CommonLib/Quant.cpp
+1
-5
source/Lib/CommonLib/RdCost.h
source/Lib/CommonLib/RdCost.h
+1
-1
source/Lib/CommonLib/Slice.cpp
source/Lib/CommonLib/Slice.cpp
+6
-15
source/Lib/CommonLib/Slice.h
source/Lib/CommonLib/Slice.h
+10
-9
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+2
-0
source/Lib/CommonLib/UnitTools.cpp
source/Lib/CommonLib/UnitTools.cpp
+179
-54
source/Lib/CommonLib/UnitTools.h
source/Lib/CommonLib/UnitTools.h
+10
-2
source/Lib/CommonLib/dtrace_blockstatistics.cpp
source/Lib/CommonLib/dtrace_blockstatistics.cpp
+74
-4
source/Lib/DecoderLib/CABACReader.cpp
source/Lib/DecoderLib/CABACReader.cpp
+1
-1
source/Lib/DecoderLib/DecCu.cpp
source/Lib/DecoderLib/DecCu.cpp
+22
-4
source/Lib/DecoderLib/DecLib.cpp
source/Lib/DecoderLib/DecLib.cpp
+1
-7
source/Lib/DecoderLib/VLCReader.cpp
source/Lib/DecoderLib/VLCReader.cpp
+6
-2
source/Lib/EncoderLib/CABACWriter.cpp
source/Lib/EncoderLib/CABACWriter.cpp
+5
-5
source/Lib/EncoderLib/EncCfg.h
source/Lib/EncoderLib/EncCfg.h
+11
-3
source/Lib/EncoderLib/EncCu.cpp
source/Lib/EncoderLib/EncCu.cpp
+1
-7
source/Lib/EncoderLib/EncGOP.cpp
source/Lib/EncoderLib/EncGOP.cpp
+12
-21
source/Lib/EncoderLib/EncLib.cpp
source/Lib/EncoderLib/EncLib.cpp
+5
-1
source/Lib/EncoderLib/EncModeCtrl.cpp
source/Lib/EncoderLib/EncModeCtrl.cpp
+4
-15
source/Lib/EncoderLib/EncSlice.cpp
source/Lib/EncoderLib/EncSlice.cpp
+6
-10
source/Lib/EncoderLib/InterSearch.cpp
source/Lib/EncoderLib/InterSearch.cpp
+301
-44
source/Lib/EncoderLib/RateCtrl.cpp
source/Lib/EncoderLib/RateCtrl.cpp
+6
-6
source/Lib/EncoderLib/RateCtrl.h
source/Lib/EncoderLib/RateCtrl.h
+3
-3
source/Lib/EncoderLib/VLCWriter.cpp
source/Lib/EncoderLib/VLCWriter.cpp
+6
-2
source/VisualStudio/common.natvis
source/VisualStudio/common.natvis
+3
-4
No files found.
cfg/encoder_intra_bms.cfg
View file @
c180eab1
...
...
@@ -105,7 +105,6 @@ MTT : 1
EMT : 3
EMTFast : 3
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1
...
...
@@ -127,3 +126,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_intra_vtm.cfg
View file @
c180eab1
...
...
@@ -105,7 +105,6 @@ MTT : 1
EMT : 1
EMTFast : 1
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
...
...
@@ -121,3 +120,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_lowdelay_P_bms.cfg
View file @
c180eab1
...
...
@@ -121,7 +121,6 @@ MTT : 1
EMT : 3
EMTFast : 3
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1
...
...
@@ -143,3 +142,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_lowdelay_P_vtm.cfg
View file @
c180eab1
...
...
@@ -121,7 +121,6 @@ MTT : 1
EMT : 1
EMTFast : 1
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
...
...
@@ -137,3 +136,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_lowdelay_bms.cfg
View file @
c180eab1
...
...
@@ -121,7 +121,6 @@ MTT : 1
EMT : 3
EMTFast : 3
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1
...
...
@@ -143,3 +142,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_lowdelay_vtm.cfg
View file @
c180eab1
...
...
@@ -121,7 +121,6 @@ MTT : 1
EMT : 1
EMTFast : 1
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
...
...
@@ -137,3 +136,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_randomaccess_bms.cfg
View file @
c180eab1
...
...
@@ -110,7 +110,7 @@ RCForceIntraQP : 0 # Rate control: force int
#============ JEM settings ======================
LoopFilterTcOffset_div2 : 0
SEIDecodedPictureHash :
0
SEIDecodedPictureHash :
1
CbQpOffset : 0
CrQpOffset : 0
...
...
@@ -135,7 +135,6 @@ MTT : 1
EMT : 3
EMTFast : 3
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1
...
...
@@ -158,3 +157,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
cfg/encoder_randomaccess_vtm.cfg
View file @
c180eab1
...
...
@@ -135,7 +135,6 @@ MTT : 1
EMT : 1
EMTFast : 1
Affine : 1
HighPrecMv : 1
SubPuMvp : 1
MaxNumMergeCand : 6
LMChroma : 1 # use CCLM only
...
...
@@ -151,3 +150,4 @@ AMaxBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
source/App/EncoderApp/EncApp.cpp
View file @
c180eab1
...
...
@@ -241,7 +241,9 @@ void EncApp::xInitLibCfg()
#endif
#endif
#if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
m_cEncLib
.
setHighPrecisionMv
(
m_highPrecisionMv
);
#endif
m_cEncLib
.
setAffine
(
m_Affine
);
#if JVET_K0337_AFFINE_6PARA
m_cEncLib
.
setAffineType
(
m_AffineType
);
...
...
source/App/EncoderApp/EncAppCfg.cpp
View file @
c180eab1
...
...
@@ -833,10 +833,14 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
(
"SubPuMvp"
,
m_SubPuMvpMode
,
0
,
"Enable Sub-PU temporal motion vector prediction (0:off, 1:on) [default: off]"
)
#endif
(
"SubPuMvpLog2Size"
,
m_SubPuMvpLog2Size
,
2u
,
"Sub-PU TMVP size index: 2^n"
)
(
"HighPrecMv"
,
m_highPrecisionMv
,
false
,
"High precision motion vectors for temporal merging (0:off, 1:on) [default: off]"
)
#if !REMOVE_MV_ADAPT_PREC
(
"HighPrecMv"
,
m_highPrecisionMv
,
false
,
"High precision motion vectors for temporal merging (0:off, 1:on) [default: off]"
)
#endif
#endif
#if JEM_TOOLS || JVET_K_AFFINE
(
"HighPrecMv"
,
m_highPrecisionMv
,
false
,
"High precision motion vectors for temporal merging (0:off, 1:on) [default: off]"
)
#if !REMOVE_MV_ADAPT_PREC
(
"HighPrecMv"
,
m_highPrecisionMv
,
false
,
"High precision motion vectors for temporal merging (0:off, 1:on) [default: off]"
)
#endif
(
"Affine"
,
m_Affine
,
false
,
"Enable affine prediction (0:off, 1:on) [default: off]"
)
#if JVET_K0337_AFFINE_6PARA
(
"AffineType"
,
m_AffineType
,
true
,
"Enable affine type prediction (0:off, 1:on) [default: on]"
)
...
...
@@ -2122,7 +2126,9 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara
(
!
(
m_OBMCBlkSize
==
4
||
m_OBMCBlkSize
==
8
),
"OBMC Block Size must be set to 4 or 8 samples"
);
#endif
#if JVET_K_AFFINE
xConfirmPara
(
m_Affine
&&
!
m_highPrecisionMv
,
"Affine is not yet implemented for HighPrecMv off."
);
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara
(
m_Affine
&&
!
m_highPrecisionMv
,
"Affine is not yet implemented for HighPrecMv off."
);
#endif
#endif
#if JEM_TOOLS
xConfirmPara
(
m_DMVR
&&
!
m_QTBT
,
"DMVR without QTBT results in encoder-decoder mismatch!"
);
...
...
@@ -3403,11 +3409,15 @@ void EncAppCfg::xPrintParameter()
#endif
#endif
#if JEM_TOOLS
msg
(
VERBOSE
,
"HighPrecMv:%d "
,
m_highPrecisionMv
);
#if !REMOVE_MV_ADAPT_PREC
msg
(
VERBOSE
,
"HighPrecMv:%d "
,
m_highPrecisionMv
);
#endif
msg
(
VERBOSE
,
"BIO:%d "
,
m_BIO
);
#endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC
msg
(
VERBOSE
,
"HighPrecMv:%d "
,
m_highPrecisionMv
);
#endif
#endif
msg
(
VERBOSE
,
"DisMDC:%d "
,
m_DisableMotionCompression
);
#if JEM_TOOLS
...
...
source/Lib/CommonLib/CodingStructure.cpp
View file @
c180eab1
...
...
@@ -564,13 +564,7 @@ cTUTraverser CodingStructure::traverseTUs( const UnitArea& unit, const ChannelTy
void
CodingStructure
::
allocateVectorsAtPicLevel
()
{
const
int
twice
=
(
#if JVET_K0076_CPR_DT
(
!
pcv
->
ISingleTree
&&
(
slice
->
isIntra
()
||
this
->
slice
->
getCprIsOnlyRefPic
()))
#else
!
pcv
->
ISingleTree
&&
slice
->
isIntra
()
#endif
&&
pcv
->
chrFormat
!=
CHROMA_400
)
?
2
:
1
;
const
int
twice
=
(
!
pcv
->
ISingleTree
&&
slice
->
isIRAP
()
&&
pcv
->
chrFormat
!=
CHROMA_400
)
?
2
:
1
;
size_t
allocSize
=
twice
*
unitScale
[
0
].
scale
(
area
.
blocks
[
0
].
size
()
).
area
();
cus
.
reserve
(
allocSize
);
...
...
source/Lib/CommonLib/ContextModelling.cpp
View file @
c180eab1
...
...
@@ -769,7 +769,13 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
{
pu
.
cu
->
ibc
=
true
;
pu
.
bv
=
pu
.
mv
[
REF_PIC_LIST_0
];
#if REMOVE_MV_ADAPT_PREC
const
int
shift
=
2
+
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
pu
.
bv
.
hor
=
pu
.
bv
.
hor
>>
shift
;
pu
.
bv
.
ver
=
pu
.
bv
.
ver
>>
shift
;
#else
pu
.
bv
>>=
2
;
// used for only integer resolution
#endif
}
#endif
#if JEM_TOOLS
...
...
source/Lib/CommonLib/InterPrediction.cpp
View file @
c180eab1
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/InterPrediction.h
View file @
c180eab1
...
...
@@ -324,8 +324,11 @@ protected:
#endif
void
xFrucUpdateTemplate
(
PredictionUnit
&
pu
,
int
nWidth
,
int
nHeight
,
RefPicList
eCurRefPicList
,
const
MvField
&
rCurMvField
);
void
xFrucInsertMv2StartList
(
const
MvField
&
rMvField
,
std
::
list
<
MvField
>
&
rList
,
bool
setHighPrec
);
#if REMOVE_MV_ADAPT_PREC
void
xFrucInsertMv2StartList
(
const
MvField
&
rMvField
,
std
::
list
<
MvField
>
&
rList
);
#else
void
xFrucInsertMv2StartList
(
const
MvField
&
rMvField
,
std
::
list
<
MvField
>
&
rList
,
bool
setHighPrec
);
#endif
bool
xFrucIsInList
(
const
MvField
&
rMvField
,
std
::
list
<
MvField
>
&
rList
);
bool
xFrucGetCurBlkTemplate
(
PredictionUnit
&
pu
,
int
nCurBlkWidth
,
int
nCurBlkHeight
);
...
...
source/Lib/CommonLib/LoopFilter.cpp
View file @
c180eab1
...
...
@@ -506,14 +506,18 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
int
nThreshold
=
4
;
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if
(
cu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
)
#if !REMOVE_MV_ADAPT_PREC
if
(
cu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
())
{
mvP0
.
setHighPrec
();
mvP1
.
setHighPrec
();
mvQ0
.
setHighPrec
();
mvQ1
.
setHighPrec
();
#endif
nThreshold
=
4
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
}
#if !REMOVE_MV_ADAPT_PREC
}
#endif
#endif
unsigned
uiBs
=
0
;
...
...
@@ -569,12 +573,16 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
int
nThreshold
=
4
;
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
if
(
cu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
)
#if !REMOVE_MV_ADAPT_PREC
if
(
cu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
())
{
mvP0
.
setHighPrec
();
mvQ0
.
setHighPrec
();
#endif
nThreshold
=
4
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
#endif
return
(
(
abs
(
mvQ0
.
getHor
()
-
mvP0
.
getHor
()
)
>=
nThreshold
)
||
(
abs
(
mvQ0
.
getVer
()
-
mvP0
.
getVer
()
)
>=
nThreshold
)
)
?
1
:
0
;
}
...
...
source/Lib/CommonLib/Mv.cpp
View file @
c180eab1
...
...
@@ -44,7 +44,9 @@
void
roundMV
(
Mv
&
rMV
,
unsigned
imvShift
)
{
CHECK
(
imvShift
==
0
,
"roundMV called for imvShift=0"
);
if
(
rMV
.
highPrec
)
imvShift
+=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#if !REMOVE_MV_ADAPT_PREC
if
(
rMV
.
highPrec
)
imvShift
+=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#endif
int
offset
=
1
<<
(
imvShift
-
1
);
rMV
.
setHor
(
(
(
rMV
.
getHor
()
+
offset
)
>>
imvShift
)
<<
imvShift
);
...
...
@@ -63,10 +65,13 @@ void roundAffineMv( int& mvx, int& mvy, int nShift )
void
clipMv
(
Mv
&
rcMv
,
const
Position
&
pos
,
const
SPS
&
sps
)
{
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
int
iMvShift
=
2
+
(
rcMv
.
highPrec
?
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
:
0
);
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
int
iMvShift
=
2
+
(
rcMv
.
highPrec
?
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
:
0
);
#else
int
iMvShift
=
2
;
#endif
#if REMOVE_MV_ADAPT_PREC
iMvShift
+=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#endif
int
iOffset
=
8
;
int
iHorMax
=
(
sps
.
getPicWidthInLumaSamples
()
+
iOffset
-
(
int
)
pos
.
x
-
1
)
<<
iMvShift
;
...
...
source/Lib/CommonLib/Mv.h
View file @
c180eab1
...
...
@@ -53,7 +53,7 @@ class Mv
public:
int
hor
;
///< horizontal component of motion vector
int
ver
;
///< vertical component of motion vector
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
bool
highPrec
;
///< true if the vector is high precision
#endif
...
...
@@ -61,7 +61,7 @@ public:
// constructors
// ------------------------------------------------------------------------------------------------------------------
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
Mv
(
)
:
hor
(
0
),
ver
(
0
),
highPrec
(
false
)
{}
Mv
(
int
iHor
,
int
iVer
,
bool
_highPrec
=
false
)
:
hor
(
iHor
),
ver
(
iVer
),
highPrec
(
_highPrec
)
{}
#if DMVR_JVET_K0217
...
...
@@ -80,9 +80,33 @@ public:
return
(
hor
==
0
&&
ver
==
0
);
}
#endif
#else
#if JEM_TOOLS
#if REMOVE_MV_ADAPT_PREC && DMVR_JVET_K0217
Mv
()
:
hor
(
0
),
ver
(
0
)
{}
Mv
(
int
iHor
,
int
iVer
)
:
hor
(
iHor
),
ver
(
iVer
)
{}
// explicit Mv(const Mv &newMv) : hor(newMv.hor), ver(newMv.ver) {} // use default copy constructor
explicit
Mv
(
int
iHorAndiVer
)
:
hor
(
iHorAndiVer
),
ver
(
iHorAndiVer
)
{}
Mv
operator
<<
(
int
i
)
{
return
Mv
(
hor
<<
i
,
ver
<<
i
);
}
Mv
operator
-
(
void
)
{
return
Mv
(
-
hor
,
-
ver
);
}
bool
IsZero
(
void
)
{
return
(
hor
==
0
&&
ver
==
0
);
}
#else
Mv
()
:
hor
(
0
),
ver
(
0
)
{}
Mv
(
int
iHor
,
int
iVer
)
:
hor
(
iHor
),
ver
(
iVer
)
{}
#endif
#else
Mv
(
)
:
hor
(
0
),
ver
(
0
)
{}
Mv
(
int
iHor
,
int
iVer
)
:
hor
(
iHor
),
ver
(
iVer
)
{}
#endif
#endif
// ------------------------------------------------------------------------------------------------------------------
...
...
@@ -109,7 +133,7 @@ public:
const
Mv
&
operator
+=
(
const
Mv
&
_rcMv
)
{
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
highPrec
==
_rcMv
.
highPrec
)
{
hor
+=
_rcMv
.
hor
;
...
...
@@ -120,7 +144,7 @@ public:
{
Mv
rcMv
=
_rcMv
;
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
highPrec
&&
!
rcMv
.
highPrec
)
rcMv
.
setHighPrec
();
if
(
!
highPrec
&&
rcMv
.
highPrec
)
setHighPrec
();
#endif
...
...
@@ -132,7 +156,7 @@ public:
const
Mv
&
operator
-=
(
const
Mv
&
_rcMv
)
{
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
highPrec
==
_rcMv
.
highPrec
)
{
hor
-=
_rcMv
.
hor
;
...
...
@@ -143,7 +167,7 @@ public:
{
Mv
rcMv
=
_rcMv
;
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
highPrec
&&
!
rcMv
.
highPrec
)
rcMv
.
setHighPrec
();
if
(
!
highPrec
&&
rcMv
.
highPrec
)
setHighPrec
();
#endif
...
...
@@ -182,7 +206,7 @@ public:
const
Mv
operator
-
(
const
Mv
&
rcMv
)
const
{
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
rcMv
.
highPrec
==
highPrec
)
{
return
Mv
(
hor
-
rcMv
.
hor
,
ver
-
rcMv
.
ver
,
highPrec
);
...
...
@@ -201,7 +225,7 @@ public:
const
Mv
operator
+
(
const
Mv
&
rcMv
)
const
{
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
rcMv
.
highPrec
==
highPrec
)
{
return
Mv
(
hor
+
rcMv
.
hor
,
ver
+
rcMv
.
ver
,
highPrec
);
...
...
@@ -220,7 +244,7 @@ public:
bool
operator
==
(
const
Mv
&
rcMv
)
const
{
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
rcMv
.
highPrec
==
highPrec
)
{
return
(
hor
==
rcMv
.
hor
&&
ver
==
rcMv
.
ver
);
...
...
@@ -247,7 +271,7 @@ public:
{
const
int
mvx
=
Clip3
(
-
32768
,
32767
,
(
iScale
*
getHor
()
+
127
+
(
iScale
*
getHor
()
<
0
))
>>
8
);
const
int
mvy
=
Clip3
(
-
32768
,
32767
,
(
iScale
*
getVer
()
+
127
+
(
iScale
*
getVer
()
<
0
))
>>
8
);
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
return
Mv
(
mvx
,
mvy
,
highPrec
);
#else
return
Mv
(
mvx
,
mvy
);
...
...
@@ -257,11 +281,20 @@ public:
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
void
roundMV2SignalPrecision
()
{
#if REMOVE_MV_ADAPT_PREC
const
int
nShift
=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
const
int
nOffset
=
1
<<
(
nShift
-
1
);
hor
=
hor
>=
0
?
(
hor
+
nOffset
)
>>
nShift
:
-
((
-
hor
+
nOffset
)
>>
nShift
);
ver
=
ver
>=
0
?
(
ver
+
nOffset
)
>>
nShift
:
-
((
-
ver
+
nOffset
)
>>
nShift
);
hor
=
hor
>=
0
?
(
hor
)
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
:
-
((
-
hor
)
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
);
ver
=
ver
>=
0
?
(
ver
)
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
:
-
((
-
ver
)
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
);
#else
const
bool
isHP
=
highPrec
;
setLowPrec
();
if
(
isHP
)
setHighPrec
();
#endif
}
#if !REMOVE_MV_ADAPT_PREC
void
setLowPrec
()
{
if
(
!
highPrec
)
return
;
...
...
@@ -280,6 +313,7 @@ public:
highPrec
=
true
;
}
#endif
#endif
};
// END CLASS DEFINITION MV
#if JVET_K0076_CPR
namespace
std
...
...
source/Lib/CommonLib/Quant.cpp
View file @
c180eab1
...
...
@@ -799,11 +799,7 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
const
int
iQBits
=
QUANT_SHIFT
+
cQP
.
per
+
iTransformShift
;
// QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset
const
int64_t
iAdd
=
int64_t
(
tu
.
cs
->
slice
->
getSliceType
()
==
I_SLICE
#if JVET_K0076_CPR
||
(
tu
.
cs
->
slice
->
getNumRefIdx
(
REF_PIC_LIST_0
)
==
1
&&
tu
.
cs
->
slice
->
getSPS
()
->
getSpsNext
().
getIBCMode
())
#endif
?
171
:
85
)
<<
int64_t
(
iQBits
-
9
);
const
int64_t
iAdd
=
int64_t
(
tu
.
cs
->
slice
->
isIRAP
()
?
171
:
85
)
<<
int64_t
(
iQBits
-
9
);
#if HEVC_USE_SIGN_HIDING
const
int
qBits8
=
iQBits
-
8
;
#endif
...
...
source/Lib/CommonLib/RdCost.h
View file @
c180eab1
...
...
@@ -187,7 +187,7 @@ public:
void
setPredictor
(
const
Mv
&
rcMv
)
{
m_mvPredictor
=
rcMv
;
#if
JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if
(JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
if
(
m_mvPredictor
.
highPrec
)
{
m_mvPredictor
=
Mv
(
m_mvPredictor
.
hor
>>
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
,
m_mvPredictor
.
ver
>>
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
,
false
);
...
...
source/Lib/CommonLib/Slice.cpp
View file @
c180eab1
...
...
@@ -136,9 +136,6 @@ Slice::Slice()
,
m_iProcessingStartTime
(
0
)
,
m_dProcessingTime
(
0
)
,
m_uiMaxBTSize
(
0
)
#if JVET_K0076_CPR
,
m_bCprIsOnlyRefPic
(
false
)
#endif
{
for
(
uint32_t
i
=
0
;
i
<
NUM_REF_PIC_LIST_01
;
i
++
)
{
...
...
@@ -1839,11 +1836,15 @@ SPSNext::SPSNext( SPS& sps )
#endif
#endif
#if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
,
m_highPrecMv
(
false
)
#endif
,
m_BIO
(
false
)
#endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC
,
m_highPrecMv
(
false
)
#endif
#endif
,
m_DisableMotionCompression
(
false
)
#if JEM_TOOLS
...
...
@@ -2726,12 +2727,7 @@ void calculateParameterSetChangedFlag(bool &bChanged, const std::vector<uint8_t>
uint32_t
PreCalcValues
::
getValIdx
(
const
Slice
&
slice
,
const
ChannelType
chType
)
const
{
#if JVET_K0076_CPR_DT
return
(
slice
.
isIntra
()
||
slice
.
getCprIsOnlyRefPic
())
?
(
ISingleTree
?
0
:
(
chType
<<
1
))
:
1
;
#else
return
slice
.
isIntra
()
?
(
ISingleTree
?
0
:
(
chType
<<
1
)
)
:
1
;
#endif
return
slice
.
isIRAP
()
?
(
ISingleTree
?
0
:
(
chType
<<
1
)
)
:
1
;
}
uint32_t
PreCalcValues
::
getMaxBtDepth
(
const
Slice
&
slice
,
const
ChannelType
chType
)
const
...
...
@@ -2746,12 +2742,7 @@ uint32_t PreCalcValues::getMinBtSize( const Slice &slice, const ChannelType chTy
uint32_t
PreCalcValues
::
getMaxBtSize
(
const
Slice
&
slice
,
const
ChannelType
chType
)
const
{
#if JVET_K0076_CPR_DT
return
((
!
slice
.
isIntra
()
&&
!
slice
.
getCprIsOnlyRefPic
())
||
isLuma
(
chType
)
||
ISingleTree
)
?
slice
.
getMaxBTSize
()
:
MAX_BT_SIZE_C
;
#else
return
(
!
slice
.
isIntra
()
||
isLuma
(
chType
)
||
ISingleTree
)
?
slice
.
getMaxBTSize
()
:
MAX_BT_SIZE_C
;
#endif
return
(
!
slice
.
isIRAP
()
||
isLuma
(
chType
)
||
ISingleTree
)
?
slice
.
getMaxBTSize
()
:
MAX_BT_SIZE_C
;
}
uint32_t
PreCalcValues
::
getMinTtSize
(
const
Slice
&
slice
,
const
ChannelType
chType
)
const
...
...
source/Lib/CommonLib/Slice.h
View file @
c180eab1
...
...
@@ -829,11 +829,15 @@ private:
#endif
#endif
#if JEM_TOOLS
#if !REMOVE_MV_ADAPT_PREC
bool
m_highPrecMv
;
// 11
#endif
bool
m_BIO
;
// 12
#endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC
bool
m_highPrecMv
;
#endif
#endif
bool
m_DisableMotionCompression
;
// 13
#if JEM_TOOLS
...
...
@@ -1016,14 +1020,18 @@ public:
#endif
#endif
#if JEM_TOOLS
void
setUseHighPrecMv
(
bool
b
)
{
m_highPrecMv
=
b
;
}
bool
getUseHighPrecMv
()
const
{
return
m_highPrecMv
;
}
#if !REMOVE_MV_ADAPT_PREC
void
setUseHighPrecMv
(
bool
b
)
{
m_highPrecMv
=
b
;
}
bool
getUseHighPrecMv
()
const
{
return
m_highPrecMv
;
}
#endif
void
setUseBIO
(
bool
b
)
{
m_BIO
=
b
;
}
bool
getUseBIO
()
const
{
return
m_BIO
;
}
#endif
#if !JEM_TOOLS && (JVET_K0346 || JVET_K_AFFINE)
#if !REMOVE_MV_ADAPT_PREC
void
setUseHighPrecMv
(
bool
b
)
{
m_highPrecMv
=
b
;
}
bool
getUseHighPrecMv
()
const
{
return
m_highPrecMv
;
}
#endif
#endif
void
setDisableMotCompress
(
bool
b
)
{
m_DisableMotionCompression
=
b
;
}
bool
getDisableMotCompress
()
const
{
return
m_DisableMotionCompression
;
}
...
...
@@ -1839,9 +1847,6 @@ private:
clock_t
m_iProcessingStartTime
;
double
m_dProcessingTime
;
uint32_t
m_uiMaxBTSize
;
#if JVET_K0076_CPR
bool
m_bCprIsOnlyRefPic
;
#endif
#if JVET_K0371_ALF
AlfSliceParam
m_alfSliceParam
;
...
...
@@ -1962,10 +1967,6 @@ public:
void
setMaxBTSize
(
int
i
)
{
m_uiMaxBTSize
=
i
;
}
uint32_t
getMaxBTSize
()
const
{
return
m_uiMaxBTSize
;
}
#if JVET_K0076_CPR
bool
getCprIsOnlyRefPic
()
const
{
return
m_bCprIsOnlyRefPic
;
}
void
setCprIsOnlyRefPic
(
bool
b
)
{
m_bCprIsOnlyRefPic
=
b
;
}
#endif
#if JEM_TOOLS
bool
getUseLIC
()
const
{
return
m_UseLIC
;
}
...
...
source/Lib/CommonLib/TypeDef.h
View file @
c180eab1
...
...
@@ -128,6 +128,8 @@
#define JVET_K0357_AMVR 1 // Adaptive motion vector resolution separated from JEM_TOOLS macro
#define REMOVE_MV_ADAPT_PREC 1 // remove the high precision flag in the MV class
#if JVET_K0485_BIO
#define JVET_K0485_BIO_EXTEND_SIZE 1
#endif
...
...
source/Lib/CommonLib/UnitTools.cpp
View file @
c180eab1
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/UnitTools.h
View file @
c180eab1
...
...
@@ -189,14 +189,22 @@ namespace PU
#if JEM_TOOLS
bool
isAffineMrgFlagCoded
(
const
PredictionUnit
&
pu
);
void
setAllAffineMvField
(
PredictionUnit
&
pu
,
MvField
*
mvField
,
RefPicList
eRefList
);
void
setAllAffineMv
(
PredictionUnit
&
pu
,
Mv
affLT
,
Mv
affRT
,
Mv
affLB
,
RefPicList
eRefList
);
void
setAllAffineMv
(
PredictionUnit
&
pu
,
Mv
affLT
,
Mv
affRT
,
Mv
affLB
,
RefPicList
eRefList
#if REMOVE_MV_ADAPT_PREC
,
bool
setHighPrec
=
false
#endif
);
bool
isBIOLDB
(
const
PredictionUnit
&
pu
);
#endif
#if !JEM_TOOLS && JVET_K_AFFINE
bool
isAffineMrgFlagCoded
(
const
PredictionUnit
&
pu
);
void
getAffineMergeCand
(
const
PredictionUnit
&
pu
,
MvField
(
*
mvFieldNeighbours
)[
3
],
unsigned
char
&
interDirNeighbours
,
int
&
numValidMergeCand
);
void
setAllAffineMvField
(
PredictionUnit
&
pu
,
MvField
*
mvField
,
RefPicList
eRefList
);
void
setAllAffineMv
(
PredictionUnit
&
pu
,
Mv
affLT
,
Mv
affRT
,
Mv
affLB
,
RefPicList
eRefList
);
void
setAllAffineMv
(
PredictionUnit
&
pu
,
Mv
affLT
,
Mv
affRT
,
Mv
affLB
,
RefPicList
eRefList
#if REMOVE_MV_ADAPT_PREC
,
bool
setHighPrec
=
false
#endif
);
#endif
#if !JEM_TOOLS && JVET_K0346
bool
getInterMergeSubPuMvpCand
(
const
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
bool
&
LICFlag
,
const
int
count
...
...
source/Lib/CommonLib/dtrace_blockstatistics.cpp
View file @
c180eab1
...
...
@@ -278,7 +278,10 @@ void getAndStoreBlockStatistics(const CodingStructure& cs, const UnitArea& ctuAr
void
writeAllData
(
const
CodingStructure
&
cs
,
const
UnitArea
&
ctuArea
)
{
const
int
maxNumChannelType
=
cs
.
pcv
->
chrFormat
!=
CHROMA_400
&&
CS
::
isDualITree
(
cs
)
?
2
:
1
;
#if REMOVE_MV_ADAPT_PREC
const
int
nShift
=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
const
int
nOffset
=
1
<<
(
nShift
-
1
);
#endif
for
(
int
ch
=
0
;
ch
<
maxNumChannelType
;
ch
++
)
{
const
ChannelType
chType
=
ChannelType
(
ch
);
...
...
@@ -385,9 +388,16 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
Mv
mv
=
pu
.
mv
[
REF_PIC_LIST_0
];
Mv
mvd
=
pu
.
mvd
[
REF_PIC_LIST_0
];
#if JEM_TOOLS || JVET_K0346 || JVET_K_AFFINE
#if REMOVE_MV_ADAPT_PREC
mv
.
hor
=
mv
.
hor
>=
0
?
(
mv
.
hor
+
nOffset
)
>>
nShift
:
-
((
-
mv
.
hor
+
nOffset
)
>>
nShift
);
mv
.
ver
=
mv
.
ver
>=
0
?
(
mv
.
ver
+
nOffset
)
>>
nShift
:
-
((
-
mv
.
ver
+
nOffset
)
>>
nShift
);
mvd
.
hor
=
mvd
.
hor
>=
0
?
(
mvd
.
hor
+
nOffset
)
>>
nShift
:
-
((
-
mvd
.
hor
+
nOffset
)
>>
nShift
);
mvd
.
ver
=
mvd
.
ver
>=
0
?
(
mvd
.
ver
+
nOffset
)
>>
nShift
:
-
((
-
mvd
.
ver
+
nOffset
)
>>
nShift
);