Commit Graph

1409 Commits

Author SHA1 Message Date
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
Sebastien Zwickert ac3dbb4d58 hwaccel: OS X Video Decoder Acceleration (VDA) support.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-11-14 16:07:32 +01:00
Anton Khirnov e1e22851c1 AVOptions: don't return an invalid option when option list is empty 2011-11-11 08:27:16 +01:00
Alex Converse c9e5ac3380 aes: Avoid illegal read and don't generate more key than we use. 2011-11-10 10:15:59 -08:00
Justin Ruggles f2bd8a0786 x86inc: use sse versions of common macros instead of sse2 when applicable 2011-11-06 19:14:13 -05:00
Martin Storsjö 3607ed70d5 Remove leftover includes of strings.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:53:05 +02:00
Reimar Döffinger de8d1940b5 avutil: Don't allow using strcasecmp/strncasecmp
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:59 +02:00
Reimar Döffinger bb3244dee2 Replace all usage of strcasecmp/strncasecmp
All current usages of it are incompatible with localization.
For example strcasecmp("i", "I") != 0 is possible, but would
break many of the places where it is used.

Instead use our own implementations that always treat the data
as ASCII.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:57 +02:00
Reimar Döffinger ba04ecfdac avstring: Add locale independent implementations of strcasecmp/strncasecmp
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:56 +02:00
Luca Barbato 07b172fe8f avstring: Add locale independent implementations of toupper/tolower
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:54 +02:00
Loren Merritt 2f7f2e4b41 Update x86inc.asm to latest x264 version, and add AVX symmetry.
We keep INIT_AVX (for backwards compatibility). 3arg AVX ops with
a memory arg can only have it in src2, whereas SSE emulation of
3arg prefers to have it in src1 (i.e. the mov). So, if the op is
symmetric and the wrong one is memory, swap them.
2011-11-05 20:48:14 -07:00
Diego Biurrun f36b390275 Replace some forgotten FFmpeg references by Libav. 2011-11-02 10:42:55 +01:00
Justin Ruggles 4e8e262476 fmtconvert: port int32_to_float_fmul_scalar() x86 inline asm to yasm 2011-10-21 10:13:05 -04:00
Ronald S. Bultje dc49bf1270 sws/pixfmt/pixdesc: add support for yuv420p9le/be. 2011-10-21 00:58:01 -07:00
Anton Khirnov 4e64c4d51a AVOptions: add documentation. 2011-10-19 06:59:58 +02:00
Martin Storsjö 299234a0a9 avoptions: Fix av_opt_flag_is_set
With the changes in 3b3ea34655,
"Remove all uses of deprecated AVOptions API", av_opt_flag_is_set
was broken, since it now uses av_opt_find, which doesn't return
named constants unless a unit to look for the constant in is given.

This broke enabling LATM encapsulated AAC output in RTP.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 21:35:41 +03:00
Anton Khirnov 85afbb1d00 AVOptions: don't segfault on NULL parameter in av_set_options_string() 2011-10-17 10:42:21 +02:00
Jindrich Makovicka 67bbf07fb5 log.h: make AVClass a named struct
'struct AVClass' is used in the code since
641c7afe3c, but AVClass is typedeffed as
an anonymous struct.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-12 23:39:31 +02:00
Anton Khirnov 492bd1a28f AVOptions: bump minor and add APIchanges entry. 2011-10-12 16:55:56 +02:00
Anton Khirnov 145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Anton Khirnov 3b3ea34655 Remove all uses of deprecated AVOptions API. 2011-10-12 16:51:16 +02:00
Anton Khirnov 8c5dcaad13 AVOptions: add av_opt_next, deprecate av_next_option.
Just for naming consistency, no functional changes.
2011-10-12 16:51:16 +02:00
Anton Khirnov dca055be3a AVOptions: add functions for evaluating option strings. 2011-10-12 16:51:16 +02:00
Anton Khirnov 059a037fbd AVOptions: split get_number().
Split actual writing to read_number() in the same way as write_number().
Allows set_string_number() to write to a caller-provided destination.
2011-10-12 16:51:16 +02:00
Anton Khirnov 41d9d51a72 AVOptions: add av_opt_get*, deprecate av_get*.
New functions can get values from child objects, properly report error
codes and have consistent naming and signatures.
2011-10-12 16:51:16 +02:00
Anton Khirnov dac66da63d AVOptions: add av_opt_set*().
Deprecate av_set_*

New functions support setting values on children, return error codes
instead of options and have consistent naming and signatures.
2011-10-12 16:51:16 +02:00
Anton Khirnov 641c7afe3c AVOptions: add new API for enumerating children.
This will allow the caller to enumerate child contexts in a generic way
and since the API is recursive, it also allows for deeper nesting (e.g.
AVFormatContext->AVIOContext->URLContext)

This will also allow the new setting/reading API to transparently apply
to children contexts.
2011-10-12 16:51:16 +02:00
Mans Rullgard 88d1e2b2b0 intfloat_readwrite: fix signed addition overflows
These additions might overflow the signed range for large
input values.  Converting to unsigned before the addition
rather than after avoids such undefined behaviour.  The
result under normal two's complement wraparound remains
unchanged.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-11 14:42:28 +01:00
Anton Khirnov 7bb1807c2d AVOptions: refactor set_number/write_number
write_number() does the actual writing of the supplied
number to destination. Move finding the option and choosing destination
address out of it.
2011-10-10 20:27:31 +02:00
Anton Khirnov cf10095f0b AVOptions: cosmetics, rename static av_set_number2() to write_number(). 2011-10-10 20:27:31 +02:00
Anton Khirnov b003d0be5b AVOptions: cosmetics, move and rename static av_set_number(). 2011-10-10 20:27:31 +02:00
Anton Khirnov c8d787d2ef AVOptions: split av_set_string3 into opt type-specific functions
Also stop attempting to honor the alloc parameter, as things break
horribly in that case.
It will be removed in upcoming successor to av_set_string3.
2011-10-10 20:27:30 +02:00
Mans Rullgard 8b19ae0761 crc: fix signed overflow
This fixes a signed overflow from i << 24 when i == 255 by
making i unsigned.  The result of the shift is already
assigned to an variable of unsigned type.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-09 16:53:31 +01:00
Jason Garrett-Glaser 96a59cf37b x86: XOP/FMA4 CPU detection support 2011-09-26 15:30:31 -07:00
Anton Khirnov 775af761a0 eval: test isnan(sqrt(-1)) instead of just sqrt(-1)
sqrt(-1) returns "some NaN", it's not specified which exactly.
2011-09-22 08:13:55 +02:00
David Goldwich b3e144a7df des: add possibility to calculate DES-CBC-MAC with small buffer
This patch adds the possibility to calculate the DES-CBC-MAC of a
source buffer (i.e. the last block of the buffer encrypted in CBC
mode) without having to allocate a destination buffer that is as
long as the complete source buffer, but instead only 8 bytes
for the MAC.

Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 08:28:20 +02:00
Stefano Sabatini 8cee38a298 eval: implement not() expression 2011-09-19 12:38:34 +02:00
Stefano Sabatini 9bc393908a eval: add sqrt function for computing the square root 2011-09-19 12:38:14 +02:00
Stefano Sabatini 6cfed11270 audioconvert: add explanatory comments to channel_names array
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-09-11 18:41:34 +02:00
Stefano Sabatini 3a0b5fa5e8 audioconvert: K&R whitespace cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-09-11 18:41:33 +02:00
Anton Khirnov 4dbcdfa86d AVOptions: remove AVOption.offset <= 0 checks
They will only ever be <=0 if the option is broken, in which case this
check is hiding a bug.
2011-09-07 11:20:29 +02:00
Anton Khirnov 79eff91325 AVOptions: deprecate av_opt_set_defaults2
It's a hack which was created to allow for multiple options with
different defaults to refer to same field (e.g. 'b' vs 'ab'). There is
no need for it anymore.
2011-09-07 11:19:43 +02:00
Anton Khirnov a7e2b2ccc9 AVOptions: move doxy for av_opt_set_defaults() from opt.c to opt.h
Also change it to be more readable.
2011-09-07 11:16:52 +02:00
Anton Khirnov e955a682e1 AVOptions: fix av_set_string3() doxy to match reality.
Fixes bug 28.
2011-09-03 21:00:52 +02:00
Anton Khirnov c11fb8288d AVOptions: add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find().
It allows to search for options only with AVClass, without allocating
the corresponding context.
2011-09-03 20:52:21 +02:00
Sean McGovern 5938e02185 cpu detection: avoid a signed overflow
1<<31 overflows because 1 is signed, so force it to unsigned.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-09-03 08:31:50 -07:00
Anton Khirnov bea5670a4f AVOptions: drop av_ prefix from static av_get_number(). 2011-09-01 10:37:04 +02:00
Diego Biurrun fa19c5c20e doxygen: drop another pointless star from pointer variable name 2011-08-27 14:00:54 +02:00
Stefano Sabatini 1717ba0cdd fifo: add FIFO API test program, and fate test
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-26 20:54:36 +02:00
Stefano Sabatini f2011ed234 fifo: add av_fifo_peek2(), and deprecate av_fifo_peek()
The new function provides a more generic interface than av_fifo_peek()
for peeking at a FIFO buffer data.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-26 20:53:02 +02:00
Diego Biurrun 0138a8dead doxygen: drop pointless star from pointer variable names 2011-08-26 18:08:38 +02:00
Ronald S. Bultje 38e06c2969 Move clipd macros to x86util.asm.
This allows sharing them between multiple .asm files.
2011-08-17 20:56:06 -07:00
Ronald S. Bultje b2c087871d Move x86util.asm from libavcodec/ to libavutil/.
This allows using it in swscale also.
2011-08-12 11:43:03 -07:00
Ronald S. Bultje 3a39195b1d Move x86inc.asm to libavutil/.
This allows using it in libswscale/ also.
2011-08-12 11:43:02 -07:00
Mans Rullgard 172ee1da2b random_seed: use proper #includes
Use <> for system headers, add needed math.h, drop unnecessary avutil.h.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-17 20:47:39 +01:00
Mans Rullgard bd39c07688 des: fix #if conditional around P_shuffle
CONFIG_SMALL is always defined as 0 or 1.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-16 19:39:19 +01:00
Diego Biurrun 66f6bab7ad mem.h: switch doxygen parameter order to match function prototype 2011-07-15 02:01:22 +02:00
Diego Biurrun 6168781f70 doxygen: do not include license boilerplate in Doxygen documentation 2011-07-15 00:52:09 +02:00
Diego Biurrun 96c1e6d40d doxygen: Make sure parameter names match between .c and .h files. 2011-07-14 04:09:49 +02:00
Oskar Arvidsson e59d6b4d72 pix_fmt: Fix number of bits per component in yuv444p9be
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-07-12 08:13:56 -07:00
Mans Rullgard 7ce914fb5a lls: use av_lfg instead of rand() in test program
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-11 21:09:27 +01:00
Anton Khirnov a726d7fd4e AVOptions: in av_opt_find() don't return named constants unless unit is specified.
That is, unless the caller explicitly asks for them.

Prevents conflict between e.g. the 'loop' option in img2 demuxer and
'loop' flag in AVCodecContext.
2011-07-08 18:34:18 +02:00
Anton Khirnov 8c28e01d31 dict: extend documentation. 2011-07-08 18:29:27 +02:00
Mans Rullgard fdaf1d0640 lls: whitespace cosmetics
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-08 15:03:40 +01:00
Diego Biurrun 4904995652 avutil: Add missing test programs to Makefile. 2011-07-08 00:17:19 +02:00
Ronald S. Bultje dfd8116986 eval: add missing comma to tests. 2011-07-05 18:18:11 -07:00
Ronald S. Bultje fe277b16f0 eval: fix memleak. 2011-07-05 18:18:10 -07:00
Mans Rullgard 94350ab986 eval: clear Parser instances before using
This prevents random values from the stack being used as
"variables" in expressions.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-04 12:31:47 +01:00
Kostya Shishkov 3e2aa268f6 sha: use AV_RB32() instead of assuming buffer can be cast to uint32_t*
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-04 11:16:52 +01:00
Mans Rullgard 9e52a40695 des: allow unaligned input and output buffers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-04 11:07:15 +01:00
Mans Rullgard d04d9f24a0 aes: allow unaligned input and output buffers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-04 11:07:15 +01:00
Mans Rullgard 6da812e4ee eval: make timing optional in test program
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-04 10:26:21 +01:00
Mans Rullgard abc78a5a7c Do not include log.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:07 +01:00
Mans Rullgard d49ea4afb4 Do not include pixfmt.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:07 +01:00
Mans Rullgard e91709ca17 Do not include rational.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Mans Rullgard 0ebcdf5cda Do not include mathematics.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Mans Rullgard ee8aecd23a Do not include intfloat_readwrite.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Mans Rullgard add41decd9 Remove return statements following infinite loops without break
These statements cannot be reached and are thus not needed.
This removes a number of compiler warnings.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:39:07 +01:00
Mans Rullgard 82494cad9d md5: cosmetics
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 18:19:19 +01:00
Mans Rullgard fa49fc72d9 md5: use AV_WL32 to write result
This is simpler, safer, and removes the undocumented requirement of
aligned output buffer.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 18:19:19 +01:00
Mans Rullgard 44496ff2d6 md5: include correct headers
This file needs stdint.h but not string.h

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 18:19:18 +01:00
Mans Rullgard edf4dbff33 md5: fix test program
This makes the md5-test program print something meaningful and not
smash the stack.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 18:19:18 +01:00
Diego Biurrun ff993cd7fc doxygen: Drop array size declarations from Doxygen parameter names.
Adding [] to a Doxygen parameter name clashes with Doxygen syntax.
2011-07-03 18:30:02 +02:00
Diego Biurrun 24c9babaaf doxygen: Fix parameter names to match the function prototypes. 2011-07-03 18:30:02 +02:00
Diego Biurrun 91c9aa0941 Move some conditionally used code below the appropriate #ifdef. 2011-07-03 18:30:01 +02:00
Mans Rullgard 8f175810be aes: fix for big endian systems
This was missed in 5d20f19 since CONFIG_SMALL was always broken
for big endian.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 13:41:42 +01:00
Mans Rullgard 66fe5970ab des: reduce number of iterations in test program
Testing a million random keys takes annoying long time.
1000 iterations should be enough.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 13:41:31 +01:00
Mans Rullgard 5d20f19be2 aes: fix invalid array indexing in init code
This makes the code work with clang/x86_32 and removes several warnings.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 03:09:22 +01:00
Mans Rullgard af2ea72495 aes: use direct assignments instead of memcpy() or loops
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 03:08:52 +01:00
Reinhard Tartler 21a19b7912 doxygen: Prefer member groups over grouping into modules
Before this, almost all module groups have been used for grouping functions
and fields in structures semantically. This causes them to not appear
properly in the file documentation and needlessly clutters up the "Modules"
index.

Additionally, this commit streamlines some spelling and appearances.
2011-07-02 13:52:29 +02:00
Reinhard Tartler 134557f3a4 doxygen: fix usage of @file directive in libavutil/{dict,file}.h 2011-07-01 15:12:33 +02:00
Reinhard Tartler 192bfbc1f1 avutil: elaborate documentation for av_get_random_seed 2011-06-30 21:19:16 +02:00
Mans Rullgard 4bfe064460 aes: whitespace cosmetics
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-30 16:50:27 +01:00
Mans Rullgard bd55da1c08 adler32: whitespace cosmetics
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-30 16:50:27 +01:00
Mans Rullgard c31bc5371e Fix cpu flags test program
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-30 14:19:51 +01:00
Diego Biurrun ce1e181b13 opt-test: Add missing braces to silence compiler warnings.
libavutil/opt.c:604:1: warning: missing braces around initializer [-Wmissing-braces]
2011-06-30 13:34:38 +02:00
Mans Rullgard 744765a9c5 aes: improve test program and add fate test
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-30 09:47:32 +01:00
Mans Rullgard f6252b4845 adler32: make test program more useful and add fate test
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-30 09:47:32 +01:00
Diego Biurrun 812f2376ee rational-test: Add proper main() declaration to fix gcc warnings. 2011-06-30 01:35:47 +02:00
Mans Rullgard cfa68a3381 Remove unused, never built libavutil/pca.[ch]
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-29 23:49:03 +01:00
Can Wu 86c3c1abf0 pixfmt: fix YUV422/444 wrong endian comment
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-06-29 11:56:56 +02:00
Mans Rullgard 57b4a3dd2b build: include sub-makefiles using full path instead of symlinks
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-28 18:15:19 +01:00
Diego Biurrun bb00b15f9e avutil: Remove unused arbitrary precision integer code. 2011-06-28 13:14:46 +02:00
Diego Biurrun a6213f3dce build: Remove redundant config.mak includes from subdirectory Makefiles.
Calling Make from subdirectories is not supported and config.mak has
multiple inclusion guards anyway, so the top-level include is enough.
2011-06-25 13:02:51 +02:00
Diego Biurrun adbfc605f6 doxygen: Consistently use '@' instead of '\' for Doxygen markup.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-06-24 00:37:49 +02:00
Martin Storsjö 9abbe8cc13 Use av_printf_format to check the usage of printf style functions
This helps catching cases where the format string doesn't
match what is passed in, or injection bugs where user data
is passed in as format string.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-23 20:17:46 +03:00
Martin Storsjö 67e9ae14d9 Add av_printf_format, for marking printf style format strings and their parameters
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-23 20:17:44 +03:00
Mans Rullgard 8986fddc2b ARM: allow building in Thumb2 mode
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-23 07:31:54 +01:00
Uoti Urpala c98b928fa7 intreadwrite.h: fix AV_RL32/AV_RB32 signedness.
The output type of the AV_RL32/AV_RB32 macros was signed int. The
resulting overflow broke at least some ASF streams with large
timestamps. Fix by adding a cast to uint32_t.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-16 20:49:19 +02:00
Anton Khirnov 7c44d716e7 Add minor bumps and APIChanges entries for lavf private options. 2011-06-16 20:24:58 +02:00
Anton Khirnov 1b9b37b8a4 dict: add AV_DICT_APPEND flag. 2011-06-16 20:24:56 +02:00
Anton Khirnov dc59ec5e79 AVOptions: add av_opt_find() as a replacement for av_find_opt. 2011-06-16 20:24:56 +02:00
Anton Khirnov 7e83e1c511 AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.
This way the caller can pass all the options in one nice package.
2011-06-16 20:24:56 +02:00
Ronald S. Bultje 103278f7b0 libavutil/swscale: YUV444P10/YUV444P9 support.
Also add missing glue code for recently added YUV422P10 formats
to swscale.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-06-10 15:12:24 -04:00
Martin Storsjö cb7c11cc9e avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-10 10:47:42 +03:00
Anton Khirnov d9f80ea2a7 Move metadata API from lavf to lavu.
Rename it to AVDictionary, since it will be used as such.  Tags
documentation and metadata conversion API is lavf-specific, so remains
there.
2011-06-08 07:43:45 +02:00
Stefano Sabatini a6703faa15 samplefmt: add av_get_bytes_per_sample()
Deprecate av_get_bits_per_sample_fmt(), which was a misnamed function.

For the moment we don't have sample formats with a non-integer number
of bytes, in that case we may need to create a new
av_get_bits_per_sample() function. In the meanwhile we prefer to adopt
this variant, since avoids divisions by 8 all over the place.
2011-06-07 13:06:41 -04:00
Diego Biurrun e01bb264e7 inverse.c: Replace unnecessary intmath.h header by necessary stdint.h. 2011-06-07 10:31:26 +02:00
Diego Biurrun dc25d79f49 Drop unnecessary directory prefixes from #include directives. 2011-06-07 10:31:26 +02:00
Diego Biurrun fb8648ad4b Remove unnecessary LIBAVFORMAT_BUILD #ifdef. 2011-06-05 16:01:01 +02:00
Anton Khirnov b39b06233d AVOptions: add av_opt_free convenience function. 2011-06-05 15:01:36 +02:00
Mans Rullgard 5a4a71257c Fix build of eval-test program
eval.c has moved to libavutil, move the TESTPROGS entry too.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-05 11:47:14 +01:00
Mans Rullgard d0989bed22 Fix error check in av_file_map()
On failure, mmap() returns MAP_FAILED, which may or may not be -1.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-04 17:03:25 +01:00
Mans Rullgard 6bb70dfd74 ARM: simplify inline asm with 64-bit operands
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-30 21:19:57 +01:00
Mans Rullgard a84f82560e ARM: improve FASTDIV asm
This uses one register less.  Also add missing "cc" clobber.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-28 15:00:17 +01:00
Stefano Sabatini 8f653e28f5 lavu: add av_get_pix_fmt_name() convenience function
Also deprecate avcodec_get_pix_fmt_name() in its favor.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-28 09:44:18 -04:00
Mans Rullgard ca7d8256e3 ARM: add ARMv6 optimised av_clip_uintp2
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-26 20:13:00 +01:00
Mans Rullgard 77cd6efc33 ARM: remove volatile from asm statements in libavutil/intmath
The volatile qualifiers are not needed on these statements as
their effects are fully specified by constraints.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-26 20:13:00 +01:00
Mans Rullgard 74cc8c52ed ARM: fix av_clipl_int32_arm()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-26 20:12:59 +01:00
Anton Khirnov 6c117d43c9 AVOptions: set string default values. 2011-05-26 20:03:03 +02:00
Martin Storsjö 80068da3a0 avoptions: Return explicitly NAN or {0,0} if the option isn't found
This actually matches what av_get_double did earlier, the
0.0/0.0 division was intentional, for producing NAN.

Still keeping the check for the return value from
av_get_number, for clarity.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-25 22:01:33 +03:00
Ronald S. Bultje e973557211 Move emms_c() from libavcodec to libavutil. 2011-05-24 14:48:49 -04:00
Martin Storsjö 8089b7fa8c avoptions: Check the return value from av_get_number
This avoids doing a division by zero if the option wasn't found,
or wasn't an option of an appropriate type.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-22 22:06:17 +03:00
Diego Biurrun 153382e1b6 multiple inclusion guard cleanup
Add missing multiple inclusion guards; clean up #endif comments;
add missing library prefixes; keep guard names consistent.
2011-05-21 13:48:10 +02:00
Mans Rullgard 1550f45a89 Add av_clip_uintp2() function
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-13 16:45:24 -04:00
Diego Biurrun 046f081b46 configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.
Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems
since it causes certain system functions to be hidden on some (BSD) systems.
The solution is to only add the flag on systems that really require it, i.e.
glibc-based ones.

This change makes BSD systems compile out-of-the-box without the need for
adding specific flags manually.  It also allows dropping a number of flags
set manually on a file-per-file basis, but were only present to work around
breakage introduced by the presence of _POSIX_C_SOURCE.

Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems.  We use XSI extensions
in several places already, so it is preferable to define it globally instead
of littering source files with individual #defines only needed for glibc.
2011-05-12 11:41:59 +02:00
Ronald S. Bultje c8f487deae swscale: fix YUV420P 9/10bit support.
Fix handling of input if not in native endianness, and add support for
9/10-bit output. This allows us to force endianness of YUV420P 9/10bit
in the H264/10bit fate tests, which should fix them on big-endian
systems.
2011-05-11 19:15:14 -04:00
Baptiste Coudurier 5c511ad4ce swscale: extend YUV422p support to 10bits depth
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-11 14:38:14 +02:00
Diego Biurrun bea705752d Remove unused softfloat implementation.
The softfloat functionality is unused, not installed and incomplete.
On platforms without floating point units, the compiler provides a softfloat
implementation so there is no point in carrying this code around locally.
2011-05-11 13:43:30 +02:00
Anton Khirnov b66752790a AVOptions: make default_val a union, as proposed in AVOption2.
This breaks API and ABI.
2011-05-10 20:22:06 +02:00
Oskar Arvidsson 42239ced65 Add pixel formats for 9- and 10-bit yuv420p.
Also add support for these formats in libswscale.

Needed for high bit depth h264 decoding.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-10 07:24:19 -04:00
Alex Converse 847aaec682 log: Fix an oob array read. 2011-05-08 13:34:05 -07:00
Alex Converse 1569554153 Ban strncpy() it's too easy to misuse. 2011-05-08 12:49:07 -07:00
Alex Converse 1a5e4fd8c5 Replace strncpy() with av_strlcpy(). 2011-05-03 21:20:13 -07:00
Reinhard Tartler 0247bdee25 Fix races in default av_log handler
Prevent competing threads from overwriting (shared) buffers.

Original patch by: Michael Niedermayer <michaelni@gmx.at>
2011-04-29 22:46:13 +02:00
Diego Biurrun e610098e7b bswap.h: Remove disabled code. 2011-04-29 20:01:04 +02:00
Diego Biurrun e6ff064845 Eliminate pointless '#if 1' statements without matching '#else'. 2011-04-26 20:18:27 +02:00
Vitor Sessak 13dfce3d44 Increase alignment of av_malloc() as needed by AVX ASM.
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-04-26 18:18:22 +02:00
Stefano Sabatini bebe72f4a0 lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums
Also deprecate av_get_pict_type_char() in favor of
av_get_picture_type_char().

The new enum and av_get_picture_type_char() are defined in libavutil.
This allows the use in libavfilter without the need to link against
libavcodec.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 08:38:57 +02:00
Jason Garrett-Glaser 15919ee48f bswap: use native types for av_bwap16().
This prevents a call to bytestream_get_be16() using a movzwl both before
and after the ror instruction, which is obviously inefficient. Arm uses
the same trick also.

Sintel decoding goes from (avg+SD) 9.856 +/- 0.003 to 9.797 +/- 0.003 sec.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-04-22 20:05:48 -04:00
Stefano Sabatini 8d67218bd7 error: sort, pack, and align error code and string definitions
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-04-21 16:48:29 +02:00
Martin Storsjö 23d3931a6a Provide a fallback version of the libm function trunc
This fixes compilation on DOS.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-21 14:13:09 +03:00
Anton Khirnov a975dbc86b error: change AVERROR_EOF value
The current value is masking the POSIX error code EPIPE, which has a
different semantics.

This breaks API.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-21 07:10:16 +02:00
Stefano Sabatini 79157f400b error: remove AVERROR_NUMEXPECTED
AVERROR_NUMEXPECTED is used only in the image muxer and demuxer, and
has a too much specific meaning, which is better explained through a
log message. Thus it can be replaced by AVERROR(EINVAL).

This breaks API.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-21 07:10:16 +02:00
Stefano Sabatini 58f8463947 error: add error code AVERROR_OPTION_NOT_FOUND, and use it in opt.c
The new error code is better than AVERROR(ENOENT), which has a
completely different semantics ("No such file or directory").

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-21 07:10:16 +02:00
Diego Biurrun 63de9e7d80 Remove a version check in av_log made unnecessary by the big bump. 2011-04-20 18:19:04 +02:00
Anton Khirnov 975c273405 lavu: remove disabled ff_random_get_seed cruft. 2011-04-19 21:50:12 +02:00
Anton Khirnov 488d2b6349 lavu: remove disabled sha1 cruft. 2011-04-19 21:50:10 +02:00
Anton Khirnov 490a022d86 lavu: remove misc disabled cruft 2011-04-19 19:04:28 +02:00
Anton Khirnov 9e5c62c97f lavu: remove FF_API_OLD_IMAGE_NAMES cruft 2011-04-19 19:04:01 +02:00
Anton Khirnov 516fb5e40c lavu: remove FF_API_OLD_EVAL_NAMES cruft 2011-04-19 19:03:44 +02:00
Anton Khirnov 139f3ac42d Bump major versions of all libraries.
They've accumulated enough new APIs and corresponding deprecated cruft.

This breaks API and ABI.
2011-04-18 20:19:47 +02:00
Diego Biurrun 6001dad6e2 Replace more FFmpeg references by Libav. 2011-04-17 19:31:49 +02:00
Alexis Ballier a3a0af4fb1 avutil: make aes and sha api public
The functions are already av_ prefixed and sha1 header is already provided.
Install libavutil/{aes,sha}.h

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-14 22:14:30 +02:00
Stefano Sabatini 5ae4251c3b eval: add support for trunc, ceil, and floor functions
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-10 09:24:21 +02:00
Brad 3028b6ede6 os: fix OpenBSD/PowerPC compilation
When attempting to re-enable the AltiVec support it was noticed
that we need to undefine _POSIX_C_SOURCE to appease the headers
for ff_get_cpu_flags_ppc() to be able to compile.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-10 05:02:29 +02:00
Peter Ross 73389754c9 pixfmt: add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE
PIX_FMT_BGR48LE is used by PhantomCINE demuxer.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-10 04:44:37 +02:00
Mans Rullgard 820818a330 Remove unnecessary icc version checks
With unknown attribute warnings disabled, these checks are no
longer needed.  Removing them improves readability while having
no effect on generated code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-23 12:39:58 +00:00
Justin Ruggles 45ed822550 cosmetics: indentation 2011-03-22 09:11:07 -04:00
Justin Ruggles eba586b0d9 Add a CPU flag for the Atom processor.
The Atom has SSSE3 support, which is useful in many cases, but sometimes the
SSSE3 version is slower than the SSE2 equivalent on the Atom, but is generally
faster on other processors supporting SSSE3. This flag allows for selectively
disabling certain SSSE3 functions on the Atom.
2011-03-22 09:11:07 -04:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Janne Grunau a03be6e1ba use LIBAV_LICENSE and LIBAV_VERSION instead of FFMPEG_* 2011-03-16 21:54:39 +01:00
Janne Grunau 29ba091136 replace FFMPEG with LIBAV in FFMPEG_CONFIGURATION
also update the multiple inclusion guards in config.h|mak
2011-03-16 21:54:39 +01:00
Nicolas George bafa4dd3e6 Add AVERROR_EXIT.
This is different from AVERROR(EINTR) because calls that fail with EINTR
should usually be restarted.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-15 08:09:19 -04:00
Mans Rullgard ef66953875 x86: use raw opcode for xgetbv instruction
This allows the CPU detection to work with assemblers not supporting
the xgetbv mnemonic.  These include clang and some BSD versions.

All AVX code will be written for yasm, where the main assembler
is not involved.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-20 17:31:23 +00:00
Mans Rullgard 87f1355f9b x86: check for AVX support
This adds configure and runtime checks for AVX support on x86 CPUs.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-20 13:20:42 +00:00
Jason Garrett-Glaser eb3755a5aa Force inlining of avutil common routines
On some versions of gcc, these weren't always getting inlined due to hitting
the inline cap limit in some files.  This is generally bad, as most of these
functions are smaller inlined than not.
2011-02-17 15:25:25 -08:00
Anton Khirnov 09d171b988 lavf, lavu: bump minor versions and add an APIChanges entry for av_ prefixes
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-17 15:40:17 +01:00
Anton Khirnov ab0287fcbd Move find_info_tag to lavu and add av_ prefix to it
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-17 15:35:18 +01:00
Stefano Sabatini f6c7375a17 Deprecate parse_date() in favor of av_parse_time().
The new av_parse_time() is created in libavutil/parseutils.h, all the
internal functions used by parse_date are moved to
libavutil/parseutils.c and made static.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-16 23:39:56 +00:00
Reinhard Tartler 737eb5976f Merge libavcore into libavutil
It is pretty hopeless that other considerable projects will adopt
libavutil alone in other projects. Projects that need small footprint
are better off with more specialized libraries such as gnulib or rather
just copy the necessary parts that they need. With this in mind, nobody
is helped by having libavutil and libavcore split. In order to ease
maintenance inside and around FFmpeg and to reduce confusion where to
put common code, avcore's functionality is merged (back) to avutil.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-02-15 16:18:21 +01:00
Justin Ruggles 74b1f96859 Add check for Athlon64 and similar AMD processors with slow SSE2.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-11 16:58:18 -05:00
Alexander Strange 37b00b47cb Frame-based multithreading framework using pthreads
See doc/multithreading.txt for details on use in codecs.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-09 09:17:28 -05:00
Clément Bœsch 523d9407d5 Remove a few if (p) av_freep(&p) forms
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-04 10:00:49 +00:00
Clément Bœsch dc75d6dbf2 Avoid pointless check before calling free
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-03 01:36:00 +00:00
Anton Khirnov 4868bebe5b Add forgotten minor API bumps and APIChanges entries
The bumps are for adding version.h and avio_{get/put}_str functions in
lavf and making av_dlog public in lavu.

Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-02 22:42:39 +01:00