Commit Graph

3552 Commits

Author SHA1 Message Date
Zhang Rui
5db095793a 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>
(cherry picked from commit fcbea93cf8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 04:43:41 +02:00
Andreas Cadhalpun
b477f97ab9 arm: only enable setend on ARMv6
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 5bf84a584e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-20 04:43:40 +02:00
Simon Thelen
3c7e41df27 libavutil/channel_layout: Correctly return layout when channel specification 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 83307a32eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-20 04:43:39 +02:00
Nedeljko Babic
c8377cc49b libavutil/softfloat: Fix av_normalize1_sf bias.
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 7131aba916)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-20 04:43:39 +02:00
Michael Niedermayer
39236d5618 avutil/avstring: Use size_t in av_strlcatf()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae4eea8be4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:51 +02:00
Michael Niedermayer
cf6cbcca7e avutil/dict: Use size_t for appending strings
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c128ea162)

Conflicts:

	libavutil/dict.c
2015-05-15 10:04:51 +02:00
Michael Niedermayer
df9eca44f8 libavutil/mem: use size_t for the length in av_strdup()
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4950bd4ebe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-15 10:04:50 +02:00
Andreas Cadhalpun
9bcaf90378 imgutils: initialize palette padding bytes in av_image_alloc
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 51f6455285)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-14 19:14:10 +02:00
Michael Niedermayer
f597b9f04e avutil/pca: Check for av_malloc* failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dadc43eee4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-11 22:01:46 +02:00
James Almer
037d6cf580 avutil/cpu: add missing check for mmxext to av_force_cpu_flags
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1f5d1eed78)
2015-03-28 22:10:34 -03:00
James Cowgill
7439ed2f39 mips/float_dsp: fix vector_fmul_window_mips on mips64
Commit dfa9208074 ("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 f8323744a0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-28 11:59:04 +01:00
James Cowgill
c58edf52f9 mips/asmdefs: use _ABI64 as defined by gcc
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 a251aa1a35)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:32 +01:00
Martin Storsjö
47e8d17132 arm: Suppress tags about used cpu arch and extensions
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 dcae2e32f7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 13:04:31 +01:00
James Cowgill
876d2d8db8 mips/asmdefs: change include guard to read AVUTIL_ instead of AVCODEC_
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3499a1c0a9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-07 11:34:35 +01:00
Michael Niedermayer
28950d1f8c Revert "avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit"
Fixed build with opencl enabled
Found-by:  WJ Liu

This reverts commit 0f2359b869.
(cherry picked from commit ebd59d271c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-07 10:38:07 +01:00
Srikanth G
0f2359b869 avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit
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>
2015-03-06 15:20:12 +01:00
James Cowgill
157d6f0d5b mips: port optimizations to mips n64
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>
2015-03-06 14:37:44 +01:00
Michael Niedermayer
6d7e57e88b avutil/opt: Do not print inf in selftest
This fixes fate failures on windows

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 13:50:22 +01:00
Nedeljko Babic
dfa9208074 mips/float_dsp: fix a bug in vector_fmul_window_mips
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>
2015-03-05 12:31:44 +01:00
Kevin Wheatley
86b59e6a50 avutil: Extract gamma determination from PNG encoder for future use. Adds 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>
2015-03-05 12:26:22 +01:00
Peter Cordes
9e5687adf2 pixelutils: Comment on (lack of) sad_8x8_sse2
Signed-off-by: Peter Cordes <peter@cordes.ca>
2015-03-04 21:58:53 +01:00
Peter Cordes
4da3a14f3c pixelutils: indent comments in pixdesc.h to be clearer
Signed-off-by: Peter Cordes <peter@cordes.ca>
2015-03-04 21:58:53 +01:00
Michael Niedermayer
85108195c5 avutil/common: minor simplification in av_clip_intp2_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-02 01:07:50 +01:00
Michael Niedermayer
88ec5435bb avutil/opt: also test av_opt_show2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 17:45:32 +01:00
Michael Niedermayer
e9c85ae648 avutil/opt: Remove odd trailing whitespace bytes from flags help description
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 17:29:33 +01:00
Michael Niedermayer
c1e93cdc9e avutil/opt: Also test/compare the av_log output i the selftest
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 17:04:12 +01:00
Michael Niedermayer
9564375dee avutil/ppc/intreadwrite: remove AV_??64 overriding code
The code has undefined behavior and makes no difference when optimizations
are enabled.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 03:15:19 +01:00
Michael Niedermayer
5705dc5276 avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously

Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-28 21:57:11 +01:00
James Almer
bc65abc8d7 libavutil: add x86 optimized av_popcount
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-25 19:58:00 -03:00
Michael Niedermayer
6d66e1a113 avutil/common: Fix integer overflow in av_clip_int8/16_c
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>
2015-02-25 20:56:00 +01:00
Michael Niedermayer
c3b6454d80 avutil/fixed_dsp: Check for av_malloc() failure
Fixes CID1271051

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-22 16:27:28 +01:00
Michael Niedermayer
1253091d6f Merge commit '76ce9bd8e26dcb3652240a1072840ff4011d7cdc'
* commit '76ce9bd8e26dcb3652240a1072840ff4011d7cdc':
  libavutil: Add ARM av_clip_intp2_arm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 11:15:32 +01:00
Michael Niedermayer
88d850ecb3 Merge commit 'bf07d813f6c88b5a76980f321cf7272d799c4216'
* commit 'bf07d813f6c88b5a76980f321cf7272d799c4216':
  libavutil: Add av_clip_intp2

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 11:13:34 +01:00
Peter Meerwald
76ce9bd8e2 libavutil: Add ARM av_clip_intp2_arm
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>
2015-02-21 00:54:40 +01:00
Peter Meerwald
bf07d813f6 libavutil: Add av_clip_intp2
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>
2015-02-21 00:54:40 +01:00
Michael Niedermayer
e3755119fa Merge commit '5b1d9ceec715846a58fe029bc3889ed6fa62436a'
* 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>
2015-02-19 20:23:48 +01:00
Anton Khirnov
5b1d9ceec7 pixfmt: add a pixel format for QSV hwaccel 2015-02-19 15:07:21 +01:00
Michael Niedermayer
e0be5c4fbe avutil/sha: Protect macro arguments with ()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-18 22:50:41 +01:00
Supraja Meedinti
092ee6cd32 libavutil: optimize twofish cipher
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>
2015-02-18 00:59:55 +01:00
Christophe Gisquet
d9293c776e x86inc: Correctly warn on use of SSE2 instructions in SSE functions
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>
2015-02-17 12:35:58 +01:00
Michael Niedermayer
52d1929000 avutil/aes: Add () to protect the ROT() arguments
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 00:22:42 +01:00
Michael Niedermayer
06309fc704 avutil/attributes: Add () to protect the AV_GCC_VERSION_AT_LEAST() arguments
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 00:21:48 +01:00
Michael Niedermayer
f8607cfb0a avutil/intmath: Add () to protect the ff_log2() argument
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 00:20:49 +01:00
Michael Niedermayer
cdee0c9d5f avutil/murmur3: Add () to protect the ROT() arguments
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 00:18:15 +01:00
Michael Niedermayer
9cde41cdb5 avutil/version: Add () to protect the AV_VERSION_INT() arguments
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 00:17:47 +01:00
Michael Niedermayer
61eb602d27 avutil/log: add () to protect the argument of AV_LOG_C()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 00:04:22 +01:00
Michael Niedermayer
64e0369808 avutil/fixed_dsp: Use av_clip_int16() instead of the non optimized av_clip_int16_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-15 00:43:32 +01:00
Michael Niedermayer
6998400c61 Merge commit 'bf704132a51f5d838365158331d4e535e1df4c8e'
* commit 'bf704132a51f5d838365158331d4e535e1df4c8e':
  Don't anonymously typedef structs

Conflicts:
	avprobe.c
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:27:44 +01:00
Diego Biurrun
bf704132a5 Don't anonymously typedef structs 2015-02-14 10:13:49 -08:00
Michael Niedermayer
1cca124886 Merge commit '0232ba62a28527579e34d44700b48017cc727e5f'
* commit '0232ba62a28527579e34d44700b48017cc727e5f':
  frame: clarify buf documentation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-11 01:32:30 +01:00