1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00
Commit Graph

39708 Commits

Author SHA1 Message Date
Philip Langdale
0e93694e64 avcodec/nvdec: More effort to make vp8 compile with gcc < 4.6
I'm told my prefix work-around wasn't enough to make it compile,
although I'm not sure why; I did some basic testing and that
approach appeared to work, but I'm not in a position to do a
full compile on CentOS 6 so I can't be sure of anything.

I have had it confirmed that the additional change to not use
named initialisers is enough to make it compile, so let's
throw that into the mix too.
2017-11-26 22:21:12 -08:00
Philip Langdale
b93d96a07b avcodec/nvdec: Make vp8 initialisation more 'compatible'
Ancient versions of gcc (pre 4.6) can't directly initialise
members of anonymous inner unions/structs by name.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676

Unfortunately, RHEL 6 shipped with one of these ancient
versions and so we're stuck with it until approximately the
heat death of the universe.

Putting explicit braces into the initialisation is possibly a
work-around but the behaviour there was never fully understood
before direct initialisation was made to work.

So, this may or may not work.
2017-11-26 20:52:38 -08:00
Michael Niedermayer
97c00edaa0 avcodec/mlpdsp: Fix signed integer overflow, 2nd try
The outputted bits should match what is used in the lossless check

Fixes: runtime error: signed integer overflow: -538697856 * 256 cannot be represented in type 'int'
Fixes: 4326/clusterfuzz-testcase-minimized-5689449645080576

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-27 03:31:54 +01:00
Michael Niedermayer
9cc926da7d avcodec/h264idct_template: Fix integer overflow in ff_h264_idct8_add
Fixes: signed integer overflow: 452986184 - -2113885312 cannot be represented in type 'int'
Fixes: 4196/clusterfuzz-testcase-minimized-5580648594014208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-27 03:31:53 +01:00
Michael Niedermayer
3aad94bf2b avcodec/kgv1dec: Check that there is enough input for maximum RLE compression
Fixes: Timeout
Fixes: 4271/clusterfuzz-testcase-4676667768307712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-27 03:31:53 +01:00
James Almer
1eee394c7c avcodec/vc1dec: fix preprocessor checks and hw_configs lists for the hwaccels
Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-26 22:22:17 -03:00
James Almer
921d7af6e9 avcodec/mpeg4videodec: fix preprocessor check for the nvdec hwaccel
Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-26 22:21:20 -03:00
Philip Langdale
1da9851e34 avcodec/nvdec: Implement vp8 hwaccel 2017-11-26 14:55:01 -08:00
Mark Thompson
f69e9365f6 vaapi_decode: Ignore the profile when not useful
Enables VP8 decoding - the decoder places the the bitstream version
in the profile field, which we want to ignore.
2017-11-26 21:41:19 +00:00
Mark Thompson
40b75a943b vaapi: Add VP8 decode hwaccel 2017-11-26 21:41:19 +00:00
Mark Thompson
9f00fa5369 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).
2017-11-26 21:41:19 +00:00
Mark Thompson
efd0612fdc vaapi: Make the decode profile matching more explicit
Also fixes a bug where it could attempt to decode with an unsupported
codec if allow-profile-mismatch was set.
2017-11-26 21:41:19 +00:00
Mark Thompson
3a71bcc213 lavc: Mark all AVHWAccel structures as const 2017-11-26 21:41:19 +00:00
Mark Thompson
da4e02b196 lavc: Delete all fake hwaccels
They are now unused.
2017-11-26 21:41:14 +00:00
Mark Thompson
9bd326ac46 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.
2017-11-26 21:36:34 +00:00
Mark Thompson
3536a3efb9 lavc: Deprecate av_hwaccel_next() and av_register_hwaccel() 2017-11-26 21:36:31 +00:00
Mark Thompson
67e81d79cc 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).
2017-11-26 21:35:53 +00:00
Mark Thompson
758fbc54fe 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.
2017-11-26 21:35:53 +00:00
Mark Thompson
24cc0a53e9 lavc: Add codec metadata to indicate hardware support 2017-11-26 21:35:49 +00:00
Michael Niedermayer
2b6964f764 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>
2017-11-26 18:35:55 +01:00
Derek Buitenhuis
e7af1394ec vorbisenc: Check the return value of av_frame_clone
Prevents a segfault when alloc fails.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-11-26 17:26:59 +00:00
Mark Thompson
3fbd4fc476 nvenc: Include config.h before checking for D3D11 support
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-11-26 15:40:24 +00:00
Derek Buitenhuis
52a44d50be h264_picture: Actually return error during alloc failure
Fixes NULL dereference during alloc failure.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-11-26 13:37:02 +00:00
Rostislav Pehlivanov
3701d499f8 error_resilience: remove avpriv_atomic usage
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-11-26 02:17:23 +00:00
Rostislav Pehlivanov
590136e78d libavcodec/utils.c: simplify avcodec locking with atomics
Also makes it more robust than using volatiles.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-11-26 02:17:23 +00:00
Rostislav Pehlivanov
3154f4417a lavc/utils.c: use C11 atomics for entangled thread handling
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-11-26 02:17:23 +00:00
Martin Vignali
21c06c4095 avcodec/hapdec : use gray8 for HapAlphaOnly decoding instead of RGB0 2017-11-25 19:49:30 +01:00
Martin Vignali
07e427aa56 avcodec/texturedsp : add rgtc1u gray decoding
decode rgtc1 block in gray8 picture
2017-11-25 19:49:25 +01:00
Mikulas Patocka
fbdd78fa3e avcodec/fft: fix INTERL macro on 3dnow
The commit b7c16a3f2c ("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>
2017-11-25 13:11:45 -03:00
Mark Thompson
b26dd5ae2f Merge commit '136e7cf64ce9e78de7158d6720539d51cb96b743'
* commit '136e7cf64ce9e78de7158d6720539d51cb96b743':
  qsv/hevcdec: Load hw plugin by default on non-windows os

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-11-25 14:38:03 +00:00
Mikulas Patocka
279d2599dd 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>
2017-11-25 02:32:54 +01:00
Michael Niedermayer
12a511f2c2 avcodec/sbrdsp_fixed: Fix integer overflow
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>
2017-11-25 02:32:33 +01:00
Philip Langdale
4186a77f26 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.
2017-11-24 12:19:31 -08:00
Dale Curtis
9648cc6d7f avcodec/vorbis: 1 << 31 > int32_t::max(), so use 1u << 31 instead.
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-24 19:03:03 +01:00
Michael Niedermayer
7c191dfba7 avcodec/j2kenc: Only allocate cblk.data once
Fixes: memleak
Found-by: <jamrial>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-24 04:04:39 +01:00
Martin Vignali
515555af6c avcodec/x86/exrdsp : use ymm constant for pb_80
speed seems to be similar, but simplify code
2017-11-23 20:00:13 +01:00
Li, Zhong
136e7cf64c 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
b05128f3c9.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2017-11-23 12:59:02 +01:00
Rostislav Pehlivanov
6e0723470b opus_pvq: fix crashing on analysis of mono
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-11-23 01:00:08 +00:00
Michael Niedermayer
3d5822d9cf 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>
2017-11-22 13:06:50 +01:00
Michael Niedermayer
0e7865ce41 avcodec/mpeg4videodec: Check also for negative versions in the validity check
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-21 21:24:08 +01:00
James Almer
beb63baa69 x86/utvideodsp: reuse shared constants
Remove the broadcast instructions as well now that they are wide
enough.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-21 10:57:14 -03:00
James Almer
ebf352116b x86/constants: make pb_80 32 byte wide
Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-21 10:57:03 -03:00
Martin Vignali
2053832d1c avcodec/hapdec : add support for hapqa decoding 2017-11-21 12:05:16 +01:00
Martin Vignali
fca8919961 avcodec/hapdec : indent after previous commit 2017-11-21 12:05:10 +01:00
Martin Vignali
518b9ee3d1 avcodec/hapdec : reorganize code before adding multi-texture decoding 2017-11-21 12:05:06 +01:00
Martin Vignali
ba98f8463f avcodec/huffyuvdspenc : add diff_int16 AVX2 func 2017-11-21 09:42:08 +01:00
Martin Vignali
d189a426fa avcodec/huffyuvdspenc : reorganize diff_int16 2017-11-21 09:42:03 +01:00
Martin Vignali
e641c94190 avcodec/huffyuvdsp : add add_int16 AVX2 func 2017-11-21 09:41:58 +01:00
Martin Vignali
6955e8842e avcodec/huffyuvdsp : reorganize add_int16 asm 2017-11-21 09:41:52 +01:00
Martin Vignali
7f9b67bcb6 avcodec/huffyuvdsp(enc) : move duplicate macro to a template file 2017-11-21 09:41:46 +01:00