Commit Graph

4717 Commits

Author SHA1 Message Date
James Almer
4959f18a8e Merge commit '04b0f0e371ff81b682274b574fb465ba4395c09f'
* commit '04b0f0e371ff81b682274b574fb465ba4395c09f':
  mem: uninline av_malloc(z)_array()

Merged-by: James Almer <jamrial@gmail.com>
2017-10-30 16:08:14 -03:00
James Almer
7df37dd319 avutil/frame: deprecate getters and setters for AVFrame fields
The fields can be accessed directly, so these are not needed anymore.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-29 10:16:44 -03:00
James Almer
00bfe8509c Merge commit '193b09189004ede4a6998e69192d1a9f63602088'
* commit '193b09189004ede4a6998e69192d1a9f63602088':
  thread: Define ff_mutex_* macros as stub functions when threads are disabled

Merged-by: James Almer <jamrial@gmail.com>
2017-10-26 17:13:14 -03:00
James Almer
5de85c1029 Merge commit '10f4511f14a4e830c0ed471df4cd1cc2a18a481a'
* commit '10f4511f14a4e830c0ed471df4cd1cc2a18a481a':
  libavutil: Make LOCAL_ALIGNED(xx be equal to LOCAL_ALIGNED_xx(

Also added LOCAL_ALIGNED_4 as it's used in vp8 decoder, and
simplified the configure defines.

Merged-by: James Almer <jamrial@gmail.com>
2017-10-26 14:06:34 -03:00
Kaustubh Raste
736a48901f avcodec/mips: Improve hevc bi weighted hv mc msa functions
Use immediate unsigned saturation for clip to max saving one vector register.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-25 21:50:37 +02:00
Dale Curtis
50e30d9bb7 Don't use _tzcnt instrinics with clang for windows w/o BMI.
Technically _tzcnt* intrinsics are only available when the BMI
instruction set is present. However the instruction encoding
degrades to "rep bsf" on older processors.

Clang for Windows debatably restricts the _tzcnt* instrinics behind
the __BMI__ architecture define, so check for its presence or
exclude the usage of these intrinics when clang is present.

See also:
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183404.html
https://bugs.llvm.org/show_bug.cgi?id=30506
http://lists.llvm.org/pipermail/cfe-dev/2016-October/051034.html

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-25 21:50:37 +02:00
Diego Biurrun
0af8a72174 build: Drop support for legacy TI ARM compiler 2017-10-25 13:39:58 +02:00
Mark Thompson
2708c8e8ef hwcontext_vaapi: Set message callbacks on internally-created devices
The message callbacks are library-safe in libva2, so we can now use
them.
2017-10-25 00:01:41 +01:00
James Almer
4e9dc52a97 Merge commit '1bd986ed4b0e95ded368a8eeb5c044853c090f9b'
* commit '1bd986ed4b0e95ded368a8eeb5c044853c090f9b':
  hwcontext: Move NONE to the be the first member of AVHWDeviceType

Merged-by: James Almer <jamrial@gmail.com>
2017-10-24 19:14:22 -03:00
Martin Storsjö
17f5171cd4 arm: Check for have_vfp_vm instead of !have_vfpv3 for float_dsp_vfp
This was missed in e2710e790c since those functions weren't exercised
by checkasm.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-10-24 09:06:56 +03:00
James Almer
572b7a0b85 Merge commit '35cf146a33ce41a1adb6c9bd5a0827eacb1b6bfc'
* commit '35cf146a33ce41a1adb6c9bd5a0827eacb1b6bfc':
  lavu: Drop deprecated av_dlog macro

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:20:07 -03:00
James Almer
c0cfc0ce11 Merge commit '619a433eca2c5655c41b799e0b06380020fb1498'
* commit '619a433eca2c5655c41b799e0b06380020fb1498':
  lavu: Drop deprecated option type

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:18:00 -03:00
James Almer
b773a8d8c1 Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'
* commit 'dd343fd986459f467a2d1d70c26101dff1d47d68':
  lavu: Drop deprecated VDPAU pixel formats

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:15:49 -03:00
James Almer
b46613dd9b Merge commit 'dcc39ee10e82833ce24aa57926c00ffeb1948198'
* commit 'dcc39ee10e82833ce24aa57926c00ffeb1948198':
  lavc: Remove deprecated XvMC support hacks

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 15:20:49 -03:00
James Almer
8c2b829123 avutil/frame: remove unneccessary metadata pointer getter
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-23 10:58:00 -03:00
Martin Storsjö
f1fd12ef85 lavu/arm: Check for have_vfp_vm instead of !have_vfpv3 for float_dsp_vfp
This was missed in e754c8e8 / e2710e790c since those functions
weren't exercised by checkasm.

Fixes ticket #6766.
2017-10-23 13:29:12 +02:00
Clément Bœsch
2b32031827 lavc: drop VDA
Deprecated (aka removed) in OSX 10.11, and we have a replacement for it
(VideoToolbox).
2017-10-23 11:56:15 +02:00
James Almer
90eb0a2180 avutil/tests/hmac: remove superfluous loop
The gap in enum values has been removed.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-22 20:25:38 -03:00
James Almer
1eb01cca6f avutil/hmac: remove gap in AVHMACType enum values
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-22 19:47:05 -03:00
James Almer
382aaa3312 avutil/crc: remove gap in AVCRCId enum values
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-22 00:44:55 -03:00
James Almer
69b5ce64d2 Merge commit '07a2b155949eb267cdfc7805f42c7b3375f9c7c5'
* commit '07a2b155949eb267cdfc7805f42c7b3375f9c7c5':
  Bump major versions of all libraries

A few API deprecated ~2 years ago or more are also postponed here for
varying reasons.

FF_API_LOWRES:
Since this functionality depends on AVStream->codec, i figure the two can
be removed at the same time in the next bump or so.

FF_API_AVCTX_TIMEBASE:
Couldn't get this one to work. Not just libavcodec but apparently also
libavformat and ffmpeg.c expect AVCodecContext->time_base to be set for
decoding. Upon removal some tests report a different generic stream time
base (like 1/25), and others lose packet duration values. I guess it's
somehow tied to the AVStream->codec clusterfuck.
It can be dealt with alongside FF_API_LAVF_AVCTX in the next bump.

FF_API_OLD_FILTER_OPTS_ERROR:
This one is meant to remain after FF_API_OLD_FILTER_OPTS is removed.
Its purpose is displaying the corrected command line using the new syntax
as a suggestion as part of the error message.

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 14:57:53 -03:00
James Almer
072b14f390 Merge commit '8e2346154e6d58b733fd20326ce706f82fd91b3e'
* commit '8e2346154e6d58b733fd20326ce706f82fd91b3e':
  libavutil: Hook up the rest of the gcc specific attributes to clang as well

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 14:25:55 -03:00
James Almer
1ba5e456dd Merge commit '3aa9c523e9cf4f4a5e239ac737281e096c884907'
* commit '3aa9c523e9cf4f4a5e239ac737281e096c884907':
  libavutil: Define the noreturn attribute for clang in MSVC mode as well

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 14:21:12 -03:00
James Almer
2904db9045 Merge commit '994c4bc10751e39c7ed9f67ffd0c0dea5223daf2'
* commit '994c4bc10751e39c7ed9f67ffd0c0dea5223daf2':
  x86util: Port all macros to cpuflags

See d5f8a642f6

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 12:15:57 -03:00
Martin Storsjö
69ac24e556 aarch64: Get rid of a stray double space
The extra space got included as part of the expansion of ELF, which
later interfered with gas-preprocessor which earlier only stripped out
leftover lines starting with '#' if the line started with that char.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-10-18 10:49:28 +03:00
Diego Biurrun
7ac092d05d build: CryptGenRandom --> wincrypt, it is a better name 2017-10-12 20:04:18 +02:00
Diego Biurrun
b46900914a build: Merge mach/mach_time.h and mach_absolute_time() checks 2017-10-12 20:04:16 +02:00
Michael Niedermayer
80154b1b3a Bump version for master after 3.4 branchpoint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 02:45:37 +02:00
Michael Niedermayer
e1de9eab3a Bump minor versions for branching 3.4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 01:23:47 +02:00
Michael Niedermayer
832fc05a9b avutil/frame: Fix project name
Issue introduced in: caa12027ba

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 00:02:07 +02:00
Kaustubh Raste
af9433b1d6 avcodec/mips: Improve avc bi-weighted mc msa functions
Replace generic with block size specific function.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-10 23:58:41 +02:00
Diego Biurrun
09c98327b9 build: Drop support for Tru64 Unix (OSF/1)
This proprietary Unix flavor dropped from the face of the earth more
than a decade ago. Nothing of value was lost.
2017-10-10 23:17:54 +02:00
James Almer
3d828c9fd5 cpu: split flag checks per arch in av_cpu_max_align()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-10-09 11:48:24 +02:00
Mark Thompson
b2f256a9f5 hwcontext_vaapi: Add support for mapping to DRM objects
Uses vaExportSurfaceHandle() from libva2.
2017-10-09 00:46:16 +01:00
Mark Thompson
309d660775 hwcontext: Perform usual initialisation on derived device contexts
The initialisation should be common.  For libmfx, it was previously
happening in the derivation function and this moves it out.  For VAAPI,
it fixes some failures when deriving from a DRM device because this
initialisation did not run.
2017-10-09 00:11:53 +01:00
Mark Thompson
f3602875b3 hwcontext_vaapi: Set message callbacks on internally-created devices
The message callbacks are library-safe in libva2, so we can now use
them.
2017-10-09 00:11:53 +01:00
Mark Thompson
5f39788668 hwcontext_vaapi: Factorise out common connection code
This was duplicated between normal device creation and creation by
derivation from a DRM device.
2017-10-09 00:11:53 +01:00
Carl Eugen Hoyos
cd01b3cbcf lavu/opt: Use "&&" instead of "*" in boolean expression.
Fixes the following warning:
libavutil/opt.c:101:47: warning: '*' in boolean context, suggest '&&' instead
2017-10-08 23:15:53 +02:00
Carl Eugen Hoyos
d96d65dfeb lavu/utils: Use "__asm__" like everywhere else in the codebase. 2017-10-08 01:13:16 +02:00
James Almer
7aa6b8a68f Merge commit '4de220d2e3751c459f8739a08ac6ca52e63eba30'
* commit '4de220d2e3751c459f8739a08ac6ca52e63eba30':
  frame: allow align=0 (meaning automatic) for av_frame_get_buffer()

See https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html

Merged-by: James Almer <jamrial@gmail.com>
2017-09-27 23:31:53 -03:00
James Almer
3b345d389b avutil/cpu: split flag checks per arch in av_cpu_max_align()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-27 23:10:09 -03:00
James Almer
522f877086 Merge commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e'
* commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e':
  cpu: add a function for querying maximum required data alignment

Adapted to work with the arbitrary runtime cpuflag changes av_force_cpu_flags()
can generate.

Merged-by: James Almer <jamrial@gmail.com>
2017-09-27 23:03:57 -03:00
James Almer
1a115a31d4 Merge commit 'ce6d72d10776b03c6780d4aa676414ce002285d4'
* commit 'ce6d72d10776b03c6780d4aa676414ce002285d4':
  imgutils: Document av_image_get_buffer_size()

Merged-by: James Almer <jamrial@gmail.com>
2017-09-27 20:35:04 -03:00
Kaustubh Raste
10ab5534e0 avcodec/mips: Improve avc weighted mc msa functions
Replace generic with block size specific function.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-27 21:15:57 +02:00
Luca Barbato
ccbb31c14b qsv: Make sure the session is set with the latest version
It is needed to have the calls to MFXJoinSession succeed.
2017-09-27 12:27:34 +00:00
James Almer
0c005fa86f Merge commit '7abdd026df6a9a52d07d8174505b33cc89db7bf6'
* commit '7abdd026df6a9a52d07d8174505b33cc89db7bf6':
  asm: Consistently uppercase SECTION markers

Merged-by: James Almer <jamrial@gmail.com>
2017-09-26 18:48:06 -03:00
James Almer
318778de9e Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'
* commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3':
  Mark some arrays that never change as const.

Merged-by: James Almer <jamrial@gmail.com>
2017-09-26 16:02:40 -03:00
Kaustubh Raste
7f8417f226 avcodec/mips: Improve hevc uni-w copy mc msa functions
Load the specific destination bytes instead of MSA load and pack.
Pack the data to half word before clipping.
Use immediate unsigned saturation for clip to max saving one vector register.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-24 02:33:48 +02:00
Vittorio Giovara
6f15f1cdc8 pixdesc: Add API to map color property names to enum values
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-09-21 13:33:29 +02:00
Vittorio Giovara
2b50847e0f pixdesc: Add API to map color property names to enum values
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-09-21 13:23:21 +02:00
James Almer
18516d3e69 avutil/hwcontext_dxva2: return an error when buffer allocation fails
This also prevents the use of an uninitialized variable.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-19 19:30:08 -03:00
Mark Thompson
b0ece2b31f hwcontext_vaapi: Fix DRM format mapping 2017-09-19 22:47:04 +01:00
Michael Niedermayer
0f5576a22b avutil/imgutils: Fix warning: missing braces around initializer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-16 19:55:03 +02:00
Kaustubh Raste
1a85fb7e1e avcodec/mips: Improve hevc sao band filter msa functions
Preload data in band filter 0-8 for better pipeline parallelization.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-15 22:36:42 +02:00
Jun Zhao
197d298ab3 hwcontext_vaapi: Fix build failure with old libdrm
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-09-14 22:42:51 +01:00
Mark Thompson
170c65335c hwcontext_vaapi: Add DRM to VAAPI mapping 2017-09-13 22:25:25 +01:00
Mark Thompson
9cb23cd9fe lavu: Add DRM hwcontext 2017-09-13 22:03:27 +01:00
Jesse Liu
8e17cd20b9 add missing ignore files
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-10 19:08:33 +02:00
Clément Bœsch
f61379cbd4 lavu/timer.h: add Linux Perf API support
Refer to "checkasm: use perf API on Linux ARM*" commit for the
rationale.

The implementation is somehow duplicated with checkasm, but so is the
current usage of AV_READ_TIME(). Until these implementations and
heuristics are made consistent, I don't see a way of sharing that code.

Note: when using libavutil/timer.h, it is now important to include
before any other include due to the _GNU_SOURCE requirement.
2017-09-08 18:51:05 +02:00
Clément Bœsch
e0b9b3e60e lavu/tests: move timer.h include earlier
In the next commit, timer.h will require a _GNU_SOURCE to be set before
including system headers. This commit prevents compilation failures.
2017-09-08 18:51:05 +02:00
Clément Bœsch
dc27df47ff lavu/tests/des: rename crypt to crypt_ref
This will prevent a symbol clash with crypt(3) after unistd.h is
included.
2017-09-08 18:51:05 +02:00
Clément Bœsch
9c0d823a7c lavu/timer.h: factor out timer report
This commit is meant to reduce the diff in the following one.
2017-09-08 18:51:05 +02:00
Kaustubh Raste
9b2c3c406f avcodec/mips: Improve vp9 mc msa functions
Load the specific destination bytes instead of MSA load and pack.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-08 13:48:40 +02:00
Martin Storsjö
abf1c058d1 msvc: Properly specify dllexport for data symbols shared across dll boundaries
We currently only have exported data symbols within libavcodec, but
the concept is easy to extend to other libraries if necessary.
The attribute declaration needs to be in a private header though,
since we can't use CONFIG_SHARED in public installed headers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:22:06 +03:00
Martin Storsjö
e41daa6246 Remove support for building for mingw32ce (Windows CE)
The toolchain for this target is unmaintained since many years.

While it has been continuously build tested on fate, it hasn't
actually been tested at runtime since many, many years (and back
then, only a few codecs in libavcodec were tested).

So far, keeping support for it has been mostly effortless, but
the compiler does seem to have issues with dllimported data symbols,
ending up as internal compiler errors in some cases. Instead of
jumping through further hoops to work around that, just remove the
target.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:21:08 +03:00
Timo Rothenpieler
ef0c6d9b01 libavutil/opencl: fix potential null dereference
Fixes CID 1396840

Reviewed-by: Wei Gao <highgod0401@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-08-27 21:08:17 +02:00
Martin Storsjö
7b7760ad6e aarch64: Fix negative movrel offsets for windows
On windows, the offset for the relocation doesn't get stored in
the relocation itself, but as an unsigned immediate in the opcode.
Therefore, negative offsets has to be handled via a separate sub
instruction, just as on MachO.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-22 13:41:08 +03:00
Paul B Mahol
1146133df8 avutil/eval: add linear interpolation helper 2017-08-19 12:42:24 +02:00
Ivan Kalvachev
30ae07d7ef Add macros to x86util.asm .
Improved version of VBROADCASTSS that works like the avx2 instruction.
Emulation of vpbroadcastd.
Horizontal sum HSUMPS that places the result in all elements.
Emulation of blendvps and pblendvb.

Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
2017-08-18 17:18:32 +01:00
Vittorio Giovara
1460408703 Add single precision planar RGB pixel formats
Add a pixel format flag to identify this family.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-08-15 15:26:20 +02:00
Vittorio Giovara
f357104866 pixfmt: Support chroma-derived and ictcp color matrices
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-08-10 15:54:06 +02:00
Vittorio Giovara
538e508751 pixfmt: Support chroma-derived and ictcp color matrices
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-08-10 15:36:04 +02:00
Martin Storsjö
9042402ec7 d3d11va: Check WINAPI_FAMILY instead of HAVE_LOADLIBRARY
If using the winstore compat library, a fallback LoadLibrary
function does exist, that only calls LoadPackagedLibrary though
(which doesn't work for dynamically loading d3d11 DLLs).

Therefore explicitly check the targeted API family instead.

Make this check a reusable HAVE_* component which other parts
of the libraries can check when necessary as well.

Signed-off-by: Martin Storsjö <martin@martin.st>

Merged from Libav commit 4d330da006.
2017-08-10 11:58:25 +02:00
wm4
463b81de2b imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 45df7adc1d.
2017-08-08 13:37:37 +02:00
wm4
caa12027ba lavc, lavu: move frame cropping to a convenience function
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 47399ccdfd.
2017-08-08 13:35:09 +02:00
Paul B Mahol
ab6d89d7ee libavutil: add GRAY9 pixel format 2017-08-07 13:06:51 +02:00
Yogender Gupta
3407d8118c hwcontext_cuda : Support YUV444P16 format
Signed-off-by: Philip Langdale <philipl@overt.org>
2017-08-03 15:25:35 -07:00
Tobias Rapp
60008c0fe9 fate: update pixfmt_best test to check for endianness
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-07-27 08:53:37 +02:00
wm4
45df7adc1d imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-26 23:21:26 +02:00
wm4
47399ccdfd lavc, lavu: move frame cropping to a convenience function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-26 23:20:40 +02:00
James Almer
4cebf0fc45 avutil/frame: add ICC Profile to av_frame_side_data_name
Reviwed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-07-26 11:31:17 -03:00
Kaustubh Raste
a776cb2074 libavcodec/mips: Optimize avc idct 4x4 for msa
Removed memset call and improved performance.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-25 22:04:34 +02:00
Rostislav Pehlivanov
24de4fddca lavu/frame: add new side data type for ICC profiles
Many image formats support embedding of ICC profiles directly in
their bitstreams. Add a new side data type to allow exposing them to
API users.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-25 20:11:06 +01:00
Mark Thompson
f2c11b9337 pixdesc: Reindent after previous commit 2017-07-22 21:51:41 +01:00
Mark Thompson
f48efb14f9 pixdesc: Explicitly handle invalid arguments to av_find_best_pix_fmt_of_2() 2017-07-22 21:51:26 +01:00
Kaustubh Raste
ef1b4bdf44 libavutil/mips: Updated msa generic macros
Reduced msa load-store code.
Removed inline asm of GP load-store for 64 bit.
Updated variable names in GP load-store macros for naming consistency.
Corrected macro descriptions.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-21 17:37:05 +02:00
Muhammad Faiz
a3d3cfa65c avutil: merge slice threading implementation from avcodec and avfilter
Rework it to improve performance. Now mutex is not shared by workers,
instead each worker has its own mutex and condition variable. This
reduces lock contention between workers. Also use atomic variable for
counter.

The interface also allows execute to run special function on main
thread, requested by Ronald.

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-07-19 15:50:07 +07:00
Mark Thompson
3192821237 pixdesc: Add a test for av_find_best_pix_fmt_of_2() 2017-07-18 22:56:30 +01:00
Mark Thompson
8a442d7a8a pixdesc: Improve scoring for opaque/unknown pixel formats
Hardware pixel formats do not tell you anything about their actual
contents, but should still score higher than formats with completely
unknown properties, which in turn should score higher than invalid
formats.

Do not return an AVERROR code as a score.

Fixes a hang in libavfilter where format negotiation gets stuck in a
loop because AV_PIX_FMT_NONE scores more highly than all other
possibilities.
2017-07-18 22:56:30 +01:00
Aleksandr Slobodeniuk
390e028c66 avutil/threadmessage: fix error return in case of av_fifo_alloc failure
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-14 02:30:37 +02:00
Martin Storsjö
1912973a2d d3d11va: Check WINAPI_FAMILY instead of HAVE_LOADLIBRARY
If using the winstore compat library, a fallback LoadLibrary
function does exist, that only calls LoadPackagedLibrary though
(which doesn't work for dynamically loading d3d11 DLLs).

Therefore explicitly check the targeted API family instead.

Make this check a reusable HAVE_* component which other parts
of the libraries can check when necessary as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-07-05 13:55:11 +03:00
Clément Bœsch
2658e66cd1 lavu/cpu: disable MMX warning on non x86 platforms
We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of
this MMX warning on AArch64.
2017-06-29 18:00:58 +02:00
Hendrik Leppkes
15b00aea41 hwcontext_d3d11va: use correct license header 2017-06-28 00:19:55 +02:00
wm4
289d387330 hwcontext_d3d11va: add option to enable debug mode
Basically copied from VLC (LGPL):

http://git.videolan.org/?p=vlc.git;a=blob;f=modules/video_output/win32/direct3d11.c;h=e9fcb83dcabfe778f26e63d19f218caf06a7c3ae;hb=HEAD#l1482
http://git.videolan.org/?p=vlc.git;a=blob;f=modules/codec/avcodec/d3d11va.c;h=85e7d25caebc059a9770da2ef4bb8fe90816d76d;hb=HEAD#l599

Merges Libav commit cfc9e7c94e.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-06-27 18:05:02 +02:00
wm4
8d7fdba7b8 dxva: support DXGI_FORMAT_420_OPAQUE decoding
Some devices (some phones, apparently) will support only this opaque
format. Of course this won't work with CLI, because copying data
directly is not supported.

Automatic frame allocation (setting AVCodecContext.hw_device_ctx) does
not support this mode, even if it's the only supported mode. But since
opaque surfaces are generally less useful, that's probably ok.

Merges Libav commit 5030e3856c.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-06-27 18:05:02 +02:00
wm4
6f5ff3269b hwcontext_d3d11va: allocate staging texture lazily
Makes dealing with formats that can not be used for staging textures
easier (DXGI_FORMAT_420_OPAQUE). It also saves memory if the staging
texture is never needed, so this is a good thing.

Merges Libav commit 98d73e4174.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-06-27 18:05:02 +02:00
wm4
1509d739a0 hwcontext_d3d11va: fix crash on frames_init failure
It appears in this case, frames_ininit is called twice (once by
av_hwframe_ctx_init(), and again by unreffing the frames ctx ref).

Merges Libav commit 086321c612.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-06-27 18:05:02 +02:00
Martin Storsjö
3125a4a8a8 d3d11va: Link directly to dxgi.dll and d3d11.dll functions if LoadLibrary is unavailable
When targeting the UWP API subset, the LoadLibrary function is not
available (and the fallback, LoadPackagedLibrary, can't be used to
load system DLLs). In these cases, link directly to the functions
in the DLLs instead of trying to load them dynamically at runtime.

Merges Libav commit fd1ffa1f10.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-27 18:05:02 +02:00
wm4
70143a3954 dxva: add support for new dxva2 and d3d11 hwaccel APIs
This also adds support to avconv (which is trivial due to the new
hwaccel API being generic enough).

The new decoder setup code in dxva2.c is significantly based on work by
Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites.

Merges Libav commit f9e7a2f95a.
Also adds untested VP9 support.
The check for DXVA2 COBJs is removed. Just update your MinGW to
something newer than a 5 year old release.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-27 18:05:02 +02:00
wm4
3303511f33 lavu: add new D3D11 pixfmt and hwcontext
To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the
decoder (other than the required dimension and format). The old D3D11VA
pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the
decoder configuration, and thus is incompatible with the new hwaccel
API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D
and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme <robux4@gmail.com>, but with
heavy changes/rewrites.

Merges Libav commit fff90422d1.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-27 18:05:02 +02:00