* [FFmpeg-devel] [PATCH] avfilter/vf_colorspace: Make array smaller (PR #20575)
@ 2025-09-22 13:14 mkver via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: mkver via ffmpeg-devel @ 2025-09-22 13:14 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: mkver
PR #20575 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20575
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20575.patch
>From 5cb58a94a6fc59d96fafbffb10b4a191409e7223 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 22 Sep 2025 14:40:24 +0200
Subject: [PATCH 1/2] avfilter/vf_colorspace: Make array smaller
Also makes it more independent of AVCOL_TRC_NB.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/vf_colorspace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index f919350d65..52e84abbe1 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -171,7 +171,7 @@ typedef struct ColorSpaceContext {
// FIXME I'm pretty sure gamma22/28 also have a linear toe slope, but I can't
// find any actual tables that document their real values...
// See http://www.13thmonkey.org/~boris/gammacorrection/ first graph why it matters
-static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB] = {
+static const struct TransferCharacteristics transfer_characteristics[] = {
[AVCOL_TRC_BT709] = { 1.099, 0.018, 0.45, 4.5 },
[AVCOL_TRC_GAMMA22] = { 1.0, 0.0, 1.0 / 2.2, 0.0 },
[AVCOL_TRC_GAMMA28] = { 1.0, 0.0, 1.0 / 2.8, 0.0 },
@@ -189,7 +189,7 @@ static const struct TransferCharacteristics *
{
const struct TransferCharacteristics *coeffs;
- if (trc >= AVCOL_TRC_NB)
+ if ((unsigned)trc >= FF_ARRAY_ELEMS(transfer_characteristics))
return NULL;
coeffs = &transfer_characteristics[trc];
if (!coeffs->alpha)
--
2.49.1
>From 18e2c4a7b07cb50ed003555ee6eb119b9c79465b Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 22 Sep 2025 15:00:32 +0200
Subject: [PATCH 2/2] avfilter/vf_tonemap_opencl: Make array smaller
Also makes the code more independent of AVCOL_TRC_NB.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/vf_tonemap_opencl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c
index 26fc02923c..2c1b0a007d 100644
--- a/libavfilter/vf_tonemap_opencl.c
+++ b/libavfilter/vf_tonemap_opencl.c
@@ -70,12 +70,12 @@ typedef struct TonemapOpenCLContext {
cl_mem util_mem;
} TonemapOpenCLContext;
-static const char *const linearize_funcs[AVCOL_TRC_NB] = {
+static const char *const linearize_funcs[] = {
[AVCOL_TRC_SMPTE2084] = "eotf_st2084",
[AVCOL_TRC_ARIB_STD_B67] = "inverse_oetf_hlg",
};
-static const char *const delinearize_funcs[AVCOL_TRC_NB] = {
+static const char *const delinearize_funcs[] = {
[AVCOL_TRC_BT709] = "inverse_eotf_bt1886",
[AVCOL_TRC_BT2020_10] = "inverse_eotf_bt1886",
};
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-22 13:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-22 13:14 [FFmpeg-devel] [PATCH] avfilter/vf_colorspace: Make array smaller (PR #20575) mkver via ffmpeg-devel
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 http://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/ http://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