Commit Graph

1394 Commits

Author SHA1 Message Date
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
Justin Ruggles 0109a09dc3 avutil: use align == 0 for default alignment in audio sample buffer functions 2012-04-09 10:20:35 -04:00
Justin Ruggles 18ed3788b0 avutil: allow NULL linesize in av_samples_fill_arrays() and av_samples_alloc() 2012-04-09 10:20:35 -04:00
Nicolas George b2db35995f audioconvert: make av_get_channel_layout accept composite names.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-08 18:35:49 -04:00
Justin Ruggles 4d693b023c avutil: add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
Based on a patch by Clément Bœsch <ubitux@gmail.com>
2012-04-08 15:13:28 -04:00
Justin Ruggles 5cc51a5847 avutil: Add av_get_default_channel_layout()
Also, use the new function in the AC-3 encoder.
2012-04-05 16:35:14 -04:00
Diego Biurrun 3dde147ff9 cosmetics: Consistently place static, inline and av_cold attributes/keywords. 2012-04-04 14:54:13 +02:00
Diego Biurrun a92be9b856 Replace memset(0) by zero initializations.
Also remove one pointless zero initialization in rangecoder.c.
2012-03-28 09:38:33 +02:00
Diego Biurrun e7e19b15c7 build: Only clean the architecture subdirectory we build for.
This allows simplifying the Makefiles; it is no longer necessary to register
arch subdirectory Makefiles, just putting them in place is enough.
2012-03-26 13:29:03 +02:00
Diego Biurrun 80391552c9 libavutil: Remove pointless rational test program. 2012-03-26 13:00:09 +02:00
Diego Biurrun 193d7eea95 libavutil: Remove broken and pointless lzo test program. 2012-03-26 13:00:09 +02:00
Martin Storsjö 27b7459b8d docs: Fix a stray reference to tags in the generic doxy on dicts
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-19 16:07:38 +02:00
Ronald S. Bultje 98b9da2ac7 x86inc: add *mp named argument support to DEFINE_ARGS. 2012-03-14 20:09:53 -07:00
Janne Grunau 363bd1c62c remove iwmmxt optimizations
The were broken since August of 2010 without anyone noticing until
three weeks ago. Nobody cares about it anymore and hopefully Marvell
will support NEON like in the PXA978 from now on.
2012-03-12 22:46:56 +01:00
Ronald S. Bultje a9c5b6f602 cpu: initialize mask to -1, so that by default, optimizations are used. 2012-03-06 12:53:02 -08:00
Anton Khirnov 4d851f8dcf cpu: add av_set_cpu_flags_mask(). 2012-03-06 15:02:28 +01:00
Loren Merritt 0f53d0cf4b x86inc: don't "bake" stack_offset in named arguments.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-03 20:39:59 -08:00
Diego Biurrun cfac648e6a doxygen: Remove documentation for non-existing parameters; misc small fixes. 2012-02-28 20:48:43 +01:00
Justin Ruggles c9bca80132 avutil: add AVERROR_UNKNOWN
Useful to return instead of -1 when the cause of the error is unknown,
typically from an external library.
2012-02-25 11:49:41 -05:00
Diego Biurrun b315042c8c Remove libpostproc.
This library does not fit into Libav as a whole and its code is just a
maintenance burden.  Furthermore it is now available as an external project,
which completely obviates any reason to keep it around.

URL: http://git.videolan.org/?p=libpostproc.git
2012-02-23 19:36:16 +01:00
Tim Walker 147715ca10 Add channel names to channel_names[] array for channels added in b2890f5
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-02-22 10:50:06 -05:00
Tim W b38b6d56ca Add names for more channel layouts to the channel layout map.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-02-21 16:10:05 -05:00
Alex Converse b0f29db5c2 Mark mutable static data const where appropriate. 2012-02-21 09:47:07 -08:00
Justin Ruggles 0b42a9388c avutil: add av_rescale_q_rnd() to allow different rounding 2012-02-20 15:08:40 -05:00
Diego Biurrun 6df5c528ca Move some conditionally used variables into the block where they are used.
This allows dropping the av_unused argument from them.
2012-02-13 19:20:54 +01:00
Diego Biurrun f769cfedd8 build: Add missing directories to DIRS declarations. 2012-02-09 12:26:48 +01:00
Anton Khirnov 38d5533228 pixdesc: mark pseudopaletted formats with a special flag.
This makes it possible to dintinguish them from PAL8.

Fixes an invalid write in avpicture_layout().
2012-02-08 21:01:31 +01:00
Haruhiko Yamagata 166f399377 x86inc: support yasm -f win64 flag also.
This sets __OUTPUT_FORMAT__ to win64 instead of win32, even though both
(through -m amd64) produce 64-bit binary code.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-02-08 10:31:14 -08:00
Henrik Gramner 9cf7385309 x86inc: allow manual use of WIN64_SPILL_XMM.
Functions using INIT_MMX may still access XMM registers through direct
means (xmm0-15). Therefore, they still need to be marked for clobber
so they can be properly saved/restored.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-02-08 10:31:14 -08:00
Alex Converse 314af0ff94 aacdec: Use correct speaker order for 7.1.
The spec says the following speaker mapping is default:
center front speaker
left, right center front speakers,
left, right outside front speakers,
left surround, right surround rear speakers,
front low frequency effects speaker
2012-02-08 09:56:37 -08:00
Ronald S. Bultje 7e4d9d5d45 win64: add a XMM clobber test configure option.
This will be useful to test more aggressively for failures to mark XMM
registers as clobbered in Win64 builds, and prevent regressions thereof.

Based on a patch by Ramiro Polla <ramiro.polla@gmail.com>
2012-02-02 12:00:48 -08:00
Paul B Mahol 8b933129b9 avutil: make intfloat api public
The functions are already av_ prefixed and intfloat header is already provided.
Install libavutil/intfloat.h

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-30 07:41:31 +01:00
Alex Converse 7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Ronald S. Bultje 412b248edb x86inc.asm: fix typo.
Assemblers don't understand ! in %if statements.
2012-01-27 16:33:03 +08:00
Ronald S. Bultje 3b15a6d742 config.asm: change %ifdef directives to %if directives.
This allows combining multiple conditionals in a single statement.
2012-01-27 10:19:57 +08:00
Alex Converse 08628b6afb Revert "sws/pixfmt/pixdesc: add support for yuva444p"
This reverts commit fc115c80b7.

Tests are broken.
2012-01-26 18:06:57 -08:00
Paul B Mahol fc115c80b7 sws/pixfmt/pixdesc: add support for yuva444p
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-27 09:24:08 +08:00
Diego Biurrun 299ab0fd17 libavutil: Remove pointless file test program. 2012-01-26 22:44:37 +01:00
Vitor Sessak 39df0c434c mpegaudiodec: optimized iMDCT transform
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 17:40:55 -08:00
Diego Biurrun dff4af448d timer: K&R formatting cosmetics 2012-01-05 14:48:30 +01:00
Janne Grunau c04a954da6 lavu: bump lavu minor for av_popcount64
Add it to doc/APIchanges and update and correct other entries.
2012-01-03 15:42:26 +01:00
Daniel Verkamp b73ec05473 Add av_popcount64
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-03 14:25:43 +01:00
Diego Biurrun c18365402b Replace Subversion revisions in comments by Git hashes. 2011-12-21 09:04:25 +01:00
Luca Barbato 1ee5b5e823 lavu: add AVERROR_BUG error value
It should be used to mark codepath that can be reached only through
programming error.
2011-12-19 18:31:28 +01:00
Mans Rullgard 878dda5db1 build: move inclusion of subdir.mak to main subdir loop
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-13 14:26:49 +00:00
Diego Biurrun 58c42af722 doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
Anton Khirnov 1be323054e Add basic libavdevice documentation. 2011-12-12 19:43:37 +01:00
Mans Rullgard 5b0d35eaed x86: bswap: remove test for bswap instruction
Firstly, this test never worked as intended, always reporting
success.  Secondly, bswap is available from 486 onward and can
thus be assumed present.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-12 12:14:15 +00:00
Mans Rullgard f64c2e710f bswap: make generic implementation more compiler-friendly
With these changes, gcc 4.5 and later recognise it as a bswap
and use the proper instructions on ARM and x86.  On x86, the
16-bit bswap is recognised from gcc 4.1.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-12 12:14:14 +00:00
Mans Rullgard 3383a53e7d lavu: replace int/float punning functions
The existing functions defined in intfloat_readwrite.[ch] are
both slow and incorrect (infinities are not handled).

This introduces a new header with fast, inline conversion
functions using direct union punning assuming an IEEE-754
system, an assumption already made throughout the code.

The one use of Intel/Motorola extended 80-bit format is
replaced by simpler code sufficient under the present
constraints (positive normal values).

The old functions are marked deprecated and retained for
compatibility.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-11 18:47:19 +00:00
Diego Biurrun da9cea77e3 Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
Justin Ruggles b2890f5ed6 audioconvert: add some additional channel and channel layout macros 2011-12-09 16:12:58 -05:00
Justin Ruggles 1d2449a613 audioconvert: change 7.1 "wide" layout to use side surround channels 2011-12-09 16:12:58 -05:00
Diego Biurrun 4dccfff9dd tests/examples: Mark some variables only used within their files as static. 2011-12-08 01:01:00 +01:00
Sean McGovern be0675ce67 x86 cpuid: set vendor union members separately
Solaris Studio (suncc) has difficulty with filling in
members of a union. Instead, let's retrieve and store the
cpuid() results separately. This is still a compiler bug,
however this fix does not cause a regression on other platforms.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-12-08 00:57:11 +01:00
Diego Biurrun ff159e7816 doxygen: Replace '\' by '@' in Doxygen markup tags. 2011-12-07 15:29:14 +01:00
Diego Biurrun c68fafe0d2 doxygen: eliminate Qt-style doxygen syntax 2011-12-05 13:06:58 +01:00
Yordan Makariev 425b45d4b0 Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-03 15:13:48 -08:00
Tsvetelina Borisova 4a59eca97a Cleaned pixdesc.c file in libavutil
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-03 14:36:11 -08:00
Mans Rullgard 60084a1723 timer: fix misspelling of "decicycles"
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-28 14:34:42 +00:00
Vitor Sessak 6b6ee58249 x86inc: Flag shufps as an floating-point instruction for the AVX emulation code.
Without this, code like "shufps m0, m1, m2, 0xaa" would not work in CPUs
not supporting SSE2.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-27 13:10:33 -08:00
Mans Rullgard 019dd23657 Fix av_get_channel_layout_string() for positions >31
A value shifted left by >31 needs to have a 64-bit type.
As there are no defined channels in this range, the fix
is purely theoretical at this point, although it does
avoid some invalid shifts triggering the overflow
checker.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-25 15:19:55 +00:00
Mans Rullgard cc276c85d1 Make channel layout masks unsigned
It makes more sense for a bit mask to use an unsigned type.
The change should be source and binary compatible on all
supported systems, hence micro version bump.

Fixes a few invalid shifts.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-25 13:19:54 +00:00
Mans Rullgard 6b34fbba9b MK(BE)TAG: avoid undefined shifts
Casting the left-most byte to unsigned avoids an undefined
result of the shift by 24 if bit 7 is set.  This affects
the rm demuxer.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-25 00:20:03 +00:00
Ronald S. Bultje f7f1835258 swscale: fix failing fate tests.
isGray() is left as a FIXME for later.
2011-11-24 12:21:03 -08:00
Ronald S. Bultje 6b0768e202 Clean up swscale pixfmt macros using av_pix_fmt_descriptors[]. 2011-11-24 08:24:55 -08:00
Ronald S. Bultje bd97b2e1ce pixfmt: add planar RGB formats. 2011-11-24 08:13:50 -08:00
Justin Ruggles bbb46f3ec7 libavutil: add utility functions to simplify allocation of audio buffers.
Based on code by Stefano Sabatini.
2011-11-23 18:39:28 -05:00
Justin Ruggles 8889cc4f5b libavutil: add planar sample formats and av_sample_fmt_is_planar() 2011-11-23 18:39:28 -05:00
Luca Barbato e361b5089a doxy: structure libavformat groups 2011-11-22 17:16:02 +01:00
Luca Barbato e97e5a2e02 doxy: introduce an empty structure in libavcodec 2011-11-22 17:16:02 +01:00
Luca Barbato 757cd8d876 doxy: provide a start page and document libavutil
Introduce a basic layout, the subpages are currently left empty.

Split libavutil in multiple groups as example of the structure
2011-11-22 17:16:02 +01:00
Luca Barbato 384bdaceeb doxy: cleanup pixfmt.h
Remove the dubious warning about the header being private and
add some formatting
2011-11-22 17:16:02 +01:00
Thierry Foucu c693aa6f71 imgutils: Fix illegal read.
Found with address sanitizer.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
2011-11-18 17:42:49 -08:00
Martin Storsjö 627067118c avutil: Add av_timegm as a public function
This is useful, since the normal timegm function isn't a standard
function (requiring _BSD_SOURCE or _SVID_SOURCE on glibc to
be visible, and not available on e.g. windows). The widely available
function mktime uses the local time zone, which requires ugly
workarounds to handle UTC time.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-16 11:22:41 +02:00