ffmpeg.git
6 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months agoavcodec/nvdec: Implement vp8 hwaccel
Philip Langdale [Sun, 19 Nov 2017 16:42:39 +0000 (08:42 -0800)]
avcodec/nvdec: Implement vp8 hwaccel

6 months 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 months agovaapi: Add VP8 decode hwaccel
Mark Thompson [Sat, 18 Nov 2017 17:55:24 +0000 (17:55 +0000)]
vaapi: Add VP8 decode hwaccel

6 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months agoavfilter: add normalize filter
Richard Ling [Tue, 21 Nov 2017 10:32:06 +0000 (21:32 +1100)]
avfilter: add normalize filter

6 months 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 months 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 months 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 months 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 months 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>
6 months agoavcodec/nvdec: Round up odd width/height values
Philip Langdale [Fri, 24 Nov 2017 18:05:49 +0000 (10:05 -0800)]
avcodec/nvdec: Round up odd width/height values

nvdec will not produce odd width/height output, and while this is
basically never an issue with most codecs, due to internal alignment
requirements, you can get odd sized jpegs.

If an odd-sized jpeg is encountered, nvdec will actually round down
internally and produce output that is slightly smaller. This isn't
the end of the world, as long as you know the output size doesn't
match the original image resolution.

However, with an hwaccel, we don't know. The decoder controls
the reported output size and the hwaccel cannot change it. I was
able to trigger an error in mpv where it tries to copy the output
surface as part of rendering and triggers a cuda error because
cuda knows the output frame is smaller than expected.

To fix this, we can round up the configured width/height passed
to nvdec so that the frames are always at least as large as the
decoder's reported size, and data can be copied out safely.

In this particular jpeg case, you end up with a blank (green) line
at the bottom due to nvdec refusing to decode the last line, but
the behaviour matches cuviddec, so it's as good as you're going to
get.

6 months agoavformat/ttaenc: add tta_init()
James Almer [Mon, 20 Nov 2017 20:43:23 +0000 (17:43 -0300)]
avformat/ttaenc: add tta_init()

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/ttaenc: buffer packets directly
James Almer [Mon, 20 Nov 2017 19:16:11 +0000 (16:16 -0300)]
avformat/ttaenc: buffer packets directly

This is a bit more robust in case of OOM.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavcodec/vorbis: 1 << 31 > int32_t::max(), so use 1u << 31 instead.
Dale Curtis [Wed, 22 Nov 2017 18:58:39 +0000 (10:58 -0800)]
avcodec/vorbis: 1 << 31 > int32_t::max(), so use 1u << 31 instead.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/utils: Prevent undefined shift with wrap_bits > 64.
Dale Curtis [Fri, 17 Nov 2017 21:35:56 +0000 (13:35 -0800)]
avformat/utils: Prevent undefined shift with wrap_bits > 64.

2LL << (wrap_bits=64 - 1) does not fit in int64_t; change the
code to use a uint64_t (2ULL) and add an av_assert2() to
ensure wrap_bits <= 64.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/af_amix: make use of av_asprintf()
Paul B Mahol [Fri, 24 Nov 2017 16:09:48 +0000 (17:09 +0100)]
avfilter/af_amix: make use of av_asprintf()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 months agoavfilter: add mix filter
Paul B Mahol [Mon, 20 Nov 2017 18:58:44 +0000 (19:58 +0100)]
avfilter: add mix filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 months agoavfilter/af_ladspa: remove duplicate code lines
Paul B Mahol [Fri, 24 Nov 2017 12:36:26 +0000 (13:36 +0100)]
avfilter/af_ladspa: remove duplicate code lines

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 months agoavcodec/j2kenc: Only allocate cblk.data once
Michael Niedermayer [Fri, 24 Nov 2017 02:49:55 +0000 (03:49 +0100)]
avcodec/j2kenc: Only allocate cblk.data once

Fixes: memleak
Found-by: <jamrial>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/hlsenc: Added option to add EXT-X-INDEPENDENT-SEGMENTS tag
Karthick J [Thu, 23 Nov 2017 22:57:36 +0000 (06:57 +0800)]
avformat/hlsenc: Added option to add EXT-X-INDEPENDENT-SEGMENTS tag

6 months agoavformat/hlsenc: Refactor an inconsistent variable name
Karthick J [Thu, 23 Nov 2017 22:42:35 +0000 (06:42 +0800)]
avformat/hlsenc: Refactor an inconsistent variable name

6 months agoavformat/hlsenc: Minor fix in setting http options for master playlist
Karthick J [Thu, 23 Nov 2017 22:41:25 +0000 (06:41 +0800)]
avformat/hlsenc: Minor fix in setting http options for master playlist

6 months agoavfilter/Makefile: skip building opencl.h when opencl is disabled
James Almer [Thu, 23 Nov 2017 22:11:17 +0000 (19:11 -0300)]
avfilter/Makefile: skip building opencl.h when opencl is disabled

Fixes make checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
7 months agodoc/filters: mention (a)loop defaults
Lou Logan [Thu, 23 Nov 2017 20:54:26 +0000 (11:54 -0900)]
doc/filters: mention (a)loop defaults

Signed-off-by: Lou Logan <lou@lrcd.com>
7 months agodoc/filters.texi: explain infinite looping
Werner Robitza [Thu, 23 Nov 2017 12:16:53 +0000 (13:16 +0100)]
doc/filters.texi: explain infinite looping

Explain how to achieve infinite looping with the loop / aloop filters.

Signed-off-by: Werner Robitza <werner.robitza@gmail.com>
7 months agoavcodec/x86/exrdsp : use ymm constant for pb_80
Martin Vignali [Tue, 21 Nov 2017 21:02:07 +0000 (22:02 +0100)]
avcodec/x86/exrdsp : use ymm constant for pb_80

speed seems to be similar, but simplify code

7 months agoRevert "udp: fix compilation when HAVE_PTHREAD_CANCEL isnt defined"
Derek Buitenhuis [Wed, 22 Nov 2017 15:28:40 +0000 (15:28 +0000)]
Revert "udp: fix compilation when HAVE_PTHREAD_CANCEL isnt defined"

This was an mplayer-specific hack.

This reverts commit a4f94f24b4f153c30bbcaa700bedfb2b3a581e5e.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
7 months agoqsv/hevcdec: Load hw plugin by default on non-windows os
Li, Zhong [Fri, 10 Nov 2017 08:03:42 +0000 (03:03 -0500)]
qsv/hevcdec: Load hw plugin by default on non-windows os

Software plugin is not available on Linux, Only works on Windows.
Similar changes have been applied to qsv hevc encoder by
b05128f3c953bd66483e697d60a2e7e45ee9cfa0.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
7 months agolavf/mov: Read aspect ratio from AVID jpeg2000 mov files.
Carl Eugen Hoyos [Thu, 23 Nov 2017 01:57:24 +0000 (02:57 +0100)]
lavf/mov: Read aspect ratio from AVID jpeg2000 mov files.

7 months agoopus_pvq: fix crashing on analysis of mono
Rostislav Pehlivanov [Thu, 23 Nov 2017 00:58:36 +0000 (00:58 +0000)]
opus_pvq: fix crashing on analysis of mono

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
7 months agotools/cl2c: Add a copyright header
Mark Thompson [Wed, 22 Nov 2017 23:55:03 +0000 (23:55 +0000)]
tools/cl2c: Add a copyright header

7 months agolavu,lavfi,ffmpeg: Remove experimental OpenCL API
Mark Thompson [Tue, 14 Nov 2017 19:47:30 +0000 (19:47 +0000)]
lavu,lavfi,ffmpeg: Remove experimental OpenCL API

This was added in early 2013 and abandoned several months later; as far as
I can tell, there are no external users.  Future OpenCL use will be via
hwcontext, which requires neither special OpenCL-only API nor global state
in libavutil.

All internal users are also deleted - this is just the unsharp filter
(replaced by unsharp_opencl, which is more flexible) and the deshake filter
(no replacement).

7 months agohwcontext: Perform usual uninitialisation on derived frames contexts
Mark Thompson [Mon, 26 Jun 2017 19:28:07 +0000 (20:28 +0100)]
hwcontext: Perform usual uninitialisation on derived frames contexts

7 months agovf_hwmap: Pass mapping mode when deriving frames context on an existing device
Mark Thompson [Sun, 25 Jun 2017 21:13:03 +0000 (22:13 +0100)]
vf_hwmap: Pass mapping mode when deriving frames context on an existing device

To match creation on a newly-derived device.  (This was missed earlier
because the mode is only used in some cases.)

7 months agolavfi: Add OpenCL unsharp mask filter
Mark Thompson [Tue, 14 Nov 2017 19:47:27 +0000 (19:47 +0000)]
lavfi: Add OpenCL unsharp mask filter

Intended to replace existing opencl mode of the unsharp filter.
Supports many more pixel formats and works without immediate upload
and download of frame data.  The options are compatible with the
existing filter.

7 months agolavfi: Add OpenCL overlay filter
Mark Thompson [Sun, 10 Sep 2017 20:53:36 +0000 (21:53 +0100)]
lavfi: Add OpenCL overlay filter

Input and output formats must be the same, the overlay format must be
the same as the input except possibly with an additional alpha component.

7 months agolavfi: Add infrastructure for building OpenCL source into libavfilter
Mark Thompson [Sun, 10 Sep 2017 20:53:35 +0000 (21:53 +0100)]
lavfi: Add infrastructure for building OpenCL source into libavfilter

7 months agolavfi: Add some common code for OpenCL filtering
Mark Thompson [Tue, 27 Jun 2017 21:50:49 +0000 (22:50 +0100)]
lavfi: Add some common code for OpenCL filtering

7 months agohwcontext_opencl: DRM to OpenCL mapping for ARM
Mark Thompson [Sun, 10 Sep 2017 12:37:20 +0000 (13:37 +0100)]
hwcontext_opencl: DRM to OpenCL mapping for ARM

Using cl_arm_import_memory.  Unfortunately, despite this not being a
standard extension, the function clImportMemoryARM() is not accessible
via clGetExtensionFunctionAddressForPlatform().  This means that it has
to be linked directly to the ARM OpenCL binary, so making a portable
binary is not possible as it is with all other mapping extensions.

7 months agohwcontext_opencl: D3D11 to OpenCL mapping
Mark Thompson [Sun, 25 Jun 2017 21:34:40 +0000 (22:34 +0100)]
hwcontext_opencl: D3D11 to OpenCL mapping

Using cl_khr_d3d11_sharing and cl_intel_d3d11_nv12_media_sharing.

7 months agohwcontext_opencl: DXVA2 to OpenCL mapping
Mark Thompson [Sun, 5 Mar 2017 16:21:41 +0000 (16:21 +0000)]
hwcontext_opencl: DXVA2 to OpenCL mapping

Using cl_khr_dx9_media_sharing.

7 months agohwcontext_opencl: QSV to OpenCL mapping for Intel Media SDK
Mark Thompson [Sat, 4 Mar 2017 23:57:49 +0000 (23:57 +0000)]
hwcontext_opencl: QSV to OpenCL mapping for Intel Media SDK

Uses the cl_intel_va_api_media_sharing extension, which supports only
NV12 surfaces and only mapping from QSV to OpenCL.

7 months agohwcontext_opencl: VAAPI to OpenCL mapping for Intel i965+beignet
Mark Thompson [Sat, 4 Mar 2017 23:57:48 +0000 (23:57 +0000)]
hwcontext_opencl: VAAPI to OpenCL mapping for Intel i965+beignet

Supports all surface formats in common between the two.

7 months agolavu: OpenCL hwcontext implementation
Mark Thompson [Sat, 4 Mar 2017 23:57:47 +0000 (23:57 +0000)]
lavu: OpenCL hwcontext implementation

7 months agolavu: Add OpenCL hardware pixfmt
Mark Thompson [Sat, 4 Mar 2017 23:57:46 +0000 (23:57 +0000)]
lavu: Add OpenCL hardware pixfmt

7 months agodoc: Add FAQs about running in background (rev 2)
Jim DeLaHunt [Wed, 15 Nov 2017 08:43:30 +0000 (00:43 -0800)]
doc: Add FAQs about running in background (rev 2)

Add two FAQs about running FFmpeg in the background.
The first explains the use of the -nostdin option in
a straightforward way. Text revised based on review.

The second FAQ starts from a confusing error message,
and leads to the solution, use of the -nostdin option.
The purpose of the second FAQ is to attract web searches
from people having the problem, and offer them a solution.

Add an anchor to the Main Options section of the ffmpeg
documentation, so that the FAQs can link directly there.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavformat/mov: Increment stsd_count while processing stsd data; avoids leaks.
Dale Curtis [Tue, 21 Nov 2017 23:40:22 +0000 (15:40 -0800)]
avformat/mov: Increment stsd_count while processing stsd data; avoids leaks.

In the event of ff_mov_read_stsd_entries() failure, sc->stsd_count
is not updated, even if the function allocates extradata memory.
Instead update the sc->stsd_count as entries are parsed so that
mov_read_close() can do the right thing.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavcodec/jpeg2000: Dynamically allocate codeblock data
Michael Niedermayer [Sat, 18 Nov 2017 00:33:18 +0000 (01:33 +0100)]
avcodec/jpeg2000: Dynamically allocate codeblock data

Fixes: OOM
Fixes: 3541/clusterfuzz-testcase-minimized-6469958596820992

Adds support for decoding codeblock data larger than 8kb
Reduces decoder memory consumption

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavdevice/decklink_dec: autodetect the video input format
Karthick J [Fri, 27 Oct 2017 06:30:23 +0000 (12:00 +0530)]
avdevice/decklink_dec: autodetect the video input format

When -format_code is not specified autodetection will happen.

Signed-off-by: Marton Balint <cus@passwd.hu>
7 months agoavdevice/decklink: refactor ff_decklink_set_format function
Karthick J [Tue, 7 Nov 2017 04:02:23 +0000 (09:32 +0530)]
avdevice/decklink: refactor ff_decklink_set_format function

This is done to enable input format autodetection in decklink_dec.

Signed-off-by: Marton Balint <cus@passwd.hu>
7 months agoavcodec/mpeg4videodec: Check also for negative versions in the validity check
Michael Niedermayer [Tue, 21 Nov 2017 02:15:53 +0000 (03:15 +0100)]
avcodec/mpeg4videodec: Check also for negative versions in the validity check

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 months agoavfilter/af_asetnsamples: add missing error check
Paul B Mahol [Mon, 20 Nov 2017 13:02:28 +0000 (14:02 +0100)]
avfilter/af_asetnsamples: add missing error check

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 months agocheckasm/utvideodsp: zero initialize the entire buffer
James Almer [Tue, 21 Nov 2017 14:14:33 +0000 (11:14 -0300)]
checkasm/utvideodsp: zero initialize the entire buffer

Signed-off-by: James Almer <jamrial@gmail.com>
7 months agocheckasm/utvideodsp: fix mixed declarations and code
James Almer [Tue, 21 Nov 2017 14:13:24 +0000 (11:13 -0300)]
checkasm/utvideodsp: fix mixed declarations and code

Signed-off-by: James Almer <jamrial@gmail.com>
7 months agox86/utvideodsp: reuse shared constants
James Almer [Tue, 21 Nov 2017 13:57:06 +0000 (10:57 -0300)]
x86/utvideodsp: reuse shared constants

Remove the broadcast instructions as well now that they are wide
enough.

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