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
a49ee60d
Commit
a49ee60d
authored
May 07, 2017
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaapi_h264: Add support for SEI recovery points
Included by default with non-IDR intra frames.
parent
820a4483
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
vaapi_encode_h264.c
libavcodec/vaapi_encode_h264.c
+19
-1
No files found.
libavcodec/vaapi_encode_h264.c
View file @
a49ee60d
...
...
@@ -37,6 +37,7 @@
enum
{
SEI_TIMING
=
0x01
,
SEI_IDENTIFIER
=
0x02
,
SEI_RECOVERY_POINT
=
0x04
,
};
// Random (version 4) ISO 11578 UUID.
...
...
@@ -61,6 +62,7 @@ typedef struct VAAPIEncodeH264Context {
H264RawSEIBufferingPeriod
buffering_period
;
H264RawSEIPicTiming
pic_timing
;
H264RawSEIRecoveryPoint
recovery_point
;
H264RawSEIUserDataUnregistered
identifier
;
char
*
identifier_string
;
...
...
@@ -230,6 +232,11 @@ static int vaapi_encode_h264_write_extra_header(AVCodecContext *avctx,
priv
->
sei
.
payload
[
i
].
payload
.
pic_timing
=
priv
->
pic_timing
;
++
i
;
}
if
(
opt
->
sei
&
SEI_RECOVERY_POINT
&&
pic
->
type
==
PICTURE_TYPE_I
)
{
priv
->
sei
.
payload
[
i
].
payload_type
=
H264_SEI_TYPE_RECOVERY_POINT
;
priv
->
sei
.
payload
[
i
].
payload
.
recovery_point
=
priv
->
recovery_point
;
++
i
;
}
priv
->
sei
.
payload_count
=
i
;
av_assert0
(
priv
->
sei
.
payload_count
>
0
);
...
...
@@ -613,6 +620,14 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx,
priv
->
sei_needed
=
1
;
}
if
(
opt
->
sei
&
SEI_RECOVERY_POINT
&&
pic
->
type
==
PICTURE_TYPE_I
)
{
priv
->
recovery_point
.
recovery_frame_cnt
=
0
;
priv
->
recovery_point
.
exact_match_flag
=
1
;
priv
->
recovery_point
.
broken_link_flag
=
ctx
->
b_per_p
>
0
;
priv
->
sei_needed
=
1
;
}
vpic
->
CurrPic
=
(
VAPictureH264
)
{
.
picture_id
=
pic
->
recon_surface
,
.
frame_idx
=
priv
->
frame_num
,
...
...
@@ -950,7 +965,7 @@ static const AVOption vaapi_encode_h264_options[] = {
{
"sei"
,
"Set SEI to include"
,
OFFSET
(
sei
),
AV_OPT_TYPE_FLAGS
,
{
.
i64
=
SEI_IDENTIFIER
|
SEI_TIMING
},
{
.
i64
=
SEI_IDENTIFIER
|
SEI_TIMING
|
SEI_RECOVERY_POINT
},
0
,
INT_MAX
,
FLAGS
,
"sei"
},
{
"identifier"
,
"Include encoder version identifier"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SEI_IDENTIFIER
},
...
...
@@ -958,6 +973,9 @@ static const AVOption vaapi_encode_h264_options[] = {
{
"timing"
,
"Include timing parameters (buffering_period and pic_timing)"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SEI_TIMING
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"sei"
},
{
"recovery_point"
,
"Include recovery points where appropriate"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SEI_RECOVERY_POINT
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"sei"
},
{
NULL
},
};
...
...
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