summaryrefslogtreecommitdiff
path: root/libavutil/libm.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-28 00:42:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-28 01:08:52 +0200
commit87df986dcf90dcda2d10d9c3b3c84656cdd032aa (patch)
treef7c506a9a96b3df41f392a558a1f9add4f9ff013 /libavutil/libm.h
parentee7214c59a2641389bec9e9598345c7a58f1e173 (diff)
parent15358ade152ebc28fcc824e09ad9206597c281df (diff)
downloadffmpeg-87df986dcf90dcda2d10d9c3b3c84656cdd032aa.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: mss1: validate number of changeable palette entries mss1: report palette changed when some additional colours were decoded x86: fft: replace call to memcpy by a loop udp: Support IGMPv3 source specific multicast and source blocking dxva2: include dxva.h if found libm: Provide fallback definitions for isnan() and isinf() tcp: Pass NULL as hostname to getaddrinfo if the string is empty tcp: Set AI_PASSIVE when the socket will be used for listening Conflicts: configure libavcodec/mss1.c libavformat/udp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/libm.h')
-rw-r--r--libavutil/libm.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavutil/libm.h b/libavutil/libm.h
index ef90df0384..41b20f64c1 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -27,6 +27,7 @@
#include <math.h>
#include "config.h"
#include "attributes.h"
+#include "intfloat.h"
#if HAVE_MIPSFPU && HAVE_INLINE_ASM
#include "libavutil/mips/libm_mips.h"
@@ -49,6 +50,26 @@ static av_always_inline float cbrtf(float x)
#define exp2f(x) ((float)exp2(x))
#endif /* HAVE_EXP2F */
+#if !HAVE_ISINF
+static av_always_inline av_const int isinf(float x)
+{
+ uint32_t v = av_float2int(x);
+ if ((v & 0x7f800000) != 0x7f800000)
+ return 0;
+ return !(v & 0x007fffff);
+}
+#endif /* HAVE_ISINF */
+
+#if !HAVE_ISNAN
+static av_always_inline av_const int isnan(float x)
+{
+ uint32_t v = av_float2int(x);
+ if ((v & 0x7f800000) != 0x7f800000)
+ return 0;
+ return v & 0x007fffff;
+}
+#endif /* HAVE_ISNAN */
+
#if !HAVE_LLRINT
#undef llrint
#define llrint(x) ((long long)rint(x))