Commit Graph

1409 Commits

Author SHA1 Message Date
Jason Garrett-Glaser 85a3c19ed1 dsputil: x86: add SHUFFLE_MASK_W macro
Simplifies pshufb masks that operate on words.
2012-07-22 16:56:58 -04:00
Luca Barbato f3e5e6f05b mem: introduce av_malloc_array and av_mallocz_array
Both function ease allocating large arrays implementing the overflow
check inside it.
2012-07-14 20:07:25 +02:00
Janne Grunau 2d497c141d eval: add gt(), gte(), lt() and lte() fate tests 2012-07-14 13:43:10 +02:00
Max Lazarov caac3ab6ef eval: fix swapping of lt() and lte()
CC: libav-stable@libav.org
2012-07-14 13:33:25 +02:00
Ronald S. Bultje 183b1c2268 configure: Check for the math function rint
Add a fallback implementation if it doesn't exist.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-11 10:40:11 +03:00
Ronald S. Bultje 358d854df8 x86/cpu: implement get/set_eflags using intrinsics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-10 14:33:32 +03:00
Ronald S. Bultje c0ee695bd7 x86/cpu: implement support for cpuid through intrinsics
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-10 14:33:24 +03:00
Ronald S. Bultje 3f150ffba3 x86/cpu: implement support for xgetbv through intrinsics
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-10 14:33:17 +03:00
Ronald S. Bultje f80ddd5bf7 lavu: use intrinsics for emms on systems lacking inline asm support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-10 14:33:09 +03:00
Martin Storsjö 620b1e7e98 mem: Don't abort on av_malloc(0) in debug mode
This makes the behaviour consistent between debug and release mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-10 11:37:03 +03:00
Ronald S. Bultje 07b287020c x86/timer: implement an intrinsic-based version for rdtsc (AV_READ_TIME). 2012-07-07 13:35:07 -07:00
Loren Merritt 4d4752366f x86inc: add SPLATB_LOAD, SPLATB_REG, PSHUFLW macros
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-07-05 17:37:11 +02:00
Loren Merritt 2cd1f5cadc x86inc: modify ALIGN to not generate long nops on i586
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-07-05 17:37:11 +02:00
Samuel Pitoiset 983db9b2b4 xtea: Make the count parameter match the documentation
Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-05 12:45:18 +03:00
Samuel Pitoiset e4a7fb3da3 blowfish: Make the count parameter match the documentation
Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-05 12:41:57 +03:00
Luca Barbato f6687bf5f8 xtea: invert branch and loop precedence
Should slightly improve performance depending on the compiler used.
2012-07-05 10:42:00 +02:00
Luca Barbato 669bbedfa8 blowfish: invert branch and loop precedence
Should slightly improve performance depending on the compiler used.
2012-07-05 10:40:13 +02:00
Diego Biurrun 2047e40e6e Clarify Doxygen comment for FF_API_* #defines. 2012-07-04 15:10:10 +02:00
Diego Biurrun 86ab7b0f2f Create version.h headers for libraries that lack them 2012-07-04 15:10:06 +02:00
Samuel Pitoiset 8c14f7a593 Add XTEA encryption support in libavutil
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-04 15:10:57 +03:00
Samuel Pitoiset bc3dbcc8e5 Add Blowfish encryption support in libavutil
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-04 15:10:57 +03:00
Martin Storsjö 143f1e9203 eval: Add the isinf() function and tests for it
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-04 15:10:56 +03:00
Diego Biurrun 1a068bfefd cosmetics: Consistently use C-style comments with multiple inclusion guards 2012-07-03 17:35:12 +02:00
Reinhard Tartler 22662ca560 attributes: add av_noreturn
Also use it in the declaration of the various exit_program
implementations in avtools.

inspired by a clang-scan report.
2012-07-03 17:26:51 +02:00
Reinhard Tartler a1641e9540 attributes: drop pointless define guards
the av_-prefixed attributes must not be defined outside of this file
2012-07-03 17:26:51 +02:00
Ronald S. Bultje ff8f8dfb79 intfloat: Don't use designated initializers in the public headers
intfloat.h is a public header, and is now (since a1245d5ca) included
by mathematics.h, which many external callers include.

This fixes building third party applications that include
mathematics.h in a language that doesn't support designated
initalizers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-02 14:05:40 +03:00
Martin Storsjö 3893feeccd opt/eval: Include mathematics.h for NAN/INFINITY
These files use NAN/INFINITY but didn't include mathematics.h to get
the fallback definitions if the system lacks the macros.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-01 19:20:11 +03:00
Ronald S. Bultje a1245d5ca1 mathematics: Don't use division by zero in NAN/INFINITY macros
Some compilers, MSVC among them, don't recognize the divisions by
zero as meaning infinity/nan.

These macros should, according to the standard, expand to constant
expressions, but this shouldn't matter for our usage.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-01 19:06:13 +03:00
Mans Rullgard 889c1ec4cc x86: cpu: clean up check for cpuid instruction support
This adds macros for accessing the EFLAGS register and uses
these instead of coding the entire check in inline asm.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-01 12:25:33 +01:00
Mans Rullgard 62634158b7 ARM: generate position independent code to access data symbols
This creates proper position independent code when accessing
data symbols if CONFIG_PIC is set.

References to external symbols should now use the movrelx macro.
Some additional code changes are required since this macro may
need a register to hold the GOT pointer.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-01 11:25:06 +01:00
Ronald S. Bultje 4f2c846d96 attributes: Add a definition of av_always_inline for MSVC
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-30 16:03:45 +03:00
Ronald S. Bultje f985113075 random_seed: Only read /dev/*random if we have unistd.h
unistd.h is used for open/read/close, but if this header does not
exist, there's probably no use in trying to open /dev/*random
at all.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-29 15:52:07 +03:00
Martin Storsjö 46df708b45 libm: Provide fallback definitions for isnan() and isinf()
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-27 14:04:02 +03:00
Mans Rullgard 153335625c libm: provide fallback definition for cbrtf() using powf()
This adds a fallback for cbrtf() using powf(x, 1/3).  Since
powf() with a non-integer exponent requires a non-negative
base, special handling of negative inputs is needed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-26 15:56:38 +01:00
Ronald S. Bultje 246154a9af log: Include io.h on windows
This is required for isatty, which exists on MSVC and is found by
configure, but is provided by io.h instead of unistd.h.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-25 23:28:36 +03:00
Mans Rullgard 963cdf39b4 x86: cpu: whitespace (mostly) cosmetics
This adds whitespace around operators, aligns line continuation
backslashes, and breaks long lines.  Also fixes an ifdef halfway
through a statement.  The one line of duplication this saved is
not worth the ugliness.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-25 16:24:31 +01:00
Ronald S. Bultje 8123e0901f x86: place some inline asm under #if HAVE_INLINE_ASM
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-25 13:23:12 +01:00
Martin Storsjö 145a8096d5 log: Only include unistd.h if configure found it
MSVC has isatty (in io.h), but not unistd.h. (isatty isn't called
at all for windows, since there's a special case block for that.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-24 12:36:22 +03:00
Diego Biurrun 65345a5a30 x86: Add CPU flag for the i686 cmov instruction 2012-06-23 16:21:50 +02:00
Mans Rullgard d3d3a32c9d lavu: add av_usleep() function
This function implements a delay using the first available
of the following functions:

- nanosleep()
- usleep()
- Sleep() (Windows)

The conditional #includes in time.c are simplified by including
unistd.h and windows.h whenever they are available rather than
having these lines triggered by specific functions.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-22 17:15:18 +01:00
Diego Biurrun a5a93fa8f5 cosmetics: do not use full path for local headers 2012-06-22 10:49:40 +02:00
Mans Rullgard d11baad055 lavu/file: include unistd.h only when available
The unistd.h header is only needed for the close() declaration.
If this header is not available, the close() declaration may be
provided by another header, e.g. io.h.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 22:54:31 +01:00
Mans Rullgard 539df61193 log: include unistd.h only when needed
The only symbol this file uses from unistd.h is isatty().  By
including the header only when this function is used, the file
can be built on systems without unistd.h (which presumably also
lack isatty).

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 22:53:35 +01:00
Mans Rullgard dc7e336cae lavf, lavu: version bumps and APIchanges for av_gettime() move
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 11:45:28 +01:00
Mans Rullgard 61183b5ab4 av_gettime: support Win32 without gettimeofday()
Based on patch by Ronald S. Bultje.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 17:09:03 +01:00
Mans Rullgard 980f81d961 Use av_gettime() in various places
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 17:09:03 +01:00
Mans Rullgard ae0a301668 Move av_gettime() to libavutil
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 17:09:03 +01:00
Janne Grunau a2b186a188 mathematics.h: remove a couple of math defines
While these defines are not defined by the C standard they are
standardized as X/Open System Interfaces Extension. We use the
appropiate _XOPEN_SOURCE define to make them available. They
seem to be available on all FATE configs since the constants
are used in files where mathematics.h is not included.
2012-06-20 15:45:21 +02:00
Mans Rullgard 6501dcfb5e Remove unnecessary inclusions of [sys/]time.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 11:46:46 +01:00
Ronald S. Bultje be1a839ca6 mem: add support for _aligned_malloc() as found on Windows
The check uses check_func_header, since this function is
conditionally available depending on the targeted MSVCRT
version.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 10:08:00 +03:00