summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* all: Make header guard names consistentTimothy Gu2016-01-31
|
* libavutil/mastering_display_metadata.h: change fields to be rationals as ↵Neil Birkbeck2016-01-29
| | | | | | | | | this is how they are typically coded. (this structure is not referenced anywhere yet) Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* all: Add missing header guardsTimothy Gu2016-01-28
|
* avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-27
| | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avutil/opt: check for and handle errors in av_opt_set_dict2()Michael Niedermayer2016-01-26
| | | | | | Previously errors could result in random entries to be lost. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: add P010 pixel formatHendrik Leppkes2016-01-26
| | | | | P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.
* Add missing conversions from side data enum to nameNeil Birkbeck2016-01-22
| | | | | | | Add names for recently added enums to av_frame_side_data_name. Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* x86inc: Add debug symbols indicating sizes of compiled functionsGeza Lore2016-01-21
| | | | | | | | | Some debuggers/profilers use this metadata to determine which function a given instruction is in; without it they get can confused by local labels (if you haven't stripped those). On the other hand, some tools are still confused even with this metadata. e.g. this fixes `gdb`, but not `perf`. Currently only implemented for ELF.
* x86inc: Avoid creating unnecessary local labelsHenrik Gramner2016-01-21
| | | | | | | | | | The REP_RET workaround is only needed on old AMD cpus, and the labels clutter up the symbol table and confuse debugging/profiling tools, so use EQU to create SHN_ABS symbols instead of creating local labels. Furthermore, skip the workaround completely in functions that definitely won't run on such cpus. Note that EQU is just creating a local label when using nasm instead of yasm. This is probably a bug, but at least it doesn't break anything.
* x86inc: Simplify AUTO_REP_RETHenrik Gramner2016-01-21
| | | | | | cpuflags is never undefined any more, it's set to 0 instead. Also fix an incorrect comment.
* x86inc: Use more consistent indentationHenrik Gramner2016-01-21
|
* x86inc: Preserve arguments when allocating stack spaceHenrik Gramner2016-01-21
| | | | | | When allocating stack space with a larger alignment than the known stack alignment a temporary register is used for storing the stack pointer. Ensure that this isn't one of the registers used for passing arguments.
* x86inc: Improve FMA instruction handlingHenrik Gramner2016-01-21
| | | | | | | | | | | | * Correctly handle FMA instructions with memory operands. * Print a warning if FMA instructions are used without the correct cpuflag. * Simplify the instantiation code. * Clarify documentation. Only the last operand in FMA3 instructions can be a memory operand. When converting FMA4 instructions to FMA3 instructions we can utilize the fact that multiply is a commutative operation and reorder operands if necessary to ensure that a memory operand is used only as the last operand.
* x86inc: Be more verbose in assertion failuresHenrik Gramner2016-01-21
|
* x86/intmath: disable sse av_clip functions when using ICCJames Almer2016-01-21
| | | | | | | | | It seems to miscompile them Should fix fate-ra-288 and fate-twinvq Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* lavu: add pthread asserts if ASSERT_LEVEL>1Clément Bœsch2016-01-20
|
* libavutil: add mastering display metadata sidedataNeil Birkbeck2016-01-19
| | | | | | | | | | | | | | Adding mastering display metadata struct to avutil. The mastering display metadata contains information about the mastering display color volume (SMPTE 2086:2014). This info comes from HEVC in the SEI_TYPE_MASTERING_DISPLAY_INFO and is soon to be included in MKV: https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=sZyfPTM-QY69P-0omfOIiTN622o so it is similar to SEI FPA / stereo_mode in MKV and as such this patch follows how AVStereo3D is implemented. I'll add support to HEVC in a follow-up (and MKV when spec is approved). Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '73c8c0341cce9e1a6c4169721f5123f97fc4be2f'Hendrik Leppkes2016-01-19
|\ | | | | | | | | | | | | * commit '73c8c0341cce9e1a6c4169721f5123f97fc4be2f': arm: Fix vfp dead code elimination with have_vfp_vm Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * arm: Fix vfp dead code elimination with have_vfp_vmMartin Storsjö2016-01-08
| | | | | | | | | | | | | | | | | | This fixes builds with --disable-vfp. Checking for the armv6 cpu flag is incorrect, since vfpv2 isn't armv6 specific. Signed-off-by: Martin Storsjö <martin@martin.st>
* | x86/fixed_dsp: add ff_butterflies_fixed_sse2James Almer2016-01-16
| | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | lavu/x86/lls: add fma3 optimizations for update_llsGanesh Ajjanagadde2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves accuracy (very slightly) and speed for processors having fma3. Sample benchmark (fate flac-16-lpc-cholesky, Haswell): old: 5993610 decicycles in ff_lpc_calc_coefs, 64 runs, 0 skips 5951528 decicycles in ff_lpc_calc_coefs, 128 runs, 0 skips new: 5252410 decicycles in ff_lpc_calc_coefs, 64 runs, 0 skips 5232869 decicycles in ff_lpc_calc_coefs, 128 runs, 0 skips Tested with FATE and --disable-fma3, also examined contents of lavu/lls-test. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Henrik Gramner <henrik@gramner.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | x86/intmath: add missing early clobber to output operandsJames Almer2016-01-15
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | lavu: prevent overflow in av_clip_intp2_cAndreas Cadhalpun2016-01-15
| | | | | | | | | | | | | | | | This fixes ubsan runtime error: signed integer overflow: 8388608 + 2140274688 cannot be represented in type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavu/libm: add isfinite fallbackGanesh Ajjanagadde2016-01-13
| | | | | | | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avutil/common: Protect GET_BYTE in GET_UTF8() by ()Michael Niedermayer2016-01-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Correct two build/built typosTimothy Gu2016-01-11
| | | | | | | | | | Found-by: Leo Izen <leo.izen@gmail.com> as thebombzen on IRC Signed-off-by: Timothy Gu <timothygu99@gmail.com>
* | x86/float_dsp: zero extend offset from ff_scalarproduct_float_sseJames Almer2016-01-08
| | | | | | | | | | Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | x86/float_dsp: zero extend len from ff_butterflies_float_sse implicitlyJames Almer2016-01-08
| | | | | | | | | | Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | x86/float_dsp: remove len check from ff_butterflies_float_sseJames Almer2016-01-08
| | | | | | | | | | | | | | The function documentation explicitly mentions it needs to be a multiple of 4. Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | lavu: rename and move ff_parity to av_parityJames Almer2016-01-07
| | | | | | | | | | | | | | av_popcount is not defined in intmath.h. Reviewed-by: ubitux Signed-off-by: James Almer <jamrial@gmail.com>
* | lavu: add ff_parity()Clément Bœsch2016-01-07
| |
* | lavu/common: add an explanation to FF_CEIL_RSHIFT()Clément Bœsch2016-01-07
| |
* | lavu/common: fix FF_CEIL_RSHIFT() range commentClément Bœsch2016-01-07
| |
* | x86/intmath: add sse optimized av_clipf and av_clipdJames Almer2016-01-07
| | | | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/cpu: add missing entry for vfp_vm to av_parse_cpu_capsHendrik Leppkes2016-01-02
| |
* | Merge commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0'Hendrik Leppkes2016-01-02
|\| | | | | | | | | | | | | * commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0': arm: add a cpu flag for the VFPv2 vector mode Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * arm: add a cpu flag for the VFPv2 vector modeJanne Grunau2015-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The vector mode was deprecated in ARMv7-A/VFPv3 and various cpu implementations do not support it in hardware. Vector mode code will depending the OS either be emulated in software or result in an illegal instruction on cpus which does not support it. This was not really problem in practice since NEON implementations of the same functions are preferred. It will however become a problem for checkasm which tests every cpu flag separately. Since this is a cpu feature newer cpu do not support anymore the behaviour of this flag differs from the other flags. It can be only activated by runtime cpu feature selection.
* | Merge commit '64034849dad8410bedbe1def4c533490fb85cc4a'Hendrik Leppkes2016-01-02
|\| | | | | | | | | | | | | * commit '64034849dad8410bedbe1def4c533490fb85cc4a': arm64: add cycle counter support Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * arm64: add cycle counter supportJanne Grunau2015-12-14
| | | | | | | | | | | | The ISB (instruction synchronization barrier) might be too heavy for START/STOPTIMER use but should be more accurate in checkasm where the timing overhead is subtracted.
* | Merge commit '50078c1c8070dd8d1c329e8117ff30ec72489039'Hendrik Leppkes2016-01-02
|\| | | | | | | | | | | | | * commit '50078c1c8070dd8d1c329e8117ff30ec72489039': libavutil: move FFALIGN macro from common.h to macros.h Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libavutil: move FFALIGN macro from common.h to macros.hJanne Grunau2015-12-14
| | | | | | | | | | | | | | | | | | Include macros.h explicitly in common.h so that external code using FFALIGN does not break. It was already implicitly included through version.h. Include macros.h in lls.h and internal.h for FFALIGN. lls.h was including common.h only for FFALIGN and internal.h was missing the include for FFALIGN. `make checkheaders` did not catch it because it's an internal header.
* | lavu/eval: replace pow(10,x) by ff_exp10(x)Ganesh Ajjanagadde2015-12-25
| | | | | | | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/internal: add ff_exp10Ganesh Ajjanagadde2015-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | Fast, reasonably accurate 10^x. Alternative of detection of libm exp10 at configure time is not worth the trouble, since it is anyway not POSIX or ISO C, and currently only the GNU libm has it. Furthermore, GNU libm's variant is ~ 2x slower, and is ironically not correctly rounded (2 ulp off) to justify all that slowdown. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/libm,configure: remove exp10, exp10f detectionGanesh Ajjanagadde2015-12-25
| | | | | | | | | | | | Subsequent commit introduces ff_exp10 instead. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/libm: misc, minor changesGanesh Ajjanagadde2015-12-25
| | | | | | | | | | | | | | Addition of comments marking the end of ifdef blocks, correction of an incorrect (at double precision) M_LN2, removal of an unnecessary undef. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/libm: add exp10 supportGanesh Ajjanagadde2015-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exp10 is a function available in GNU libm. Looks like no other common libm has it. This adds support for it to FFmpeg. There are essentially 2 ways of handling the fallback: 1. Using pow(10, x) 2. Using exp2(M_LOG2_10 * x). First one represents a Pareto improvement, with no speed or accuracy regression anywhere, but speed improvement limited to GNU libm. Second one represents a slight accuracy loss (relative error ~ 1e-13) for non GNU libm. Speedup of > 2x is obtained on non GNU libm platforms, ~30% on GNU libm. These are "average case numbers", another benefit is the lack of triggering of the well-known terrible worst case paths through pow. Based on reviews, second one chosen. Comment added accordingly. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/libm: add erf hack and make dynaudnorm available everywhereGanesh Ajjanagadde2015-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Source code is from Boost: http://www.boost.org/doc/libs/1_46_1/boost/math/special_functions/erf.hpp with appropriate modifications for FFmpeg. Tested on interval -6 to 6 (beyond which it saturates), +/-NAN, +/-INFINITY under -fsanitize=undefined on clang to test for possible undefined behavior. This function turns out to actually be essentially as accurate and faster than the libm (GNU/BSD's/Mac OS X), and I can think of 3 reasons why upstream does not use this: 1. They are not aware of it. 2. They are concerned about licensing - this applies especially to GNU libm. 3. They do not know and/or appreciate the benefits of rational approximations over polynomial approximations. Boost uses them to great effect, see e.g swr/resample for bessel derived from them, which is also similarly superior to libm variants. First, performance. sample benchmark (clang -O3, Haswell, GNU/Linux): 3e8 values evenly spaced from 0 to 6 time (libm): ./test 13.39s user 0.00s system 100% cpu 13.376 total time (boost based): ./test 9.20s user 0.00s system 100% cpu 9.190 total Second, accuracy. 1e8 eval pts from 0 to 6 maxdiff (absolute): 2.2204460492503131e-16 occuring at point where libm erf is correctly rounded, this is not. Illustration of superior rounding of this function: arg : 0.83999999999999997 erf : 0.76514271145499457 boost : 0.76514271145499446 real : 0.76514271145499446 i.e libm is actually incorrectly rounded. Note that this is clear from: https://github.com/JuliaLang/openlibm/blob/master/src/s_erf.c (the Sun implementation used by both BSD and GNU libm's), where only 1 ulp is guaranteed. Reasons it is not easy/worthwhile to create a "correctly rounded" variant of this function (i.e 0.5ulp): 1. Upstream libm's don't do it anyway, so we can't guarantee this unless we force this implementation on all platforms. This is not easy, as the linker would complain unless measures are taken. 2. Nothing in FFmpeg cares or can care about such things, due to the above and FFmpeg's nature. 3. Creating a correctly rounded function will in practice need some use of long double/fma. long double, although C89/C90, unfortunately has problems on ppc. This needs fixing of toolchain flags/configure. In any case this will be slower for miniscule gain. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/libm: add copysign hackGanesh Ajjanagadde2015-12-19
| | | | | | | | | | | | | | | | | | | | | | | | For systems with broken libms. Tested with NAN, -NAN, INFINITY, -INFINITY, +/-x for regular double x and combinations of these. Old versions of MSVC need some UINT64_C hackery. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/intmath: add faster clz supportGanesh Ajjanagadde2015-12-19
| | | | | | | | | | | | | | | | This should be useful for the sofalizer filter. Reviewed-by: Kieran Kunhya <kierank@ob-encoder.com> Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu/error: add missing error messages for errors supported on all platformsMarton Balint2015-12-18
| | | | | | | | | | | | | | | | We need these if we have no strerror_r. Descriptions are taken from doc/errno.txt except for ENOMEM. Signed-off-by: Marton Balint <cus@passwd.hu>