1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

4753 Commits

Author SHA1 Message Date
Mark Thompson
193e43e619 hwcontext_vaapi: Fix frames context creation with external attributes 2018-02-21 23:38:10 +00:00
Mark Thompson
fabcbfba38 hwcontext_vaapi: Add more surface formats
Adds YUV 4:1:1, 4:4:0 and 4:4:4 - these will be needed for JPEG decoding.
2018-02-21 23:38:10 +00:00
Michael Niedermayer
ab6f571ef7 avutil/common: Fix integer overflow in av_clip_uint8_c() and av_clip_uint16_c()
Fixes: 5567/clusterfuzz-testcase-minimized-5769966247739392
Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-02-17 15:56:55 +01:00
James Almer
8a8d0b319a avutil/crypto: change length parameter to size_t on the remaining modules
See 651ee93461
fcc4ed1efa

Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-15 11:21:28 -03:00
wm4
474194a8d0 avutil/opt: remove ABI hacks
These were needed for ABI compatibility with Libav. We don't need them
anymore.
2018-02-13 04:46:04 +01:00
James Almer
35347e7e9b Merge commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906'
* commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906':
  Drop some unnecessary config.h #includes

Merged-by: James Almer <jamrial@gmail.com>
2018-02-11 23:08:48 -03:00
James Almer
0a320f7e7a Merge commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935'
* commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935':
  hwcontext: Fix memory leak on derived frame allocation failure

Merged-by: James Almer <jamrial@gmail.com>
2018-02-11 22:50:57 -03:00
Diego Biurrun
4cf84e254a Drop some unnecessary config.h #includes 2018-02-06 10:03:15 +01:00
Mark Thompson
2eb396b175 hwcontext: Fix memory leak on derived frame allocation failure 2018-02-04 13:47:25 +00:00
Jun Zhao
96e476cc9d hwcontext: Fix documentation for av_hwdevice_ctx_alloc()
From ffmpeg commit 9365dfcbf6.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-02-04 13:47:19 +00:00
Mark Thompson
8e9be8ffba Merge commit '85e10c0a9321bfe0d2afe0f3983ab6a8df6e3fba'
* commit '85e10c0a9321bfe0d2afe0f3983ab6a8df6e3fba':
  intreadwrite: Use __unaligned in MSVC for ARM64 as well

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-01-25 22:45:45 +00:00
Jacob Trimble
9f07cf7c00 avutil/aes_ctr: Add method to set 16-byte IV.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-23 21:48:31 +01:00
Henrik Gramner
6f62b0bd4f x86inc: Drop cpuflags_slowctz 2018-01-20 19:23:37 +01:00
Henrik Gramner
eb5f063e7c x86inc: Correctly set mmreg variables 2018-01-20 19:23:37 +01:00
Henrik Gramner
6b6edd1216 x86inc: Support creating global symbols from local labels
On ELF platforms such symbols needs to be flagged as functions with the
correct visibility to please certain linkers in some scenarios.
2018-01-20 19:23:37 +01:00
Henrik Gramner
9e4b3675f2 x86inc: Use .rdata instead of .rodata on Windows
The standard section for read-only data on Windows is .rdata. Nasm will
flag non-standard sections as executable by default which isn't ideal.
2018-01-20 19:23:37 +01:00
Henrik Gramner
3a02cbe3fa x86inc: Enable AVX emulation for floating-point pseudo-instructions
There are 32 pseudo-instructions for each floating-point comparison
instruction, but only 8 of them are actually valid in legacy-encoded mode.
The remaining 24 requires the use of VEX-encoded (v-prefixed) instructions
and can therefore be disregarded for this purpose.
2018-01-20 19:23:37 +01:00
Mark Thompson
d204b7ff61 Merge commit 'e23190269fb6e8217d080918893641ba3e0e3556'
* commit 'e23190269fb6e8217d080918893641ba3e0e3556':
  lavu/qsv: add log message for libmfx version

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-01-16 22:57:02 +00:00
Martin Storsjö
85e10c0a93 intreadwrite: Use __unaligned in MSVC for ARM64 as well
This attribute is supported for this architecture in MSVC as well
(but produces errors if used for 32 bit x86).

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-01-16 22:52:11 +02:00
wm4
27b9f82e2c hwcontext_d3d11va: implement av_hwdevice_get_hwframe_constraints()
D3D11 has rather fine grained per format capabilities for different uses
that can be queried at runtime. Since we don't know what the user wants
to do with the formats when av_hwdevice_get_hwframe_constraints() is
called, we simply return all formats that have the most basic support.
2018-01-16 17:40:24 +01:00
wm4
cbbb206734 hwcontext_vdpau: implement av_hwdevice_get_hwframe_constraints()
In addition, this does not allow creating frames contexts with sw_format
for which no known transfer formats exist. In theory, we should check
whether the chroma format (i.e. the sw_format) is supported at all by
the vdpau driver, but checking for transfer formats has the same effect.

Note that the pre-existing code adds 1 to priv->nb_pix_fmts[i] for
unknown reason, and some checks need to account for that to check for
empty lists. They are not off-by-one errors.
2018-01-15 12:37:30 +01:00
James Almer
ef21033c32 avutil/mastering_display_metadata: fix copyright header wrongly formated as doxy
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-11 11:35:51 -03:00
Anton Khirnov
89b84cb18b It has been replaced by C11 stdatomic.h and is now unused.
(cherry picked from commit 5cc0057f49)
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 14:06:02 -03:00
James Almer
8d9c9775b2 avutil/log: use thread wrappers for the locking functionality
w32threads and os2threads both support static mutex initialization now,
so don't limit it to pthreads only.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-04 15:22:19 -03:00
wm4
18fbfd7bf8 hwcontext_dxva2: initialize D3DDISPLAYMODEEX correctly 2018-01-04 15:52:46 +01:00
Humberto Ribeiro
59b126f922 libavutil/hwcontext_dxva2: Add check for possible errors from GetAdapterDisplayModeEx
This prevents a possible crash in CreateDeviceEx when using faulty
response from GetAdapterDisplayModeEx and allows ffmpeg to fallback to
classic d3d9.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
2018-01-04 15:41:40 +01:00
Carl Eugen Hoyos
695b1d8111 lavu/mem: Allow allocations close to max_alloc_size with av_fast_realloc(). 2018-01-04 05:39:18 +01:00
Carl Eugen Hoyos
21b5990da4 lavu/mem: Do not realloc in av_fast_realloc() if size == min_size.
This can avoid OOM for min_size close to FFmpeg's arbitrary alloc limits.
2018-01-01 22:30:22 +01:00
Zhong Li
e23190269f lavu/qsv: add log message for libmfx version
It is benefit to diagnose issues related to different libmfx version.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-12-29 16:12:16 +00:00
wm4
a04c2c707d lavc: replace and deprecate the lock manager
Use static mutexes instead of requiring a lock manager. The behavior
should be roughly the same before and after this change for API users
which did not set the lock manager at all (except that a minor memory
leak disappears).
2017-12-26 02:50:00 +01:00
wm4
9b121dfc32 w32pthreads: always use Vista+ API, drop XP support
This removes the XP compatibility code, and switches entirely to SWR
locks, which are available starting at Windows Vista.

This removes CRITICAL_SECTION use, which allows us to add
PTHREAD_MUTEX_INITIALIZER, which will be useful later.

Windows XP is hereby not a supported build target anymore. It was
decided in a project vote that this is OK.
2017-12-26 02:49:48 +01:00
James Almer
90d216cb90 x86inc: set the correct amount of simd regs in x86_64 when avx512 is enabled but not used
Fixes compilation of libavresample/x86/audio_mix.asm

Reviewed-by: Gramner
Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-24 23:02:54 -03:00
Henrik Gramner
f7197f68dc x86inc: AVX-512 support
AVX-512 consists of a plethora of different extensions, but in order to keep
things a bit more manageable we group together the following extensions
under a single baseline cpu flag which should cover SKL-X and future CPUs:
 * AVX-512 Foundation (F)
 * AVX-512 Conflict Detection Instructions (CD)
 * AVX-512 Byte and Word Instructions (BW)
 * AVX-512 Doubleword and Quadword Instructions (DQ)
 * AVX-512 Vector Length Extensions (VL)

On x86-64 AVX-512 provides 16 additional vector registers, prefer using
those over existing ones since it allows us to avoid using `vzeroupper`
unless more than 16 vector registers are required. They also happen to
be volatile on Windows which means that we don't need to save and restore
existing xmm register contents unless more than 22 vector registers are
required.

Big thanks to Intel for their support.
2017-12-24 22:02:41 +01:00
James Darnley
e2218ed8ce avutil: add alignment needed for AVX-512 2017-12-24 22:02:41 +01:00
James Darnley
4783a01c11 avutil: detect when AVX-512 is available 2017-12-24 22:02:41 +01:00
James Darnley
8b81eabe57 avutil: add AVX-512 flags 2017-12-24 22:02:41 +01:00
Carl Eugen Hoyos
9b79c65ec0 lavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT. 2017-12-17 18:05:42 +01:00
Aman Gupta
e4d9f05ca7 lavu/hwcontext: add AV_HWDEVICE_TYPE_MEDIACODEC
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-12-16 00:52:00 +01:00
Andrew D'Addesio
9b45bcf713 libavutil: Add saturating subtraction functions
Add av_sat_sub32 and av_sat_dsub32 as the subtraction analogues to
av_sat_add32/av_sat_dadd32.

Also clarify the formulas for dadd32/dsub32.

Signed-off-by: Andrew D'Addesio <modchipv12@gmail.com>
2017-12-04 07:28:45 +00:00
Thomas Köppe
53c492640c avutil/mem: Add DECLARE_ASM_ALIGNED macro for DJGPP architecture.
The macro was added in 43171a2a73, but I forgot to add it to the DJGPP architecture in that change.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-02 19:14:09 +01:00
Martin Vignali
b37196adff avutil/x86util : add macro for loading a 128 bits constants in an xmm or in each part of an ymm in order to simplify avx2 asm func 2017-12-02 18:25:15 +01:00
James Almer
d268094f88 Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'
* commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa':
  stereo3d: Support view type for frame sequence type

Merged-by: James Almer <jamrial@gmail.com>
2017-11-29 21:06:49 -03:00
Vittorio Giovara
99e9697e3a stereo3d: Support view type for frame sequence type
Implement detection in h264 and hevc and insertion in framepack filter.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-11-28 14:56:51 -05:00
Rodger Combs
1204ce0b63 lavu/hwcontext_opencl.h: fix build on macOS 2017-11-28 00:23:42 -06:00
Mark Thompson
6e0e3e1d8d hwcontext_vaapi: Do not assume that sw_format is transferable
Drivers can support a format for surfaces without also supporting it for
images, so we can't assume that sw_format is usable for transfer.  This
would previously hit an assert in cases where it isn't.
2017-11-26 15:40:24 +00:00
Jan Ekström
f6d49a0dc8 hwcontext_d3d11va: properly reset values after release/close
Makes the uninit function re-entrable, which can be a common case
when an API user first tries to initialize its context, fails, and
then finally unrefs the AVHWDevice.

Fixes a crash reported by sm2345 on IRC.
2017-11-25 18:51:41 +02:00
Mark Thompson
f4e319d8a9 hwcontext_opencl: Reset internal command queue on device_uninit
device_uninit can be called twice if device_init fails.
2017-11-25 15:44:31 +00:00
Mark Thompson
8bbf2dacbf hwcontext_d3d11: Log adapter details on device creation
This is helpful to know what device has actually been used.
2017-11-25 15:44:31 +00:00
Mark Thompson
e1d1924427 lavu/pixfmt: Remove gap in the middle of enum AVPixelFormat
This was added for compatibility with libav, by leaving a space for
formats added in libav to be merged.  Since that feature has been
removed, we don't need a gap here.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-25 14:42:10 +00:00
Mark Thompson
3650cb2dfa lavu,lavfi,ffmpeg: Remove experimental OpenCL API
This was added in early 2013 and abandoned several months later; as far as
I can tell, there are no external users.  Future OpenCL use will be via
hwcontext, which requires neither special OpenCL-only API nor global state
in libavutil.

All internal users are also deleted - this is just the unsharp filter
(replaced by unsharp_opencl, which is more flexible) and the deshake filter
(no replacement).
2017-11-22 23:20:39 +00:00