Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VVCSoftware_VTM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jacob Strom
VVCSoftware_VTM
Commits
3e5a4a40
Commit
3e5a4a40
authored
2 years ago
by
Yue Li
Browse files
Options
Downloads
Patches
Plain Diff
allow data_loader to extract patches from reference picture list 0 and reference picture list 1
parent
1f8cef07
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
training/data_loader/data_loader.py
+29
-0
29 additions, 0 deletions
training/data_loader/data_loader.py
with
29 additions
and
0 deletions
training/data_loader/data_loader.py
+
29
−
0
View file @
3e5a4a40
...
...
@@ -44,6 +44,13 @@ class PatchInfo(NamedTuple):
frame_index
:
int
patch_x0
:
int
patch_y0
:
int
def
getRefDistance
(
poc
):
distance
=
[
32
,
16
,
8
,
4
,
2
,
1
]
for
d
in
distance
:
if
poc
%
d
==
0
:
return
d
def
readData
(
patch_size
,
border_size
,
norm
,
fn
,
off
,
nbb
,
ctype
,
h
,
w
,
x0
,
y0
):
...
...
@@ -121,6 +128,12 @@ class DataLoader:
self
.
components
.
append
(
"
org_Y
"
)
self
.
components
.
append
(
"
org_U
"
)
self
.
components
.
append
(
"
org_V
"
)
self
.
components
.
append
(
"
ref_list_0_Y
"
)
self
.
components
.
append
(
"
ref_list_0_U
"
)
self
.
components
.
append
(
"
ref_list_0_V
"
)
self
.
components
.
append
(
"
ref_list_1_Y
"
)
self
.
components
.
append
(
"
ref_list_1_U
"
)
self
.
components
.
append
(
"
ref_list_1_V
"
)
if
'
suffix_rec_after_dbf
'
in
dcontent
:
self
.
suffix
[
'
rec_after_dbf
'
]
=
dcontent
[
'
suffix_rec_after_dbf
'
]
self
.
components
.
append
(
"
rec_after_dbf_Y
"
)
...
...
@@ -251,6 +264,22 @@ class DataLoader:
elif
'
partition_cu_average
'
in
c
:
norm
=
self
.
normalizer_cu_average
v
=
readData
(
psize
,
bsize
,
norm
,
fn
,
off
,
nbb
,
'
uint16
'
,
h
,
w
,
x0
,
y0
)
elif
'
ref_list_0
'
in
c
or
'
ref_list_1
'
in
c
:
fn
=
d
[
'
dirname
'
]
+
'
/
'
+
d
[
'
basename
'
]
+
self
.
suffix
[
'
rec_before_dbf
'
]
nbb
=
2
# 16 bits data
if
'
ref_list_0
'
in
c
:
off
=
(
pinfo
.
frame_index
-
getRefDistance
(
pinfo
.
frame_index
))
*
(
frame_size_Y
*
nbb
*
3
//
2
)
else
:
off
=
(
pinfo
.
frame_index
+
getRefDistance
(
pinfo
.
frame_index
))
*
(
frame_size_Y
*
nbb
*
3
//
2
)
if
'
_U
'
in
c
:
off
+=
frame_size_Y
*
nbb
elif
'
_V
'
in
c
:
off
+=
frame_size_Y
*
nbb
+
(
frame_size_Y
*
nbb
)
//
4
norm
=
self
.
normalizer_rec
v
=
readData
(
psize
,
bsize
,
norm
,
fn
,
off
,
nbb
,
'
uint16
'
,
h
,
w
,
x0
,
y0
)
elif
c
==
'
qp_slice
'
:
fn
=
d
[
'
dirname
'
]
+
'
/
'
+
d
[
'
basename
'
]
+
self
.
suffix
[
'
qp_slice
'
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment