mirror of https://git.ffmpeg.org/ffmpeg.git
Factorize CHECK/SUINT code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e3c14eaa54
commit
4614bf2caf
|
@ -23,16 +23,6 @@
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
#include "libavutil/samplefmt.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 {
|
typedef struct FLACDSPContext {
|
||||||
void (*decorrelate[4])(uint8_t **out, int32_t **in, int channels,
|
void (*decorrelate[4])(uint8_t **out, int32_t **in, int channels,
|
||||||
int len, int shift);
|
int len, int shift);
|
||||||
|
|
|
@ -59,14 +59,6 @@
|
||||||
|
|
||||||
#define FIX(a) ((int)((a) * FRAC_ONE))
|
#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
|
#if USE_FLOATS
|
||||||
# define INTFLOAT float
|
# define INTFLOAT float
|
||||||
# define SUINTFLOAT float
|
# define SUINTFLOAT float
|
||||||
|
|
|
@ -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)
|
# define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
|
||||||
#endif
|
#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.
|
* 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
|
* This function is needed because conversion of floating point to integers when
|
||||||
|
|
Loading…
Reference in New Issue