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
45463a41
Commit
45463a41
authored
Dec 25, 2018
by
Karsten Suehring
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clean_REMOVE_MV_ADAPT_PREC' into 'master'
Cleaned REMOVE_MV_ADAPT_PREC See merge request
jvet/VVCSoftware_VTM!138
parents
10a973eb
0783ed2d
Pipeline
#472
passed with stage
Changes
22
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
0 additions
and
692 deletions
+0
-692
source/App/EncoderApp/EncApp.cpp
source/App/EncoderApp/EncApp.cpp
+0
-3
source/App/EncoderApp/EncAppCfg.cpp
source/App/EncoderApp/EncAppCfg.cpp
+0
-16
source/App/EncoderApp/EncAppCfg.h
source/App/EncoderApp/EncAppCfg.h
+0
-3
source/Lib/CommonLib/ContextModelling.cpp
source/Lib/CommonLib/ContextModelling.cpp
+0
-65
source/Lib/CommonLib/InterPrediction.cpp
source/Lib/CommonLib/InterPrediction.cpp
+0
-17
source/Lib/CommonLib/LoopFilter.cpp
source/Lib/CommonLib/LoopFilter.cpp
+0
-20
source/Lib/CommonLib/Mv.cpp
source/Lib/CommonLib/Mv.cpp
+0
-9
source/Lib/CommonLib/Mv.h
source/Lib/CommonLib/Mv.h
+0
-104
source/Lib/CommonLib/RdCost.h
source/Lib/CommonLib/RdCost.h
+0
-6
source/Lib/CommonLib/Slice.cpp
source/Lib/CommonLib/Slice.cpp
+0
-3
source/Lib/CommonLib/Slice.h
source/Lib/CommonLib/Slice.h
+0
-7
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+0
-1
source/Lib/CommonLib/UnitTools.cpp
source/Lib/CommonLib/UnitTools.cpp
+0
-178
source/Lib/CommonLib/UnitTools.h
source/Lib/CommonLib/UnitTools.h
+0
-2
source/Lib/CommonLib/dtrace_blockstatistics.cpp
source/Lib/CommonLib/dtrace_blockstatistics.cpp
+0
-56
source/Lib/DecoderLib/DecCu.cpp
source/Lib/DecoderLib/DecCu.cpp
+0
-16
source/Lib/DecoderLib/VLCReader.cpp
source/Lib/DecoderLib/VLCReader.cpp
+0
-3
source/Lib/EncoderLib/CABACWriter.cpp
source/Lib/EncoderLib/CABACWriter.cpp
+0
-9
source/Lib/EncoderLib/EncCfg.h
source/Lib/EncoderLib/EncCfg.h
+0
-7
source/Lib/EncoderLib/EncLib.cpp
source/Lib/EncoderLib/EncLib.cpp
+0
-3
source/Lib/EncoderLib/InterSearch.cpp
source/Lib/EncoderLib/InterSearch.cpp
+0
-161
source/Lib/EncoderLib/VLCWriter.cpp
source/Lib/EncoderLib/VLCWriter.cpp
+0
-3
No files found.
source/App/EncoderApp/EncApp.cpp
View file @
45463a41
...
...
@@ -225,9 +225,6 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib
.
setAffine
(
m_Affine
);
m_cEncLib
.
setAffineType
(
m_AffineType
);
#if !REMOVE_MV_ADAPT_PREC
m_cEncLib
.
setHighPrecisionMv
(
m_highPrecisionMv
);
#endif
#if JVET_L0256_BIO
m_cEncLib
.
setBIO
(
m_BIO
);
#endif
...
...
source/App/EncoderApp/EncAppCfg.cpp
View file @
45463a41
...
...
@@ -817,12 +817,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
(
"SubPuMvp"
,
m_SubPuMvpMode
,
0
,
"Enable Sub-PU temporal motion vector prediction (0:off, 1:ATMVP, 2:STMVP, 3:ATMVP+STMVP) [default: off]"
)
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
(
"SubPuMvpLog2Size"
,
m_SubPuMvpLog2Size
,
2u
,
"Sub-PU TMVP size index: 2^n"
)
#endif
#if !REMOVE_MV_ADAPT_PREC
(
"HighPrecMv"
,
m_highPrecisionMv
,
false
,
"High precision motion vectors for temporal merging (0:off, 1:on) [default: off]"
)
#endif
#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]"
)
(
"AffineType"
,
m_AffineType
,
true
,
"Enable affine type prediction (0:off, 1:on) [default: on]"
)
...
...
@@ -1941,10 +1935,6 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara
(
m_LMChroma
,
"LMChroma only allowed with NEXT profile"
);
xConfirmPara
(
m_LargeCTU
,
"Large CTU is only allowed with NEXT profile"
);
xConfirmPara
(
m_SubPuMvpMode
!=
0
,
"Sub-PU motion vector prediction is only allowed with NEXT profile"
);
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara
(
m_highPrecisionMv
,
"High precision MV for temporal merging can only be used with NEXT profile"
);
xConfirmPara
(
m_Affine
,
"Affine is only allowed with NEXT profile"
);
#endif
#if JVET_L0256_BIO
xConfirmPara
(
m_BIO
,
"BIO only allowed with NEXT profile"
);
#endif
...
...
@@ -1984,9 +1974,6 @@ bool EncAppCfg::xCheckParameter()
#endif
}
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara
(
m_Affine
&&
!
m_highPrecisionMv
,
"Affine is not yet implemented for HighPrecMv off."
);
#endif
}
#if JVET_L0231_WRAPAROUND
...
...
@@ -3147,9 +3134,6 @@ void EncAppCfg::xPrintParameter()
msg
(
VERBOSE
,
"DualITree:%d "
,
m_dualTree
);
msg
(
VERBOSE
,
"LargeCTU:%d "
,
m_LargeCTU
);
msg
(
VERBOSE
,
"IMV:%d "
,
m_ImvMode
);
#if !REMOVE_MV_ADAPT_PREC
msg
(
VERBOSE
,
"HighPrecMv:%d "
,
m_highPrecisionMv
);
#endif
#if JVET_L0256_BIO
msg
(
VERBOSE
,
"BIO:%d "
,
m_BIO
);
#endif
...
...
source/App/EncoderApp/EncAppCfg.h
View file @
45463a41
...
...
@@ -212,9 +212,6 @@ protected:
#endif
bool
m_Affine
;
bool
m_AffineType
;
#if !REMOVE_MV_ADAPT_PREC
bool
m_highPrecisionMv
;
#endif
#if JVET_L0256_BIO
bool
m_BIO
;
#endif
...
...
source/Lib/CommonLib/ContextModelling.cpp
View file @
45463a41
...
...
@@ -403,10 +403,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
fPosPosition
=
tempIdx
-
fPosStep
*
(
4
);
const
int
offset
=
refMvdCands
[
fPosStep
];
#if !REMOVE_MV_ADAPT_PREC
const
int
highPrecList0
=
mmvdBaseMv
[
fPosBaseIdx
][
0
].
mv
.
highPrec
;
const
int
highPrecList1
=
mmvdBaseMv
[
fPosBaseIdx
][
1
].
mv
.
highPrec
;
#endif
const
int
refList0
=
mmvdBaseMv
[
fPosBaseIdx
][
0
].
refIdx
;
const
int
refList1
=
mmvdBaseMv
[
fPosBaseIdx
][
1
].
refIdx
;
...
...
@@ -421,7 +417,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
refSign
=
-
1
;
}
#if REMOVE_MV_ADAPT_PREC
if
(
fPosPosition
==
0
)
{
tempMv
[
0
]
=
Mv
(
offset
,
0
);
...
...
@@ -442,28 +437,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
tempMv
[
0
]
=
Mv
(
0
,
-
offset
);
tempMv
[
1
]
=
Mv
(
0
,
-
offset
*
refSign
);
}
#else
if
(
fPosPosition
==
0
)
{
tempMv
[
0
]
=
Mv
(
offset
,
0
,
highPrecList0
);
tempMv
[
1
]
=
Mv
(
offset
*
refSign
,
0
,
highPrecList1
);
}
else
if
(
fPosPosition
==
1
)
{
tempMv
[
0
]
=
Mv
(
-
offset
,
0
,
highPrecList0
);
tempMv
[
1
]
=
Mv
(
-
offset
*
refSign
,
0
,
highPrecList1
);
}
else
if
(
fPosPosition
==
2
)
{
tempMv
[
0
]
=
Mv
(
0
,
offset
,
highPrecList0
);
tempMv
[
1
]
=
Mv
(
0
,
offset
*
refSign
,
highPrecList1
);
}
else
{
tempMv
[
0
]
=
Mv
(
0
,
-
offset
,
highPrecList0
);
tempMv
[
1
]
=
Mv
(
0
,
-
offset
*
refSign
,
highPrecList1
);
}
#endif
if
(
abs
(
poc1
-
currPoc
)
>
abs
(
poc0
-
currPoc
))
{
const
int
scale
=
PU
::
getDistScaleFactor
(
currPoc
,
poc0
,
currPoc
,
poc1
);
...
...
@@ -489,7 +462,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
}
else
if
(
refList0
!=
-
1
)
{
#if REMOVE_MV_ADAPT_PREC
if
(
fPosPosition
==
0
)
{
tempMv
[
0
]
=
Mv
(
offset
,
0
);
...
...
@@ -506,24 +478,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
tempMv
[
0
]
=
Mv
(
0
,
-
offset
);
}
#else
if
(
fPosPosition
==
0
)
{
tempMv
[
0
]
=
Mv
(
offset
,
0
,
highPrecList0
);
}
else
if
(
fPosPosition
==
1
)
{
tempMv
[
0
]
=
Mv
(
-
offset
,
0
,
highPrecList0
);
}
else
if
(
fPosPosition
==
2
)
{
tempMv
[
0
]
=
Mv
(
0
,
offset
,
highPrecList0
);
}
else
{
tempMv
[
0
]
=
Mv
(
0
,
-
offset
,
highPrecList0
);
}
#endif
pu
.
interDir
=
1
;
pu
.
mv
[
REF_PIC_LIST_0
]
=
mmvdBaseMv
[
fPosBaseIdx
][
0
].
mv
+
tempMv
[
0
];
pu
.
refIdx
[
REF_PIC_LIST_0
]
=
refList0
;
...
...
@@ -532,7 +486,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
}
else
if
(
refList1
!=
-
1
)
{
#if REMOVE_MV_ADAPT_PREC
if
(
fPosPosition
==
0
)
{
tempMv
[
1
]
=
Mv
(
offset
,
0
);
...
...
@@ -549,24 +502,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
{
tempMv
[
1
]
=
Mv
(
0
,
-
offset
);
}
#else
if
(
fPosPosition
==
0
)
{
tempMv
[
1
]
=
Mv
(
offset
,
0
,
highPrecList1
);
}
else
if
(
fPosPosition
==
1
)
{
tempMv
[
1
]
=
Mv
(
-
offset
,
0
,
highPrecList1
);
}
else
if
(
fPosPosition
==
2
)
{
tempMv
[
1
]
=
Mv
(
0
,
offset
,
highPrecList1
);
}
else
{
tempMv
[
1
]
=
Mv
(
0
,
-
offset
,
highPrecList1
);
}
#endif
pu
.
interDir
=
2
;
pu
.
mv
[
REF_PIC_LIST_0
]
=
Mv
(
0
,
0
);
pu
.
refIdx
[
REF_PIC_LIST_0
]
=
-
1
;
...
...
source/Lib/CommonLib/InterPrediction.cpp
View file @
45463a41
...
...
@@ -639,15 +639,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
int
iAddPrecShift
=
0
;
#if !REMOVE_MV_ADAPT_PREC
if
(
_mv
.
highPrec
)
{
CHECKD
(
!
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
(),
"Found a high-precision motion vector, but the high-precision MV extension is disabled!"
);
#endif
iAddPrecShift
=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
int
shiftHor
=
2
+
iAddPrecShift
+
::
getComponentScaleX
(
compID
,
chFmt
);
int
shiftVer
=
2
+
iAddPrecShift
+
::
getComponentScaleY
(
compID
,
chFmt
);
...
...
@@ -663,10 +655,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
#endif
xFrac
<<=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
-
iAddPrecShift
;
yFrac
<<=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
-
iAddPrecShift
;
#if !REMOVE_MV_ADAPT_PREC
CHECKD
(
!
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
&&
((
xFrac
&
3
)
!=
0
),
"Invalid fraction"
);
CHECKD
(
!
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
&&
((
yFrac
&
3
)
!=
0
),
"Invalid fraction"
);
#endif
PelBuf
&
dstBuf
=
dstPic
.
bufs
[
compID
];
unsigned
width
=
dstBuf
.
width
;
...
...
@@ -781,11 +769,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
Mv
mvRT
=
_mv
[
1
];
Mv
mvLB
=
_mv
[
2
];
#if !REMOVE_MV_ADAPT_PREC
mvLT
.
setHighPrec
();
mvRT
.
setHighPrec
();
mvLB
.
setHighPrec
();
#endif
// get affine sub-block width and height
const
int
width
=
pu
.
Y
().
width
;
...
...
source/Lib/CommonLib/LoopFilter.cpp
View file @
45463a41
...
...
@@ -486,18 +486,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
if
(
0
<=
miQ
.
refIdx
[
1
]
)
{
mvQ1
=
miQ
.
mv
[
1
];
}
int
nThreshold
=
4
;
#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
unsigned
uiBs
=
0
;
//th can be optimized
...
...
@@ -551,16 +540,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
Mv
mvQ0
=
miQ
.
mv
[
0
];
int
nThreshold
=
4
;
#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
return
(
(
abs
(
mvQ0
.
getHor
()
-
mvP0
.
getHor
()
)
>=
nThreshold
)
||
(
abs
(
mvQ0
.
getVer
()
-
mvP0
.
getVer
()
)
>=
nThreshold
)
)
?
1
:
0
;
}
...
...
source/Lib/CommonLib/Mv.cpp
View file @
45463a41
...
...
@@ -43,9 +43,6 @@
void
roundMV
(
Mv
&
rMV
,
unsigned
imvShift
)
{
CHECK
(
imvShift
==
0
,
"roundMV called for imvShift=0"
);
#if !REMOVE_MV_ADAPT_PREC
if
(
rMV
.
highPrec
)
imvShift
+=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#endif
int
offset
=
1
<<
(
imvShift
-
1
);
#if JVET_L0377_AMVR_ROUNDING_ALIGN
rMV
.
setHor
(
rMV
.
getHor
()
>=
0
?
((
rMV
.
getHor
()
+
offset
)
>>
imvShift
)
<<
imvShift
:
-
(((
-
rMV
.
getHor
()
+
offset
)
>>
imvShift
))
<<
imvShift
);
...
...
@@ -69,14 +66,8 @@ void clipMv( Mv& rcMv, const Position& pos,
#endif
const
SPS
&
sps
)
{
#if !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
;
int
iHorMin
=
(
-
(
int
)
sps
.
getMaxCUWidth
()
-
iOffset
-
(
int
)
pos
.
x
+
1
)
<<
iMvShift
;
...
...
source/Lib/CommonLib/Mv.h
View file @
45463a41
...
...
@@ -53,21 +53,13 @@ class Mv
public:
int
hor
;
///< horizontal component of motion vector
int
ver
;
///< vertical component of motion vector
#if !REMOVE_MV_ADAPT_PREC
bool
highPrec
;
///< true if the vector is high precision
#endif
// ------------------------------------------------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------------------------------------------------
#if !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
)
{}
#else
Mv
(
)
:
hor
(
0
),
ver
(
0
)
{}
Mv
(
int
iHor
,
int
iVer
)
:
hor
(
iHor
),
ver
(
iVer
)
{}
#endif
// ------------------------------------------------------------------------------------------------------------------
// set
...
...
@@ -93,21 +85,9 @@ public:
const
Mv
&
operator
+=
(
const
Mv
&
_rcMv
)
{
#if !REMOVE_MV_ADAPT_PREC
if
(
highPrec
==
_rcMv
.
highPrec
)
{
hor
+=
_rcMv
.
hor
;
ver
+=
_rcMv
.
ver
;
}
else
#endif
{
Mv
rcMv
=
_rcMv
;
#if !REMOVE_MV_ADAPT_PREC
if
(
highPrec
&&
!
rcMv
.
highPrec
)
rcMv
.
setHighPrec
();
if
(
!
highPrec
&&
rcMv
.
highPrec
)
setHighPrec
();
#endif
hor
+=
rcMv
.
hor
;
ver
+=
rcMv
.
ver
;
}
...
...
@@ -116,21 +96,9 @@ public:
const
Mv
&
operator
-=
(
const
Mv
&
_rcMv
)
{
#if !REMOVE_MV_ADAPT_PREC
if
(
highPrec
==
_rcMv
.
highPrec
)
{
hor
-=
_rcMv
.
hor
;
ver
-=
_rcMv
.
ver
;
}
else
#endif
{
Mv
rcMv
=
_rcMv
;
#if !REMOVE_MV_ADAPT_PREC
if
(
highPrec
&&
!
rcMv
.
highPrec
)
rcMv
.
setHighPrec
();
if
(
!
highPrec
&&
rcMv
.
highPrec
)
setHighPrec
();
#endif
hor
-=
rcMv
.
hor
;
ver
-=
rcMv
.
ver
;
}
...
...
@@ -166,60 +134,17 @@ public:
const
Mv
operator
-
(
const
Mv
&
rcMv
)
const
{
#if !REMOVE_MV_ADAPT_PREC
if
(
rcMv
.
highPrec
==
highPrec
)
{
return
Mv
(
hor
-
rcMv
.
hor
,
ver
-
rcMv
.
ver
,
highPrec
);
}
else
{
Mv
self
=
*
this
;
self
.
setHighPrec
();
Mv
other
=
rcMv
;
other
.
setHighPrec
();
return
self
-
other
;
}
#else
return
Mv
(
hor
-
rcMv
.
hor
,
ver
-
rcMv
.
ver
);
#endif
}
const
Mv
operator
+
(
const
Mv
&
rcMv
)
const
{
#if !REMOVE_MV_ADAPT_PREC
if
(
rcMv
.
highPrec
==
highPrec
)
{
return
Mv
(
hor
+
rcMv
.
hor
,
ver
+
rcMv
.
ver
,
highPrec
);
}
else
{
Mv
self
=
*
this
;
self
.
setHighPrec
();
Mv
other
=
rcMv
;
other
.
setHighPrec
();
return
self
+
other
;
}
#else
return
Mv
(
hor
+
rcMv
.
hor
,
ver
+
rcMv
.
ver
);
#endif
}
bool
operator
==
(
const
Mv
&
rcMv
)
const
{
#if !REMOVE_MV_ADAPT_PREC
if
(
rcMv
.
highPrec
==
highPrec
)
{
return
(
hor
==
rcMv
.
hor
&&
ver
==
rcMv
.
ver
);
}
else
if
(
rcMv
.
highPrec
)
{
return
(
(
hor
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
)
==
rcMv
.
hor
&&
(
ver
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
)
==
rcMv
.
ver
);
}
else
{
return
(
(
rcMv
.
hor
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
)
==
hor
&&
(
rcMv
.
ver
<<
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
)
==
ver
);
}
#else
return
(
hor
==
rcMv
.
hor
&&
ver
==
rcMv
.
ver
);
#endif
}
bool
operator
!=
(
const
Mv
&
rcMv
)
const
...
...
@@ -231,47 +156,18 @@ 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 !REMOVE_MV_ADAPT_PREC
return
Mv
(
mvx
,
mvy
,
highPrec
);
#else
return
Mv
(
mvx
,
mvy
);
#endif
}
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
;
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
);
highPrec
=
false
;
}
void
setHighPrec
()
{
if
(
highPrec
)
return
;
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
);
highPrec
=
true
;
}
#endif
};
// END CLASS DEFINITION MV
#if JVET_L0293_CPR
namespace
std
...
...
source/Lib/CommonLib/RdCost.h
View file @
45463a41
...
...
@@ -167,12 +167,6 @@ public:
void
setPredictor
(
const
Mv
&
rcMv
)
{
m_mvPredictor
=
rcMv
;
#if !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
);
}
#endif
}
void
setCostScale
(
int
iCostScale
)
{
m_iCostScale
=
iCostScale
;
}
Distortion
getCost
(
uint32_t
b
)
{
return
Distortion
(
m_motionLambda
*
b
);
}
...
...
source/Lib/CommonLib/Slice.cpp
View file @
45463a41
...
...
@@ -1779,9 +1779,6 @@ SPSNext::SPSNext( SPS& sps )
,
m_LargeCTU
(
false
)
,
m_SubPuMvp
(
false
)
,
m_IMV
(
false
)
#if !REMOVE_MV_ADAPT_PREC
,
m_highPrecMv
(
false
)
#endif
#if JVET_L0256_BIO
,
m_BIO
(
false
)
#endif
...
...
source/Lib/CommonLib/Slice.h
View file @
45463a41
...
...
@@ -803,9 +803,6 @@ private:
bool
m_LargeCTU
;
// 5
bool
m_SubPuMvp
;
bool
m_IMV
;
// 9
#if !REMOVE_MV_ADAPT_PREC
bool
m_highPrecMv
;
#endif
#if JVET_L0256_BIO
bool
m_BIO
;
#endif
...
...
@@ -892,10 +889,6 @@ public:
bool
getUseAffine
()
const
{
return
m_Affine
;
}
void
setUseAffineType
(
bool
b
)
{
m_AffineType
=
b
;
}
bool
getUseAffineType
()
const
{
return
m_AffineType
;
}
#if !REMOVE_MV_ADAPT_PREC
void
setUseHighPrecMv
(
bool
b
)
{
m_highPrecMv
=
b
;
}
bool
getUseHighPrecMv
()
const
{
return
m_highPrecMv
;
}
#endif
#if JVET_L0256_BIO
void
setUseBIO
(
bool
b
)
{
m_BIO
=
b
;
}
bool
getUseBIO
()
const
{
return
m_BIO
;
}
...
...
source/Lib/CommonLib/TypeDef.h
View file @
45463a41
...
...
@@ -130,7 +130,6 @@
#define REUSE_CU_RESULTS 1
#define REMOVE_MV_ADAPT_PREC 1 // remove the high precision flag in the MV class
#define JVET_L0093_SIMP_PRUNE 1
...
...
source/Lib/CommonLib/UnitTools.cpp
View file @
45463a41
...
...
@@ -1664,12 +1664,6 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
// average two MVs
Mv
avgMv
=
MvI
;
#if !REMOVE_MV_ADAPT_PREC
if
(
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
)
{
avgMv
.
setHighPrec
();
}
#endif
avgMv
+=
MvJ
;
avgMv
.
setHor
(
avgMv
.
getHor
()
/
2
);
avgMv
.
setVer
(
avgMv
.
getVer
()
/
2
);
...
...
@@ -1691,23 +1685,11 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
else
if
(
refIdxI
!=
NOT_VALID
)
{
Mv
singleMv
=
mrgCtx
.
mvFieldNeighbours
[
i
*
2
+
refListId
].
mv
;
#if !REMOVE_MV_ADAPT_PREC
if
(
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
)
{
singleMv
.
setHighPrec
();
}
#endif
mrgCtx
.
mvFieldNeighbours
[
cnt
*
2
+
refListId
].
setMvField
(
singleMv
,
refIdxI
);
}
else
if
(
refIdxJ
!=
NOT_VALID
)
{
Mv
singleMv
=
mrgCtx
.
mvFieldNeighbours
[
j
*
2
+
refListId
].
mv
;
#if !REMOVE_MV_ADAPT_PREC
if
(
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
)
{
singleMv
.
setHighPrec
();
}
#endif
mrgCtx
.
mvFieldNeighbours
[
cnt
*
2
+
refListId
].
setMvField
(
singleMv
,
refIdxJ
);
}
}
...
...
@@ -1918,25 +1900,6 @@ void PU::getInterMMVDMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx,
int
currBaseNum
=
0
;
const
uint16_t
maxNumMergeCand
=
mrgCtx
.
numValidMergeCand
;
#if !REMOVE_MV_ADAPT_PREC
if
(
pu
.
cu
->
slice
->
getSPS
()
->
getSpsNext
().
getUseHighPrecMv
())
{
for
(
k
=
0
;
k
<
maxNumMergeCand
;
k
++
)
{
if
(
mrgCtx
.
mrgTypeNeighbours
[
k
]
==
MRG_TYPE_DEFAULT_N
)
{
if
((
mrgCtx
.
mvFieldNeighbours
[(
k
<<
1
)].
mv
.
highPrec
==
false
)
&&
(
mrgCtx
.
mvFieldNeighbours
[(
k
<<
1
)].
refIdx
>=
0
))
{
mrgCtx
.
mvFieldNeighbours
[(
k
<<
1
)].
mv
.
setHighPrec
();
}
if
((
mrgCtx
.
mvFieldNeighbours
[(
k
<<
1
)
+
1
].
mv
.
highPrec
==
false
)
&&
(
mrgCtx
.
mvFieldNeighbours
[(
k
<<
1
)
+
1
].
refIdx
>=
0
))
{
mrgCtx
.
mvFieldNeighbours
[(
k
<<
1
)
+
1
].
mv
.
setHighPrec
();
}
}
}
}
#endif
for
(
k
=
0
;
k
<
maxNumMergeCand
;
k
++
)
{
if
(
mrgCtx
.
mrgTypeNeighbours
[
k
]
==
MRG_TYPE_DEFAULT_N
)
...
...
@@ -2067,13 +2030,6 @@ bool PU::getColocatedMVP(const PredictionUnit &pu, const RefPicList &eRefPicList
}
else
{
#if !REMOVE_MV_ADAPT_PREC
if
(
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
()
)
{
// allow extended precision for temporal scaling
cColMv
.
setHighPrec
();
}
#endif
rcMv
=
cColMv
.
scaleMv
(
distscale
);
}
}
...
...
@@ -2295,9 +2251,7 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
if
(
pu
.
cu
->
imv
!=
0
)
{
unsigned
imvShift
=
pu
.
cu
->
imv
<<
1
;
#if REMOVE_MV_ADAPT_PREC
imvShift
+=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#endif
for
(
int
i
=
0
;
i
<
pInfo
->
numCand
;
i
++
)
{
roundMV
(
pInfo
->
mvCand
[
i
],
imvShift
);
...
...
@@ -2360,9 +2314,7 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
if
(
pu
.
cu
->
imv
!=
0
)
{
unsigned
imvShift
=
pu
.
cu
->
imv
<<
1
;
#if REMOVE_MV_ADAPT_PREC
imvShift
+=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
#endif
roundMV
(
cColMv
,
imvShift
);
}
int
i
=
0
;
...
...
@@ -2397,32 +2349,16 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
while
(
pInfo
->
numCand
<
AMVP_MAX_NUM_CANDS
)
{
#if !REMOVE_MV_ADAPT_PREC
const
bool
prec
=
pInfo
->
mvCand
[
pInfo
->
numCand
].
highPrec
;
pInfo
->
mvCand
[
pInfo
->
numCand
]
=
Mv
(
0
,
0
,
prec
);
#else
pInfo
->
mvCand
[
pInfo
->
numCand
]
=
Mv
(
0
,
0
);
#endif
pInfo
->
numCand
++
;
}
#if !REMOVE_MV_ADAPT_PREC
if
(
pu
.
cs
->
sps
->
getSpsNext
().
getUseHighPrecMv
())
{
#endif
for
(
Mv
&
mv
:
pInfo
->
mvCand
)
{
#if REMOVE_MV_ADAPT_PREC
const
int
nShift
=
VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE
;
const
int
nOffset
=
1
<<
(
nShift
-
1
);
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
);
#else
if
(
mv
.
highPrec
)
mv
.