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
14
Merge Requests
14
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
78f2ecd2
Commit
78f2ecd2
authored
Apr 02, 2019
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codes of N0481 BCW inheritance for constructed affine candidate
parent
b6e0728a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
2 deletions
+66
-2
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+1
-0
source/Lib/CommonLib/UnitTools.cpp
source/Lib/CommonLib/UnitTools.cpp
+61
-2
source/Lib/CommonLib/UnitTools.h
source/Lib/CommonLib/UnitTools.h
+4
-0
No files found.
source/Lib/CommonLib/TypeDef.h
View file @
78f2ecd2
...
...
@@ -50,6 +50,7 @@
#include <assert.h>
#include <cassert>
#define JVET_N0481_BCW_CONSTRUCTED_AFFINE 1
#define JVET_N0477_LMCS_CLEANUP 1
#define JVET_N0220_LMCS_SIMPLIFICATION 1
...
...
source/Lib/CommonLib/UnitTools.cpp
View file @
78f2ecd2
...
...
@@ -3100,8 +3100,11 @@ bool PU::isBipredRestriction(const PredictionUnit &pu)
}
return
false
;
}
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
void
PU
::
getAffineControlPointCand
(
const
PredictionUnit
&
pu
,
MotionInfo
mi
[
4
],
int8_t
neighGbi
[
4
],
bool
isAvailable
[
4
],
int
verIdx
[
4
],
int
modelIdx
,
int
verNum
,
AffineMergeCtx
&
affMrgType
)
#else
void
PU
::
getAffineControlPointCand
(
const
PredictionUnit
&
pu
,
MotionInfo
mi
[
4
],
bool
isAvailable
[
4
],
int
verIdx
[
4
],
int
modelIdx
,
int
verNum
,
AffineMergeCtx
&
affMrgType
)
#endif
{
int
cuW
=
pu
.
Y
().
width
;
int
cuH
=
pu
.
Y
().
height
;
...
...
@@ -3113,6 +3116,9 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
Mv
cMv
[
2
][
4
];
int
refIdx
[
2
]
=
{
-
1
,
-
1
};
int
dir
=
0
;
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
int8_t
gbiIdx
=
GBI_DEFAULT
;
#endif
EAffineModel
curType
=
(
verNum
==
2
)
?
AFFINEMODEL_4PARAM
:
AFFINEMODEL_6PARAM
;
if
(
verNum
==
2
)
...
...
@@ -3135,6 +3141,16 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
}
}
}
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
if
(
dir
==
3
)
{
if
(
neighGbi
[
idx0
]
==
neighGbi
[
idx1
])
{
gbiIdx
=
neighGbi
[
idx0
];
}
}
#endif
}
else
if
(
verNum
==
3
)
{
...
...
@@ -3156,6 +3172,31 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
}
}
}
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
int
gbiClass
[
5
]
=
{
-
1
,
0
,
0
,
0
,
1
};
if
(
dir
==
3
)
{
if
(
neighGbi
[
idx0
]
==
neighGbi
[
idx1
]
&&
gbiClass
[
neighGbi
[
idx0
]]
==
gbiClass
[
neighGbi
[
idx2
]])
{
gbiIdx
=
neighGbi
[
idx0
];
}
else
if
(
neighGbi
[
idx0
]
==
neighGbi
[
idx2
]
&&
gbiClass
[
neighGbi
[
idx0
]]
==
gbiClass
[
neighGbi
[
idx1
]])
{
gbiIdx
=
neighGbi
[
idx0
];
}
else
if
(
neighGbi
[
idx1
]
==
neighGbi
[
idx2
]
&&
gbiClass
[
neighGbi
[
idx0
]]
==
gbiClass
[
neighGbi
[
idx1
]])
{
gbiIdx
=
neighGbi
[
idx1
];
}
else
{
gbiIdx
=
GBI_DEFAULT
;
}
}
#endif
}
if
(
dir
==
0
)
...
...
@@ -3229,6 +3270,9 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
}
affMrgType
.
interDirNeighbours
[
affMrgType
.
numValidMergeCand
]
=
dir
;
affMrgType
.
affineType
[
affMrgType
.
numValidMergeCand
]
=
curType
;
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
affMrgType
.
GBiIdx
[
affMrgType
.
numValidMergeCand
]
=
gbiIdx
;
#endif
affMrgType
.
numValidMergeCand
++
;
...
...
@@ -3435,7 +3479,9 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
{
MotionInfo
mi
[
4
];
bool
isAvailable
[
4
]
=
{
false
};
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
int8_t
neighGbi
[
4
]
=
{
GBI_DEFAULT
};
#endif
// control point: LT B2->B3->A2
const
Position
posLT
[
3
]
=
{
pu
.
Y
().
topLeft
().
offset
(
-
1
,
-
1
),
pu
.
Y
().
topLeft
().
offset
(
0
,
-
1
),
pu
.
Y
().
topLeft
().
offset
(
-
1
,
0
)
};
for
(
int
i
=
0
;
i
<
3
;
i
++
)
...
...
@@ -3448,6 +3494,9 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
{
isAvailable
[
0
]
=
true
;
mi
[
0
]
=
puNeigh
->
getMotionInfo
(
pos
);
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
neighGbi
[
0
]
=
puNeigh
->
cu
->
GBiIdx
;
#endif
break
;
}
}
...
...
@@ -3465,6 +3514,9 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
{
isAvailable
[
1
]
=
true
;
mi
[
1
]
=
puNeigh
->
getMotionInfo
(
pos
);
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
neighGbi
[
1
]
=
puNeigh
->
cu
->
GBiIdx
;
#endif
break
;
}
}
...
...
@@ -3482,6 +3534,9 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
{
isAvailable
[
2
]
=
true
;
mi
[
2
]
=
puNeigh
->
getMotionInfo
(
pos
);
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
neighGbi
[
2
]
=
puNeigh
->
cu
->
GBiIdx
;
#endif
break
;
}
}
...
...
@@ -3565,7 +3620,11 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
for
(
int
idx
=
startIdx
;
idx
<
modelNum
;
idx
++
)
{
int
modelIdx
=
order
[
idx
];
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
getAffineControlPointCand
(
pu
,
mi
,
neighGbi
,
isAvailable
,
model
[
modelIdx
],
modelIdx
,
verNum
[
modelIdx
],
affMrgCtx
);
#else
getAffineControlPointCand
(
pu
,
mi
,
isAvailable
,
model
[
modelIdx
],
modelIdx
,
verNum
[
modelIdx
],
affMrgCtx
);
#endif
if
(
affMrgCtx
.
numValidMergeCand
!=
0
&&
affMrgCtx
.
numValidMergeCand
-
1
==
mrgCandIdx
)
{
return
;
...
...
source/Lib/CommonLib/UnitTools.h
View file @
78f2ecd2
...
...
@@ -155,7 +155,11 @@ namespace PU
bool
isBipredRestriction
(
const
PredictionUnit
&
pu
);
void
spanMotionInfo
(
PredictionUnit
&
pu
,
const
MergeCtx
&
mrgCtx
=
MergeCtx
()
);
void
applyImv
(
PredictionUnit
&
pu
,
MergeCtx
&
mrgCtx
,
InterPrediction
*
interPred
=
NULL
);
#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
void
getAffineControlPointCand
(
const
PredictionUnit
&
pu
,
MotionInfo
mi
[
4
],
int8_t
neighGbi
[
4
],
bool
isAvailable
[
4
],
int
verIdx
[
4
],
int
modelIdx
,
int
verNum
,
AffineMergeCtx
&
affMrgCtx
);
#else
void
getAffineControlPointCand
(
const
PredictionUnit
&
pu
,
MotionInfo
mi
[
4
],
bool
isAvailable
[
4
],
int
verIdx
[
4
],
int
modelIdx
,
int
verNum
,
AffineMergeCtx
&
affMrgCtx
);
#endif
void
getAffineMergeCand
(
const
PredictionUnit
&
pu
,
AffineMergeCtx
&
affMrgCtx
,
const
int
mrgCandIdx
=
-
1
);
void
setAllAffineMvField
(
PredictionUnit
&
pu
,
MvField
*
mvField
,
RefPicList
eRefList
);
void
setAllAffineMv
(
PredictionUnit
&
pu
,
Mv
affLT
,
Mv
affRT
,
Mv
affLB
,
RefPicList
eRefList
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment