From: mkver via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: mkver <code@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] avfilter/vf_colorspace: Make array smaller (PR #20575) Date: Mon, 22 Sep 2025 13:14:48 -0000 Message-ID: <175854688896.25.402111820911838381@463a07221176> (raw) 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
reply other threads:[~2025-09-22 13:15 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=175854688896.25.402111820911838381@463a07221176 \ --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 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