summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-08-08 16:06:29 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2017-08-10 15:32:59 +0200
commitebf3b9e8a875eb12312460aee505118791ef805f (patch)
treeb1c68b5486fbe99749c400196ed10f446a487b46 /libavcodec/h264_slice.c
parent19388a7200e5d99c703271f05dba1c806720e808 (diff)
h264: 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/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c6309b298c..5dd01d836e 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1154,6 +1154,12 @@ static int h264_export_frame_props(H264Context *h)
a53->a53_caption_size = 0;
}
+ if (h->sei.alternative_transfer.present &&
+ av_color_transfer_name(h->sei.alternative_transfer.preferred_transfer_characteristics) &&
+ h->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) {
+ h->avctx->color_trc = cur->f->color_trc = h->sei.alternative_transfer.preferred_transfer_characteristics;
+ }
+
return 0;
}