]> git.sesse.net Git - ffmpeg/log
ffmpeg
6 years agoMerge commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e'
James Almer [Thu, 30 Nov 2017 00:04:33 +0000 (21:04 -0300)]
Merge commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e'

* commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e':
  qsvenc: cavlc option is only available for h264

Merged-by: James Almer <jamrial@gmail.com>
6 years agoexamples/hw_decode: Use hw-config information to find pixfmt
Mark Thompson [Tue, 28 Nov 2017 13:58:31 +0000 (13:58 +0000)]
examples/hw_decode: Use hw-config information to find pixfmt

This removes all remaining device-type specificity.

6 years agolavc/samidec: properly raise errors from sami_paragraph_to_ass()
Clément Bœsch [Wed, 29 Nov 2017 21:23:36 +0000 (22:23 +0100)]
lavc/samidec: properly raise errors from sami_paragraph_to_ass()

6 years agoavcodec/samidec: check av_strdup() return value
Pan Bian [Mon, 27 Nov 2017 06:56:32 +0000 (14:56 +0800)]
avcodec/samidec: check av_strdup() return value

In function sami_paragraph_to_ass(), the return value of av_strdup() is
not checked. To avoid potential NULL dereference, the return value
should be checked against NULL.

Signed-off-by: Pan Bian <bianpan2016@163.com>
6 years agoavcodec/amfenc: move config.h include where it's needed
James Almer [Wed, 29 Nov 2017 17:24:08 +0000 (14:24 -0300)]
avcodec/amfenc: move config.h include where it's needed

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agovp9_parser: don't split superframes into separate packets
wm4 [Wed, 29 Nov 2017 16:07:26 +0000 (17:07 +0100)]
vp9_parser: don't split superframes into separate packets

We did this for the sake of the decoder. With the vp9 change, it's not
necessary anymore.

6 years agovp9: use superframe split BSF
wm4 [Fri, 17 Nov 2017 13:15:22 +0000 (14:15 +0100)]
vp9: use superframe split BSF

webm usually has invisible superframes merged with normal frames.
(vpxenc muxes them in this form, which is evidence enough that this is
the standard webm packet format. It's rather unclear whether ffmpeg is
even allowed to remux them with split packets.)

The vp9 decoder needs them to be in separate packets for multithreading
to work. Add the BSF to the decoder, so the conversion happens
automatically.

This contains the important part of fa1749dd34c55fb9, which
was apparently skipped in commit d417e95af76. This restores Libav API
compatibility.

6 years agoavformat/hlsplaylist: add missing header includes
James Almer [Wed, 29 Nov 2017 16:09:23 +0000 (13:09 -0300)]
avformat/hlsplaylist: add missing header includes

Fixes checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/hlsplaylist: fix header include guard
James Almer [Wed, 29 Nov 2017 16:02:37 +0000 (13:02 -0300)]
avformat/hlsplaylist: fix header include guard

Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/hlsenc: Modularized playlist creation to allow reuse
Karthick J [Wed, 29 Nov 2017 11:44:15 +0000 (19:44 +0800)]
avformat/hlsenc: Modularized playlist creation to allow reuse

6 years agoavcodec/nvenc: set correct error code
Pan Bian [Mon, 27 Nov 2017 01:52:50 +0000 (09:52 +0800)]
avcodec/nvenc: set correct error code

In function process_output_surface(), the return value is 0 on the path
that av_mallocz() returns a NULL pointer. 0 indicates success, which
deviates from the fact. Return "AVERROR(ENOMEM)" instead of "0".

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
6 years agolibavformat/hlsenc: Persistent HTTP connections supported as an option
Jeyapal, Karthick [Wed, 29 Nov 2017 06:33:07 +0000 (14:33 +0800)]
libavformat/hlsenc: Persistent HTTP connections supported as an option

6 years agolibavformat/http: Handled multiple_requests option during write
Jeyapal, Karthick [Wed, 29 Nov 2017 06:32:16 +0000 (14:32 +0800)]
libavformat/http: Handled multiple_requests option during write

6 years agolibavformat/avio: Utility function to return URLContext
Jeyapal, Karthick [Wed, 29 Nov 2017 06:31:34 +0000 (14:31 +0800)]
libavformat/avio: Utility function to return URLContext

6 years agoDon't manipulate duration when it's AV_NOPTS_VALUE.
Dale Curtis [Tue, 28 Nov 2017 22:26:55 +0000 (14:26 -0800)]
Don't manipulate duration when it's AV_NOPTS_VALUE.

This leads to signed integer overflow.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/oggparseopus: Free opus extradata before reallocating.
Dale Curtis [Tue, 28 Nov 2017 21:44:49 +0000 (13:44 -0800)]
avformat/oggparseopus: Free opus extradata before reallocating.

Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolibvpxenc,vp9: add corpus-complexity option
James Zern [Tue, 21 Nov 2017 01:32:23 +0000 (17:32 -0800)]
libvpxenc,vp9: add corpus-complexity option

Corpus VBR mode is a variant of standard VBR where the complexity
distribution midpoint is passed in rather than calculated for a specific
clip or chunk.

The valid range is [0, 10000]. 0 (default) uses standard VBR.

Signed-off-by: James Zern <jzern@google.com>
6 years agoffmpeg_opt: Constify hwaccel pointer.
Carl Eugen Hoyos [Mon, 27 Nov 2017 22:54:33 +0000 (23:54 +0100)]
ffmpeg_opt: Constify hwaccel pointer.

Fixes a warning:
fftools/ffmpeg_opt.c:804:29: warning: assignment discards ‘const’ qualifier from pointer target type

6 years agoAdd HW H.264 and HEVC encoding for AMD GPUs based on AMF SDK
Mikhail Mironov [Mon, 27 Nov 2017 02:36:06 +0000 (21:36 -0500)]
Add HW H.264 and HEVC encoding for AMD GPUs based on AMF SDK

Requires AMF headers for at least version 1.4.4.1.

Signed-off-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoexamples: Add a VA-API encode example.
Jun Zhao [Mon, 6 Nov 2017 06:45:27 +0000 (14:45 +0800)]
examples: Add a VA-API encode example.

Supports only raw NV12 input.

Example use:
./vaapi_encode 1920 1080 test.yuv test.h264

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
6 years agoChangelog: add VAAPI VP8 decoder
Mark Thompson [Tue, 28 Nov 2017 21:37:38 +0000 (21:37 +0000)]
Changelog: add VAAPI VP8 decoder

6 years agoavformat/mov: return correct value in mov_read_cmov
Pan Bian [Mon, 27 Nov 2017 03:13:05 +0000 (11:13 +0800)]
avformat/mov: return correct value in mov_read_cmov

On some failure paths, the error code is not correctly set.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mov: set correct error code in mov_read_custom
Pan Bian [Mon, 27 Nov 2017 03:12:56 +0000 (11:12 +0800)]
avformat/mov: set correct error code in mov_read_custom

In function mov_read_custom(), it returns 0 on the path that av_malloc()
returns a NULL pointer. 0 indicates success. An error code should be
assigned to ret.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mxfenc: pass MXFPackage around instead of type
Mark Reid [Mon, 27 Nov 2017 05:42:16 +0000 (21:42 -0800)]
avformat/mxfenc: pass MXFPackage around instead of type

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec: set correct return value in ff_mpeg_ref_picture
Pan Bian [Mon, 27 Nov 2017 12:41:10 +0000 (20:41 +0800)]
avcodec: set correct return value in ff_mpeg_ref_picture

In function ff_mpeg_ref_picture(), it returns 0 on the error path that
the return value of av_buffer_ref() is NULL. 0 indicates success, which
seems to deviate from the fact. Set ret to AVERROR(ENOMEM) to propagate
the error status to the callers.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoFree extradata before reallocating.
Dale Curtis [Tue, 21 Nov 2017 23:10:08 +0000 (15:10 -0800)]
Free extradata before reallocating.

Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavfilter/drawbox: rename variable for maximum thickness
Gyan Doshi [Mon, 20 Nov 2017 10:06:39 +0000 (15:36 +0530)]
avfilter/drawbox: rename variable for maximum thickness

The present value name for maximum thickness is 'max' which results in a
parse error of any thickness expression containing 'max(val1,val2)'.

Value renamed to 'fill'. Tested locally and documented.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agovf_zscale: Add more supported input properties
Vittorio Giovara [Tue, 28 Nov 2017 18:56:06 +0000 (13:56 -0500)]
vf_zscale: Add more supported input properties

Bump the minimum version necessary in the configure file.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
6 years agovf_zscale: Relax color properties maximum bounds
Vittorio Giovara [Tue, 28 Nov 2017 18:55:47 +0000 (13:55 -0500)]
vf_zscale: Relax color properties maximum bounds

This simplifies adding new values, which are already validated elsewhere.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
6 years agomov: Support mdcv and clli boxes for mastering display an color light level
Vittorio Giovara [Wed, 4 Oct 2017 18:47:54 +0000 (14:47 -0400)]
mov: Support mdcv and clli boxes for mastering display an color light level

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
6 years agoprores: Always assume limited range
Vittorio Giovara [Wed, 27 Sep 2017 19:52:52 +0000 (15:52 -0400)]
prores: Always assume limited range

As defined by the specification.

6 years agoavcodec/videotoolbox: fix SEGV when hwaccel decoding h264 with ffmpeg.c
Aman Gupta [Tue, 28 Nov 2017 16:49:21 +0000 (08:49 -0800)]
avcodec/videotoolbox: fix SEGV when hwaccel decoding h264 with ffmpeg.c

Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavformat/hlsenc: Fixed initial setting for end_pts
Karthick J [Tue, 28 Nov 2017 12:03:15 +0000 (20:03 +0800)]
avformat/hlsenc: Fixed initial setting for end_pts

This patch fixes Bug #6868
Sometimes end_pts is getting initialized to audio stream's
first pts, while the duration is calculated based on video stream's pts.
In this patch the end_pts is initialized with the correct stream's first pts.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Tested-by: beloko
6 years agoavformat/hls: Obey AVProgram discard flags
Anssi Hannula [Sun, 19 Nov 2017 18:11:49 +0000 (20:11 +0200)]
avformat/hls: Obey AVProgram discard flags

Currently HLS demuxer only obeys AVStream discard flags but not
AVProgram (which bandwidth variants appear as) discard flags.

Fix that.

6 years agoavformat/hls: Factor playlist need check to a common function
Anssi Hannula [Sun, 19 Nov 2017 17:30:02 +0000 (19:30 +0200)]
avformat/hls: Factor playlist need check to a common function

6 years agolavu/hwcontext_opencl.h: fix build on macOS
Rodger Combs [Tue, 28 Nov 2017 05:38:46 +0000 (23:38 -0600)]
lavu/hwcontext_opencl.h: fix build on macOS

6 years agoavformat/matroskaenc: add missing allocation failure checks for stream durations
James Almer [Tue, 28 Nov 2017 04:23:23 +0000 (01:23 -0300)]
avformat/matroskaenc: add missing allocation failure checks for stream durations

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/matroskaenc: move some initialization checks to mkv_init
James Almer [Mon, 27 Nov 2017 17:11:21 +0000 (14:11 -0300)]
avformat/matroskaenc: move some initialization checks to mkv_init

It's the correct place for them.

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoffmpeg: Check read_ffserver_streams() return value
Pan Bian [Mon, 27 Nov 2017 01:12:54 +0000 (09:12 +0800)]
ffmpeg: Check read_ffserver_streams() return value

The function avformat_alloc_context() will return a NULL pointer on
failure. However, in function read_ffserver_streams(), its return value
is not validated and the subsequent dereference may result in a bad
memory access bug. Check its return value against NULL and avoid
potential NULL dereference.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolibavformat/rtpenc_mpegts: check avformat_new_stream() return value
Pan Bian [Mon, 27 Nov 2017 01:30:53 +0000 (09:30 +0800)]
libavformat/rtpenc_mpegts: check avformat_new_stream() return value

The function avformat_new_stream() returns a NULL pointer on failure.
However, in function rtp_mpegts_write_header(), its return value is not
validated before it is dereferenced. Check the return value against NULL
to avoid potential NULL dereference.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavfilter/vf_threshold: use correct linesize
Paul B Mahol [Mon, 27 Nov 2017 17:04:39 +0000 (18:04 +0100)]
avfilter/vf_threshold: use correct linesize

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/matroskaenc: actually enforce the stream limit
James Almer [Mon, 27 Nov 2017 16:39:42 +0000 (13:39 -0300)]
avformat/matroskaenc: actually enforce the stream limit

Prevents out of array accesses. Adressess ticket #6873

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavfilter/af_silenceremove: fix possible crash if supplied duration is negative
Paul B Mahol [Mon, 27 Nov 2017 15:32:54 +0000 (16:32 +0100)]
avfilter/af_silenceremove: fix possible crash if supplied duration is negative

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agolavd/alsa: Double maximum alsa buffer size.
Carl Eugen Hoyos [Mon, 27 Nov 2017 13:05:28 +0000 (14:05 +0100)]
lavd/alsa: Double maximum alsa buffer size.

Fixes recording from ATI Wonder 600 USB adapter, regression since e35c674d.

Reported and analyzed by: Marco Paolieri, paolieri at gmail

6 years agoavfilter/af_silenceremove: fix logic error in EOF case
Paul B Mahol [Mon, 27 Nov 2017 12:38:33 +0000 (13:38 +0100)]
avfilter/af_silenceremove: fix logic error in EOF case

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/avienc: fix fields-per-frame value for interlaced video streams
Tobias Rapp [Mon, 27 Nov 2017 08:13:05 +0000 (09:13 +0100)]
avformat/avienc: fix fields-per-frame value for interlaced video streams

Writes one set of field framing information for progressive streams and
two sets for interlaced streams. Fixes ticket #6383.

Unfortunately the OpenDML v1.02 document is not very specific on what
value to use for start_line when frame data is not coming from a
capturing device, so this is just using 0/1 depending on the field order
as a best-effort guess.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
6 years agoavcodec/nvdec: More effort to make vp8 compile with gcc < 4.6
Philip Langdale [Mon, 27 Nov 2017 06:18:22 +0000 (22:18 -0800)]
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.

6 years agoavcodec/nvdec: Make vp8 initialisation more 'compatible'
Philip Langdale [Mon, 27 Nov 2017 04:40:32 +0000 (20:40 -0800)]
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.

6 years agotests/fate-run: Use -bitexact
Michael Niedermayer [Sat, 21 Oct 2017 23:19:59 +0000 (01:19 +0200)]
tests/fate-run: Use -bitexact

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/mlpdsp: Fix signed integer overflow, 2nd try
Michael Niedermayer [Mon, 20 Nov 2017 17:45:45 +0000 (18:45 +0100)]
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>
6 years agolibavformat/mov: Replace duplicate stream_nb check by assert
Michael Niedermayer [Wed, 22 Nov 2017 11:16:57 +0000 (12:16 +0100)]
libavformat/mov: Replace duplicate stream_nb check by assert

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/h264idct_template: Fix integer overflow in ff_h264_idct8_add
Michael Niedermayer [Mon, 20 Nov 2017 02:08:20 +0000 (03:08 +0100)]
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>
6 years agoavcodec/kgv1dec: Check that there is enough input for maximum RLE compression
Michael Niedermayer [Wed, 22 Nov 2017 19:14:54 +0000 (20:14 +0100)]
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>
6 years agotests/checkasm/float_dsp: Increase allowed difference for float_dsp.vector_dmul
Michael Niedermayer [Sun, 29 Oct 2017 14:26:50 +0000 (15:26 +0100)]
tests/checkasm/float_dsp: Increase allowed difference for float_dsp.vector_dmul

Tested for 10000 iterations on x86-32

Fixes: Ticket6848
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/vc1dec: fix preprocessor checks and hw_configs lists for the hwaccels
James Almer [Mon, 27 Nov 2017 01:22:17 +0000 (22:22 -0300)]
avcodec/vc1dec: fix preprocessor checks and hw_configs lists for the hwaccels

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/mpeg4videodec: fix preprocessor check for the nvdec hwaccel
James Almer [Mon, 27 Nov 2017 01:19:45 +0000 (22:19 -0300)]
avcodec/mpeg4videodec: fix preprocessor check for the nvdec hwaccel

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/nvdec: Implement vp8 hwaccel
Philip Langdale [Sun, 19 Nov 2017 16:42:39 +0000 (08:42 -0800)]
avcodec/nvdec: Implement vp8 hwaccel

6 years agovaapi_decode: Ignore the profile when not useful
Mark Thompson [Sat, 18 Nov 2017 17:52:27 +0000 (17:52 +0000)]
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.

6 years agovaapi: Add VP8 decode hwaccel
Mark Thompson [Sat, 18 Nov 2017 17:55:24 +0000 (17:55 +0000)]
vaapi: Add VP8 decode hwaccel

6 years agovp8: Add hwaccel hooks
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).

6 years agovaapi: Make the decode profile matching more explicit
Mark Thompson [Thu, 9 Nov 2017 01:04:44 +0000 (01:04 +0000)]
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.

6 years agoffmpeg: Use codec hardware config to configure hwaccels
Mark Thompson [Wed, 25 Oct 2017 23:18:47 +0000 (00:18 +0100)]
ffmpeg: Use codec hardware config to configure hwaccels

Removes specific support for all hwaccels supported by the generic code
(DXVA2, D3D11VA, NVDEC, VAAPI and VDPAU).

6 years agolavc: Mark all AVHWAccel structures as const
Mark Thompson [Sat, 4 Nov 2017 18:53:26 +0000 (18:53 +0000)]
lavc: Mark all AVHWAccel structures as const

6 years agolavc: Delete all fake hwaccels
Mark Thompson [Wed, 25 Oct 2017 23:18:46 +0000 (00:18 +0100)]
lavc: Delete all fake hwaccels

They are now unused.

6 years agolavc: Remove register mechanism for hwaccels
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.

6 years agolavc: Deprecate av_hwaccel_next() and av_register_hwaccel()
Mark Thompson [Wed, 25 Oct 2017 23:18:44 +0000 (00:18 +0100)]
lavc: Deprecate av_hwaccel_next() and av_register_hwaccel()

6 years agolavc: Use hardware config information in ff_get_format()
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).

6 years agolavc: Add hardware config metadata for decoders supporting hardware output
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.

6 years agolavc: Add codec metadata to indicate hardware support
Mark Thompson [Wed, 25 Oct 2017 23:18:39 +0000 (00:18 +0100)]
lavc: Add codec metadata to indicate hardware support

6 years agoavformat/aacdec: Fix leak in adts_aac_read_packet()
Michael Niedermayer [Sat, 25 Nov 2017 18:22:51 +0000 (19:22 +0100)]
avformat/aacdec: Fix leak in adts_aac_read_packet()

Fixes: chromium-773637/clusterfuzz-testcase-minimized-6418078673141760
Found-by: ossfuzz/chromium
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*
Michael Niedermayer [Sat, 25 Nov 2017 02:15:16 +0000 (03:15 +0100)]
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>
6 years agovorbisenc: Check the return value of av_frame_clone
Derek Buitenhuis [Fri, 24 Nov 2017 19:24:41 +0000 (19:24 +0000)]
vorbisenc: Check the return value of av_frame_clone

Prevents a segfault when alloc fails.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
6 years agodoc/ffmpeg: Document opencl for -init_hw_device
Mark Thompson [Sun, 26 Nov 2017 15:35:27 +0000 (15:35 +0000)]
doc/ffmpeg: Document opencl for -init_hw_device

6 years agodoc/fftools: Remove documentation for old -opencl_bench option
Mark Thompson [Sun, 26 Nov 2017 10:29:24 +0000 (10:29 +0000)]
doc/fftools: Remove documentation for old -opencl_bench option

6 years agonvenc: Include config.h before checking for D3D11 support
Mark Thompson [Sat, 25 Nov 2017 23:05:24 +0000 (23:05 +0000)]
nvenc: Include config.h before checking for D3D11 support

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
6 years agohwcontext_vaapi: Do not assume that sw_format is transferable
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.

6 years agoh264_picture: Actually return error during alloc failure
Derek Buitenhuis [Fri, 24 Nov 2017 18:21:57 +0000 (18:21 +0000)]
h264_picture: Actually return error during alloc failure

Fixes NULL dereference during alloc failure.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
6 years agoavfilter: add lv2 wrapper filter
Paul B Mahol [Thu, 23 Nov 2017 15:08:42 +0000 (16:08 +0100)]
avfilter: add lv2 wrapper filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoerror_resilience: remove avpriv_atomic usage
Rostislav Pehlivanov [Fri, 24 Nov 2017 23:34:16 +0000 (23:34 +0000)]
error_resilience: remove avpriv_atomic usage

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
6 years agolibavcodec/utils.c: simplify avcodec locking with atomics
Rostislav Pehlivanov [Sat, 25 Nov 2017 16:55:44 +0000 (16:55 +0000)]
libavcodec/utils.c: simplify avcodec locking with atomics

Also makes it more robust than using volatiles.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
6 years agolavc/utils.c: use C11 atomics for entangled thread handling
Rostislav Pehlivanov [Fri, 24 Nov 2017 23:38:44 +0000 (23:38 +0000)]
lavc/utils.c: use C11 atomics for entangled thread handling

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
6 years agoavformat/mov_esds: check return value of ff_mp4_read_dec_config_descr
James Almer [Fri, 24 Nov 2017 20:55:19 +0000 (17:55 -0300)]
avformat/mov_esds: check return value of ff_mp4_read_dec_config_descr

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/isom: return proper error values in ff_mp4_read_dec_config_descr
James Almer [Fri, 24 Nov 2017 20:55:05 +0000 (17:55 -0300)]
avformat/isom: return proper error values in ff_mp4_read_dec_config_descr

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agofate/hapAlphaOnly : add test for hap alpha only decoding
Martin Vignali [Sat, 25 Nov 2017 18:47:06 +0000 (19:47 +0100)]
fate/hapAlphaOnly : add test for hap alpha only decoding

6 years agoavcodec/hapdec : use gray8 for HapAlphaOnly decoding instead of RGB0
Martin Vignali [Sat, 25 Nov 2017 18:46:48 +0000 (19:46 +0100)]
avcodec/hapdec : use gray8 for HapAlphaOnly decoding instead of RGB0

6 years agoavcodec/texturedsp : add rgtc1u gray decoding
Martin Vignali [Sat, 25 Nov 2017 18:41:50 +0000 (19:41 +0100)]
avcodec/texturedsp : add rgtc1u gray decoding

decode rgtc1 block in gray8 picture

6 years agohwcontext_d3d11va: properly reset values after release/close
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.

Fixes a crash reported by sm2345 on IRC.

6 years agoavcodec/fft: fix INTERL macro on 3dnow
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>
6 years agohwcontext_opencl: Reset internal command queue on device_uninit
Mark Thompson [Sat, 25 Nov 2017 15:34:43 +0000 (15:34 +0000)]
hwcontext_opencl: Reset internal command queue on device_uninit

device_uninit can be called twice if device_init fails.

6 years agohwcontext_d3d11: Log adapter details on device creation
Mark Thompson [Tue, 14 Nov 2017 13:02:26 +0000 (13:02 +0000)]
hwcontext_d3d11: Log adapter details on device creation

This is helpful to know what device has actually been used.

6 years agoconfigure: remove superfluous cuvid and nvdec checks
James Almer [Sat, 25 Nov 2017 01:48:24 +0000 (22:48 -0300)]
configure: remove superfluous cuvid and nvdec checks

Both are autodetected, and their dependency on cuda is checked
elsewhere.

Fixes ticket #6849.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: James Almer <jamrial@gmail.com>
6 years agodoc/APIchanges: Fix lavu versions for OpenCL changes
Mark Thompson [Sat, 25 Nov 2017 14:51:55 +0000 (14:51 +0000)]
doc/APIchanges: Fix lavu versions for OpenCL changes

Also fix a typo and fill hashes and dates.

6 years agolavu/pixfmt: Remove gap in the middle of enum AVPixelFormat
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>
6 years agoMerge commit '136e7cf64ce9e78de7158d6720539d51cb96b743'
Mark Thompson [Sat, 25 Nov 2017 14:38:03 +0000 (14:38 +0000)]
Merge commit '136e7cf64ce9e78de7158d6720539d51cb96b743'

* commit '136e7cf64ce9e78de7158d6720539d51cb96b743':
  qsv/hevcdec: Load hw plugin by default on non-windows os

Merged-by: Mark Thompson <sw@jkqxz.net>
6 years agoavfilter: add normalize filter
Richard Ling [Tue, 21 Nov 2017 10:32:06 +0000 (21:32 +1100)]
avfilter: add normalize filter

6 years agoffmpeg libopusdec: fix missing include file in libopusdec.c
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>
6 years agolavf/mov: fix crash in mov_read_sidx
John Stebbins [Fri, 24 Nov 2017 16:18:16 +0000 (08:18 -0800)]
lavf/mov: fix crash in mov_read_sidx

Use correct index into streams

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/dashenc: Associate mpd extension with dash muxer
Karthick J [Wed, 22 Nov 2017 08:20:03 +0000 (13:50 +0530)]
avformat/dashenc: Associate mpd extension with dash muxer

Reviewed-by: 刘歧 <lq@chinaffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/sbrdsp_fixed: Fix integer overflow
Michael Niedermayer [Wed, 22 Nov 2017 19:18:40 +0000 (20:18 +0100)]
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>
6 years agoavformat/utils: fix mixed declarations and code
James Almer [Fri, 24 Nov 2017 20:46:16 +0000 (17:46 -0300)]
avformat/utils: fix mixed declarations and code

Signed-off-by: James Almer <jamrial@gmail.com>