Commit Graph

1368 Commits

Author SHA1 Message Date
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
Justin Ruggles
82b2df9790 float_dsp: add x86-optimized functions for vector_fmac_scalar() 2012-06-18 18:01:14 -04:00
Justin Ruggles
cb5042d02c float_dsp: Move vector_fmac_scalar() from libavcodec to libavutil 2012-06-18 18:01:14 -04:00
John Stebbins
3971be0eb5 Add Dolby/DPLII downmix support to libavresample
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-06-18 10:55:00 -04:00
Anton Khirnov
b0f0dfc485 Bump lavu minor and add an APIChanges entry for audioconvert functions. 2012-06-10 08:04:01 +02:00
Anton Khirnov
59d58b3390 audioconvert: add a function for extracting the channel with the given index 2012-06-10 08:03:45 +02:00
Anton Khirnov
5df320e167 audioconvert: add a function for getting the name of a single channel. 2012-06-10 08:03:11 +02:00
Anton Khirnov
406b257de9 audioconvert: add a function for getting channel's index in layout 2012-06-10 08:02:18 +02:00
Anton Khirnov
3596de55fc audioconvert: use av_popcount64 in av_get_channel_layout_nb_channels 2012-06-10 08:02:11 +02:00
Justin Ruggles
03e098e7a0 lavu: change versioning script to include all av* prefixed symbols
Needed to properly export avpriv_* symbols.
2012-06-08 15:47:59 -04:00
Justin Ruggles
3b81a18ba3 float_dsp: ppc: add a separate header for Altivec function prototypes
Also include config.h so that HAVE_ALTIVEC will be defined.
Fixes compilation on PPC with Altivec enabled.
2012-06-08 14:52:01 -04:00
Mans Rullgard
a839d6abf8 ARM: fix float_dsp breakage from d5a7229
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-08 19:45:37 +01:00
Justin Ruggles
d5a7229ba4 Add a float DSP framework to libavutil
Move vector_fmul() from DSPContext to AVFloatDSPContext.
2012-06-08 13:14:38 -04:00
Justin Ruggles
98db4e2a4e PPC: Move types_altivec.h and util_altivec.h from libavcodec to libavutil
This will allow for easier implementation of Altivec functions in libraries
other than libavcodec.
2012-06-08 13:14:38 -04:00
Justin Ruggles
94d2b0d2fd ARM: Move asm.S from libavcodec to libavutil
This will allow for easier implementation of ARM-optimized functions in
libraries other than libavcodec.
2012-06-08 13:14:38 -04:00
Vitor Sessak
4a301706fd x86: Avoid movs on BUTTERFLYPS when in AVX mode
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-05-29 15:29:46 +02:00
Anton Khirnov
0426c69310 AVOptions: fix the value printed in out of range error message. 2012-05-28 12:55:41 +02:00
Anton Khirnov
780ff97fef log: make colored output more colorful.
Green for verbose, cyan for debug.
2012-05-26 21:14:17 +02:00
Samuel Pitoiset
154486f9ad opt: Add av_opt_set_bin()
Introduce a new function to set binary data through AVOption,
avoiding having to convert the binary data to a string inbetween.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-26 14:31:44 +03:00
Anton Khirnov
d89eca507c Add missing version bumps and APIchanges/Changelog entries. 2012-05-15 06:57:31 +02:00
Justin Ruggles
5cc6d5244d lavr: replace the SSE version of ff_conv_fltp_to_flt_6ch() with SSE4 and AVX
The current SSE version is slower than the MMX version on Athlon64 and Sandy
Bridge, but the SSE4 and AVX versions are faster on Sandy Bridge.
2012-05-09 16:17:59 -04:00
Anton Khirnov
6d7f617700 samplefmt: add a function for filling a buffer with silence. 2012-05-09 17:44:56 +02:00
Anton Khirnov
142e740d1e samplefmt: add a function for copying audio samples. 2012-05-09 17:43:26 +02:00
Mans Rullgard
6766169c41 mips: intreadwrite: fix inline asm for gcc 4.8
Just like gcc 4.6 and later on ARM, gcc 4.8 on MIPS generates
inefficient code when a known-unaligned location is used as a
memory input operand.  This applies the same fix as has been
previously done to the ARM version of the code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-09 13:45:22 +01:00
Mans Rullgard
b82b49a5b7 mips: intreadwrite: remove unnecessary inline asm
GCC actually handles unaligned accesses correctly in all cases
except, absurdly, 32-bit loads on mips64.  The remaining asm is
thus not needed, and removing it results in better code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-09 13:45:17 +01:00
Diego Biurrun
ce473de921 av_samples_fill_array: Mark unmodified function argument as const.
libavcodec/utils.c:274: warning: passing argument 3 of ‘av_samples_fill_arrays’ discards qualifiers from pointer target type
./libavutil/samplefmt.h:151: note: expected ‘uint8_t *’ but argument is of type ‘const uint8_t *’
2012-05-08 11:35:49 +02:00
Diego Biurrun
dbe6ba55a3 build: cosmetics: Add missing end-of-line backslashes to item lists. 2012-05-07 14:17:40 +02:00
Diego Biurrun
9eb83a56aa build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line. 2012-05-07 14:01:32 +02:00
Mans Rullgard
c02efacc8f arm: intreadwrite: revert 16-bit load asm to old version for gcc < 4.6
Commit adebad0 "arm: intreadwrite: fix inline asm constraints for gcc
4.6 and later" caused some older gcc versions to miscompile code.
This reverts to the old version of the code for these compilers.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-03 21:40:19 +01:00
Mans Rullgard
ababec7b95 arm: intreadwrite: disable inline asm for gcc 4.7 and later
Starting with version 4.7, gcc properly supports unaligned
memory accesses on ARM.  Not using the inline asm with these
compilers results in better code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-02 17:26:39 +01:00
Mans Rullgard
adebad07e0 arm: intreadwrite: fix inline asm constraints for gcc 4.6 and later
With a dereferenced type-cast pointer as memory operand, gcc 4.6
and later will sometimes copy the data to a temporary location,
the address of which is used as the operand value, if it thinks
the target address might be misaligned.  Using a pointer to a
packed struct type instead does the right thing.

The 16-bit case is special since the ldrh instruction addressing
modes are limited compared to ldr.  The "Uq" constraint produces a
memory reference suitable for an ldrsb instruction, which supports
the same addressing modes as ldrh.  However, the restrictions appear
to apply only when the operand addresses a single byte.  The memory
reference must thus be split into two operands each targeting one
byte.  Finally, the "Uq" constraint is only available in ARM mode.
The Thumb-2 ldrh instruction supports most addressing modes so the
normal "m" constraint can be used there.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-05-02 17:26:38 +01:00
Mans Rullgard
6eca84bad8 cpu: recognise only cpu flag names pertinent to the architecture
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-25 23:19:40 +01:00
Mans Rullgard
3527a73933 avutil: add av_parse_cpu_flags() function
This moves the cpu flag parsing code from avconv to avutil so
it can be accessed elsewhere.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-25 23:19:40 +01:00
Justin Ruggles
c8af852b97 Add libavresample
This is a new library for audio sample format, channel layout, and sample rate
conversion.
2012-04-24 21:28:27 -04:00
Justin Ruggles
83b26046fc avutil: change default buffer size alignment for sample buffer functions
Aligning nb_samples will give both correct plane pointer alignment and enough
padding for SIMD-optimized functions.
2012-04-23 14:06:45 -04:00
Mans Rullgard
d526c5338d ARM: allow runtime masking of CPU features
This allows masking CPU features with the -cpuflags avconv option
which is useful for testing different optimisations without rebuilding.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-22 12:30:45 +01:00
Justin Ruggles
0c0d1bce7c avutil: add audio fifo buffer
The functions operate on the sample level rather than the byte level and work
with all audio sample formats.
2012-04-20 09:43:11 -04:00
Loren Merritt
705f3d4759 x86inc: support AVX abstraction for 2-operand instructions
Add cvtdq2ps and cvtps2dq to the AVX instruction list.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-18 21:14:32 -04:00
Justin Ruggles
5e8280d177 avutil: add better documentation for AVSampleFormat 2012-04-16 15:26:55 -04:00
Diego Biurrun
baaab6069a build: Move all arch OBJS declarations into arch subdirectory Makefiles. 2012-04-12 21:30:13 +02:00
Henrik Gramner
729f90e268 x86inc improvements for 64-bit
Add support for all x86-64 registers
Prefer caller-saved register over callee-saved on WIN64
Support up to 15 function arguments

Also (by Ronald S. Bultje)
Fix up our asm to work with new x86inc.asm.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-11 15:47:00 -04:00
Martin Storsjö
14f063d294 mem: Consistently return NULL for av_malloc(0)
Plain POSIX malloc(0) is allowed to return either NULL or a
non-NULL pointer. The calling code should be ready to handle
a NULL return as a correct return (instead of a failure) if the size
to allocate was 0 - this makes sure the condition is handled
in a consistent way across platforms.

This also avoids calling posix_memalign(&ptr, 32, 0) on OS X,
which returns an invalid pointer (a non-NULL pointer that causes
crashes when passed to av_free).

Abort in debug mode, to help track down issues related to
incorrect handling of this case.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-10 11:56:42 +03:00