diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-06-09 17:27:22 -0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-06-28 09:44:09 -0400 |
commit | 969f215957b25ec014aeed6e440ecb450e6927c1 (patch) | |
tree | 11302d9c13c27716aceb3e1d1542dc813106fcf5 /libavcodec/hevcdec.c | |
parent | a594f17f83a1ffdc1eec18818208fe39487dd5d7 (diff) | |
download | ffmpeg-969f215957b25ec014aeed6e440ecb450e6927c1.tar.gz |
hevc: Add support for alternative transfer characterics SEI
The use of this SEI is for backward compatibility in HLG HDR systems:
older devices that cannot interpret the "arib-std-b67" transfer will
get the compatible transfer (usually bt709 or bt2020) from the VUI,
while newer devices that can interpret HDR will read the SEI and use
its value instead.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r-- | libavcodec/hevcdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 7a9182af9b..ac0b1a3c1d 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2407,6 +2407,12 @@ static int set_side_data(HEVCContext *s) s->sei.display_orientation.vflip); } + if (s->sei.alternative_transfer.present && + av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) && + s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { + s->avctx->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics; + } + return 0; } |