Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VVCSoftware_VTM
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
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
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
jvet
VVCSoftware_VTM
Commits
da38667a
Commit
da38667a
authored
2 years ago
by
Karsten Suehring
Browse files
Options
Downloads
Patches
Plain Diff
Add check whether writing to bistream succeeded
parent
3afe4046
No related branches found
No related tags found
1 merge request
!2275
Add check whether writing to bitstream succeeded
Pipeline
#7587
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Lib/EncoderLib/AnnexBwrite.h
+12
-0
12 additions, 0 deletions
source/Lib/EncoderLib/AnnexBwrite.h
with
12 additions
and
0 deletions
source/Lib/EncoderLib/AnnexBwrite.h
+
12
−
0
View file @
da38667a
...
...
@@ -42,6 +42,15 @@
//! \ingroup EncoderLib
//! \{
void
checkWriteError
(
std
::
ostream
&
out
)
{
if
(
out
.
fail
())
{
printf
(
"Error writing bitstream file
\n
"
);
exit
(
EXIT_FAILURE
);
}
}
uint32_t
writeAnnexBNalUnit
(
std
::
ostream
&
out
,
const
NALUnitEBSP
&
nalu
,
bool
useLongStartcode
)
{
uint32_t
size
=
0
;
/* size of annexB unit in bytes */
...
...
@@ -51,14 +60,17 @@ uint32_t writeAnnexBNalUnit(std::ostream& out, const NALUnitEBSP& nalu, bool use
if
(
useLongStartcode
)
{
out
.
write
(
reinterpret_cast
<
const
char
*>
(
startCodePrefix
),
4
);
checkWriteError
(
out
);
size
+=
4
;
}
else
{
out
.
write
(
reinterpret_cast
<
const
char
*>
(
startCodePrefix
+
1
),
3
);
checkWriteError
(
out
);
size
+=
3
;
}
out
<<
nalu
.
m_nalUnitData
.
str
();
checkWriteError
(
out
);
size
+=
uint32_t
(
nalu
.
m_nalUnitData
.
str
().
size
());
return
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