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
d94dda74
Commit
d94dda74
authored
May 07, 2018
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cbs_h264: Add support for pan-scan rectangle SEI messages
parent
9d375e11
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
cbs_h264.h
libavcodec/cbs_h264.h
+12
-0
cbs_h2645.c
libavcodec/cbs_h2645.c
+1
-0
cbs_h264_syntax_template.c
libavcodec/cbs_h264_syntax_template.c
+28
-0
h264_sei.h
libavcodec/h264_sei.h
+1
-0
No files found.
libavcodec/cbs_h264.h
View file @
d94dda74
...
...
@@ -264,6 +264,17 @@ typedef struct H264RawSEIPicTiming {
H264RawSEIPicTimestamp
timestamp
[
3
];
}
H264RawSEIPicTiming
;
typedef
struct
H264RawSEIPanScanRect
{
uint32_t
pan_scan_rect_id
;
uint8_t
pan_scan_rect_cancel_flag
;
uint8_t
pan_scan_cnt_minus1
;
int32_t
pan_scan_rect_left_offset
[
3
];
int32_t
pan_scan_rect_right_offset
[
3
];
int32_t
pan_scan_rect_top_offset
[
3
];
int32_t
pan_scan_rect_bottom_offset
[
3
];
uint16_t
pan_scan_rect_repetition_period
;
}
H264RawSEIPanScanRect
;
typedef
struct
H264RawSEIUserDataRegistered
{
uint8_t
itu_t_t35_country_code
;
uint8_t
itu_t_t35_country_code_extension_byte
;
...
...
@@ -301,6 +312,7 @@ typedef struct H264RawSEIPayload {
union
{
H264RawSEIBufferingPeriod
buffering_period
;
H264RawSEIPicTiming
pic_timing
;
H264RawSEIPanScanRect
pan_scan_rect
;
// H264RawSEIFiller filler -> no fields.
H264RawSEIUserDataRegistered
user_data_registered
;
H264RawSEIUserDataUnregistered
user_data_unregistered
;
...
...
libavcodec/cbs_h2645.c
View file @
d94dda74
...
...
@@ -425,6 +425,7 @@ static void cbs_h264_free_sei_payload(H264RawSEIPayload *payload)
switch
(
payload
->
payload_type
)
{
case
H264_SEI_TYPE_BUFFERING_PERIOD
:
case
H264_SEI_TYPE_PIC_TIMING
:
case
H264_SEI_TYPE_PAN_SCAN_RECT
:
case
H264_SEI_TYPE_RECOVERY_POINT
:
case
H264_SEI_TYPE_DISPLAY_ORIENTATION
:
break
;
...
...
libavcodec/cbs_h264_syntax_template.c
View file @
d94dda74
...
...
@@ -626,6 +626,30 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
return
0
;
}
static
int
FUNC
(
sei_pan_scan_rect
)(
CodedBitstreamContext
*
ctx
,
RWContext
*
rw
,
H264RawSEIPanScanRect
*
current
)
{
int
err
,
i
;
ue
(
pan_scan_rect_id
,
0
,
UINT32_MAX
-
1
);
flag
(
pan_scan_rect_cancel_flag
);
if
(
!
current
->
pan_scan_rect_cancel_flag
)
{
ue
(
pan_scan_cnt_minus1
,
0
,
2
);
for
(
i
=
0
;
i
<=
current
->
pan_scan_cnt_minus1
;
i
++
)
{
ses
(
pan_scan_rect_left_offset
[
i
],
INT32_MIN
+
1
,
INT32_MAX
,
1
,
i
);
ses
(
pan_scan_rect_right_offset
[
i
],
INT32_MIN
+
1
,
INT32_MAX
,
1
,
i
);
ses
(
pan_scan_rect_top_offset
[
i
],
INT32_MIN
+
1
,
INT32_MAX
,
1
,
i
);
ses
(
pan_scan_rect_bottom_offset
[
i
],
INT32_MIN
+
1
,
INT32_MAX
,
1
,
i
);
}
ue
(
pan_scan_rect_repetition_period
,
0
,
16384
);
}
return
0
;
}
static
int
FUNC
(
sei_user_data_registered
)(
CodedBitstreamContext
*
ctx
,
RWContext
*
rw
,
H264RawSEIUserDataRegistered
*
current
,
uint32_t
*
payload_size
)
...
...
@@ -737,6 +761,10 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK
(
FUNC
(
sei_pic_timing
)
(
ctx
,
rw
,
&
current
->
payload
.
pic_timing
));
break
;
case
H264_SEI_TYPE_PAN_SCAN_RECT
:
CHECK
(
FUNC
(
sei_pan_scan_rect
)
(
ctx
,
rw
,
&
current
->
payload
.
pan_scan_rect
));
break
;
case
H264_SEI_TYPE_FILLER_PAYLOAD
:
{
for
(
i
=
0
;
i
<
current
->
payload_size
;
i
++
)
...
...
libavcodec/h264_sei.h
View file @
d94dda74
...
...
@@ -27,6 +27,7 @@
typedef
enum
{
H264_SEI_TYPE_BUFFERING_PERIOD
=
0
,
///< buffering period (H.264, D.1.1)
H264_SEI_TYPE_PIC_TIMING
=
1
,
///< picture timing
H264_SEI_TYPE_PAN_SCAN_RECT
=
2
,
///< pan-scan rectangle
H264_SEI_TYPE_FILLER_PAYLOAD
=
3
,
///< filler data
H264_SEI_TYPE_USER_DATA_REGISTERED
=
4
,
///< registered user data as specified by Rec. ITU-T T.35
H264_SEI_TYPE_USER_DATA_UNREGISTERED
=
5
,
///< unregistered user data
...
...
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