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

39848 Commits

Author SHA1 Message Date
Rostislav Pehlivanov
fdbd261967 lavc/Makefile: fix opus_parser dependencies
Fix suggested by RiCON.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-01 19:56:37 +00:00
Michael Niedermayer
903be5e4f6 avcodec/exr: Check buf_size more completely
Fixes: Out of heap array read
Fixes: 4683/clusterfuzz-testcase-minimized-6152313673613312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-30 21:02:49 +01:00
Rostislav Pehlivanov
51027d0b8b opus: merge encoder and decoder bitallocation functions into one
There's no difference apart from which entropy coding functions get called.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-12-30 17:05:23 +00:00
Michael Niedermayer
3d23f7a096 avcodec/flacdec: Fix overflow in multiplication in decode_subframe_fixed()
Fixes: signed integer overflow: 2 * 1629495328 cannot be represented in type 'int'
Fixes: 4716/clusterfuzz-testcase-minimized-5835915940331520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Michael Niedermayer
d135f3c514 avcodec/hevcdsp_template: Fix Invalid shifts in put_hevc_qpel_bi_w_h() and put_hevc_qpel_bi_w_w()
Fixes: left shift of negative value -1
Fixes: 4690/clusterfuzz-testcase-minimized-6117482428366848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Michael Niedermayer
560daf8891 avcodec/flacdec: avoid undefined shift
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
Fixes: 4688/clusterfuzz-testcase-minimized-6572210748653568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Carl Eugen Hoyos
658bdc6771 lavc/jpeg2000dec: Support reading 64-bit atom size.
Fixes ticket #6935.
2017-12-28 02:58:56 +01:00
James Almer
2f96190732 Merge commit 'c6558e8840fbb2386bf8742e4d68dd6e067d262e'
* commit 'c6558e8840fbb2386bf8742e4d68dd6e067d262e':
  x264: Support version 153

See
2a111c99a6
7e60c74329

Merged-by: James Almer <jamrial@gmail.com>
2017-12-27 21:11:10 -03:00
Luca Barbato
c6558e8840 x264: Support version 153
It has native simultaneus 8 and 10 bit support.
2017-12-27 15:59:45 +00:00
wm4
8f9024f2ca lavc: remove uneffective attribute_deprecated on enum
Does not work. Even emits a warning with some compilers that the
attribute does not work on enums. It's likely that there is way to make
it work, but not worth the trouble.
2017-12-27 03:47:28 +01:00
James Almer
7e60c74329 avcodec/libx264: set supported pix_fmts at runtime rather than build time
This partially reverts a change in behavior introduced in 2a111c99a6.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-26 19:41:04 -03:00
Mark Thompson
e6a1dfc9ce mpeg4videodec: Fix unused variable warning
video_format is not used.
2017-12-26 17:25:46 +00:00
Michael Niedermayer
0c9ab5ef9c avcodec/hevcdsp_template.c: Fix undefined shift in FUNC(dequant)
Fixes: runtime error: left shift of negative value -180
Fixes: 4626/clusterfuzz-testcase-minimized-5647837887987712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-26 18:05:10 +01:00
Michael Niedermayer
4d70fbeec8 avcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD97iH0() and COMPOSE_DD137iL0()
Fixes: runtime error: signed integer overflow: 2147483646 + 33554433 cannot be represented in type 'int'
Fixes: 4563/clusterfuzz-testcase-minimized-5438979567517696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-26 18:05:10 +01:00
James Almer
2a111c99a6 avcodec/libx264: fix compilation with x264 builds >= 153
x264 now supports multibitdepth builds, with a slightly changed API to
request bitdepth during initialization.

Reviewed-by: Ricardo Constantino <wiiaboo@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-26 11:57:01 -03:00
James Almer
89f704caba avcodec/libx264: use the pixfmt descriptor to check for high bit depths
The x264_bit_depth constant has been removed in newer x264 builds.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-25 23:18:41 -03:00
wm4
cf57cb3ae4 h264: add AVOption to set x264_build default
This provides a generic way to the API user to deal with files that
either lack this SEI, or which have the SEI only in packets not passed
to the decoder (such as the common case of the SEI being in the very
firsat video packet, but decoding is started somewhere in the middle of
the file). Bugs like 840b41b2a6 make this
somewhat of a necessity.

This intentionally uses the version in the SEI instead, if any is found.
2017-12-26 02:56:09 +01:00
wm4
4ed66517c6 lavc: remove complex debug code around avcodec init locking
This is just a lot of complicated and confusing code that had no purpose
anymore.

Also, the functions return values were checked only sometimes. Locking
shouldn't fail anyway, so remove the return values. Barely any other
pthread lock calls check the return value (including more important code
that is more likely to fail horribly if locking fails).

It could be argued that it might be helpful in some debugging
situations, or when the user built FFmpeg without thread support against
all good advice.

But there are dummy atomics too, so the atomic check won't help with
ensuring correctness absolutely. You gain very little.

Also, for debugging, you can just raise the ASSERT_LEVEL, and then
libavutil/thread.h will redefine the locking functions to explicitly
check the return values.
2017-12-26 02:50:00 +01:00
wm4
86a13bf2ff lavc, lavf: move avformat static mutex from avcodec to avformat
It's completely absurd that libavcodec would care about libavformat
locking, but it was there because the lock manager was in libavcodec.

This is more stright forward. Changes ABI, but we don't require ABI
compatibility currently.
2017-12-26 02:50:00 +01: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 Darnley
8f86e66238 avcodec: add stride alignment needed for AVX-512 2017-12-24 22:02:41 +01:00
Michael Niedermayer
80344959f0 avcodec/jpeg2000dec: Free lengthinc earlier
Reduces memory needed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-21 19:48:41 +01:00
Michael Niedermayer
4b2a186ef0 avcodec/mpeg4videodec: Add support for parsing and exporting video_range
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-21 19:48:41 +01:00
Michael Niedermayer
42274db1c6 avcodec/jpeg2000dec: Allocate lengthinc and data_start arrays as needed
Decreases memory requirements
Fixes: OOM
Fixes: 4525/clusterfuzz-testcase-minimized-6400713073623040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-21 19:48:41 +01:00
wm4
1083859cb8 rkmppdec: move AV_CODEC_CAP_AVOID_PROBING to the correct field
AVCodec.caps_internal doesn't hold this field.

(Untested.)
2017-12-21 18:50:49 +01:00
wm4
55eebf2a11 v4l_m2m: add missing AV_CODEC_CAP_DELAY flags
This is pretty much a requirement for any codec that handles modern
codecs like h264, but it was missing. Potentially could lead to issues
like missing frames at the end of a stream.

Tested-by: Jorge Ramirez <jorge.ramirez-ortiz@linaro.org>
2017-12-21 18:49:29 +01:00
sfan5
05c1c79d37 libavcodec/hevcdec: implement skip_frame
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-20 22:26:31 +01:00
Martin Storsjö
2beba58e0e mmaldec: Fix compilation after 2fcb0090
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-12-20 10:11:27 +02:00
Mark Thompson
2117725dc5 lavc: Mark all AVHWAccel structures as const 2017-12-19 23:24:24 +00:00
Mark Thompson
2a4d34d462 lavc: Delete all fake hwaccels
They are now unused.
2017-12-19 23:22:35 +00:00
Mark Thompson
433522a1b9 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-12-19 23:22:35 +00:00
Mark Thompson
e2d575543c lavc: Deprecate av_hwaccel_next() and av_register_hwaccel() 2017-12-19 23:22:31 +00:00
Mark Thompson
39056b5240 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.
2017-12-19 23:21:59 +00:00
Mark Thompson
57623cba13 webp: Fix alpha initialisation
ff_get_format() in the next patch will reject formats which aren't in the
offered list, so the hack in 7cb9296db8 is
no longer valid.  Change the hack by adding a new field in the VP8 decoder
context to indicate that it's actually WebP and don't call ff_get_format()
at all in that case.
2017-12-19 23:21:59 +00:00
Mark Thompson
2fcb009011 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-12-19 23:21:59 +00:00
Mark Thompson
720cf4e6e7 lavc: Add codec metadata to indicate hardware support 2017-12-19 23:21:53 +00:00
Jun Zhao
a31a482611 lavc/vaapi_encode: give a debug message if attrs unsupported.
Give a debug message when query attribute get VA_ATTRIB_NOT_SUPPORTED,
it's will help to trace and debug some issue.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-12-19 23:02:31 +00:00
Martin Vignali
c76cf303ce avcodec/magicyuv : use gradient_pred dsp func for 8 bits gradient mode 2017-12-19 20:55:12 +01:00
Martin Vignali
f2e9156eb6 avcodec/utvideodec : use gradient_pred dsp in interlace decoding 2017-12-19 20:55:08 +01:00
Aurelien Jacobs
3f88744067 aptx: add codec cap SMALL_LAST_FRAME and INIT_THREADSAFE as appropriate 2017-12-18 01:07:00 +00: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
Michael Niedermayer
0ee143558d avcodec/hevc_cabac: Fix integer overflow in ff_hevc_cu_qp_delta_abs()
Fixes: signed integer overflow: 2147483647 + 1073741824 cannot be represented in type 'int'
Fixes: 4555/clusterfuzz-testcase-minimized-4505532481142784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-17 02:09:31 +01:00
Michael Niedermayer
991ef6e5b9 avcodec/hevc_sei: Fix integer overflows in decode_nal_sei_message()
Fixes: signed integer overflow: 2147483520 + 255 cannot be represented in type 'int'
Fixes: 4554/clusterfuzz-testcase-minimized-4843714515042304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-17 02:09:31 +01:00
Michael Niedermayer
439fbb9c8b avcodec/hevcdsp_template: Fix undefined shift in put_hevc_qpel_bi_w_hv()
Fixes: runtime error: left shift of negative value -3
Fixes: 4524/clusterfuzz-testcase-minimized-6055590120914944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-17 02:09:31 +01:00
Martin Vignali
ee2dfa34a2 libavcodec/magicyuvenc : fix warning 2017-12-16 14:21:07 +01:00
Matthieu Bouron
1f1207145a lavc/mediacodec_wrapper: fix potential jni global reference leak 2017-12-16 00:52:28 +01:00
Matthieu Bouron
f3cffd121b lavc/mediacodec_wrapper: factorize MediaCodec creation functions 2017-12-16 00:52:28 +01:00
Aman Gupta
8bf4e6d3ce lavc/mediacodec: use AVMediaCodecDeviceContext hw_device_ctx if set
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-12-16 00:52:27 +01:00
Jun Zhao
d228d52f1c lavc/vp8: Support resolution changes in the VP8 decoder hwaccel
Use the following command to reproduce this issue:
make fate-vp8-size-change HWACCEL="vaapi -vaapi_device \
/dev/dri/renderD128 -hwaccel_output_format yuv420p"
SAMPLES=../fate-suite/.

At the same time, reconstruct the public logic as a function.

Signed-off-by: Yun Zhou <yunx.z.zhou@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-12-15 16:52:32 +00:00