Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
eccc03c8
Commit
eccc03c8
authored
Feb 11, 2018
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cbs_h264: Add support for filler NAL units
parent
7157d959
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
cbs_h264.h
libavcodec/cbs_h264.h
+6
-0
cbs_h2645.c
libavcodec/cbs_h2645.c
+21
-0
cbs_h264_syntax_template.c
libavcodec/cbs_h264_syntax_template.c
+29
-0
No files found.
libavcodec/cbs_h264.h
View file @
eccc03c8
...
...
@@ -408,6 +408,12 @@ typedef struct H264RawSlice {
AVBufferRef
*
data_ref
;
}
H264RawSlice
;
typedef
struct
H264RawFiller
{
H264RawNALUnitHeader
nal_unit_header
;
uint32_t
filler_size
;
}
H264RawFiller
;
typedef
struct
CodedBitstreamH264Context
{
// Reader/writer context in common with the H.265 implementation.
...
...
libavcodec/cbs_h2645.c
View file @
eccc03c8
...
...
@@ -815,6 +815,19 @@ static int cbs_h264_read_nal_unit(CodedBitstreamContext *ctx,
}
break
;
case
H264_NAL_FILLER_DATA
:
{
err
=
ff_cbs_alloc_unit_content
(
ctx
,
unit
,
sizeof
(
H264RawFiller
),
NULL
);
if
(
err
<
0
)
return
err
;
err
=
cbs_h264_read_filler
(
ctx
,
&
bc
,
unit
->
content
);
if
(
err
<
0
)
return
err
;
}
break
;
default
:
return
AVERROR
(
ENOSYS
);
}
...
...
@@ -1070,6 +1083,14 @@ static int cbs_h264_write_nal_unit(CodedBitstreamContext *ctx,
}
break
;
case
H264_NAL_FILLER_DATA
:
{
err
=
cbs_h264_write_filler
(
ctx
,
pbc
,
unit
->
content
);
if
(
err
<
0
)
return
err
;
}
break
;
default
:
av_log
(
ctx
->
log_ctx
,
AV_LOG_ERROR
,
"Write unimplemented for "
"NAL unit type %"
PRIu32
".
\n
"
,
unit
->
type
);
...
...
libavcodec/cbs_h264_syntax_template.c
View file @
eccc03c8
...
...
@@ -1247,3 +1247,32 @@ static int FUNC(slice_header)(CodedBitstreamContext *ctx, RWContext *rw,
return
0
;
}
static
int
FUNC
(
filler
)(
CodedBitstreamContext
*
ctx
,
RWContext
*
rw
,
H264RawFiller
*
current
)
{
av_unused
int
ff_byte
=
0xff
;
int
err
;
HEADER
(
"Filler Data"
);
CHECK
(
FUNC
(
nal_unit_header
)(
ctx
,
rw
,
&
current
->
nal_unit_header
,
1
<<
H264_NAL_FILLER_DATA
));
#ifdef READ
while
(
bitstream_peek
(
rw
,
8
)
==
0xff
)
{
xu
(
8
,
ff_byte
,
ff_byte
,
0xff
,
0xff
);
++
current
->
filler_size
;
}
#else
{
uint32_t
i
;
for
(
i
=
0
;
i
<
current
->
filler_size
;
i
++
)
xu
(
8
,
ff_byte
,
ff_byte
,
0xff
,
0xff
);
}
#endif
CHECK
(
FUNC
(
rbsp_trailing_bits
)(
ctx
,
rw
));
return
0
;
}
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