diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-20 19:34:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-21 00:40:20 +0100 |
commit | 4614bf2caf67a89c2d833b3368f325eab54582bc (patch) | |
tree | 8a998b9f5418391f7262c117cbf0ec07ae08243d | |
parent | e3c14eaa54c87d4d8771bc75cb24b0b537fbcd19 (diff) | |
download | ffmpeg-4614bf2caf67a89c2d833b3368f325eab54582bc.tar.gz |
Factorize CHECK/SUINT code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/flacdsp.h | 10 | ||||
-rw-r--r-- | libavcodec/mpegaudio.h | 8 | ||||
-rw-r--r-- | libavutil/internal.h | 10 |
3 files changed, 10 insertions, 18 deletions
diff --git a/libavcodec/flacdsp.h b/libavcodec/flacdsp.h index 31417f8414..7bb0dd0e9a 100644 --- a/libavcodec/flacdsp.h +++ b/libavcodec/flacdsp.h @@ -23,16 +23,6 @@ #include "libavutil/internal.h" #include "libavutil/samplefmt.h" -// For debuging we use signed operations so overflows can be detected (by ubsan) -// For production we use unsigned so there are no undefined operations -#ifdef CHECKED -#define SUINT int -#define SUINT32 int32_t -#else -#define SUINT unsigned -#define SUINT32 uint32_t -#endif - typedef struct FLACDSPContext { void (*decorrelate[4])(uint8_t **out, int32_t **in, int channels, int len, int shift); diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h index fcded7ae3e..74590a8e8b 100644 --- a/libavcodec/mpegaudio.h +++ b/libavcodec/mpegaudio.h @@ -59,14 +59,6 @@ #define FIX(a) ((int)((a) * FRAC_ONE)) -#ifdef CHECKED -#define SUINT int -#define SUINT32 int32_t -#else -#define SUINT unsigned -#define SUINT32 uint32_t -#endif - #if USE_FLOATS # define INTFLOAT float # define SUINTFLOAT float diff --git a/libavutil/internal.h b/libavutil/internal.h index 4d1b3e2c18..7780a9a791 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -262,6 +262,16 @@ void avpriv_request_sample(void *avc, # define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) #endif +// For debuging we use signed operations so overflows can be detected (by ubsan) +// For production we use unsigned so there are no undefined operations +#ifdef CHECKED +#define SUINT int +#define SUINT32 int32_t +#else +#define SUINT unsigned +#define SUINT32 uint32_t +#endif + /** * Clip and convert a double value into the long long amin-amax range. * This function is needed because conversion of floating point to integers when |