[FFmpeg-cvslog] lavu/tx: avoid using 64-bit enums

Lynne git at videolan.org
Thu Jan 27 11:21:36 EET 2022


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Thu Jan 27 10:19:45 2022 +0100| [238e11b71ffcd7f487e3f5ad5e2932fc5043f146] | committer: Lynne

lavu/tx: avoid using 64-bit enums

MSVC (2016, but possibly more) still force enums to be basic ints.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=238e11b71ffcd7f487e3f5ad5e2932fc5043f146
---

 libavutil/tx_priv.h | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index 47e53fcc26..11892df4be 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -116,13 +116,11 @@ typedef void TXComplex;
 
 /* Codelet flags, used to pick codelets. Must be a superset of enum AVTXFlags,
  * but if it runs out of bits, it can be made separate. */
-typedef enum FFTXCodeletFlags {
-    FF_TX_OUT_OF_PLACE  = (1ULL << 63), /* Can be OR'd with AV_TX_INPLACE             */
-    FF_TX_ALIGNED       = (1ULL << 62), /* Cannot be OR'd with AV_TX_UNALIGNED        */
-    FF_TX_PRESHUFFLE    = (1ULL << 61), /* Codelet expects permuted coeffs            */
-    FF_TX_INVERSE_ONLY  = (1ULL << 60), /* For non-orthogonal inverse-only transforms */
-    FF_TX_FORWARD_ONLY  = (1ULL << 59), /* For non-orthogonal forward-only transforms */
-} FFTXCodeletFlags;
+#define FF_TX_OUT_OF_PLACE (1ULL << 63) /* Can be OR'd with AV_TX_INPLACE             */
+#define FF_TX_ALIGNED      (1ULL << 62) /* Cannot be OR'd with AV_TX_UNALIGNED        */
+#define FF_TX_PRESHUFFLE   (1ULL << 61) /* Codelet expects permuted coeffs            */
+#define FF_TX_INVERSE_ONLY (1ULL << 60) /* For non-orthogonal inverse-only transforms */
+#define FF_TX_FORWARD_ONLY (1ULL << 59) /* For non-orthogonal forward-only transforms */
 
 typedef enum FFTXCodeletPriority {
     FF_TX_PRIO_BASE = 0,               /* Baseline priority */
@@ -149,8 +147,8 @@ typedef struct FFTXCodelet {
     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 FFTXCodeletFlags
-                                   * that describe the codelet's properties. */
+    uint64_t flags;               /* A combination of AVTXFlags and codelet
+                                   * flags that describe its properties. */
 
     int factors[TX_MAX_SUB];      /* Length factors */
 #define TX_FACTOR_ANY -1          /* When used alone, signals that the codelet
@@ -202,9 +200,8 @@ struct AVTXContext {
     const FFTXCodelet *cd[TX_MAX_SUB];  /* Subtransform codelets */
     const FFTXCodelet *cd_self;         /* Codelet for the current context */
     enum AVTXType      type;            /* Type of transform */
-    uint64_t           flags;           /* A combination of AVTXFlags
-                                           and FFTXCodeletFlags flags
-                                           used when creating */
+    uint64_t           flags;           /* A combination of AVTXFlags and
+                                         * codelet flags used when creating */
     float              scale_f;
     double             scale_d;
     void              *opaque;          /* Free to use by implementations */



More information about the ffmpeg-cvslog mailing list