diff options
author | Jan Ekström <jeebjp@gmail.com> | 2023-01-09 22:49:49 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2023-01-13 20:53:02 +0200 |
commit | f4bebc0c34b6aeac011adfdc6fdbbfc939ac5a64 (patch) | |
tree | a77469891586bd2b567a4048d300a1bc231143a4 /libavcodec/cbs_sei_syntax_template.c | |
parent | d3538dd293125e0a8d135ffe229c8b441345d833 (diff) |
avcodec/cbs_{h2645,sei}: add support for Ambient Viewing Environment SEI
Defined by H.274, this SEI message is utilized by iPhones to save
the nominal ambient viewing environment for the display of recorded
HDR content.
Diffstat (limited to 'libavcodec/cbs_sei_syntax_template.c')
-rw-r--r-- | libavcodec/cbs_sei_syntax_template.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/cbs_sei_syntax_template.c b/libavcodec/cbs_sei_syntax_template.c index 0ef7b42ed9..6a7cc36dda 100644 --- a/libavcodec/cbs_sei_syntax_template.c +++ b/libavcodec/cbs_sei_syntax_template.c @@ -144,6 +144,23 @@ static int FUNC(alternative_transfer_characteristics) return 0; } +static int FUNC(ambient_viewing_environment) + (CodedBitstreamContext *ctx, RWContext *rw, + SEIRawAmbientViewingEnvironment *current, + SEIMessageState *state) +{ + static const uint16_t max_ambient_light_value = 50000; + int err; + + HEADER("Ambient Viewing Environment"); + + u(32, ambient_illuminance, 1, MAX_UINT_BITS(32)); + u(16, ambient_light_x, 0, max_ambient_light_value); + u(16, ambient_light_y, 0, max_ambient_light_value); + + return 0; +} + static int FUNC(message)(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessage *current) { |