aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2024-03-29 01:03:02 +0200
committerJan Ekström <jeebjp@gmail.com>2024-04-03 21:31:35 +0300
commit16128f3c5595012719db7ae7851964d5a961c160 (patch)
tree98d10394210f33c3dcc25e2153f5099d364e92ed /libavcodec
parent23d1b50175a6d07a0e2301ead347e4812c8c5dc8 (diff)
downloadffmpeg-16128f3c5595012719db7ae7851964d5a961c160.tar.gz
avcodec/libx265: do not arbitrarily limit color values
Newer specifications such as H.273 have, and probably will further in the future add new values to these, so - instead of trying to update these limits - we should simply check if the values are not set to the value of "unspecified". This should allow newer avutil values such as IPT-C2 or YCgCo-R variants be passed to x265 itself, which apparently does its own validation further down the line.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libx265.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 40ddce6030..0645cd2045 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -316,12 +316,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
avctx->pix_fmt == AV_PIX_FMT_YUVJ444P;
- if ((avctx->color_primaries <= AVCOL_PRI_SMPTE432 &&
- avctx->color_primaries != AVCOL_PRI_UNSPECIFIED) ||
- (avctx->color_trc <= AVCOL_TRC_ARIB_STD_B67 &&
- avctx->color_trc != AVCOL_TRC_UNSPECIFIED) ||
- (avctx->colorspace <= AVCOL_SPC_ICTCP &&
- avctx->colorspace != AVCOL_SPC_UNSPECIFIED)) {
+ if (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED ||
+ avctx->color_trc != AVCOL_TRC_UNSPECIFIED ||
+ avctx->colorspace != AVCOL_SPC_UNSPECIFIED) {
ctx->params->vui.bEnableColorDescriptionPresentFlag = 1;