Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avutil/tx: fix AVTXType warnings on some platforms (PR #21281)
@ 2025-12-23  8:10 Zhaozhenghang via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Zhaozhenghang via ffmpeg-devel @ 2025-12-23  8:10 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhaozhenghang

PR #21281 opened by Zhaozhenghang
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21281
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21281.patch

TX_TYPE_ANY was defined as INT32_MAX and assigned to enum AVTXType,
which triggers overflow and type-limits warnings on some platforms.
Use a proper enum value instead.

Signed-off-by: zhaozhenghang <zhaozhenghang@xiaomi.com>


>From 8799ce68804d07fec8ec0a3a9a0053582fcf48fd Mon Sep 17 00:00:00 2001
From: zhaozhenghang <zhaozhenghang@xiaomi.com>
Date: Tue, 23 Dec 2025 16:08:03 +0800
Subject: [PATCH] avutil/tx: fix AVTXType warnings on some platforms

TX_TYPE_ANY was defined as INT32_MAX and assigned to enum AVTXType,
which triggers overflow and type-limits warnings on some platforms.
Use a proper enum value instead.

Signed-off-by: zhaozhenghang <zhaozhenghang@xiaomi.com>
---
 libavutil/tx.c      | 8 ++++----
 libavutil/tx.h      | 3 +++
 libavutil/tx_priv.h | 1 -
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavutil/tx.c b/libavutil/tx.c
index 05c132ada1..15f0579cc1 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -320,7 +320,7 @@ static void ff_tx_null(AVTXContext *s, void *_out, void *_in, ptrdiff_t stride)
 static const FFTXCodelet ff_tx_null_def = {
     .name       = NULL_IF_CONFIG_SMALL("null"),
     .function   = ff_tx_null,
-    .type       = TX_TYPE_ANY,
+    .type       = AV_TX_TYPE_ANY,
     .flags      = AV_TX_UNALIGNED | FF_TX_ALIGNED |
                   FF_TX_OUT_OF_PLACE | AV_TX_INPLACE,
     .factors[0] = TX_FACTOR_ANY,
@@ -433,7 +433,7 @@ int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type,
                 goto sort;
 
             /* Check if the type matches */
-            if (cd->type != TX_TYPE_ANY && type != cd->type)
+            if (cd->type != AV_TX_TYPE_ANY && type != cd->type)
                 continue;
 
             /* Check direction for non-orthogonal codelets */
@@ -575,7 +575,7 @@ static void print_flags(AVBPrint *bp, uint64_t f)
 static void print_type(AVBPrint *bp, enum AVTXType type)
 {
     av_bprintf(bp, "%s",
-               type == TX_TYPE_ANY       ? "any"         :
+               type == AV_TX_TYPE_ANY    ? "any"         :
                type == AV_TX_FLOAT_FFT   ? "fft_float"   :
                type == AV_TX_FLOAT_MDCT  ? "mdct_float"  :
                type == AV_TX_FLOAT_RDFT  ? "rdft_float"  :
@@ -755,7 +755,7 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type,
 
         while ((cd = *list++)) {
             /* Check if the type matches */
-            if (cd->type != TX_TYPE_ANY && type != cd->type)
+            if (cd->type != AV_TX_TYPE_ANY && type != cd->type)
                 continue;
 
             /* Check direction for non-orthogonal codelets */
diff --git a/libavutil/tx.h b/libavutil/tx.h
index c950095735..285efaab2d 100644
--- a/libavutil/tx.h
+++ b/libavutil/tx.h
@@ -129,6 +129,9 @@ enum AVTXType {
     AV_TX_DOUBLE_DST_I = 16,
     AV_TX_INT32_DST_I  = 17,
 
+    /* Special type to allow all types */
+    AV_TX_TYPE_ANY,
+
     /* Not part of the API, do not use */
     AV_TX_NB,
 };
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index d3fcdbf563..c90dee8ac2 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -200,7 +200,6 @@ typedef struct FFTXCodelet {
     const char    *name;          /* Codelet name, for debugging */
     av_tx_fn       function;      /* Codelet function, != NULL */
     enum AVTXType  type;          /* Type of codelet transform */
-#define TX_TYPE_ANY INT32_MAX     /* Special type to allow all types */
 
     uint64_t flags;               /* A combination of AVTXFlags and codelet
                                    * flags that describe its properties. */
-- 
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-12-23  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-23  8:10 [FFmpeg-devel] [PATCH] avutil/tx: fix AVTXType warnings on some platforms (PR #21281) Zhaozhenghang 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 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