Mark Thompson [Thu, 28 Jul 2016 22:28:30 +0000 (23:28 +0100)]
hwcontext_vaapi: Try the first render node as the default DRM device
If no string argument is supplied when av_hwdevice_ctx_create() is
called to create a VAAPI device, we currently only try the default
X11 display (that is, $DISPLAY) to find a device, and will therefore
fail in the absence of an X server to connect to. Change the logic
to also look for a device via the first DRM render node (that is,
"/dev/dri/renderD128"), which is probably the right thing to use in
most simple configurations which only have one DRM device.
Ronald S. Bultje [Sat, 23 Nov 2013 15:27:18 +0000 (10:27 -0500)]
vp9: split last/cur_frame from the reference buffers.
We need more information from last/cur_frame than from reference
buffers, so we can use a simplified structure for reference buffers,
and then store mvs and segmentation map information in last/cur.
This prepares the decoder for frame threading support.
Anton Khirnov [Tue, 2 Aug 2016 08:43:39 +0000 (10:43 +0200)]
h264_direct: use the reference mask from the actual reference
Not from the underlying frame. Fixes races with frame threading in
field-coded files, where decoding would wait for the wrong field (e.g.
random failures in mixed-nal-coding).
Anton Khirnov [Wed, 3 Aug 2016 07:51:06 +0000 (09:51 +0200)]
buffer: fix av_buffer_pool_init2() documentation
A non-existent av_buffer_pool_can_uninit() function is mentioned instead
of av_buffer_pool_uninit(). Also, this function is to be called by the
caller, not the pool itself.
Anton Khirnov [Tue, 2 Aug 2016 19:16:44 +0000 (21:16 +0200)]
buffer: fix av_buffer_realloc() when the data is offset wrt buffer start
In such a case behave as if the buffer was not reallocatable -- allocate a
new one and copy the data (preserving just the part described by the
reference passed to av_buffer_realloc).
Since 230b1c070, the bytewise AV_W*() macros only expand their
argument once, i.e. doing exactly the same change as was done
in the AV_COPY*U macros, so this change is no longer necessary.
Martin Storsjö [Mon, 1 Aug 2016 07:04:42 +0000 (10:04 +0300)]
intreadwrite: Use the __unaligned keyword on MSVC for ARM and x86_64
AV_WN64 is meant for unaligned data, but the existing av_alias* unions
(without a definition for the av_alias attribute - we don't have one
for MSVC) indicate to the compiler that they would have sufficient
alignment for normal access, i.e. the compiler is free to assume
8 byte alignment.
On ARM, this makes sure that AV_WN64 (or two consecutive AV_WN32) is
done with two str instructions instead of one strd.
Martin Storsjö [Mon, 1 Aug 2016 06:07:48 +0000 (09:07 +0300)]
intreadwrite: Add intermediate variables in the byteswise AV_W*() macros
This avoids issues with expanding the argument multiple times,
and makes sure that it is of the right type for the following shifts.
Even if the caller of a macro could be expected not to pass parameters
that have side effects if expanded multiple times, these fallback
codepaths are rarely, if ever, tested, so it is expected that such
issues can arise.
Thefore, for safety, make sure the fallback codepaths only expand
the arguments once.
Martin Storsjö [Thu, 28 Jul 2016 11:30:25 +0000 (14:30 +0300)]
libavutil: Use an intermediate variable in AV_COPY*U
If AV_RN and AV_WN are macros with multiple individual reads and
writes, the previous version of the AV_COPYU macro would fail if
the reads and writes overlap.
This should not be any less efficient in any case, given a
sensibly optimizing compiler.
Martin Storsjö [Thu, 28 Jul 2016 10:10:22 +0000 (13:10 +0300)]
Don't use expressions with side effects in macro parameters
AV_WB32 can be implemented as a macro that expands its parameters
multiple times (in case AV_HAVE_FAST_UNALIGNED isn't set and the
compiler doesn't support GCC attributes); make sure not to read
multiple times from the source in this case.
Anton Khirnov [Mon, 25 Jul 2016 11:52:59 +0000 (13:52 +0200)]
mimic: do not release the newly obsolete reference at the end of decoding
The reference frames are used in update_thread_context(), so modifying
them after finish_setup() is a race. The frame in question will be
released during the next decode call.
The valgrind warning was a false positive due to OSX implementation of
printf (invoking a strnlen), while this code is actually fine, since the
format specifier %.*s guarantes that no more than buf_size bytes from
buf will be read.
Martin Storsjö [Mon, 18 Jul 2016 20:25:11 +0000 (23:25 +0300)]
libavutil: Always use some GCC style attributes on clang
Clang normally disguises as GCC (defining __GNUC__), and thus get
all the normal GCC specific attributes.
Clang can also work as a drop-in replacement for MSVC, and in these
cases, it doesn't define __GNUC__, but defines _MSC_VER instead.
Even in these setups, it still supports the GCC style attributes,
thus use them, especially where there isn't any MSVC specific
version, or where the MSVC specific version doesn't work on clang
(for DECLARE_ASM_CONST).
There are samples with invalid stsc that may work fine as is and
do not need extradata change. So ignore any out of range index, and
error out only when explode is set.
Hendrik Leppkes [Sat, 30 Jan 2016 16:44:34 +0000 (17:44 +0100)]
hevc: set profile based on the profile compatibility flags if needed
This fixes retrieving a valid profile for many of the FATE conformance samples,
allowing them to be properly decoded by the HWAccel after adding a profile check.