Mark Thompson [Sat, 18 Nov 2017 17:55:18 +0000 (17:55 +0000)]
vp8: Add hwaccel hooks
Also adds some extra fields to the main context structure that may
be needed by a hwaccel decoder.
The current behaviour of the WebP decoder is maintained by adding an
additional field to the VP8 decoder private context to indicate that
it is actually being used as WebP (no hwaccel is supported for that
case).
Mark Thompson [Wed, 25 Oct 2017 23:18:45 +0000 (00:18 +0100)]
lavc: Remove register mechanism for hwaccels
There is no longer any need for a list of them at runtime, because
decoders now carry the pointers to their associated hwaccels internally.
The file containing external declarations is now used to make the list
of hwaccels for configure.
Mark Thompson [Wed, 25 Oct 2017 23:18:43 +0000 (00:18 +0100)]
lavc: Use hardware config information in ff_get_format()
This removes the dependency that hardware pixel formats previously had on
AVHWAccel instances, meaning only those which actually do something need
exist after this patch.
Also updates avcodec_default_get_format() to be able to choose hardware
formats if either a matching device has been supplied or no additional
external configuration is required, and avcodec_get_hw_frames_parameters()
to use the hardware config rather than searching the old hwaccel list.
The FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS mechanism is deleted because it
no longer does anything (the codec already contains the pointers to the
matching hwaccels).
Mark Thompson [Wed, 25 Oct 2017 23:18:40 +0000 (00:18 +0100)]
lavc: Add hardware config metadata for decoders supporting hardware output
This includes a pointer to the associated hwaccel for decoders using
hwaccels - these will be used later to implement the hwaccel setup
without needing a global list.
Also added is a new file listing all hwaccels as external declarations -
this will be used later to generate the hwaccel list at configure time.
avcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*
Fixes: runtime error: signed integer overflow: -2143827186 - 7404944 cannot be represented in type 'int' Fixes: 4354/clusterfuzz-testcase-minimized-4671122764201984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Mark Thompson [Fri, 24 Nov 2017 00:21:26 +0000 (00:21 +0000)]
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.
Jan Ekström [Fri, 24 Nov 2017 00:44:44 +0000 (02:44 +0200)]
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.
Mikulas Patocka [Thu, 23 Nov 2017 19:12:55 +0000 (20:12 +0100)]
avcodec/fft: fix INTERL macro on 3dnow
The commit b7c16a3f2c4921f613319938b8ee0e3d6fa83e8d ("x86: fft: Port to
cpuflags") breaks the opus decoder in ffmpeg when compiling for 3dnow. The
output is audible, but there's a lot of noise.
The reason for the breakage is that the commit unintentionally changed the
INTERL macro so that it is empty when compiling for 3dnow. This patch
fixes it.
Signed-off-by: Mikulas Patocka <mikulas@twibright.com> Signed-off-by: James Almer <jamrial@gmail.com>
Mark Thompson [Fri, 24 Nov 2017 12:36:09 +0000 (12:36 +0000)]
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>
Mikulas Patocka [Thu, 23 Nov 2017 19:22:56 +0000 (20:22 +0100)]
ffmpeg libopusdec: fix missing include file in libopusdec.c
This patch fixes the following error when compiling mplayer with libopus.
libavcodec/libopusdec.c: In function 'libopus_decode_init':
libavcodec/libopusdec.c:130:27: error: implicit declaration of function 'ff_exp10'; did you mean 'ff_exp2fi'? [-Werror=implicit-function-declaration]
double gain_lin = ff_exp10(gain_db / (20.0 * 256));
^~~~~~~~
ff_exp2fi
Signed-off-by: Mikulas Patocka <mikulas@twibright.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Fixes: signed integer overflow: 2147483598 + 64 cannot be represented in type 'int' Fixes: 4337/clusterfuzz-testcase-minimized-6192658616680448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Philip Langdale [Fri, 24 Nov 2017 18:05:49 +0000 (10:05 -0800)]
avcodec/nvdec: Round up odd width/height values
nvdec will not produce odd width/height output, and while this is
basically never an issue with most codecs, due to internal alignment
requirements, you can get odd sized jpegs.
If an odd-sized jpeg is encountered, nvdec will actually round down
internally and produce output that is slightly smaller. This isn't
the end of the world, as long as you know the output size doesn't
match the original image resolution.
However, with an hwaccel, we don't know. The decoder controls
the reported output size and the hwaccel cannot change it. I was
able to trigger an error in mpv where it tries to copy the output
surface as part of rendering and triggers a cuda error because
cuda knows the output frame is smaller than expected.
To fix this, we can round up the configured width/height passed
to nvdec so that the frames are always at least as large as the
decoder's reported size, and data can be copied out safely.
In this particular jpeg case, you end up with a blank (green) line
at the bottom due to nvdec refusing to decode the last line, but
the behaviour matches cuviddec, so it's as good as you're going to
get.
Li, Zhong [Fri, 10 Nov 2017 08:03:42 +0000 (03:03 -0500)]
qsv/hevcdec: Load hw plugin by default on non-windows os
Software plugin is not available on Linux, Only works on Windows.
Similar changes have been applied to qsv hevc encoder by b05128f3c953bd66483e697d60a2e7e45ee9cfa0.
Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
Mark Thompson [Tue, 14 Nov 2017 19:47:30 +0000 (19:47 +0000)]
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).
Mark Thompson [Tue, 14 Nov 2017 19:47:27 +0000 (19:47 +0000)]
lavfi: Add OpenCL unsharp mask filter
Intended to replace existing opencl mode of the unsharp filter.
Supports many more pixel formats and works without immediate upload
and download of frame data. The options are compatible with the
existing filter.
Mark Thompson [Sun, 10 Sep 2017 12:37:20 +0000 (13:37 +0100)]
hwcontext_opencl: DRM to OpenCL mapping for ARM
Using cl_arm_import_memory. Unfortunately, despite this not being a
standard extension, the function clImportMemoryARM() is not accessible
via clGetExtensionFunctionAddressForPlatform(). This means that it has
to be linked directly to the ARM OpenCL binary, so making a portable
binary is not possible as it is with all other mapping extensions.
Jim DeLaHunt [Wed, 15 Nov 2017 08:43:30 +0000 (00:43 -0800)]
doc: Add FAQs about running in background (rev 2)
Add two FAQs about running FFmpeg in the background.
The first explains the use of the -nostdin option in
a straightforward way. Text revised based on review.
The second FAQ starts from a confusing error message,
and leads to the solution, use of the -nostdin option.
The purpose of the second FAQ is to attract web searches
from people having the problem, and offer them a solution.
Add an anchor to the Main Options section of the ffmpeg
documentation, so that the FAQs can link directly there.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Dale Curtis [Tue, 21 Nov 2017 23:40:22 +0000 (15:40 -0800)]
avformat/mov: Increment stsd_count while processing stsd data; avoids leaks.
In the event of ff_mov_read_stsd_entries() failure, sc->stsd_count
is not updated, even if the function allocates extradata memory.
Instead update the sc->stsd_count as entries are parsed so that
mov_read_close() can do the right thing.
Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
avcodec/jpeg2000: Dynamically allocate codeblock data
Fixes: OOM Fixes: 3541/clusterfuzz-testcase-minimized-6469958596820992
Adds support for decoding codeblock data larger than 8kb
Reduces decoder memory consumption
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>