Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
ac687add
Commit
ac687add
authored
May 07, 2018
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cbs_h264: Add support for mastering display SEI messages
parent
d94dda74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
cbs_h264.h
libavcodec/cbs_h264.h
+10
-0
cbs_h2645.c
libavcodec/cbs_h2645.c
+1
-0
cbs_h264_syntax_template.c
libavcodec/cbs_h264_syntax_template.c
+23
-0
h264_sei.h
libavcodec/h264_sei.h
+1
-0
No files found.
libavcodec/cbs_h264.h
View file @
ac687add
...
...
@@ -306,6 +306,15 @@ typedef struct H264RawSEIDisplayOrientation {
uint8_t
display_orientation_extension_flag
;
}
H264RawSEIDisplayOrientation
;
typedef
struct
H264RawSEIMasteringDisplayColourVolume
{
uint16_t
display_primaries_x
[
3
];
uint16_t
display_primaries_y
[
3
];
uint16_t
white_point_x
;
uint16_t
white_point_y
;
uint32_t
max_display_mastering_luminance
;
uint32_t
min_display_mastering_luminance
;
}
H264RawSEIMasteringDisplayColourVolume
;
typedef
struct
H264RawSEIPayload
{
uint32_t
payload_type
;
uint32_t
payload_size
;
...
...
@@ -318,6 +327,7 @@ typedef struct H264RawSEIPayload {
H264RawSEIUserDataUnregistered
user_data_unregistered
;
H264RawSEIRecoveryPoint
recovery_point
;
H264RawSEIDisplayOrientation
display_orientation
;
H264RawSEIMasteringDisplayColourVolume
mastering_display_colour_volume
;
struct
{
uint8_t
*
data
;
size_t
data_length
;
...
...
libavcodec/cbs_h2645.c
View file @
ac687add
...
...
@@ -428,6 +428,7 @@ static void cbs_h264_free_sei_payload(H264RawSEIPayload *payload)
case
H264_SEI_TYPE_PAN_SCAN_RECT
:
case
H264_SEI_TYPE_RECOVERY_POINT
:
case
H264_SEI_TYPE_DISPLAY_ORIENTATION
:
case
H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
:
break
;
case
H264_SEI_TYPE_USER_DATA_REGISTERED
:
av_buffer_unref
(
&
payload
->
payload
.
user_data_registered
.
data_ref
);
...
...
libavcodec/cbs_h264_syntax_template.c
View file @
ac687add
...
...
@@ -740,6 +740,25 @@ static int FUNC(sei_display_orientation)(CodedBitstreamContext *ctx, RWContext *
return
0
;
}
static
int
FUNC
(
sei_mastering_display_colour_volume
)(
CodedBitstreamContext
*
ctx
,
RWContext
*
rw
,
H264RawSEIMasteringDisplayColourVolume
*
current
)
{
int
err
,
c
;
for
(
c
=
0
;
c
<
3
;
c
++
)
{
us
(
16
,
display_primaries_x
[
c
],
0
,
50000
,
1
,
c
);
us
(
16
,
display_primaries_y
[
c
],
0
,
50000
,
1
,
c
);
}
u
(
16
,
white_point_x
,
0
,
50000
);
u
(
16
,
white_point_y
,
0
,
50000
);
u
(
32
,
max_display_mastering_luminance
,
1
,
MAX_UINT_BITS
(
32
));
u
(
32
,
min_display_mastering_luminance
,
0
,
current
->
max_display_mastering_luminance
-
1
);
return
0
;
}
static
int
FUNC
(
sei_payload
)(
CodedBitstreamContext
*
ctx
,
RWContext
*
rw
,
H264RawSEIPayload
*
current
)
{
...
...
@@ -787,6 +806,10 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK
(
FUNC
(
sei_display_orientation
)
(
ctx
,
rw
,
&
current
->
payload
.
display_orientation
));
break
;
case
H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
:
CHECK
(
FUNC
(
sei_mastering_display_colour_volume
)
(
ctx
,
rw
,
&
current
->
payload
.
mastering_display_colour_volume
));
break
;
default:
{
#ifdef READ
...
...
libavcodec/h264_sei.h
View file @
ac687add
...
...
@@ -35,6 +35,7 @@ typedef enum {
H264_SEI_TYPE_FRAME_PACKING
=
45
,
///< frame packing arrangement
H264_SEI_TYPE_DISPLAY_ORIENTATION
=
47
,
///< display orientation
H264_SEI_TYPE_GREEN_METADATA
=
56
,
///< GreenMPEG information
H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
=
137
,
///< mastering display properties
H264_SEI_TYPE_ALTERNATIVE_TRANSFER
=
147
,
///< alternative transfer
}
H264_SEI_Type
;
...
...
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