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
Container Registry
Model registry
Operate
Environments
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
Remy Foray
VVCSoftware_VTM
Commits
35b87710
Commit
35b87710
authored
6 years ago
by
Karsten Suehring
Browse files
Options
Downloads
Patches
Plain Diff
verify bit depth of source video
parent
312ae1ef
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
source/Lib/Utilities/VideoIOYuv.cpp
+45
-0
45 additions, 0 deletions
source/Lib/Utilities/VideoIOYuv.cpp
with
45 additions
and
0 deletions
source/Lib/Utilities/VideoIOYuv.cpp
+
45
−
0
View file @
35b87710
...
...
@@ -398,6 +398,46 @@ static bool readPlane(Pel* dst,
return
true
;
}
static
bool
verifyPlane
(
Pel
*
dst
,
uint32_t
stride444
,
uint32_t
width444
,
uint32_t
height444
,
uint32_t
padX444
,
uint32_t
padY444
,
const
ComponentID
compID
,
const
ChromaFormat
cFormat
,
const
uint32_t
bitDepth
)
{
const
uint32_t
csx
=
getComponentScaleX
(
compID
,
cFormat
);
const
uint32_t
csy
=
getComponentScaleY
(
compID
,
cFormat
);
#if EXTENSION_360_VIDEO
const
uint32_t
stride
=
stride444
;
#else
const
uint32_t
stride
=
stride444
>>
csx
;
#endif
const
uint32_t
fullWidth
=
(
width444
+
padX444
)
>>
csx
;
const
uint32_t
fullHeight
=
(
height444
+
padY444
)
>>
csy
;
Pel
*
dstBuf
=
dst
;
const
Pel
mask
=
~
((
1
<<
bitDepth
)
-
1
);
for
(
uint32_t
y
=
0
;
y
<
fullHeight
;
y
++
,
dstBuf
+=
stride
)
{
for
(
uint32_t
x
=
0
;
x
<
fullWidth
;
x
++
)
{
if
(
(
dstBuf
[
x
]
&
mask
)
!=
0
)
{
return
false
;
}
}
}
return
true
;
}
/**
* Write an image plane (width444*height444 pixels) from src into output stream fd.
*
...
...
@@ -845,6 +885,11 @@ bool VideoIOYuv::read ( PelUnitBuf& pic, PelUnitBuf& picOrg, const InputColourSp
{
return
false
;
}
if
(
!
verifyPlane
(
dst
,
stride444
,
width444
,
height444
,
pad_h444
,
pad_v444
,
compID
,
format
,
m_fileBitdepth
[
chType
])
)
{
EXIT
(
"Source image contains values outside the specified bit range!"
);
}
if
(
(
size_t
)
compID
<
picOrg
.
bufs
.
size
()
)
{
...
...
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