Commit Graph

85334 Commits

Author SHA1 Message Date
James Almer b8f26779d6 lavf: use the new bitstream filter for extracting extradata
This merges commits 8e2ea69135 and
096a8effa3 by Anton Khirnov, with the
following change:

- extract_extradata_check() is added to know if the codec is supported
by the bsf before trying to initialize it. This behaviour is similar to
the old AVCodecParser.split checks.

The FATE reference changes are due to the filtered out NAL units that
the old AVCodecParser.split implementation left alone.
Decoding is unchanged as the functions that parse extradata simply
ignored said unnecessary NAL units.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-07 17:16:17 -03:00
James Almer 9f102653fd ffmpeg: use av_stream_new_side_data()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-07 16:48:21 -03:00
Paul B Mahol faa94a576f avcodec/utvideodec: add support for gradient prediction
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-07 20:11:23 +02:00
Ronald S. Bultje 2e664b9c1e pthread_frame: make accesses to debug field be protected by owner lock.
The av_log() is done outside the lock, but this way the accesses to the
field (reads and writes) are always protected by a mutex. The av_log()
is not run inside the lock context because it may involve user callbacks
and doing that in performance-sensitive code is probably not a good idea.

This should fix occasional tsan warnings when running fate-h264, like:

WARNING: ThreadSanitizer: data race (pid=10916)
  Write of size 4 at 0x7d64000174fc by main thread (mutexes: write M2313):
    #0 update_context_from_user src/libavcodec/pthread_frame.c:335 (ffmpeg+0x000000df7b06)
[..]
  Previous read of size 4 at 0x7d64000174fc by thread T1 (mutexes: write M2311):
    #0 ff_thread_await_progress src/libavcodec/pthread_frame.c:592 (ffmpeg+0x000000df8b3e)
2017-04-07 13:29:45 -04:00
Ronald S. Bultje 7f05c5cea0 h264: don't re-call ff_h264_direct_ref_list_init() w/ frame-mt.
I'm hoping that this will address the remaining tsan fate-h264 issues:

WARNING: ThreadSanitizer: data race (pid=24478)
  Read of size 8 at 0x7dbc0001c828 by main thread (mutexes: write M3243):
    #0 ff_h264_ref_picture src/libavcodec/h264_picture.c:107 (ffmpeg+0x0000013b78d8)
[..]
  Previous write of size 1 at 0x7dbc0001c82e by thread T2 (mutexes: write M3245):
    #0 ff_h264_direct_ref_list_init src/libavcodec/h264_direct.c:137 (ffmpeg+0x000001382c93)

But I'm not sure because I haven't been able to reproduce locally.
2017-04-07 13:29:45 -04:00
Clément Bœsch 8d94d9798a lavc/mjpegdec: allow failure while decoding APP
Fix decoding frame.jpg from ticket #267

Regression since 9c7ee3749 / 212c6a1d7
2017-04-07 18:05:20 +02:00
James Almer 7c1566fec3 avcodec/tta: Don't try to read more than MIN_CACHE_BITS bits
This fixes assertion failures introduced in 4fbb56acbe.

Reviewed-by: michaelni
Reviewed-by: durandal_1707
2017-04-07 12:52:17 -03:00
Michael Niedermayer 08117a4015 avcodec/h264: Check weight values to be within the specs limits.
Fixes: integer overflows
Fixes: 911/clusterfuzz-testcase-5415105606975488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-07 15:33:17 +02:00
Clément Bœsch 9c7ee37490 Merge commit '212c6a1d70df011b6f2a2aa02f7677503287bd00'
* commit '212c6a1d70df011b6f2a2aa02f7677503287bd00':
  mjpegdec: Check return values of functions that may fail

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-07 10:17:53 +02:00
Clément Bœsch e7326e2980 Merge commit '3ee5f25d37315b27f0e2d47aa69fc445545ee2e3'
* commit '3ee5f25d37315b27f0e2d47aa69fc445545ee2e3':
  dxva2: Adjust printf length modifiers where appropriate

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-07 10:08:53 +02:00
Clément Bœsch 92e532c18f Merge commit '239d02eff3ffe9f7d40caa21dde50fb4a0e94c24'
* commit '239d02eff3ffe9f7d40caa21dde50fb4a0e94c24':
  avisynth: Cast to the right type when loading avisynth library functions

This commit is a noop, we are using dlsym() instead of GetProcAdress().

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-07 10:07:43 +02:00
James Almer 00fb745a10 Merge commit '3fe2a01df7f2c193805809f57b61d79607572351'
* commit '3fe2a01df7f2c193805809f57b61d79607572351':
  lavc: move decoding-related code from utils.c to a new file

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 01:19:56 -03:00
James Almer bd9057e74b Merge commit '328cd2b599bc2d0d38f3c12606fa2a66eeec016e'
* commit '328cd2b599bc2d0d38f3c12606fa2a66eeec016e':
  lavc: move encoding-related code from utils.c to a new file

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:42:38 -03:00
James Almer 51d8a2572f Merge commit '45d199d5b0b7f09eb9baa29929a3bd07ed46223b'
* commit '45d199d5b0b7f09eb9baa29929a3bd07ed46223b':
  aac_adtstoasc_bsf: validate and forward extradata if the stream is already ASC

This commit is a noop, see 6e1902bab4

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:31:19 -03:00
James Almer f27ff5e7c3 Merge commit '1762a39e09a3edc27d1ef7bc50070f496b893aa4'
* commit '1762a39e09a3edc27d1ef7bc50070f496b893aa4':
  mss2: only use error correction for matching block counts

This commit is a noop, see 2566ad98b0

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:29:19 -03:00
James Almer 8d2c6dc355 Merge commit 'd0c84c41d33ffd270d5f9fe0290e08341397fdee'
* commit 'd0c84c41d33ffd270d5f9fe0290e08341397fdee':
  avconv: Fix the audio next dts computation

This commit is a noop.

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:28:14 -03:00
Diego Biurrun b0f67d03c5 ac3enc: Avoid unnecessary macro indirections
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-07 00:25:55 -03:00
James Almer 19e0a67da3 Merge commit 'eb135516e6f61481877163bfc55a3161d4544092'
* commit 'eb135516e6f61481877163bfc55a3161d4544092':
  ac3enc: Avoid unnecessary macro indirections

This commit is a noop.

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:22:04 -03:00
James Almer e7ec8c181f Merge commit 'f0d3e43bd77b3194a28d75884cf83083b188bf30'
* commit 'f0d3e43bd77b3194a28d75884cf83083b188bf30':
  ac3enc: Reshuffle functions to avoid forward declarations

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:19:32 -03:00
James Almer c37e8c0b7f Merge commit 'e22c63ac74b2968075be8bf0d2deb1ee63b28976'
* commit 'e22c63ac74b2968075be8bf0d2deb1ee63b28976':
  ac3enc: Reshuffle some float/fixed-mode ifdefs to avoid a dummy function

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:04:37 -03:00
James Almer bfb2e20737 Merge commit 'd30719e62de68975cbc7ffd318df03a183037563'
* commit 'd30719e62de68975cbc7ffd318df03a183037563':
  hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool

This commit is a noop, see 2b8151c806

Merged-by: James Almer <jamrial@gmail.com>
2017-04-07 00:01:00 -03:00
James Almer 4fbb56acbe Merge commit '4adbb44ad154cec05e87de60bb827a13c0fe87df'
* commit '4adbb44ad154cec05e87de60bb827a13c0fe87df':
  tta: avoid undefined shifts

Merged-by: James Almer <jamrial@gmail.com>
2017-04-06 23:45:20 -03:00
James Almer 208cceb24c Merge commit 'dc4b62502876c0ebeeba317233cd1348c5b0b2b7'
* commit 'dc4b62502876c0ebeeba317233cd1348c5b0b2b7':
  tta: use get_unary() instead of a custom implementation

This commit is a noop, see 58b36959dd

Merged-by: James Almer <jamrial@gmail.com>
2017-04-06 23:43:56 -03:00
James Almer 8489d14274 Merge commit 'e122b12c88487ac8766ff4eb071856b0666f0134'
* commit 'e122b12c88487ac8766ff4eb071856b0666f0134':
  build: Drop gcrypt support

This commit is a noop. GCrypt support is exposed in configure as a
command line option, and it's independent of GnuTLS.

Merged-by: James Almer <jamrial@gmail.com>
2017-04-06 23:43:26 -03:00
Michael Niedermayer 61ee2ca775 avcodec/dvdsubdec: Fixes 2 runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
Fixes: 619/clusterfuzz-testcase-5803914534322176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-07 03:38:31 +02:00
Michael Niedermayer afe950e1fa avcodec/bitpacked: Fix mixed declarations and statement
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-07 00:43:46 +02:00
Michael Niedermayer 0e2f0fedcd ffmpeg: Change duration to int64_t
It is assigned from 64bit input in some branches and used with 64bit timestamps
This thus fixes a potential integer truncation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-07 00:07:08 +02:00
wm4 15a23a8332 pthread_frame: don't return stale error codes after flush
Consider the following sequence of events:

- open a codec without AV_CODEC_CAP_DELAY
- decode call fails with an error
- ff_thread_flush() is called
- drain packet is sent

Then the last step would make ff_thread_decode_frame() return an error,
because p->result can still be set to an error value. This is because
submit_packet returns immediately if AV_CODEC_CAP_DELAY is not set, and
no worker thread gets the chance to reset p->result, yet its value is
trusted by ff_thread_decode_frame().

Fix this by clearing the error fields on flush.
2017-04-06 17:46:53 +02:00
James Almer e5c11ab9ce avcodec: fix containts typo 2017-04-06 11:45:58 -03:00
Steve Lhomme f4cee500e9 avformat/dump : Display Content Light Level metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-06 11:40:31 -03:00
Steve Lhomme 157e57a181 lavc: Add Content Light Level side metadata found in HEVC
These data are necessary when transmitting HDR over HDMI.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-06 11:38:15 -03:00
Steve Lhomme b378f5bd64 lavu: add support for Content Light Level side metadata
As found in HEVC.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-06 11:26:25 -03:00
Shivraj Patil 2a512f86c1 build fix for mips
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2017-04-06 10:10:09 -04:00
Ronald S. Bultje fed92adbb3 vp8: make mv_min/max thread-local if using partition threading.
Fixes tsan warnings like this in fate-vp8-test-vector-007:

WARNING: ThreadSanitizer: data race (pid=65909)
  Write of size 4 at 0x7d8c0000e088 by thread T1:
    #0 vp8_decode_mb_row_sliced vp8.c:2519 (ffmpeg:x86_64+0x100995ede)
[..]
  Previous write of size 4 at 0x7d8c0000e088 by thread T2:
    #0 vp8_decode_mb_row_sliced vp8.c:2519 (ffmpeg:x86_64+0x100995ede)
2017-04-06 10:03:28 -04:00
Ronald S. Bultje 9a54c6f243 vp8: make wait/thread_mb_pos atomic.
Fixes tsan warnings like this in fate-vp8-test-vector-007:

WARNING: ThreadSanitizer: data race (pid=3590)
  Write of size 4 at 0x7d8c0000e07c by thread T2:
    #0 decode_mb_row_no_filter src/libavcodec/vp8.c:2330 (ffmpeg+0x000000ffb59e)
[..]
  Previous write of size 4 at 0x7d8c0000e07c by thread T1:
    #0 decode_mb_row_no_filter src/libavcodec/vp8.c:2330 (ffmpeg+0x000000ffb59e)
2017-04-06 10:03:28 -04:00
Ronald S. Bultje 83ae7e6350 x86/idctdsp_init: reindent. 2017-04-06 10:03:28 -04:00
Ronald S. Bultje 32baeafeee jrev/xvid: hardcode use of C put/add_pixels_clamped.
This removes the last use of the ff_put/add_pixels_clamped global
function pointers, and as such they are removed.

This patch has a negative effect on performance on MIPS, since there's
a SIMD-optimized put/add_pixels_clamped, but no xvid or jrev. From a
code maintenance point of view, that is probably acceptable.

Because the global function pointers are removed, this fixes the following
tsan warnings when running e.g. fate-dnxhr-parse:

WARNING: ThreadSanitizer: data race (pid=29917)
  Write of size 8 at 0x0000025b12d8 by thread T2 (mutexes: write M1543):
    #0 ff_idctdsp_init src/libavcodec/idctdsp.c:313 (ffmpeg+0x00000044b68e)
[..]
  Previous write of size 8 at 0x0000025b12d8 by thread T1 (mutexes: write M1541):
    #0 ff_idctdsp_init src/libavcodec/idctdsp.c:313 (ffmpeg+0x00000044b68e)
2017-04-06 10:03:28 -04:00
Ronald S. Bultje e0c205677f x86/simple_idct: add explicit sse2 simple_idct_put/add versions.
These use the mmx IDCT, but sse2 put/add_pixels_clamped implementations.
This way we don't need to use the ff_put/add_pixels_clamped function
pointers.
2017-04-06 10:03:28 -04:00
Ronald S. Bultje 2f0591cfa3 cavs: add a sse2 idct implementation.
This makes using the function pointer ff_add_pixels_clamped() unnecessary,
since we always know what the best implementation is at compile-time.
2017-04-06 10:03:28 -04:00
Ronald S. Bultje c9d98c5649 cavs: convert idct from inline asm to yasm. 2017-04-06 10:03:27 -04:00
Ronald S. Bultje b51d7d89f8 x86/xvididct: remove use of ff_put/add_pixels_clamped function pointer.
Since there's separate SSE2 implementations of xvid_idct_put/add, this
patch has no practical impact on performance.
2017-04-06 10:03:27 -04:00
Ronald S. Bultje 40cbd686dc idct_arm: remove use of ff_put/add_pixels_clamped function pointer.
Instead, hardcode the use of the _arm implementation of add_pixels,
and use the C version for put_pixels (as no arm-optimized version
exists). Since there's separate implementations of idct{,_put,_add}
for neon, this has no practical impact on performance.
2017-04-06 10:03:27 -04:00
Ronald S. Bultje 083300bea9 pthread_frame: allow per-field ThreadFrame owners.
This tries to handle cases where separate invocations of decode_frame()
(each running in separate threads) write to respective fields in the
same AVFrame->data[]. Having per-field owners makes interaction between
readers (the referencing thread) and writers (the decoding thread)
slightly more optimal if both accesses are field-based, since they will
use the respective producer's thread objects (mutex/cond) instead of
sharing the thread objects of the first field's producer.

In practice, this fixes the following tsan-warning in fate-h264:

WARNING: ThreadSanitizer: data race (pid=21615)
  Read of size 4 at 0x7d640000d9fc by thread T2 (mutexes: write M1006):
    #0 ff_thread_report_progress pthread_frame.c:569 (ffmpeg:x86_64+0x100f7cf54)
[..]
  Previous write of size 4 at 0x7d640000d9fc by main thread (mutexes: write M1004):
    #0 update_context_from_user pthread_frame.c:335 (ffmpeg:x86_64+0x100f81abb)
2017-04-06 10:03:27 -04:00
Thierry Foucu ac24a8202a libavformat/mov: Fix memory leak, need to free the chapter tracks array
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-06 04:05:04 +02:00
tiejun.peng@foxmail.com 9fe73b0147 avformat/ftp: Solve a crash bug when network occur a exception
This fixes a proble where ffmpeg would cause crash to do a seek when the network disconnect.
The log like this:
01-01 10:53:03.441  6580  6580 F DEBUG   : backtrace:
01-01 10:53:03.441  6580  6580 F DEBUG   :     #00 pc 0002942e  /system/lib/libavformat.so (ffurl_write+9)

Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-05 23:57:08 +02:00
Michael Niedermayer b02027c79d avcodec/dvbsubdec: Replace fprintf(stderr) by av_log()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-05 23:57:08 +02:00
Rostislav Pehlivanov c901ae9440 bitpacked: fix potential overflow
Fixes: CID1404842

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-05 20:51:13 +01:00
Ronald S. Bultje 7c7e7c44a6 huffyuv: assign correct per-thread avctx pointer to HYuvContext::avctx.
Fixes the following tsan warning when running fate-vsynth_lena-ffvhuff:

WARNING: ThreadSanitizer: data race (pid=6484)
  Write of size 8 at 0x7d64000154b8 by main thread (mutexes: write M1331):
    #0 update_context_from_user src/libavcodec/pthread_frame.c:331 (ffmpeg+0x000000dca887)
[..]
  Previous read of size 8 at 0x7d64000154b8 by thread T2 (mutexes: write M1334):
    #0 draw_slice src/libavcodec/huffyuvdec.c:857 (ffmpeg+0x000000bcc86f)
2017-04-05 15:36:53 -04:00
Kyle Swanson f3d8e0d369 avfilter/af_loudnorm: do not upsample during second-pass linear normalization
Signed-off-by: Kyle Swanson <k@ylo.ph>
2017-04-05 11:43:12 -05:00
Clément Bœsch d8eb40bd70 doc/general: fix project name after 2b1a6b1ae 2017-04-05 18:38:52 +02:00