Commit Graph

1205 Commits

Author SHA1 Message Date
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
Mans Rullgard 365e3c7878 Rename attribute_used to av_used and move it to attributes.h
This is consistent with most of the other attribute macros.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-31 16:01:26 +00:00
Luca Barbato dfd2a005eb Replace dprintf with av_dlog
dprintf clashes with POSIX.1-2008
2011-01-29 23:55:37 +01:00
Mans Rullgard e781c4e6ff intfloat_readwrite: include "mathematics.h" for fallback macros
This allows this file to build on systems lacking NAN or INFINITY
in math.h.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-25 15:57:53 +00:00
Reimar Döffinger 032f406864 Handle input or output len of 0 properly in lzo decoder.
(cherry picked from commit 7d5082600e)
2011-01-24 21:25:43 +01:00