]> git.sesse.net Git - ffmpeg/log
ffmpeg
6 years agoavformat/hlsenc: creation of hls master playlist file
Vishwanath Dixit [Mon, 20 Nov 2017 02:04:34 +0000 (10:04 +0800)]
avformat/hlsenc: creation of hls master playlist file

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
6 years agoavformat/hlsenc: creation of hls variant streams in a single hlsenc instance
Vishwanath Dixit [Mon, 20 Nov 2017 02:02:11 +0000 (10:02 +0800)]
avformat/hlsenc: creation of hls variant streams in a single hlsenc instance

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
6 years agoavformat/movenc: write clap atom for uncompressed yuv in mov
Dave Rice [Sun, 19 Nov 2017 02:19:23 +0000 (21:19 -0500)]
avformat/movenc: write clap atom for uncompressed yuv in mov

fixes 6145

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/movenc: correct ImageDescription for uncompressed ycbcr
Dave Rice [Sun, 19 Nov 2017 02:19:17 +0000 (21:19 -0500)]
avformat/movenc: correct ImageDescription for uncompressed ycbcr

Per
https://developer.apple.com/library/content/technotes/tn2162/_index.html

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoffmpeg: add ui64 type to SpecifierOpt
pkviet [Sat, 18 Nov 2017 21:19:46 +0000 (22:19 +0100)]
ffmpeg: add ui64 type to SpecifierOpt

 Adds ui64 (uint64_t) as a possible type for SpecifierOpt. This enables
 use of uint64_t options with SpecifierOpt such as channel_layout
 when expressed as a 64 bit channel mask.

Signed-off-by: pkviet <pkv.stream@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec: remove unnecessary AVPacketSideDataType enum offset
James Almer [Mon, 20 Nov 2017 00:03:09 +0000 (21:03 -0300)]
avcodec: remove unnecessary AVPacketSideDataType enum offset

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agodoc/codecs.texi: Remove documentation of removed codec flags.
Carl Eugen Hoyos [Mon, 20 Nov 2017 00:09:08 +0000 (01:09 +0100)]
doc/codecs.texi: Remove documentation of removed codec flags.

The flags were removed in b79a7da3

6 years agoMerge commit '3152058bf1dca318898550efacf0286f4836cae6'
James Almer [Sun, 19 Nov 2017 21:26:45 +0000 (18:26 -0300)]
Merge commit '3152058bf1dca318898550efacf0286f4836cae6'

* commit '3152058bf1dca318898550efacf0286f4836cae6':
  libavcodec: Don't use dllexport, only dllimport when building DLLs

Merged-by: James Almer <jamrial@gmail.com>
6 years agoconfigure: fix module dependencies on zlib
James Almer [Sun, 19 Nov 2017 18:23:02 +0000 (15:23 -0300)]
configure: fix module dependencies on zlib

select should not be used with external libraries. It's mean to soft
enable internal modules/features.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavfilter/af_surround: add some more layouts
Paul B Mahol [Sun, 19 Nov 2017 19:20:55 +0000 (20:20 +0100)]
avfilter/af_surround: add some more layouts

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter: fix indentation
Paul B Mahol [Sun, 19 Nov 2017 20:18:00 +0000 (21:18 +0100)]
avfilter: fix indentation

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agolibavcodec: Don't use dllexport, only dllimport when building DLLs
Martin Storsjö [Thu, 14 Sep 2017 05:33:05 +0000 (08:33 +0300)]
libavcodec: Don't use dllexport, only dllimport when building DLLs

The only purpose of dllexport (which is set while building the library
that exports the symbols) is to have the linker automatically
export such symbols into a DLL without using a def file - it doesn't
affect the generated code.

For both MSVC and mingw builds, this isn't essential since we override
what symbols to export via an autogenerated def file instead.

Update a comment in configure to refer to the right concept.

With lld, this avoids warnings about duplicate export directives,
when some symbols are requested to be exported both via dllexport
attributes and via the autogenerated def file.

This also reduces the number of lines of code marginally.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoavformat/subfile: allow to extract till EOF
Gyan Doshi [Wed, 15 Nov 2017 12:06:19 +0000 (17:36 +0530)]
avformat/subfile: allow to extract till EOF

Users can set end offset as 0 to extract till end of file.
Tested locally and documented.

6 years agolavfi/af_pan: fix sign handling in channel coefficient parser
Michael Roitzsch [Sat, 18 Nov 2017 12:33:08 +0000 (13:33 +0100)]
lavfi/af_pan: fix sign handling in channel coefficient parser

When a channel formula ends with a subtraction, the next formula will
otherwise have its first coefficient negated.

6 years agoconfigure: add audio_frame_queue dependency for aptx codec
James Darnley [Sun, 19 Nov 2017 13:54:34 +0000 (14:54 +0100)]
configure: add audio_frame_queue dependency for aptx codec

6 years agoavfilter: add acontrast filter
Paul B Mahol [Sat, 18 Nov 2017 09:28:27 +0000 (10:28 +0100)]
avfilter: add acontrast filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/dashenc: fix min_seg_duration option size
James Cowgill [Sat, 18 Nov 2017 15:11:45 +0000 (15:11 +0000)]
avformat/dashenc: fix min_seg_duration option size

In the DASHContext structure, min_seg_duration is declared as an int,
but the AVOption list claimed it was an INT64. Change the option list
to use the correct size, which should fix some initialization errors
seen on big-endian platforms.

Signed-off-by: James Cowgill <jcowgill@debian.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoffmpeg: Allow "-to" on input files in addition to "-t"
Vitaly _Vi Shukela [Sat, 18 Nov 2017 07:36:51 +0000 (10:36 +0300)]
ffmpeg: Allow "-to" on input files in addition to "-t"

For some strange reason "-t" option was only implemented
for input files while both "-t" and "-to" were available
for use for output files. This made extracting a range from
input file inconvenient.

This patch enables -to option for input so one can do

    ffmpeg -ss 1:23:20 -to 1:27:22.3 -i myinput.mkv ...

Signed-off-by: Vitaly _Vi Shukela <vi0oss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoffmpeg_filter: use nb_threads=1 on unused filtergraph
DHE [Fri, 17 Nov 2017 01:09:37 +0000 (20:09 -0500)]
ffmpeg_filter: use nb_threads=1 on unused filtergraph

Signed-off-by: DHE <git@dehacked.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat: remove unnecessary AVStreamParseType enum offset
James Almer [Sat, 18 Nov 2017 17:55:29 +0000 (14:55 -0300)]
avformat: remove unnecessary AVStreamParseType enum offset

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agolavf/tcp: Fix the type of the optlen argument to getsockopt().
Carl Eugen Hoyos [Sun, 12 Nov 2017 14:23:14 +0000 (15:23 +0100)]
lavf/tcp: Fix the type of the optlen argument to getsockopt().

Fixes a warning on aix:
libavformat/tcp.c:283:58: warning: passing argument 5 of 'getsockopt' from incompatible pointer type

6 years agoavcodec: Implement mpeg2 nvdec hwaccel
Philip Langdale [Thu, 16 Nov 2017 15:35:17 +0000 (07:35 -0800)]
avcodec: Implement mpeg2 nvdec hwaccel

This is mostly straight-forward. The weird part is that it should
just work for mpeg1, but I see corruption in my test cases, so I'm
going to try and fix that separately.

6 years agoavcodec: Fix reference data type for nvdec vc1 hwaccel
Philip Langdale [Thu, 16 Nov 2017 15:31:58 +0000 (07:31 -0800)]
avcodec: Fix reference data type for nvdec vc1 hwaccel

I took the reference lookup code from the vp9 hwaccel where the
type is unsigned char, but for vc1, the type is signed int.

This is particularly important because the value used when there's
no reference is different (255 vs -1).

It didn't seem to break anything, but for mpeg1/2/4, this mistake
caused decode errors.

6 years agoIgnore libavcodec/tests/mpeg12framerate, a test program
Jim DeLaHunt [Fri, 17 Nov 2017 09:45:27 +0000 (01:45 -0800)]
Ignore libavcodec/tests/mpeg12framerate, a test program

Add to libavcodec/tests/.gitignore an entry for test
program libavcodec/tests/mpeg12framerate . Other
similar test programs, e.g. jpeg2000dwt and dct, are
ignored in a similar way.

On initially checking out master, and doing "./configure"
and "make clean", "git status" reports no untracked
files. After running "make fate", "git status" reports
untracked file "libavcodec/tests/mpeg12framerate".

mpeg12framerate is a unit test program. It was apparently
introduced in commit
278c308ceae6b8d7bac1dfc24518821aae603988, on
Tue Sep 12 22:11:56 2017 +0100. It added a new function
ff_mpeg12_find_best_frame_rate() to
libavcodec/mpeg12framerate.c , and the code in
libavcodec/tests/mpeg12framerate.c to exercise that
function. This commit also added the new program to
the FATE suite, but it omitted a .gitignore entry.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavf/mov: don't read outside frag_index bounds
John Stebbins [Fri, 17 Nov 2017 16:21:02 +0000 (08:21 -0800)]
lavf/mov: don't read outside frag_index bounds

Potentially fixes:
https://bugs.chromium.org/p/chromium/issues/detail?id=786269#c1

In theory, the crash can be triggered by an invalid stream that has
either tfdt or trun outside of the moof

Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoUse ff_thread_once for fixed, float table init.
Dale Curtis [Fri, 17 Nov 2017 22:51:09 +0000 (14:51 -0800)]
Use ff_thread_once for fixed, float table init.

These tables are static so they should only be initialized once
instead of on every call to ff_mpadsp_init().

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoFix leak of frame_duration_buffer in mov_fix_index().
Dale Curtis [Fri, 17 Nov 2017 22:53:25 +0000 (14:53 -0800)]
Fix leak of frame_duration_buffer in mov_fix_index().

Should be unconditionally freed at the end of mov_fix_index() in
case it hasn't been used during the fix up.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Sasi Inguva <isasi-at-google.com@ffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/mlpdsp: Fix undefined shift ff_mlp_pack_output()
Michael Niedermayer [Wed, 15 Nov 2017 02:38:37 +0000 (03:38 +0100)]
avcodec/mlpdsp: Fix undefined shift ff_mlp_pack_output()

Fixes: runtime error: left shift of negative value -7862264
Fixes: 4074/clusterfuzz-testcase-minimized-4516104123711488
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/zmbv: Check that the buffer is large enough for mvec
Michael Niedermayer [Wed, 15 Nov 2017 16:11:12 +0000 (17:11 +0100)]
avcodec/zmbv: Check that the buffer is large enough for mvec

Fixes: Timeout
Fixes: 4143/clusterfuzz-testcase-4736864637419520
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD137iL0()
Michael Niedermayer [Tue, 14 Nov 2017 02:40:07 +0000 (03:40 +0100)]
avcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD137iL0()

Fixes: 4035/clusterfuzz-testcase-minimized-6479308925173760
Fixes: runtime error: signed integer overflow: 9 * 402653183 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/wmv2dec: Check end of bitstream in parse_mb_skip() and ff_wmv2_decode_mb()
Michael Niedermayer [Sat, 16 Sep 2017 23:28:07 +0000 (01:28 +0200)]
avcodec/wmv2dec: Check end of bitstream in parse_mb_skip() and ff_wmv2_decode_mb()

Fixes: Timeout
Fixes: 3200/clusterfuzz-testcase-5750022136135680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavc/dnxhddata: Improve help output, mention yuv444p10 and gbrp10.
Carl Eugen Hoyos [Tue, 14 Nov 2017 17:01:03 +0000 (18:01 +0100)]
lavc/dnxhddata: Improve help output, mention yuv444p10 and gbrp10.

Fixes ticket #6836.

6 years agoavcodec/nvenc: check pop_context return value
Timo Rothenpieler [Wed, 15 Nov 2017 17:33:31 +0000 (18:33 +0100)]
avcodec/nvenc: check pop_context return value

6 years agoavcodec/nvenc: fix double defined GUID on cygwin
Timo Rothenpieler [Wed, 15 Nov 2017 18:15:23 +0000 (19:15 +0100)]
avcodec/nvenc: fix double defined GUID on cygwin

6 years agohwcontext_d3d11va: add missing stdint.h include
Timo Rothenpieler [Wed, 15 Nov 2017 18:22:42 +0000 (19:22 +0100)]
hwcontext_d3d11va: add missing stdint.h include

This caused checkheaders to fail on cygwin on this file.

6 years agolibavcodec/h264_sei: Don't log random user data. This prevents terminal junk.
Kieran Kunhya [Fri, 5 May 2017 21:29:59 +0000 (14:29 -0700)]
libavcodec/h264_sei: Don't log random user data. This prevents terminal junk.

6 years agolavc/libvpxenc: add tune-content option
James Zern [Mon, 13 Nov 2017 23:19:07 +0000 (15:19 -0800)]
lavc/libvpxenc: add tune-content option

this matches the vpxenc parameter

Signed-off-by: James Zern <jzern@google.com>
6 years agoavcodec/snowdec: Check for remaining bitstream in decode_blocks()
Michael Niedermayer [Wed, 15 Nov 2017 20:17:16 +0000 (21:17 +0100)]
avcodec/snowdec: Check for remaining bitstream in decode_blocks()

Fixes: Timeout
Fixes: 3142/clusterfuzz-testcase-5007853163118592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/snowdec: Check intra block dc differences.
Michael Niedermayer [Wed, 15 Nov 2017 20:17:15 +0000 (21:17 +0100)]
avcodec/snowdec: Check intra block dc differences.

Fixes: Timeout
Fixes: 3142/clusterfuzz-testcase-5007853163118592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavfilter: add multiband compand filter
Paul B Mahol [Sat, 13 May 2017 09:57:42 +0000 (11:57 +0200)]
avfilter: add multiband compand filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/tcp: add option to enable TCP_NODELAY
Aman Gupta [Mon, 13 Nov 2017 20:20:18 +0000 (12:20 -0800)]
avformat/tcp: add option to enable TCP_NODELAY

This can reduce latency and increase throughput, particularly on high
latency networks.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Reviewed-by: Jeyapal, Karthick <kjeyapal@akamai.com>
6 years agolavf/mxf: Support 60fps output.
Carl Eugen Hoyos [Mon, 30 Oct 2017 23:19:38 +0000 (00:19 +0100)]
lavf/mxf: Support 60fps output.

6 years agolibavcodec/als: fix address sanitization error in decoder
Umair Khan [Mon, 13 Nov 2017 05:37:42 +0000 (11:07 +0530)]
libavcodec/als: fix address sanitization error in decoder

Signed-off-by: Umair Khan <omerjerk@gmail.com>
6 years agolibavcodec/als: remove check for predictor order of a block
Umair Khan [Mon, 13 Nov 2017 05:36:30 +0000 (11:06 +0530)]
libavcodec/als: remove check for predictor order of a block

Reverts commit 18f94df8, fixes ticket #5297.

Signed-off-by: Umair Khan <omerjerk@gmail.com>
6 years agoavformat/mov: Check size of STSC allocation
Fredrik Hubinette [Thu, 16 Nov 2017 01:24:30 +0000 (17:24 -0800)]
avformat/mov: Check size of STSC allocation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavf/movenc: allow writing avc3 sample entry type
John Stebbins [Wed, 15 Nov 2017 17:17:39 +0000 (09:17 -0800)]
lavf/movenc: allow writing avc3 sample entry type

The avc3 sample entry type is useful for adaptive streaming.  It permits
parameter sets to be written inline in the video stream.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoconfigure: call flatten_extralibs in a subshell
Timo Rothenpieler [Mon, 13 Nov 2017 22:43:51 +0000 (23:43 +0100)]
configure: call flatten_extralibs in a subshell

By putting the call in a subshell, the problem of it spilling
cleanup-decision from a previous library to other libraries is avoided.

For example, it could have already cleaned up cuda_extralibs in a
previous library that depended on cuda. Then when it gets to avutil, it
will never pick up the dependency of avutil to cuda, which depends on
libdl, which in turn results in a missing -ldl extralib, resulting in
link failures in certain configurations.

6 years agoMerge commit 'bad7ce1d82f0b7da55086b8c6124eff0d35a1b1a'
James Almer [Thu, 16 Nov 2017 16:12:59 +0000 (13:12 -0300)]
Merge commit 'bad7ce1d82f0b7da55086b8c6124eff0d35a1b1a'

* commit 'bad7ce1d82f0b7da55086b8c6124eff0d35a1b1a':
  makedef: Pass EXTERN_PREFIX from configure to makedef

Merged-by: James Almer <jamrial@gmail.com>
6 years agoMerge commit 'd070b9b703a542429a13db9623109ae20474c775'
James Almer [Thu, 16 Nov 2017 16:11:52 +0000 (13:11 -0300)]
Merge commit 'd070b9b703a542429a13db9623109ae20474c775'

* commit 'd070b9b703a542429a13db9623109ae20474c775':
  configure: Coalesce some arch configuration and PIC handling

Merged-by: James Almer <jamrial@gmail.com>
6 years agoMerge commit '9e48de3cc86c732d9cebd496d6f0a2b7e7732754'
James Almer [Thu, 16 Nov 2017 16:11:24 +0000 (13:11 -0300)]
Merge commit '9e48de3cc86c732d9cebd496d6f0a2b7e7732754'

* commit '9e48de3cc86c732d9cebd496d6f0a2b7e7732754':
  configure: Miscellaneous minor changes

Merged-by: James Almer <jamrial@gmail.com>
6 years agoMerge commit '5c2a01f064d5ab2b309d25c7f46c6c4471838d90'
James Almer [Thu, 16 Nov 2017 16:10:49 +0000 (13:10 -0300)]
Merge commit '5c2a01f064d5ab2b309d25c7f46c6c4471838d90'

* commit '5c2a01f064d5ab2b309d25c7f46c6c4471838d90':
  Makefile: fix distclean target
  configure: fix writing library dependencies to config.sh

This commit is a noop, see
d9ff1e4c8bdf97cbb1ab4bd97102eefbe8ebf95a
e7e7d56a850d34d710c45463607abac846972f57

Merged-by: James Almer <jamrial@gmail.com>
6 years agomakedef: Pass EXTERN_PREFIX from configure to makedef
Martin Storsjö [Thu, 16 Nov 2017 07:32:15 +0000 (09:32 +0200)]
makedef: Pass EXTERN_PREFIX from configure to makedef

This avoids having to use either "dumpbin -headers" to find out
the current architecture, or pass $ARCH from configure to deduce it.

When configuring with --disable-asm, ARCH is equal to "c", which doesn't
give any indication of what symbol prefix is to be used.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoavcodec/mpeg12dec: ensure a53_caption_size is reset on malloc failures
Aman Gupta [Wed, 15 Mar 2017 19:53:04 +0000 (12:53 -0700)]
avcodec/mpeg12dec: ensure a53_caption_size is reset on malloc failures

Signed-off-by: Aman Gupta <aman@tmm1.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/mpeg12dec: parse A53 caption data embedded in SCTE-20 user data
Aman Gupta [Wed, 15 Mar 2017 19:53:03 +0000 (12:53 -0700)]
avcodec/mpeg12dec: parse A53 caption data embedded in SCTE-20 user data

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/proresdec: align dequantization matrix buffers
James Almer [Thu, 16 Nov 2017 00:13:07 +0000 (21:13 -0300)]
avcodec/proresdec: align dequantization matrix buffers

Should fix ticket #6838

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoMerge commit '620f88a0b94a651c6cc912b1fb32d308762d59b5'
Mark Thompson [Thu, 16 Nov 2017 00:03:10 +0000 (00:03 +0000)]
Merge commit '620f88a0b94a651c6cc912b1fb32d308762d59b5'

* commit '620f88a0b94a651c6cc912b1fb32d308762d59b5':
  vaapi_h264: Add missing return value check
  h264_metadata: Fix clearing SEI payload in error case
  cbs_h2645: Fix memory leak on when reading SEI fails
  cbs: Add a missing return value check

This commit is a noop, see
03b1470088e6e4a11e5db0efd8c26d9ac8304d31
d792613badfe7e7ca3552533e691c5015991a98a
41272e112b389e61b875ba2372a64a251f1da9fc
6734eef6b8b464139fdc140ec9bc9e8d74173869

Merged-by: Mark Thompson <sw@jkqxz.net>
6 years agoMerge commit 'c77da21e5d15056b8ba060ee5ce9e73f26653612'
Mark Thompson [Wed, 15 Nov 2017 23:54:28 +0000 (23:54 +0000)]
Merge commit 'c77da21e5d15056b8ba060ee5ce9e73f26653612'

* commit 'c77da21e5d15056b8ba060ee5ce9e73f26653612':
  vaapi_h264: Do not use deprecated header type

This commit is a noop, see 32a618a948c20f18db102d0b0976790222a57105.

Merged-by: Mark Thompson <sw@jkqxz.net>
6 years agoMerge commit 'ff007e30d8d45ba1ff2b2a4615f1cd5bafb50626'
Mark Thompson [Wed, 15 Nov 2017 23:43:56 +0000 (23:43 +0000)]
Merge commit 'ff007e30d8d45ba1ff2b2a4615f1cd5bafb50626'

* commit 'ff007e30d8d45ba1ff2b2a4615f1cd5bafb50626':
  vaapi_h264: Add workaround for bad SEI in old Intel drivers

Merged-by: Mark Thompson <sw@jkqxz.net>
6 years agoavcodec/vc2enc: Clear coef_buf on allocation
Michael Niedermayer [Wed, 15 Nov 2017 15:53:34 +0000 (16:53 +0100)]
avcodec/vc2enc: Clear coef_buf on allocation

Fixes: Use of uninitialized memory
Fixes: assertion failure
Reviewed-by: <atomnuker>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/dvbsubdec: Avoid re-computing clut
Michael Niedermayer [Fri, 3 Nov 2017 23:26:56 +0000 (00:26 +0100)]
avcodec/dvbsubdec: Avoid re-computing clut

Fixes: Timeout
Fixes: 3218/clusterfuzz-testcase-5390672154591232
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/h264dec: Fix potential array overread
Michael Niedermayer [Sat, 21 Oct 2017 16:04:44 +0000 (18:04 +0200)]
avcodec/h264dec: Fix potential array overread

add padding before scantable arrays

See: 522d850e68ec4b77d3477b3c8f55b1ba00a9d69a

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoconfigure: Coalesce some arch configuration and PIC handling
Diego Biurrun [Fri, 6 Oct 2017 21:06:45 +0000 (23:06 +0200)]
configure: Coalesce some arch configuration and PIC handling

6 years agoconfigure: Miscellaneous minor changes
Diego Biurrun [Sun, 24 Sep 2017 16:46:47 +0000 (18:46 +0200)]
configure: Miscellaneous minor changes

- Move a variable closer to where it is used
- Add an explanatory comment
- Simplify a crosscompile check
- Minor SHFLAGS simplification
- Coalesce some threads tests

6 years agonvenc: support d3d11 surface input
Hendrik Leppkes [Sat, 11 Nov 2017 15:51:58 +0000 (16:51 +0100)]
nvenc: support d3d11 surface input

6 years agonvenc: factor context push/pop into functions
Hendrik Leppkes [Sat, 11 Nov 2017 15:13:24 +0000 (16:13 +0100)]
nvenc: factor context push/pop into functions

This reduces code repetition, and will allow adding further push/pop
refinement for D3D11 devices in future commits.

6 years agoavformat/utils: remove usage of AVCodecContext accessors
James Almer [Mon, 13 Nov 2017 03:11:52 +0000 (00:11 -0300)]
avformat/utils: remove usage of AVCodecContext accessors

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavfilter/vf_subtitles: remove usage of AVCodecContext accessors
James Almer [Mon, 13 Nov 2017 03:11:34 +0000 (00:11 -0300)]
avfilter/vf_subtitles: remove usage of AVCodecContext accessors

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/pthread_frame: remove usage of AVCodecContext accessors
James Almer [Mon, 13 Nov 2017 03:11:15 +0000 (00:11 -0300)]
avcodec/pthread_frame: remove usage of AVCodecContext accessors

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoffplay: remove usage of AVCodecContext accessors
James Almer [Mon, 13 Nov 2017 03:10:49 +0000 (00:10 -0300)]
ffplay: remove usage of AVCodecContext accessors

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoffprobe: remove usage of AVCodecContext accessors
James Almer [Mon, 13 Nov 2017 03:10:45 +0000 (00:10 -0300)]
ffprobe: remove usage of AVCodecContext accessors

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoffmpeg: remove usage of AVCodecContext accessors
James Almer [Mon, 13 Nov 2017 03:10:21 +0000 (00:10 -0300)]
ffmpeg: remove usage of AVCodecContext accessors

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec: deprecate getters and setters for AVCodecContext and AVCodec fields
James Almer [Mon, 13 Nov 2017 02:57:38 +0000 (23:57 -0300)]
avcodec: deprecate getters and setters for AVCodecContext and AVCodec fields

The fields can be accessed directly, so these are not needed anymore.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec: Implement vc1 nvdec hwaccel
Philip Langdale [Tue, 14 Nov 2017 05:09:27 +0000 (21:09 -0800)]
avcodec: Implement vc1 nvdec hwaccel

This hwaccel is interesting because it also works for wmv3/9 content,
which is not supported by the nvidia parser used by cuviddec.

6 years agoavcodec: Don't assume separate u and v planes in ff_alloc_picture
Philip Langdale [Tue, 14 Nov 2017 05:11:27 +0000 (21:11 -0800)]
avcodec: Don't assume separate u and v planes in ff_alloc_picture

alloc_frame_buffer in ff_alloc_picture asserts that the linesize
of planes 1 and 2 are the same. If the pixfmt has a single uv
plane, like NV12, this won't be true.

So, let's only do this check if there are more than 2 planes.

We never hit this with previous hw formats because they don't set
linesize to meaningful values, but the cuda hw format sets the
values based on the underlying data layout.

6 years agolavf/mov.c: Don't correct edit list start to zero, when we can't find a frame before...
Sasi Inguva [Tue, 14 Nov 2017 02:09:28 +0000 (18:09 -0800)]
lavf/mov.c: Don't correct edit list start to zero, when we can't find a frame before edit list start.

After c2a8f0fcbe57ea9ccaa864130f078af10516c3c1 this can happen on normal edit lists starting on a B-frame.

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoAvoid corrupting diagnostic state with _Pragma changes.
Dale Curtis [Sat, 4 Nov 2017 00:10:55 +0000 (17:10 -0700)]
Avoid corrupting diagnostic state with _Pragma changes.

The macros for ICC and MSVC correctly push and pop the diagnostic
state of the compiler when disabling deprecation warnings. The
ones for clang/gcc should do the same. Without this, if a blanket
deprecation warning is applied to the code base it'll be flipped
back on incorrectly with FF_ENABLE_DEPRECATION_WARNINGS.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agofate/mov: add test for overlapping fragments
John Stebbins [Mon, 13 Nov 2017 16:09:30 +0000 (08:09 -0800)]
fate/mov: add test for overlapping fragments

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/mips: Improve hevc non-uni hz and vt mc msa functions
Kaustubh Raste [Thu, 9 Nov 2017 10:09:49 +0000 (15:39 +0530)]
avcodec/mips: Improve hevc non-uni hz and vt mc msa functions

Use mask buffer.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/mips: cleanup unused macros
Kaustubh Raste [Thu, 9 Nov 2017 05:17:28 +0000 (10:47 +0530)]
avcodec/mips: cleanup unused macros

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec: fix whitespace on AVPanScan struct definition
Aman Gupta [Tue, 14 Nov 2017 18:02:20 +0000 (10:02 -0800)]
avcodec: fix whitespace on AVPanScan struct definition

6 years agoavformat/http: fix chunked response w/ multiple_requests=1
Aman Gupta [Mon, 13 Nov 2017 19:34:50 +0000 (11:34 -0800)]
avformat/http: fix chunked response w/ multiple_requests=1

Currently if you use the multiple_requests=1 option and try to
receive a chunked-encoded response, http_buf_read() will hang forever.

After this patch, EOF is emulated once a 0-byte final chunk is
received by setting a new flag. This flag is reset in ff_http_do_new_request(),
which is used to make additional requests on the open socket.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoMakefile: fix distclean target
James Almer [Mon, 13 Nov 2017 20:34:15 +0000 (17:34 -0300)]
Makefile: fix distclean target

It must imply clean. Regression since 7ebe7e8e7a76c0ce302f4f583ef0d14220031214.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/x86/mpegvideodsp: Fix signedness bug in need_emu
Michael Niedermayer [Mon, 13 Nov 2017 19:47:48 +0000 (20:47 +0100)]
avcodec/x86/mpegvideodsp: Fix signedness bug in need_emu

Fixes: out of array read
Fixes: 3516/attachment-311488.dat
Found-by: Insu Yun, Georgia Tech.
Tested-by: wuninsu@gmail.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/hlsenc: write fmp4 init header after first AV frame
Steven Liu [Tue, 14 Nov 2017 02:31:26 +0000 (10:31 +0800)]
avformat/hlsenc: write fmp4 init header after first AV frame

fix ticket id: 6825

Signed-off-by: Steven Liu <lq@onvideo.cn>
Tested-by: Aman Gupta <aman@tmm1.net>
6 years agoavutil/crc: use ff_thread_once at av_crc_get_table
Muhammad Faiz [Tue, 24 Oct 2017 09:23:28 +0000 (16:23 +0700)]
avutil/crc: use ff_thread_once at av_crc_get_table

Fix tsan warnings.

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
6 years agoavcodec/videotoolbox: fix opaque_ref handling
wm4 [Tue, 31 Oct 2017 14:15:27 +0000 (15:15 +0100)]
avcodec/videotoolbox: fix opaque_ref handling

This is a partial fix - to fix videotoolbox fully (with multithreaded
hwaccel decoding), much more work would be required.

Before this change, an assertion failure would trigger:

  $ ffmpeg -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld -i h264.ts -f null -y /dev/null
  Assertion (frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) || !(avctx->codec->capabilities & (1 << 1)) failed at libavcodec/decode.c:620

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: reorder functions to avoid forward declarations
Aman Gupta [Mon, 13 Nov 2017 23:06:40 +0000 (15:06 -0800)]
avcodec/videotoolbox: reorder functions to avoid forward declarations

Cosmetic change only.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: fix whitespace
Aman Gupta [Fri, 10 Nov 2017 20:02:23 +0000 (12:02 -0800)]
avcodec/videotoolbox: fix whitespace

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolboxenc: remove spurious warning
Aman Gupta [Mon, 25 Sep 2017 23:15:09 +0000 (16:15 -0700)]
avcodec/videotoolboxenc: remove spurious warning

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: pass through hevc param changes to the decoder
Aman Gupta [Fri, 10 Nov 2017 20:34:41 +0000 (12:34 -0800)]
avcodec/videotoolbox: pass through hevc param changes to the decoder

This includes the SEI_PREFIX/SEI_SUFFIX NALUs, which can contain
updates like HEVC_SEI_TYPE_ACTIVE_PARAMETER_SETS. Previously, hevc
samples with this SEI present would not playback correctly.

See for example https://github.com/lhc70000/iina/issues/1123

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/hevc: implement new decode_params callback for VideoToolbox
Aman Gupta [Fri, 10 Nov 2017 20:31:56 +0000 (12:31 -0800)]
avcodec/hevc: implement new decode_params callback for VideoToolbox

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: remove unnecessary if statement
Aman Gupta [Fri, 10 Nov 2017 19:52:38 +0000 (11:52 -0800)]
avcodec/videotoolbox: remove unnecessary if statement

Cosmetic change only.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: create avcC even when h264 extradata is missing
Aman Gupta [Mon, 25 Sep 2017 23:52:35 +0000 (16:52 -0700)]
avcodec/videotoolbox: create avcC even when h264 extradata is missing

Removes the avctx->extradata_size requirement when creating avcC/hvcC, since
avctx->extradata is only used in the esds code path.

This fixes an issue where the VideoToolbox decoder would not work unless
avformat_find_stream_info() was called.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: use decode_params to propagate H264 PPS changes and restart...
Aman Gupta [Fri, 10 Nov 2017 20:25:39 +0000 (12:25 -0800)]
avcodec/videotoolbox: use decode_params to propagate H264 PPS changes and restart on SPS changes

This fixes decoding of H264 video samples with SPS and PPS changes.

See for example https://s3.amazonaws.com/tmm1/videotoolbox/spschange.ts,
which previously stalled the decoder and failed to produce any new frames
after the SPS change.

Also see https://s3.amazonaws.com/tmm1/videotoolbox/ppschange.ts, which
uses multiple PPS and would previously cause VT decode failures.

If the VideoToolbox session needs to be restarted, and
videotoolbox_start() fails for some reason (for instance, if the video
is interlaced and the decoder is running on iOS), avcodec will return
AVERROR_EXTERNAL. This can be used by the API user to switch to another
decoder.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/h264: implement new decode_params callback for PPS/SPS
Aman Gupta [Fri, 10 Nov 2017 20:18:35 +0000 (12:18 -0800)]
avcodec/h264: implement new decode_params callback for PPS/SPS

This callback will be used by the VideoToolbox H264 hwaccel so that it
can receive SPS and PPS NALUs. VideoToolbox requires PPS changes to be
fed into the decoder session, and for the session to be recreated when
the SPS changes.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec: add decode_params callback to AVHWAccel struct
Aman Gupta [Fri, 10 Nov 2017 20:17:36 +0000 (12:17 -0800)]
avcodec: add decode_params callback to AVHWAccel struct

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are produced
Aman Gupta [Mon, 25 Sep 2017 23:45:53 +0000 (16:45 -0700)]
avcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are produced

The only reason videotoolbox wouldn't produce frames is if the data fed
to it was invalid, so returning AVERROR_INVALIDDATA makes sense here.

Further, it means AVERROR_EXTERNAL can be used in further commits to signal
fatal VideoToolbox errors, letting the user know that they need to fallback to
another decoder.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/videotoolbox: print descriptive errors on decode failures
Aman Gupta [Mon, 25 Sep 2017 23:44:47 +0000 (16:44 -0700)]
avcodec/videotoolbox: print descriptive errors on decode failures

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: reset bitstream_size in end_frame
Aman Gupta [Mon, 25 Sep 2017 23:42:18 +0000 (16:42 -0700)]
avcodec/videotoolbox: reset bitstream_size in end_frame

This allows decode_slice to be invoked multiple times before end_frame,
causing slices to accumulate before being fed into the VT decoder.

An upcoming commit will re-use decode_slice for parameter NALUs, so
they can be propagated into the VT decoder session along with slice
data.

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/videotoolbox: extract videotoolbox_{start,stop} helpers
Aman Gupta [Mon, 25 Sep 2017 23:32:11 +0000 (16:32 -0700)]
avcodec/videotoolbox: extract videotoolbox_{start,stop} helpers

These helpers will be used in later commits to automatically restart
the decoder session when SPS changes are encountered.

Signed-off-by: Aman Gupta <aman@tmm1.net>