summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2019-06-26 18:57:59 +0800
committerRick Kern <rick@8birdsvideo.com>2019-08-11 10:52:15 -0400
commit391b67fcb58f95b5cc65b75070fd9a3dce4f8ac6 (patch)
tree8da7dbd67da83ba13549e23b63dda59eb77164ed /libavcodec
parent33186028fcf7b248bcd70daf620e05353b68fbed (diff)
downloadffmpeg-391b67fcb58f95b5cc65b75070fd9a3dce4f8ac6.tar.gz
lavc/videotoolboxenc: add hdr10, linear, hlg color transfer function for videotoolboxenc
Below is the testing ffmpeg command for the setting: ./ffmpeg -i input.ts -c:v hevc_videotoolbox -color_primaries bt2020 -colorspace bt2020_ncl -color_trc smpte2084 smpte2048.ts ./ffmpeg -i input.ts -c:v hevc_videotoolbox -color_primaries bt2020 -colorspace bt2020_ncl -color_trc linear linear.ts ./ffmpeg -i input.ts -c:v hevc_videotoolbox -color_primaries bt2020 -colorspace bt2020_ncl -color_trc arib-std-b67 hlg.ts Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Rick Kern <kernrj@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/videotoolboxenc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index ff33c279c3..ece9d6ea8f 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -915,6 +915,22 @@ static int get_cv_transfer_function(AVCodecContext *avctx,
*transfer_fnc = kCVImageBufferTransferFunction_SMPTE_240M_1995;
break;
+#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ
+ case AVCOL_TRC_SMPTE2084:
+ *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ;
+ break;
+#endif
+#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR
+ case AVCOL_TRC_LINEAR:
+ *transfer_fnc = kCVImageBufferTransferFunction_Linear;
+ break;
+#endif
+#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG
+ case AVCOL_TRC_ARIB_STD_B67:
+ *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_2100_HLG;
+ break;
+#endif
+
case AVCOL_TRC_GAMMA22:
gamma = 2.2;
*transfer_fnc = kCVImageBufferTransferFunction_UseGamma;