History

avutil/avassert: Add av_assertX_fpu()

Michael Niedermayer committed 10 years ago

Commit f5495c91 parent 2c1d38d4 files · +26 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/avassert.h +9 −0
  3. libavutil/utils.c +13 −0
  4. libavutil/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182016-10-22 - xxxxxxx - lavu 55.33.100 - avassert.h
19 Add av_assert0_fpu() / av_assert2_fpu()
20
182016-xx-xx - xxxxxxx - lavc 57.61.100 / lavc 57.24.0 - avcodec.h212016-xx-xx - xxxxxxx - lavc 57.61.100 / lavc 57.24.0 - avcodec.h
19 Decoders now export the frame timestamp as AVFrame.pts. It was22 Decoders now export the frame timestamp as AVFrame.pts. It was
20 previously exported as AVFrame.pkt_pts, which is now deprecated.23 previously exported as AVFrame.pkt_pts, which is now deprecated.
libavutil/avassert.h+9−0
@@ -59,8 +59,17 @@ · 58 unmodified lines
59 */59 */
60#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 160#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
61#define av_assert2(cond) av_assert0(cond)61#define av_assert2(cond) av_assert0(cond)
62#define av_assert2_fpu() av_assert0_fpu()
62#else63#else
63#define av_assert2(cond) ((void)0)64#define av_assert2(cond) ((void)0)
65#define av_assert2_fpu() ((void)0)
64#endif66#endif
65 67
68/**
69 * Assert that floating point opperations can be executed.
70 *
71 * This will av_assert0() that the cpu is not in MMX state on X86
72 */
73void av_assert0_fpu(void);
74
66#endif /* AVUTIL_AVASSERT_H */75#endif /* AVUTIL_AVASSERT_H */
libavutil/utils.c+13−0
@@ -125,3 +125,16 @@ AVRational av_get_time_base_q(void) · 124 unmodified lines
125{125{
126 return (AVRational){1, AV_TIME_BASE};126 return (AVRational){1, AV_TIME_BASE};
127}127}
128
129void av_assert0_fpu(void) {
130#if HAVE_MMX_INLINE
131 uint16_t state[14];
132 __asm volatile (
133 "fstenv %0 \n\t"
134 : "+m" (state)
135 :
136 : "memory"
137 );
138 av_assert0((state[4] & 3) == 3);
139#endif
140}
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
79 */79 */
80 80
81#define LIBAVUTIL_VERSION_MAJOR 5581#define LIBAVUTIL_VERSION_MAJOR 55
82#define LIBAVUTIL_VERSION_MINOR 3282#define LIBAVUTIL_VERSION_MINOR 33
83#define LIBAVUTIL_VERSION_MICRO 10083#define LIBAVUTIL_VERSION_MICRO 100
84 84
85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t