Commit Graph

4063 Commits

Author SHA1 Message Date
Andreas Cadhalpun 9ac61e73d0 softfloat: handle INT_MIN correctly in av_int2sf
Otherwise v=INT_MIN doesn't get normalized and thus triggers av_assert2
in other functions.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-08 21:06:40 +01:00
Andreas Cadhalpun f3866a14c3 softfloat: assert when the argument of av_sqrt_sf is negative
The correct result can't be expressed in SoftFloat.
Currently it returns a random value from an out of bounds read.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-08 21:05:21 +01:00
Michael Niedermayer 955cdc43a3 avutil/softfloat: Include negative numbers in cmp/gt tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 15:04:05 +01:00
Michael Niedermayer 05b05a7a84 avutil/softfloat: Fix av_gt_sf() with large exponents try #2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 15:03:28 +01:00
Michael Niedermayer 791ea23e57 avutil/softfloat: Add test for av_gt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 15:02:05 +01:00
Michael Niedermayer ecfb076141 avutil/softfloat: Extend the av_cmp_sf() test to cover a wider range of exponents
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:55:22 +01:00
Michael Niedermayer cee3c9d29a avutil/softfloat: Fix overflows in shifts in av_cmp_sf() and av_gt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:54:51 +01:00
Michael Niedermayer df2a2117d2 avutil/softfloat: Add test for av_cmp_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:39:46 +01:00
Michael Niedermayer 596dfe7d6c avutil/softfloat: Add tests for exponent underflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:23:38 +01:00
Michael Niedermayer 046218b212 avutil/softfloat: Fix exponent underflow in av_div_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:23:38 +01:00
Michael Niedermayer a1e3303fc0 avutil/softfloat: Fix exponent underflow in av_mul_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:23:38 +01:00
Michael Niedermayer 4135a2bfd6 avutil/softfloat: Fix typo in av_mul_sf() doxy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 14:23:37 +01:00
Michael Niedermayer 4b6ad23609 Revert "avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()"
This case should not be possible if the input has a exponent within
the valid range

This reverts commit 0269fb11e3.
2015-11-08 14:23:37 +01:00
Michael Niedermayer 0269fb11e3 avutil/softfloat: Check for MIN_EXP in av_sqrt_sf()
Otherwise the exponent could eventually underflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 13:39:06 +01:00
Michael Niedermayer 107db5abf3 avutil/softfloat: Correctly set the exponent for 0.0 in av_sqrt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 13:39:06 +01:00
Michael Niedermayer a66b243d52 avutil/softfloat: FLOAT_0 should use MIN_EXP
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 03:57:02 +01:00
Nicolas George 47ea04ff10 lavu/opt: enhance printing durations.
Trim unneeded leading components and trailing zeros.
Move the formating code in a separate function.
Use the function also to format the default value, it was currently
printed as plain integer, inconsistent to the way it is parsed.
2015-11-07 16:04:09 +01:00
Michael Niedermayer c9bfd6a8c3 libavutil/channel_layout: Check strtol*() for failure
Fixes assertion failure
Fixes: 4f5814bb15d2dda6fc18ef9791b13816/signal_sigabrt_7ffff6ae7cc9_65_7209d160d168b76f311be6cd64a548eb.wv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 19:28:19 +01:00
Ganesh Ajjanagadde 265f83fd35 avutil/common: add FFDIFFSIGN macro
This is of use for defining comparator callbacks. Common approaches like
return x-y are not safe due to the risks of overflow.
Furthermore, the (x > y) - (x < y) trick is optimized to branchless
code.
This also documents this macro accordingly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-03 16:28:12 -05:00
Tobias Rapp 4746653466 avutil/file_open: avoid file handle inheritance on Windows
Avoids inheritance of file handles on Windows systems similar to the
O_CLOEXEC/FD_CLOEXEC flag on Linux.

Fixes file lock issues in Windows applications when a child process
is started with handle inheritance enabled (standard input/output
redirection) while a FFmpeg transcoding is running in the parent
process.

Links relevant to the subject:

https://msdn.microsoft.com/en-us/library/w7sa2b22.aspx

Describes the _wsopen() function and the O_NOINHERIT flag. File handles
opened by _wsopen() are inheritable by default.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx

Describes handle inheritance when creating new processes. Handle
inheritance must be enabled (bInheritHandles = TRUE) e.g. when you want
to pass handles for stdin/stdout via lpStartupInfo.

Signed-off-by: Tobias Rapp <t.rapp@noa-audio.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-02 17:40:49 +01:00
Ganesh Ajjanagadde c03044c86a avutil/eval: minor typo
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-01 19:35:01 -05:00
Matt Oliver bff009697d avutil/x86/intmath: Add missing header.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-11-01 02:11:29 +11:00
Ganesh Ajjanagadde 8a5b60a6b1 avutil/opencl_internal: add av_warn_unused_result
clSetKernelArg can return an error due to lack of memory (for instance):
https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetKernelArg.html.
Thus this error must be propagated.

Currently should not trigger warnings, but adds robustness.
Untested.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-31 10:40:54 -04:00
Matt Oliver 6c6ac9cb17 avutil/x86/intmath: Use tzcnt in place of bsf.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-31 23:11:32 +11:00
Ganesh Ajjanagadde 8d9f86bd37 avutil/rational: use frexp rather than ad-hoc log to get floating point exponent
This simplifies and cleans up the code.
Furthermore, it is much faster due to absence of the slow log computation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30 23:18:43 -04:00
Ganesh Ajjanagadde 191f611906 avutil/wchar_filename: add av_warn_unused_result
Current code is fine, this just adds robustness.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30 13:47:28 -04:00
Ganesh Ajjanagadde 20a30077c3 avutil/mathematics: correct documentation for av_gcd
av_gcd is now always defined regardless of input. This documents this
change in the "documented API". Two benefits (closely related):
1. The function is robust, and there is no need to worry about INT64_MIN, etc.

2. Clients of av_gcd, like av_reduce, can now be made fully correct. Currently,
av_reduce can trigger undefined behavior if e.g num is INT64_MIN due to
integer overflow in the FFABS. Furthermore, this undefined behavior is
completely undocumented, and could be a fuzzer's paradise. The FFABS was needed in the past as
av_gcd was undefined for negative inputs. In order to make av_reduce
robust, it is essential to guarantee that av_gcd works for all int64_t.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30 13:42:04 -04:00
Ganesh Ajjanagadde b7fb7c4542 avutil/mathematics: make av_gcd more robust
This ensures that no undefined behavior is invoked, while retaining
identical return values in all cases and at no loss of performance
(identical asm on clang and gcc).
Essentially, this patch exchanges undefined behavior with implementation
defined behavior, a strict improvement.

Rationale:
1. The ideal solution is to have the return type a uint64_t. This
unfortunately requires an API change.
2. The only pathological behavior happens if both arguments are
INT64_MIN, to the best of my knowledge. In such a case, the
implementation defined behavior is invoked in the sense that UINT64_MAX
is interpreted as INT64_MIN, which any reasonable implementation will
do. In any case, any usage where both arguments are INT64_MIN is a
fuzzer anyway.
3. Alternatives of checking, etc require branching and lose performance
for no concrete gain - no client cares about av_gcd's actual value when
both args are INT64_MIN. Even if it did, on sane platforms (e.g all the
ones FFmpeg cares about), it produces a correct gcd, namely INT64_MIN.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29 19:13:55 -04:00
Ganesh Ajjanagadde dd36749557 avutil/audio_fifo: add av_warn_unused_result
This one should not trigger any warnings, but will be useful for future
robustness.

Strictly speaking, one could check the size after the call by examining
the structure instead of the return value. Such a use case is highly
unusual, and this commit may be easily reverted if there is a legitimate
need of such use.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-28 23:05:31 -04:00
Ganesh Ajjanagadde fab1562a50 avutil/ripemd: make rol macro more robust by adding parentheses
This ensures that the macro remains correct in the sense of allowing
expressions for value and bits, by placing the value and bits expressions within
parentheses.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-28 21:42:15 -04:00
Rodger Combs cceed8389d lavu/aes: test CBC functionality 2015-10-28 09:38:21 -05:00
Rodger Combs 54cd1ab555 lavu/aes: align AVAES struct members 2015-10-28 04:23:14 -05:00
Rodger Combs 15ff5c7215 lavu/aes: add runtime dispatch for crypt function 2015-10-28 04:23:14 -05:00
Rodger Combs ec588db56f lavu/aes: move AVAES to separate internal header 2015-10-28 04:23:14 -05:00
Rodger Combs 1e477a970f lavu: add AESNI CPU flag 2015-10-28 04:23:14 -05:00
Ganesh Ajjanagadde a0e390e8ff avutil/avstring: add av_warn_unused_result
This does not trigger any warnings, but adds robustness.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-27 23:16:09 -04:00
Vittorio Giovara 63ea8e0610 timecode: Support HFR values 2015-10-26 15:05:26 +01:00
Vittorio Giovara 8c22148220 timecode: Do not fail for non-standard framerates
Instead just warn, and use the parse fps normally.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-26 15:05:05 +01:00
Clément Bœsch 6b5412cbfa avutil/opt: print more meaningful default flags values
Example:
% ./ffmpeg -h encoder=gif
[...]
GIF encoder AVOptions:
  -gifflags          <flags>      E..V.... set GIF flags (default offsetting+transdiff)
     offsetting                   E..V.... enable picture offsetting
     transdiff                    E..V.... enable transparency detection between frames
2015-10-25 22:47:16 +01:00
Ganesh Ajjanagadde bbd6bc6bd0 avutil/tree: clean up pointer incompatibility warnings
Commit 7c8fcbbde3 introduced some warnings
that get triggered on the test build. This should fix them.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-25 12:45:10 -04:00
Michael Niedermayer 65ffca9f80 avutil/tree: Document the guaranteed ordering of compare arguments for av_tree_find()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-25 17:28:47 +01:00
Ganesh Ajjanagadde 7c8fcbbde3 avutil/tree: add additional const qualifier to the comparator
libc's qsort comparator has a const qualifier on both arguments. This
adds a missing const qualifier to exactly match the comparator API.

Existing usages of av_tree_find, av_tree_insert are appropriately
modified: type signature changes of the comparators, and removal of
unnecessary void * casts of function pointers.

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-24 20:38:07 -04:00
Ganesh Ajjanagadde 94f333f9dc avutil/tree: improve documentation for av_tree_find, av_tree_insert
This documents the additional constness, and provides a useful libc
reference for the API specification of the comparator.

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-24 20:38:06 -04:00
Ganesh Ajjanagadde 8ed79c45b4 avutil/qsort: use the do while form for AV_QSORT, AV_MSORT
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-23 08:41:16 -04:00
Michael Niedermayer 00efaa7983 avutil/intmath: fix undefined behavior in ff_ctzll_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-22 14:10:42 +02:00
Andreas Cadhalpun 451b6a990a avutil: merge avpriv_float_dsp_init into avpriv_float_dsp_alloc
Also replace the last two usages of avpriv_float_dsp_init with
avpriv_float_dsp_alloc.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-21 00:24:58 +02:00
Andreas Cadhalpun 95687dc310 avutil: install des.h, rc4.h and tree.h as public headers
These headers contain functions supposed to be public.

libavutil/des.h:
 av_des_alloc
 av_des_crypt
 av_des_init
 av_des_mac
libavutil/rc4.h:
 av_rc4_alloc
 av_rc4_crypt
 av_rc4_init
libavutil/tree.h
 av_tree_destroy
 av_tree_enumerate
 av_tree_find
 av_tree_insert
 av_tree_node_alloc
 av_tree_node_size

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-21 00:23:10 +02:00
Matt Oliver b0bb1dc62d lavu/intmath.h: Move x86 only msvc/icl functions to x86 specific header.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-19 13:40:51 +11:00
Matt Oliver 216cc1f6fe lavu/intmath.h: Add msvc/icl ctzll optimisations.
Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-19 13:40:27 +11:00
Clément Bœsch ce0a117ed4 avutil/opt: display a better default value for int/int64 options
Example:

% ./ffmpeg -h encoder=aac
  -aac_coder         <int>        E...A... Coding algorithm (from -1 to 3) (default twoloop)
     faac                         E...A... FAAC-inspired method
     anmr                         E...A... ANMR method
     twoloop                      E...A... Two loop searching method
     fast                         E...A... Constant quantizer
[...]
2015-10-19 00:04:33 +02:00
Ganesh Ajjanagadde 07d4fe3a87 avutil: use EINVAL instead of -1 for the return code of crypto related init functions
These functions return an error typically when the key size is an
incorrect number. AVERROR(EINVAL) is more specific than -1.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-18 15:17:58 -04:00
Timothy Gu 801eca1372 opencl: Force the use of 1.2 APIs
Silences warnings regarding `clCreateCommandQueue` being deprecated.

Only a very limited number of products support 2.0. Since the
replacement API (`clCreateCommandQueueWithProperties`) is only available
in 2.0, we should not update it just yet.
2015-10-17 01:16:50 -07:00
Timothy Gu 17c68933f4 opencl: Use "opencl" as log context name
All other classes use lowercase names.
2015-10-17 01:16:50 -07:00
Timothy Gu 893a648182 opencl: Print compilation log
Useful when debugging.
2015-10-17 01:16:50 -07:00
Timothy Gu d2a1029724 opencl: Print error string when compilation fails 2015-10-17 01:16:50 -07:00
Ganesh Ajjanagadde cf52ae003b avutil/mem: add av_warn_unused_result
This adds av_warn_unused_result to functions whose return codes need to
be checked.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-16 19:53:55 -04:00
James Almer 3d1690b8c6 avutil: undo FF_API_CRYPTO_CONTEXT deprecation
It's been argued that the benefits of the current implementation far outweight
those of making the structs opaque.

This deprecation is not present in any release, so it can be safely removed.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-10-16 19:13:38 -03:00
Ganesh Ajjanagadde a0b079ac25 avutil/file: add av_warn_unused_result to av_file_map
The return code here should be checked.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-16 17:18:39 -04:00
Ganesh Ajjanagadde 31ed189d5c avutil/internal: add av_warn_unused_result to avpriv_open
The open syscall can obviously fail, and its return code needs to be
checked.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-16 17:18:21 -04:00
Ganesh Ajjanagadde 0418541d5d avutil/cast5: update Doxygen for av_cast5_init with return information
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-15 22:32:58 -04:00
Michael Niedermayer d6f6e98eb1 avutil/crc: use EINVAL instead of -1 for the return code of av_crc_init()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-16 03:24:36 +02:00
wang-bin 0861862b89 winrt: multithreading support
_beginthreadex is for desktop only. CreateThread is available for windows store apps on windows (and phone) 8.1 and later. http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2015-10-16 00:54:57 +11:00
Hendrik Leppkes f05021f3f4 Merge commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9'
* commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9':
  thread: Provide no-op variants for pthread_once

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 23:02:35 +02:00
Zhang Rui 87ff61b9ab avutil/fifo: add function av_fifo_generic_peek_at()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-14 20:23:58 +02:00
Ganesh Ajjanagadde 55d3e97970 avutil/intmath: use de Bruijn based ff_ctz
It has already been demonstrated that the de Bruijn method has benefits
over the current implementation: commit 971d12b7f9.
That commit implemented it for long long, this extends it to the int version.

Tested with FATE.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2015-10-14 13:39:42 -04:00
Luca Barbato c53e796f8b thread: Provide no-op variants for pthread_once 2015-10-14 14:35:34 +02:00
Hendrik Leppkes b994788353 Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'
* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef':
  dict: Change return type of av_dict_copy()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 14:01:11 +02:00
Michael Niedermayer 147b12162d avutil/fifo: Fix thread saftey of av_fifo_generic_peek()
changing the context state and restoring it is not safe if another
thread writes data into the fifo

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-13 19:08:42 +02:00
Vittorio Giovara 11c5f438ff dict: Change return type of av_dict_copy()
av_dict_set() could return an error, so forward it appropriately.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-12 13:35:01 +02:00
Ronald S. Bultje 93866c2aa2 intmath: remove av_ctz.
It's a non-installed header and only used in one place (flacenc).
Since ff_ctz is static inline, it's fine to use that instead.
2015-10-11 18:03:10 -04:00
Michael Niedermayer 2a4d1a66e8 avutil/intmath: Change debruijn_ctz64 to use 8bit elements
This reduces the memory & cache need from 256 to 64 bytes
the code also seems faster with this change

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-11 04:21:01 +02:00
Ganesh Ajjanagadde 971d12b7f9 avutil/mathematics: speed up av_gcd by using Stein's binary GCD algorithm
This uses Stein's binary GCD algorithm:
https://en.wikipedia.org/wiki/Binary_GCD_algorithm
to get a roughly 4x speedup over Euclidean GCD on standard architectures
with a compiler intrinsic for ctzll, and a roughly 2x speedup otherwise.
At the moment, the compiler intrinsic is used on GCC and Clang due to
its easy availability.

Quick note regarding overflow: yes, subtractions on int64_t can, but the
llabs takes care of that. The llabs is also guaranteed to be safe, with
no annoying INT64_MIN business since INT64_MIN being a power of 2, is
shifted down before being sent to llabs.

The binary GCD needs ff_ctzll, an extension of ff_ctz for long long (int64_t). On
GCC, this is provided by a built-in. On Microsoft, there is a
BitScanForward64 analog of BitScanForward that should work; but I can't confirm.
Apparently it is not available on 32 bit builds; so this may or may not
work correctly. On Intel, per the documentation there is only an
intrinsic for _bit_scan_forward and people have posted on forums
regarding _bit_scan_forward64, but often their documentation is
woeful. Again, I don't have it, so I can't test.

As such, to be safe, for now only the GCC/Clang intrinsic is added, the rest
use a compiled version based on the De-Bruijn method of Leiserson et al:
http://supertech.csail.mit.edu/papers/debruijn.pdf.

Tested with FATE, sample benchmark (x86-64, GCC 5.2.0, Haswell)
with a START_TIMER and STOP_TIMER in libavutil/rationsl.c, followed by a
make fate.

aac-am00_88.err:
builtin:
714 decicycles in av_gcd,    4095 runs,      1 skips

de-bruijn:
1440 decicycles in av_gcd,    4096 runs,      0 skips

previous:
2889 decicycles in av_gcd,    4096 runs,      0 skips

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-11 04:08:41 +02:00
Rodger Combs 0562f95902 lavu/opt: add flag to return NULL when applicable in av_opt_get
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-09 04:12:57 -05:00
Rodger Combs f36baeebc5 lavu/opt: switch AV_OPT flags to shift-based formatting 2015-10-09 04:12:57 -05:00
Ganesh Ajjanagadde 1d4af04adf avutil/attributes: add av_warn_unused_result
GCC 3.4 introduced an attribute warn_unused_result to warn when a programmer
discards the return value. Applying this judiciously across the codebase can help
in fixing a lot of problems. At a high level, functions which return error codes
should always be checked. More concretely, consider the functions ff_add_format
and the like in avfilter/formats.h. A quick examination shows that a large portion
of libavfilter fails to handle the associated errors, usually AVERROR(ENOMEM).
The above example was where I observed the utility of this, but it should be
useful in many places across the code base.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-05 19:30:20 +02:00
Henrik Gramner 2c3dbff1d8 avutil/avstring: Inline some tiny functions
They're short enough that inlining them actually reduces code size due to
all the overhead associated with making a function call.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-10-03 13:45:37 +02:00
Hendrik Leppkes 5fa5e73e81 Merge commit '1aa24df74c052a73175c43e57d35b4835e537ec8'
* commit '1aa24df74c052a73175c43e57d35b4835e537ec8':
  lavu: Deprecate AVFrame.error[]

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-03 09:52:39 +02:00
Henrik Gramner 17710550c4 x86inc: Make cpuflag() and notcpuflag() return 0 or 1
Makes it possible to use them in arithmetic expressions.
2015-10-01 18:14:12 +02:00
Vittorio Giovara 1aa24df74c lavu: Deprecate AVFrame.error[]
These field are difficult to interpret, and are provided by a single
encoder (mpegvideoenc). In general they do not belong to a structure
containing raw data only, so remove them from AVFrame.

Mpegvideoenc now uses a private field in Picture for its internal
computations.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-30 16:44:33 +02:00
Vicente Olivert Riera d00bb8addc mips: intreadwrite: Only execute that code for mips r1 or r2
MIPS R6 supports unaligned memory access and does not have
the load/store-left/right family of instructions.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera at imgtec.com>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-29 11:10:37 +02:00
Henrik Gramner ad9a543e93 avutil/avstring: Inline some tiny functions
They're short enough that inlining them actually reduces code size due to
all the overhead associated with making a function call.
2015-09-26 22:08:02 +02:00
Timo Rothenpieler 31ee86cd98 avutil/opencl: Fix volatile pointer
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-09-26 20:28:29 +02:00
James Almer 36e1665d3d avutil/attributes: add AV_GCC_VERSION_AT_MOST
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-18 12:41:29 -03:00
Ganesh Ajjanagadde 63cdb6e4a5 avutil/log: fix zero length gnu_printf format string warning
This should fix warning reported by fate client:
http://fate.ffmpeg.org/report.cgi?time=20150917113121&slot=x86_32-linux-gnu-gcc-4.5.1-have_6regs.
Untested.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-17 18:58:01 +02:00
Kevin Wheatley 4a66422450 pixfmt: Add new SMPTE color primaries and transfer characteristic values
Appeared in ITU-T Rec H.265 10/2014.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-17 10:31:43 +02:00
Rodger Combs 8e924629eb lavu/avstring: switch AV_ESCAPE_FLAGs to shift-based formatting
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-15 00:00:57 +02:00
Hendrik Leppkes eadf6cb2c4 Merge commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f'
* commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f':
  pixdesc: Document the component order

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-12 13:03:04 +02:00
Hendrik Leppkes ba42096d9a Merge commit 'e336c51e6ffcdb93fbcf3c6153d378400608526b'
* commit 'e336c51e6ffcdb93fbcf3c6153d378400608526b':
  pixdesc: Consistently order components

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-12 12:54:25 +02:00
James Almer d5f8a642f6 x86: port PSIGNW to cpuflags
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-11 23:27:03 -03:00
Michael Niedermayer 77d03b0ebb avutil/version: Bump for avpriv_get_trc_function_from_trc() and AVCOL_PRI/TRC_SMPTEST428_1 and AVCOL_TRC_SMPTEST2084
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-11 01:12:28 +02:00
Kevin Wheatley bac9048265 avutil/color_utils: Add basic transfer functions for each AVColorTransferCharacteristic
Most functions are valid over a domain and range of [0.0-1.0] but
some are defined over greater. This patch does not deal with
AVColorRange and assumes AVCOL_RANGE_JPEG for the returned values.

Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
2015-09-10 23:53:05 +02:00
Michael Niedermayer 24426172d3 avutil/pixfmt: Name "SMPTE ST 428-1" in AVColorPrimaries the same as in AVColorTransferCharacteristic
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 22:50:42 +02:00
Michael Niedermayer b5939ba09c avutil/pixdesc: Use "-" in color_primaries_names to be consistent with color_transfer_names
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 22:47:51 +02:00
Kevin Wheatley 6d4b394b5d avutil/pixdesc: Add SMPTE ST 2084 and ST 428-1 pixel descriptions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 22:34:47 +02:00
Kevin Wheatley c3cd6dd106 avutil/pixfmt: Add additional primaries and transfer characteristic enumerations from ITU-T Rec H.265
Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 22:32:52 +02:00
Luca Barbato 7b02cb29d9 pixdesc: Document the component order 2015-09-10 12:08:57 +02:00
Hendrik Leppkes e336c51e6f pixdesc: Consistently order components
Ensure that the components are ordered consistently, ie. always
RGB(A) and YUV(A). This allows to identify a specific plane on a given
pixel format without hard-coding knowledge of the plane order.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-10 12:08:57 +02:00
Hendrik Leppkes c7ed26ad60 pixdesc: Add missing alpha flag for yuva420p9be
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-10 12:08:57 +02:00
Clément Bœsch 9571a56009 avutil/opt: refactor pixel/sample fmt common case 2015-09-08 22:49:33 +02:00
Clément Bœsch 9117748cff avutil/opt: add AV_OPT_TYPE_BOOL 2015-09-08 22:39:20 +02:00
Hendrik Leppkes 5d8e836d0e Replace all remaining occurances of step/depth_minus1 and offset_plus1 2015-09-08 17:10:48 +02:00
Hendrik Leppkes 151aa2ebff Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba':
  lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 16:35:28 +02:00
Hendrik Leppkes f53569a93f Merge commit '6b3ef7f080293956b2e5212b83135c6b051212e9'
* commit '6b3ef7f080293956b2e5212b83135c6b051212e9':
  lavu: Remove bit packing from AVComponentDescriptor

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 14:53:34 +02:00
Hendrik Leppkes c734b34b04 Merge commit 'b8b5d8274471129f122858bc74ad09284dae6ab7'
* commit 'b8b5d8274471129f122858bc74ad09284dae6ab7':
  lavu: extend size of the AVPixFmtDescriptor.flags field

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 14:53:13 +02:00
Vittorio Giovara 2268db2cd0 lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields
The new fields can be accessed directly and are more intelligible.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-07 12:37:47 +02:00
Vittorio Giovara 6b3ef7f080 lavu: Remove bit packing from AVComponentDescriptor
There is no practical benefit in having this structure elements
bit packed given the size of the structure and its usage.
Change types from uint16_t (packed) to plain int in order to simplify
modifying the structure and accessing its fields.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-07 12:36:56 +02:00
wm4 b8b5d82744 lavu: extend size of the AVPixFmtDescriptor.flags field
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-07 12:36:04 +02:00
Hendrik Leppkes b7601b5f3d Merge commit 'a686e58165ca0f83966431a9166cb6e17bf6095c'
* commit 'a686e58165ca0f83966431a9166cb6e17bf6095c':
  des: Add missing include

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-07 12:28:25 +02:00
Hendrik Leppkes 160e92c8bf Merge commit 'e88103a7f92cf27a2868b50acc8a9912f6088249'
* commit 'e88103a7f92cf27a2868b50acc8a9912f6088249':
  Bump major versions of all libraries

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 21:35:46 +02:00
James Almer c956cb2c02 avutil/pixfmt: remove duplicate AVPixelFormat values
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-05 15:51:55 -03:00
Hendrik Leppkes d83dd630a0 lavu: Drop FF_API_GET_CHANNEL_LAYOUT_COMPAT cruft
FATE refs changed to accomodate for the new default behavior of the function.
Numbers are now interpreted as a channel layout, instead of a number of channels.
2015-09-05 20:36:19 +02:00
Hendrik Leppkes 237cf3786e lavu: Drop old deprecated AVOption API
Deprecated in 2011/10
2015-09-05 18:30:35 +02:00
Hendrik Leppkes 137f075993 lavu/hmac: remove deprecated type ids 2015-09-05 18:07:20 +02:00
Hendrik Leppkes 545559e43d Remove FF_CONST_AVUTIL55 cruft 2015-09-05 17:56:28 +02:00
Hendrik Leppkes 2df52088ef Merge commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a'
* commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a':
  Postpone API-incompatible changes until the next bump

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:52:10 +02:00
Hendrik Leppkes 6f6c025d6d Merge commit '3d89373fae281053154772d5e3e4370da09d3880'
* commit '3d89373fae281053154772d5e3e4370da09d3880':
  lavu: Drop deprecated private lls functions

Previously removed in ffmpeg

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:46:47 +02:00
Hendrik Leppkes f940931995 Merge commit '2f9b652e8c646eabef74a6742f0d7d4c9118fd0e'
* commit '2f9b652e8c646eabef74a6742f0d7d4c9118fd0e':
  lavu: Drop deprecated context size variables

These variables had been previously un-deprecated in ffmpeg, not removed.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:44:55 +02:00
Hendrik Leppkes a991526832 lavu/frame: put frame QP elements under a new version guard
These fields are still used, removal postponed until a replacement functionality is available.
2015-09-05 17:35:31 +02:00
Hendrik Leppkes b9fd813351 Merge commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79'
* commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79':
  lavu: Drop deprecated duplicated AVFrame/AVCodecContext parameters

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:31:45 +02:00
Hendrik Leppkes f1b02e6ca8 lavu/cpu: remove old cmov cruft 2015-09-05 17:23:28 +02:00
Hendrik Leppkes 58ebb39127 Merge commit 'bf7114b6caad8cf94696b0299c13b0d26bf291be'
* commit 'bf7114b6caad8cf94696b0299c13b0d26bf291be':
  lavu: Drop deprecated AV_CPU_FLAG_MMX2 symbol

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:19:50 +02:00
Hendrik Leppkes d9218011ef Merge commit '2d40968dd3ff17b12f7c80dbfad409b14418e267'
* commit '2d40968dd3ff17b12f7c80dbfad409b14418e267':
  lavu: Drop deprecated audioconvert.h header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:18:05 +02:00
Hendrik Leppkes d96d0252fd Merge commit 'cdfe45ad371b7a8e6135b6c063b6b2a93152cb3a'
* commit 'cdfe45ad371b7a8e6135b6c063b6b2a93152cb3a':
  lavu: Drop deprecated av_reverse function

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:17:15 +02:00
Hendrik Leppkes 0eed703d64 Merge commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51'
* commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51':
  lavu: Drop deprecated external access to AVPixFmtDescriptor table

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:12:23 +02:00
Hendrik Leppkes c10caea214 Merge commit '183db02a51a422568084b113a7571c845ca68622'
* commit '183db02a51a422568084b113a7571c845ca68622':
  lavu: Drop deprecated old_pix_fmt.h and related code

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:10:28 +02:00
Michael Niedermayer d6cd614dac avutil/common: Add FFNABS()
This macro avoids the undefined corner case with the *_MIN values

Previous version Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-03 09:05:50 +02:00
Michael Niedermayer 733511fb53 avutil/common: Document FFABS() corner case
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-03 02:18:01 +02:00
Vittorio Giovara a686e58165 des: Add missing include 2015-08-31 17:06:32 +02:00
Vittorio Giovara e88103a7f9 Bump major versions of all libraries
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-08-28 16:04:28 +02:00
Vittorio Giovara 4e649debcf Postpone API-incompatible changes until the next bump 2015-08-28 16:04:28 +02:00
Vittorio Giovara 3d89373fae lavu: Drop deprecated private lls functions
Deprecated in 02/2013.
2015-08-28 16:04:27 +02:00
Vittorio Giovara 2f9b652e8c lavu: Drop deprecated context size variables
Deprecated in 10/2012.
2015-08-28 16:04:27 +02:00
Vittorio Giovara 8f12ef9860 lavu: Drop deprecated duplicated AVFrame/AVCodecContext parameters
Deprecated in 10/2012.
2015-08-28 16:04:27 +02:00
Vittorio Giovara bf7114b6ca lavu: Drop deprecated AV_CPU_FLAG_MMX2 symbol
Deprecated in 11/2012.
2015-08-28 16:04:27 +02:00
Vittorio Giovara 2d40968dd3 lavu: Drop deprecated audioconvert.h header
Deprecated in 11/2012.
2015-08-28 16:04:27 +02:00
Vittorio Giovara cdfe45ad37 lavu: Drop deprecated av_reverse function
Deprecated in 10/2012.
2015-08-28 16:04:27 +02:00
Vittorio Giovara 2f8cbbc962 lavu: Drop deprecated external access to AVPixFmtDescriptor table
Deprecated in 10/2012.
2015-08-28 16:04:27 +02:00
Vittorio Giovara 183db02a51 lavu: Drop deprecated old_pix_fmt.h and related code
Deprecated in 10/2012.
2015-08-28 16:04:27 +02:00
Hendrik Leppkes fd2977d85f Merge commit 'e23f84d9652474353d8bbc42787a56ec1991908f'
* commit 'e23f84d9652474353d8bbc42787a56ec1991908f':
  channel_layout: Add a 16channel default layout

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-24 10:40:24 +02:00
Luca Barbato e23f84d965 channel_layout: Add a 16channel default layout
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-23 21:44:38 +02:00
Andreas Cadhalpun 095347ffe4 disable deprecation warnings in deprecated code
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:14 +02:00
Timothy Gu c5d9e9b354 doxygen: Remove lavu_internal group
There is no use in an internal group for a public API documentation.
2015-08-22 10:07:05 -07:00
Timothy Gu 0aa9bbbc37 version: Fix two more typos
Same as cafba99b51 but applied to
lavf and lavu.
2015-08-22 08:09:03 -07:00
Ganesh Ajjanagadde 531b0a316b avutil/x86/asm: rename REG_SP to REG_sp
REG_SP is defined by Solaris system headers.
This fixes a sea of warnings while building on Solaris:
http://fate.ffmpeg.org/report.cgi?time=20150820233505&slot=x86-opensolaris-gcc4.3

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-22 02:56:53 +02:00
Michael Niedermayer 0b7829901b */version.h: Add note/recommandition about bumping major
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-19 21:37:32 +02:00
Paul B Mahol 2fa019958b avfilter: add showfreqs filter 2015-08-19 16:15:13 +00:00
Gwenole Beauchesne 9f8e57efe4 vaapi: define a unique pixel format for VA-API (AV_PIX_FMT_VAAPI).
Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely
to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format
that is aliased to the older VLD variant.

This is an API change.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-08-19 14:03:24 +02:00
Ronald S. Bultje 87068ea5c5 lavu: disable wrong value check in get_version() upon api bump. 2015-08-18 15:57:20 -04:00
Ronald S. Bultje 3285005347 Undeprecate av_opt_set_defaults2(). 2015-08-18 13:09:06 -04:00
Ronald S. Bultje ad45121d56 options: mark av_get_{int,double,q} as deprecated.
Convert last users to av_opt_get_*() counterparts.
2015-08-18 12:05:17 -04:00
Ronald S. Bultje 70a19c482a Move ff_dlog from lavc to lavu. 2015-08-18 09:46:49 -04:00
Henrik Gramner 44b4444120 x86inc: Various minor backports from x264
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-13 07:46:24 +02:00
Andreas Cadhalpun 107e54c5bf avutil: add ff_reverse as av_reverse replacement
The table is used in libavutil/eval.c.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-12 00:14:14 +02:00
Henrik Gramner ab43beefab x86inc: Drop SECTION_TEXT macro
The .text section is already 16-byte aligned by default on all supported
platforms so `SECTION_TEXT` isn't any different from `SECTION .text`.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:12:01 +02:00
Henrik Gramner 1c6bb81328 x86inc: Disable vpbroadcastq workaround in newer yasm versions
The bug was fixed in 1.3.0, so only perform the workaround in earlier versions.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:11:27 +02:00
Christophe Gisquet f5e486f6f8 x86inc: Fix instantiation of YMM registers
Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:09:08 +02:00
Anton Mitrofanov b114d28a18 x86inc: warn when instructions incompatible with current cpuflags are used
Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:07:18 +02:00
Henrik Gramner 9f1245eb96 x86inc: Support arbitrary stack alignments
Change ALLOC_STACK to always align the stack before allocating stack space for
consistency. Previously alignment would occur either before or after allocating
stack space depending on whether manual alignment was required or not.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:04:11 +02:00
Anton Mitrofanov 8c75ba55a4 x86inc: warn if XOP integer FMA instruction emulation is impossible
Emulation requires a temporary register if arguments 1 and 4 are the same; this
doesn't obey the semantics of the original instruction, so we can't emulate
that in x86inc.

Also add pmacsdql emulation.

Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-08-11 11:02:27 +02:00
Michael Niedermayer 7d3aa2ca63 avutil/float_dsp: Remove use of deprecated av_set_cpu_flags_mask()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-07 22:46:27 +02:00
Anton Mitrofanov 8db0f71b49 x86inc: warn if XOP integer FMA instruction emulation is impossible
Signed-off-by: Henrik Gramner <henrik@gramner.com>
2015-08-05 16:15:40 +02:00
Henrik Gramner f0b7882ceb x86inc: Drop SECTION_TEXT macro
The .text section is already 16-byte aligned by default on all supported
platforms so `SECTION_TEXT` isn't any different from `SECTION .text`.
2015-08-04 20:13:09 +02:00
Henrik Gramner 826790f596 x86inc: Support arbitrary stack alignments
Change ALLOC_STACK to always align the stack before allocating stack space for
consistency. Previously alignment would occur either before or after allocating
stack space depending on whether manual alignment was required or not.
2015-08-04 20:13:09 +02:00
James Almer 5750d6c5e9 x86: move XOP emulation code back to x86inc
Only two functions that use xop multiply-accumulate instructions where the
first operand is the same as the fourth actually took advantage of the macros.

This further reduces differences with x264's x86inc.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-08-03 17:11:13 -03:00
Sebastien Zwickert 11d923d414 avcodec: add new Videotoolbox hwaccel. 2015-08-03 10:12:10 +02:00
Henrik Gramner 127203ba5a x86inc: Various minor backports from x264
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-03 04:08:33 +02:00
Henrik Gramner f151fbd9e5 x86inc: Disable vpbroadcastq workaround in newer yasm versions
The bug was fixed in 1.3.0, so only perform the workaround in earlier versions.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-03 03:13:20 +02:00
Hendrik Leppkes d95fee4425 Merge commit '3e853ff7acc56b180950ab39e7282f1b938c8784'
* commit '3e853ff7acc56b180950ab39e7282f1b938c8784':
  des: extend av_des_init() doxy

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:41:26 +02:00
Hendrik Leppkes 3cf08e96fc Merge commit 'd9e8b47e3144262d6bc4681740411d4bdafad6ac'
* commit 'd9e8b47e3144262d6bc4681740411d4bdafad6ac':
  des: add av_des_alloc()

Conflicts:
	libavutil/des.c

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:41:16 +02:00
Hendrik Leppkes 9ca19971bc Merge commit '5d8bea3bb2357bb304f8f771a4107039037c5549'
* commit '5d8bea3bb2357bb304f8f771a4107039037c5549':
  xtea: add av_xtea_alloc()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:39:37 +02:00
Hendrik Leppkes 52566efd5c Merge commit 'b469832de993dabbfe037bef59c68e90e82ebca5'
* commit 'b469832de993dabbfe037bef59c68e90e82ebca5':
  rc4: extend av_rc4_init() doxy

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:38:53 +02:00
Hendrik Leppkes a130ec9540 Merge commit 'ae365453c370c85f278bff7fbf9e20d9d335cb2a'
* commit 'ae365453c370c85f278bff7fbf9e20d9d335cb2a':
  rc4: add av_rc4_alloc()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:38:33 +02:00
Hendrik Leppkes 9ed59f16e0 Merge commit '7a7df34c91e16ea8936f59524145a2cdd6b790f9'
* commit '7a7df34c91e16ea8936f59524145a2cdd6b790f9':
  blowfish: add av_blowfish_alloc()

Conflicts:
	doc/APIchanges
	libavutil/version.h

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:38:12 +02:00
James Almer 3e853ff7ac des: extend av_des_init() doxy
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-31 09:04:12 +02:00
James Almer d9e8b47e31 des: add av_des_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-31 09:04:12 +02:00
James Almer 5d8bea3bb2 xtea: add av_xtea_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-31 09:04:12 +02:00
James Almer b469832de9 rc4: extend av_rc4_init() doxy
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-31 09:04:12 +02:00
James Almer ae365453c3 rc4: add av_rc4_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-31 09:04:12 +02:00
James Almer 7a7df34c91 blowfish: add av_blowfish_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-31 09:04:09 +02:00
James Almer 6877537ff3 hmac: add missing version bump and APIChanges entry
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-07-30 16:40:26 +03:00
James Almer bc397246aa avutil/hmac: fix API/ABI compatibility with the fork
The test code is updated with some cosmetics to avoid the loop
using undefined AVHMACType values.
The old enum values will be removed in the next major bump, effectively
making both projects synced and without API or ABI issues.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-07-29 21:32:05 -03:00
Michael Niedermayer 8c5cc7b7fb avutil/hmac: support another ABI difference to the fork
spotted this and so adding it.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 01:25:05 +02:00
James Almer e59f7cd89e fate: add test vectors for HMAC SHA and SHA-2
Also replace custom tests for MD5 with those published in RFC 2202

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-07-29 22:09:16 +03:00
James Almer 7e38340b83 hmac: add support for SHA-2
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-07-29 22:09:16 +03:00
James Almer 4d2c014a8f x86/float_dsp: add missing colon to labels
Silences warnings with Nasm

Signed-off-by: James Almer <jamrial@gmail.com>
2015-07-26 02:51:08 -03:00
Michael Niedermayer e171309756 avutil/softfloat: Add a test for av_sincos_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-25 21:42:42 +02:00
Paul B Mahol f0489a35c0 avutil: add ayuv64le and ayuv64be packed pixel format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-24 03:40:36 +00:00
Shivraj Patil fd7eadd25c avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for VP9 lpf functions
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-23 16:52:18 +02:00
James Almer a176bbc873 avutil/softfloat: move av_sincos_sf() back to header
Fixes compilation of host tool aacps_fixed_tablegen

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-07-22 23:12:21 -03:00
Vesselin Bontchev 323ec6b5e2 Add support for TEA (Tiny Encryption Algorithm)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 23:10:44 +02:00
Michael Niedermayer be0fd07457 Merge commit '219b39a71a5694b1c14a07b86477f665a5b6849b'
* commit '219b39a71a5694b1c14a07b86477f665a5b6849b':
  parseutil: Use non ambiguous aliases for uhd

Conflicts:
	doc/ffmpeg.texi
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 16:55:39 +02:00
Luca Barbato 219b39a71a parseutil: Use non ambiguous aliases for uhd
uhd1 and uhd2 would be ambigous.
2015-07-21 11:43:44 +02:00
Michael Niedermayer d82d11397f avutil/arm/intmath: return int for uint8 / uint16 clip
The C functions return uint8/16_t but that is effectively int not unsigned int
Fixes fate-filter-tblend

We do not return uint8/16_t as that would require the compiler to truncate the
values, slowing it down.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 17:20:16 +02:00
Djordje Pesut f85bc147fb avcodec: Implementation of AAC_fixed_decoder (SBR-module)
Add fixed poind code.

Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 17:20:16 +02:00
Michael Niedermayer 9ebe041e1c Merge commit 'e93ca480c91397f82f2ea5b6a8b82ac6d0e2bfd2'
* commit 'e93ca480c91397f82f2ea5b6a8b82ac6d0e2bfd2':
  parseutil: Add more resolution aliases

Conflicts:
	doc/ffmpeg.texi
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 04:32:28 +02:00
Luca Barbato e93ca480c9 parseutil: Add more resolution aliases
Add DCI 2k and 4k and uhd1 and uhd2.
2015-07-20 04:05:48 +02:00
James Almer bd48764532 avutil/x86/bswap: force inline asm versions with ICC
Recent ICC versions that define GCC as >= 4.5 (like ICC 13) apparently can't
optimize the generic C versions of av_bswap*() on their own.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-07-18 20:48:09 -03:00
James Almer 78347549a4 avutil/intmath: check for ICC before GCC
Intel compiler also defines __GNUC__, so the Intel specific intrinsics were not
really being used.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-07-18 19:59:34 -03:00
Michael Niedermayer 129785b5e8 avutil/frame: Update AVFrame docs library references
These where apparently forgotten when AVFrames where moved into libavutil

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-18 10:46:36 +02:00
Zhang Rui fcbea93cf8 avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 17:28:55 +02:00