From: Lynne via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Lynne <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] Small fixes for the extended color primaries and transfer functions (PR #20863)
Date: Sat, 08 Nov 2025 12:47:11 -0000
Message-ID: <176260603218.25.11762922272952556025@2cb04c0e5124> (raw)
PR #20863 opened by Lynne
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20863
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20863.patch
This just lets them actually be used in swscale and vf_colorspace.
>From 7e9039e3e472567e8fb3df3ee89861f9915ee5a5 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Fri, 7 Nov 2025 13:53:48 +0100
Subject: [PATCH 1/2] swscale: allow extended primaries
---
libswscale/format.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libswscale/format.c b/libswscale/format.c
index 6aec0132be..2ae6d50523 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -546,7 +546,8 @@ int sws_test_colorspace(enum AVColorSpace csp, int output)
int sws_test_primaries(enum AVColorPrimaries prim, int output)
{
- return prim > AVCOL_PRI_RESERVED0 && prim < AVCOL_PRI_NB &&
+ return ((prim > AVCOL_PRI_RESERVED0 && prim < AVCOL_PRI_NB) ||
+ (prim >= AVCOL_PRI_EXT_BASE && prim < AVCOL_PRI_EXT_NB)) &&
prim != AVCOL_PRI_RESERVED;
}
--
2.49.1
>From be498dfabc17bfdaca36982275e0bf166cd51abc Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Fri, 7 Nov 2025 13:24:43 +0100
Subject: [PATCH 2/2] vf_colorspace: allow for extended primaries and
colorspace
---
libavfilter/vf_colorspace.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 52e84abbe1..78164e1f34 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -950,7 +950,7 @@ static const AVOption colorspace_options[] = {
{ "primaries", "Output color primaries",
OFFSET(user_prm), AV_OPT_TYPE_INT, { .i64 = AVCOL_PRI_UNSPECIFIED },
- AVCOL_PRI_RESERVED0, AVCOL_PRI_NB - 1, FLAGS, .unit = "prm" },
+ AVCOL_PRI_RESERVED0, AVCOL_PRI_EXT_NB - 1, FLAGS, .unit = "prm" },
ENUM("bt709", AVCOL_PRI_BT709, "prm"),
ENUM("bt470m", AVCOL_PRI_BT470M, "prm"),
ENUM("bt470bg", AVCOL_PRI_BT470BG, "prm"),
@@ -963,10 +963,11 @@ static const AVOption colorspace_options[] = {
ENUM("bt2020", AVCOL_PRI_BT2020, "prm"),
ENUM("jedec-p22", AVCOL_PRI_JEDEC_P22, "prm"),
ENUM("ebu3213", AVCOL_PRI_EBU3213, "prm"),
+ ENUM("vgamut", AVCOL_PRI_V_GAMUT, "prm"),
{ "trc", "Output transfer characteristics",
OFFSET(user_trc), AV_OPT_TYPE_INT, { .i64 = AVCOL_TRC_UNSPECIFIED },
- AVCOL_TRC_RESERVED0, AVCOL_TRC_NB - 1, FLAGS, .unit = "trc" },
+ AVCOL_TRC_RESERVED0, AVCOL_TRC_EXT_NB - 1, FLAGS, .unit = "trc" },
ENUM("bt709", AVCOL_TRC_BT709, "trc"),
ENUM("bt470m", AVCOL_TRC_GAMMA22, "trc"),
ENUM("gamma22", AVCOL_TRC_GAMMA22, "trc"),
@@ -981,6 +982,7 @@ static const AVOption colorspace_options[] = {
ENUM("iec61966-2-4", AVCOL_TRC_IEC61966_2_4, "trc"),
ENUM("bt2020-10", AVCOL_TRC_BT2020_10, "trc"),
ENUM("bt2020-12", AVCOL_TRC_BT2020_12, "trc"),
+ ENUM("vlog", AVCOL_TRC_V_LOG, "trc"),
{ "format", "Output pixel format",
OFFSET(user_format), AV_OPT_TYPE_INT, { .i64 = AV_PIX_FMT_NONE },
@@ -1030,10 +1032,10 @@ static const AVOption colorspace_options[] = {
AVCOL_RANGE_UNSPECIFIED, AVCOL_RANGE_NB - 1, FLAGS, .unit = "rng" },
{ "iprimaries", "Input color primaries",
OFFSET(user_iprm), AV_OPT_TYPE_INT, { .i64 = AVCOL_PRI_UNSPECIFIED },
- AVCOL_PRI_RESERVED0, AVCOL_PRI_NB - 1, FLAGS, .unit = "prm" },
+ AVCOL_PRI_RESERVED0, AVCOL_PRI_EXT_NB - 1, FLAGS, .unit = "prm" },
{ "itrc", "Input transfer characteristics",
OFFSET(user_itrc), AV_OPT_TYPE_INT, { .i64 = AVCOL_TRC_UNSPECIFIED },
- AVCOL_TRC_RESERVED0, AVCOL_TRC_NB - 1, FLAGS, .unit = "trc" },
+ AVCOL_TRC_RESERVED0, AVCOL_TRC_EXT_NB - 1, FLAGS, .unit = "trc" },
{ NULL }
};
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2025-11-08 12:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176260603218.25.11762922272952556025@2cb04c0e5124 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git