aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
* avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rndMichael Niedermayer2015-12-201-2/+2
| | | | | | | | | | | | The code expects actual positive numbers and gives completely wrong results if INT64_MIN is treated as positive Instead clip it into the valid range that is add 1 and treat it as negative Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 25e37f5ea92d4201976a59ae306ce848d257a7e6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/integer: Fix av_mod_i() with negative dividendMichael Niedermayer2015-12-201-0/+8
| | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3a9cb18855d29c96a5d9d2f5ad30448cae3a2ddf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavutil/channel_layout: Check strtol*() for failureMichael Niedermayer2015-11-191-2/+5
| | | | | | | | | | | | | 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> (cherry picked from commit c9bfd6a8c35a2102e730aca12f6e09d1627f76b3) Conflicts: libavutil/channel_layout.c
* avutil/file_open: avoid file handle inheritance on WindowsTobias Rapp2015-11-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (cherry picked from commit 474665346616e446ecd1407002fdf5f88201bf72) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Add FFNABS()Michael Niedermayer2015-11-191-0/+9
| | | | | | | | | | 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> (cherry picked from commit d6cd614dac579850076ae312c29c4188f8659e46) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Document FFABS() corner caseMichael Niedermayer2015-11-191-0/+6
| | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 733511fb53fedd3adaaeabc5db9d0b29e71ea1d3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/fifo: Fix the case where func() returns less bytes than requested in ↵Zhang Rui2015-07-201-1/+2
| | | | | | | | | av_fifo_generic_write() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit fcbea93cf8777bbef2a393d26942b5d3c70a448d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* arm: only enable setend on ARMv6Andreas Cadhalpun2015-07-201-1/+1
| | | | | | | | | | Without this check it causes SIGILL crashes on ARMv5. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 5bf84a584e9ce681b439a5747671e2809a019c83) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavutil/channel_layout: Correctly return layout when channel specification ↵Simon Thelen2015-07-201-1/+1
| | | | | | | | | | | | | ends with a trailing 'c'. Return layout when FF_API_GET_CHANNEL_LAYOUT_COMPAT is set even if the layout itself is not in the deprecated style. Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 83307a32eb0c9f0843f655c44bb65e3e999153f8) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavutil/softfloat: Fix av_normalize1_sf bias.Nedeljko Babic2015-07-201-1/+1
| | | | | | | | | | av_normalize1_sf doesn't properly address border case when mantis is exactly -0x40000000. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 7131aba916d1f562bdaf6a81319f1421ce175b1e) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/avstring: Use size_t in av_strlcatf()Michael Niedermayer2015-05-151-1/+1
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit ae4eea8be45a0b212fd57ceaac1f11089ab81d98) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/dict: Use size_t for appending stringsMichael Niedermayer2015-05-151-1/+1
| | | | | | | | | | | the string length is not constrained to INT_MAX Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4c128ea1629116fc4936edc5f96bbd18f3ef1647) Conflicts: libavutil/dict.c
* libavutil/mem: use size_t for the length in av_strdup()Michael Niedermayer2015-05-151-1/+1
| | | | | | | | | the string length is not constrained to INT_MAX Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4950bd4ebedbb6289734234bb2a719820f565c41) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* imgutils: initialize palette padding bytes in av_image_allocAndreas Cadhalpun2015-05-141-0/+8
| | | | | | | | | | | | | | | av_image_fill_pointers always aligns the palette, but the padding bytes don't (and can't) get initialized in av_image_copy. Thus initialize them in av_image_alloc. This fixes 'Syscall param write(buf) points to uninitialised byte(s)' valgrind warnings. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 51f64552853e16d72644308db53abee870aecfb9) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avutil/pca: Check for av_malloc* failuresMichael Niedermayer2015-04-111-0/+8
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit dadc43eee4d9036aa532665a04720238cc15e922) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/cpu: add missing check for mmxext to av_force_cpu_flagsJames Almer2015-03-281-0/+1
| | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 1f5d1eed78fad63f1c80a3766d3dc2421b99104d)
* mips/float_dsp: fix vector_fmul_window_mips on mips64James Cowgill2015-03-281-6/+6
| | | | | | | | | | | | | | | | | | Commit dfa920807494 ("mips/float_dsp: fix a bug in vector_fmul_window_mips") fixed vector_fmul_window_mips by unrolling the loop only 4 times, but also removed the outer C loop and replaced it with assembly branches and pointer arithmetic. When submitting my 64-bit porting patch I missed this new assembly which also needed porting. This patch fixes a bus error in the fate-float-dsp test when run on 64-bit mips. Signed-off-by: James Cowgill <james410@cowgill.org.uk> Reviewed-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit f8323744a0783d5937232a95cd1cc98f6b70a810) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips/asmdefs: use _ABI64 as defined by gccJames Cowgill2015-03-131-3/+1
| | | | | | | | | | | | Unfortunately android < api 21 (lollipop) doesn't have the sgidefs.h header, the easiest way around this is to just use the preprocessor definitions from gcc / clang. Signed-off-by: James Cowgill <james410@cowgill.org.uk> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a251aa1a350a1b9d3af07a7948efcc0add8e68ff) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* arm: Suppress tags about used cpu arch and extensionsMartin Storsjö2015-03-131-0/+6
| | | | | | | | | | | | | When all the codepaths using manually set .arch/.fpu code is behind runtime detection, the elf attributes should be suppressed. This allows tools to know that the final built binary doesn't strictly require these extensions. Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips/asmdefs: change include guard to read AVUTIL_ instead of AVCODEC_James Cowgill2015-03-071-2/+2
| | | | | | | | Signed-off-by: James Cowgill <james410@cowgill.org.uk> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 3499a1c0a91c8bc81556d837c87bf991ef6657c1) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Revert "avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit"Michael Niedermayer2015-03-071-3/+0
| | | | | | | | | | Fixed build with opencl enabled Found-by: WJ Liu This reverts commit 0f2359b86926ed33da4bd64ca76d84d03d5ad380. (cherry picked from commit ebd59d271c24601e08c3569681b129cd27bf4070) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/opencl: is_compiled flag not being cleared in av_opencl_uninitSrikanth G2015-03-061-0/+3
| | | | | | | | | | | | When OpenCL kernels are compiled, is_compiled flag is being set for each kernel. But, in opencl uninit, this flag is not being cleared. This causes an error when an OpenCL kernel is tried on different OpenCL devices on same platform. Here is the patch with a fix Reviewed-by; Wei Gao <highgod0401@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips: port optimizations to mips n64James Cowgill2015-03-062-10/+59
| | | | | | | | | | | | | This mainly consists of replacing all the pointer arithmatic 'addiu' instructions with PTR_ADDIU which will handle the differences in pointer sizes when compiled on 64 bit mips systems. The header asmdefs.h contains the PTR_ macros which expend to the correct mips instructions to manipulate registers containing pointers. Signed-off-by: James Cowgill <james410@cowgill.org.uk> Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/opt: Do not print inf in selftestMichael Niedermayer2015-03-051-0/+4
| | | | | | This fixes fate failures on windows Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mips/float_dsp: fix a bug in vector_fmul_window_mipsNedeljko Babic2015-03-051-106/+74
| | | | | | | | | | Loop was unrolled eight times although in heder there is assumption that len is multiple of 4. This is fixed, and assembly code is rewritten to be more optimal and to simplify clobber list. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil: Extract gamma determination from PNG encoder for future use. Adds ↵Kevin Wheatley2015-03-054-1/+93
| | | | | | | private avpriv_get_gamma_from_trc() function to libavutil. Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* pixelutils: Comment on (lack of) sad_8x8_sse2Peter Cordes2015-03-041-0/+6
| | | | Signed-off-by: Peter Cordes <peter@cordes.ca>
* pixelutils: indent comments in pixdesc.h to be clearerPeter Cordes2015-03-041-3/+3
| | | | Signed-off-by: Peter Cordes <peter@cordes.ca>
* avutil/common: minor simplification in av_clip_intp2_c()Michael Niedermayer2015-03-021-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/opt: also test av_opt_show2()Michael Niedermayer2015-03-011-22/+25
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/opt: Remove odd trailing whitespace bytes from flags help descriptionMichael Niedermayer2015-03-011-3/+3
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/opt: Also test/compare the av_log output i the selftestMichael Niedermayer2015-03-011-0/+8
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/ppc/intreadwrite: remove AV_??64 overriding codeMichael Niedermayer2015-03-011-14/+0
| | | | | | | The code has undefined behavior and makes no difference when optimizations are enabled. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/imgutils: correctly check for negative SAR componentsMichael Niedermayer2015-02-281-1/+1
| | | | | | | These could trigger assert failures previously Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavutil: add x86 optimized av_popcountJames Almer2015-02-252-0/+41
| | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/common: Fix integer overflow in av_clip_int8/16_cMichael Niedermayer2015-02-251-2/+2
| | | | | | | Fixes: signal_sigsegv_30420a5_2388_cov_1489993561_integra_lavf.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/fixed_dsp: Check for av_malloc() failureMichael Niedermayer2015-02-221-0/+4
| | | | | | Fixes CID1271051 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '76ce9bd8e26dcb3652240a1072840ff4011d7cdc'Michael Niedermayer2015-02-211-0/+8
|\ | | | | | | | | | | | | * commit '76ce9bd8e26dcb3652240a1072840ff4011d7cdc': libavutil: Add ARM av_clip_intp2_arm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavutil: Add ARM av_clip_intp2_armPeter Meerwald2015-02-211-0/+8
| | | | | | | | | | | | | | | | | | | | add ARM code for implementing av_clip_intp2 using the ssat instruction on Cortex-A8, av_clip_intp2_arm() is faster than av_clip_intp2_c() and the generic av_clip(), about -19% Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'bf07d813f6c88b5a76980f321cf7272d799c4216'Michael Niedermayer2015-02-211-0/+17
|\| | | | | | | | | | | | | * commit 'bf07d813f6c88b5a76980f321cf7272d799c4216': libavutil: Add av_clip_intp2 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavutil: Add av_clip_intp2Peter Meerwald2015-02-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there already is a function, av_clip_uintp2() that clips a signed integer to an unsigned power-of-two range, i.e. 0,2^p-1 this patch adds a function av_clip_intp2() that clips a signed integer to a signed power-of-two range, i.e. -(2^p),(2^p-1) the new function can be used as a special case for av_clip(), e.g. av_clip(x, -8192, 8191) can be rewritten as av_clip_intp2(x, 13) there are ARM instructions, usat and ssat resp., which map nicely to these functions (see next patch) Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '5b1d9ceec715846a58fe029bc3889ed6fa62436a'Michael Niedermayer2015-02-193-2/+10
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '5b1d9ceec715846a58fe029bc3889ed6fa62436a': pixfmt: add a pixel format for QSV hwaccel Conflicts: doc/APIchanges libavutil/pixfmt.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pixfmt: add a pixel format for QSV hwaccelAnton Khirnov2015-02-193-1/+10
| |
* | avutil/sha: Protect macro arguments with ()Michael Niedermayer2015-02-181-6/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavutil: optimize twofish cipherSupraja Meedinti2015-02-181-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | before: lavu TWOFISH size: 1048576 runs: 1024 time: 90.052 +- 4.630 after: lavu TWOFISH size: 1048576 runs: 1024 time: 18.085 +- 0.241 gcrypt TWOFISH size: 1048576 runs: 1024 time: 25.666 +- 0.307 tomcrypt TWOFISH size: 1048576 runs: 1024 time: 18.428 +- 0.363 Signed-off-by: Supraja Meedinti <supraja0493@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | x86inc: Correctly warn on use of SSE2 instructions in SSE functionsChristophe Gisquet2015-02-171-2/+4
| | | | | | | | | | | | | | | | SSE2 instructions that are XMM-implementations of pre-existing MMX/MMX2 instructions did not issue warnings when used in SSE functions. Handle it by also checking the register type when such instructions are used. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/aes: Add () to protect the ROT() argumentsMichael Niedermayer2015-02-171-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/attributes: Add () to protect the AV_GCC_VERSION_AT_LEAST() argumentsMichael Niedermayer2015-02-171-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/intmath: Add () to protect the ff_log2() argumentMichael Niedermayer2015-02-171-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/murmur3: Add () to protect the ROT() argumentsMichael Niedermayer2015-02-171-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>