ffmpeg.git
13 months agolavfi: add sobel, prewitt, roberts filters
Danil Iashchenko [Sat, 30 Jun 2018 00:46:24 +0000 (03:46 +0300)]
lavfi: add sobel, prewitt, roberts filters

Add opencl version of sobel, prewitt, roberts filters.

13 months agolibavfilter: vf_sr.c remove warnings
Pedro Arthur [Mon, 2 Jul 2018 16:45:38 +0000 (13:45 -0300)]
libavfilter: vf_sr.c remove warnings

13 months agoAdds ESPCN super resolution filter merged with SRCNN filter.
Sergey Lavrushkin [Wed, 13 Jun 2018 21:37:12 +0000 (00:37 +0300)]
Adds ESPCN super resolution filter merged with SRCNN filter.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
13 months agoavcodec/dvdsubdec: Check for fully transparent rectangles earlier
Michael Niedermayer [Sat, 30 Jun 2018 21:34:14 +0000 (23:34 +0200)]
avcodec/dvdsubdec: Check for fully transparent rectangles earlier

Testcase with large transparent rectangles changes from 67 sec to 3 sec decode time

Fixes: Timeout
Fixes: 8728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5190088756559872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/apngdec: set pts to AV_NOPTS_VALUE
Marton Balint [Thu, 28 Jun 2018 19:07:30 +0000 (21:07 +0200)]
avformat/apngdec: set pts to AV_NOPTS_VALUE

And let the generic code figure out the proper PTS. This is needed because apng
does not provide seek functions, but after a generic seek (e.g. to file start)
timestamps are not reset which causes broken timestamps when looping apngs,
like in ticket #6121.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoffmpeg: fix -stream_loop with multiple inputs
Marton Balint [Wed, 27 Jun 2018 20:27:01 +0000 (22:27 +0200)]
ffmpeg: fix -stream_loop with multiple inputs

The input thread needs to be properly cleaned up and re-initalized before we
can start reading again in threaded mode. (Threaded input reading is used when
there is mode than one input file).

Fixes ticket #6121 and #7043.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoffmpeg: factorize input thread creation and destruction
Marton Balint [Wed, 27 Jun 2018 19:55:38 +0000 (21:55 +0200)]
ffmpeg: factorize input thread creation and destruction

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agotools/target_dec_fuzzer: Fix parser_avctx memleak on error path
Michael Niedermayer [Sat, 30 Jun 2018 13:48:58 +0000 (15:48 +0200)]
tools/target_dec_fuzzer: Fix parser_avctx memleak on error path

Fixes: oss-fuzz issue 9195

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/vc1_block: Fix mqaunt check for negative values
Michael Niedermayer [Thu, 28 Jun 2018 21:46:32 +0000 (23:46 +0200)]
avcodec/vc1_block: Fix mqaunt check for negative values

Fixes: out of array access
Fixes: ffmpeg_bof_4.avi
Fixes: ffmpeg_bof_5.avi
Fixes: ffmpeg_bof_6.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Reviewed-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolibavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in...
Wang Cao [Thu, 28 Jun 2018 08:32:01 +0000 (16:32 +0800)]
libavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in Y4M.

Set pixel format and color_range for YUVJ pixel formats. Also set
color_range based on AVFormatContext.

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoChangelog: Mention vc1 improvements by Jerome Borsboom.
Carl Eugen Hoyos [Thu, 28 Jun 2018 23:34:23 +0000 (01:34 +0200)]
Changelog: Mention vc1 improvements by Jerome Borsboom.

13 months agoavcodec/vc1: fix check for missing CBPTAB
Jerome Borsboom [Wed, 20 Jun 2018 13:17:34 +0000 (15:17 +0200)]
avcodec/vc1: fix check for missing CBPTAB

CBPTAB must be present in (non skipped) P and B pictures.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: fix overlap filter for frame interlaced pictures
Jerome Borsboom [Wed, 20 Jun 2018 11:11:07 +0000 (13:11 +0200)]
avcodec/vc1: fix overlap filter for frame interlaced pictures

The overlap filter is not correct for vertical edges in frame interlaced
I and P pictures. When filtering macroblocks with different FIELDTX values,
we have to match the lines at both sides of the vertical border. In addition,
we have to use the correct rounding values, depending on the line we are
filtering.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: change the internal ordering of blocks within a macroblock
Jerome Borsboom [Wed, 20 Jun 2018 11:11:03 +0000 (13:11 +0200)]
avcodec/vc1: change the internal ordering of blocks within a macroblock

The overlap filter needs to cover a full macroblock vertical edge when the
FIELDTX value for two neighbouring macroblocks is not equal. By changing
the internal ordering of the blocks from row major to column major, we do
not need to reinterlace a FIELDTX coded macroblock before running the overlap
filter.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agoavcodec/vc1: fix condition guarding overlap filter on I picture
Jerome Borsboom [Wed, 20 Jun 2018 11:10:58 +0000 (13:10 +0200)]
avcodec/vc1: fix condition guarding overlap filter on I picture

The overlap filter needs to run when PQUANT is 9 or higher, irrespective
of CONDOVER.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
13 months agohwcontext_opencl: remove an unused variable
Jun Zhao [Mon, 18 Jun 2018 12:19:39 +0000 (20:19 +0800)]
hwcontext_opencl: remove an unused variable

remove an unused variable

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agohwcontext_opencl: Remove the opencl_device_init in opencl_device_derive
Jun Zhao [Wed, 20 Jun 2018 03:13:59 +0000 (11:13 +0800)]
hwcontext_opencl: Remove the opencl_device_init in opencl_device_derive

In opencl device derived case, don't need to call opencl_device_init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agoconfigure: fix check for opencl_vaapi_intel_media.
Jun Zhao [Sat, 2 Jun 2018 03:06:50 +0000 (11:06 +0800)]
configure: fix check for opencl_vaapi_intel_media.

opencl_vaapi_intel_media doesn't depend on libmfx, OpenCL™ Drivers
and Runtimes for Intel® Architectureis is a standalone release, more
information can be found in the link:
https://software.intel.com/en-us/articles/opencl-drivers.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
13 months agoh264_slice: Fix return of incomplete frames from decoder
John Stebbins [Wed, 27 Jun 2018 22:12:24 +0000 (15:12 -0700)]
h264_slice: Fix return of incomplete frames from decoder

When not using libavformat for demuxing, AVCodecContext.has_b_frames
gets set too late causing the recovery frame heuristic in h264_refs to
incorrectly flag an early frame as recovered.

This patch sets has_b_frames earlier to prevent improperly flagging the
frame as recovered.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/movenc: Use mov->fc consistently for av_log()
Michael Niedermayer [Wed, 27 Jun 2018 21:41:52 +0000 (23:41 +0200)]
avformat/movenc: Use mov->fc consistently for av_log()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agotools/target_dec_fuzzer: Also optionally fuzz with a parser
Michael Niedermayer [Sat, 23 Jun 2018 11:35:17 +0000 (13:35 +0200)]
tools/target_dec_fuzzer: Also optionally fuzz with a parser

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/mpeg4videodec: Check read profile before setting it
Michael Niedermayer [Wed, 27 Jun 2018 17:37:09 +0000 (19:37 +0200)]
avcodec/mpeg4videodec: Check read profile before setting it

Fixes: null pointer dereference
Fixes: ffmpeg_crash_7.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/movenc: Do not pass AVCodecParameters in avpriv_request_sample
Michael Niedermayer [Wed, 27 Jun 2018 15:27:50 +0000 (17:27 +0200)]
avformat/movenc: Do not pass AVCodecParameters in avpriv_request_sample

Fixes: out of array read
Fixes: ffmpeg_crash_8.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/ac3_parser: Check init_get_bits8() for failure
Michael Niedermayer [Wed, 27 Jun 2018 14:59:13 +0000 (16:59 +0200)]
avcodec/ac3_parser: Check init_get_bits8() for failure

Fixes: null pointer dereference
Fixes: ffmpeg_crash_6.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have...
Michael Niedermayer [Wed, 27 Jun 2018 14:51:51 +0000 (16:51 +0200)]
avformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id

Fixes: out of array access
Fixes: ffmpeg_bof_1.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dpx: Check elements in 12bps planar path
Michael Niedermayer [Wed, 27 Jun 2018 14:12:39 +0000 (16:12 +0200)]
avcodec/dpx: Check elements in 12bps planar path

Fixes: null pointer dereference
Fixes: 8946/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5078915222601728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolavfi/colorspace: Add namespace prefix to global functions
Mark Thompson [Sat, 23 Jun 2018 16:51:14 +0000 (17:51 +0100)]
lavfi/colorspace: Add namespace prefix to global functions

13 months agoffmpeg: make loglevel verbose for frame duration warning
Gyan Doshi [Thu, 28 Jun 2018 08:35:31 +0000 (14:05 +0530)]
ffmpeg: make loglevel verbose for frame duration warning

13 months agoavcodec/qsvenc: fix version detection on cygwin
Timo Rothenpieler [Fri, 15 Jun 2018 14:52:28 +0000 (16:52 +0200)]
avcodec/qsvenc: fix version detection on cygwin

13 months agoavcodec/escape124: Fix spelling errors in comment
Michael Niedermayer [Wed, 27 Jun 2018 11:00:28 +0000 (13:00 +0200)]
avcodec/escape124: Fix spelling errors in comment

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/dvbsubdec: Compute scoretab without iterating over pixels multiple times...
Michael Niedermayer [Thu, 21 Jun 2018 21:32:23 +0000 (23:32 +0200)]
avcodec/dvbsubdec: Compute scoretab without iterating over pixels multiple times in compute_default_clut()

Improves speed 102->2 sec
Testcase: 8655/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-6277869285146624
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/ra144: Fix integer overflow in ff_eval_refl()
Michael Niedermayer [Thu, 21 Jun 2018 21:08:32 +0000 (23:08 +0200)]
avcodec/ra144: Fix integer overflow in ff_eval_refl()

Fixes: signed integer overflow: -4096 * -524288 cannot be represented in type 'int'
Fixes: 8650/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-5734816036159488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolibavutil/encryption_info: Add unit tests.
Jacob Trimble [Fri, 1 Jun 2018 18:38:05 +0000 (11:38 -0700)]
libavutil/encryption_info: Add unit tests.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavutil/gitignore: Ignore integer test binary.
Jacob Trimble [Tue, 26 Jun 2018 16:35:05 +0000 (09:35 -0700)]
avutil/gitignore: Ignore integer test binary.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavutil/encryption_info: Fix documentation problem.
Jacob Trimble [Tue, 26 Jun 2018 16:32:14 +0000 (09:32 -0700)]
avutil/encryption_info: Fix documentation problem.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agov4l2_m2m: decoder: fix memory leak
Lukas Rusak [Tue, 26 Jun 2018 21:36:46 +0000 (14:36 -0700)]
v4l2_m2m: decoder: fix memory leak

13 months agolavf/amr: Fix heuristic to avoid detection of repeated bytes.
Carl Eugen Hoyos [Mon, 25 Jun 2018 21:20:09 +0000 (23:20 +0200)]
lavf/amr: Fix heuristic to avoid detection of repeated bytes.

13 months agofftools/ffmpeg: check sseof value and clash with ss
Gyan Doshi [Fri, 22 Jun 2018 16:32:16 +0000 (22:02 +0530)]
fftools/ffmpeg: check sseof value and clash with ss

Prioritize -ss

13 months agolavc/libopenjpeg: Support GRAY10, GRAY12 and GRAY14.
Carl Eugen Hoyos [Thu, 21 Jun 2018 10:05:40 +0000 (12:05 +0200)]
lavc/libopenjpeg: Support GRAY10, GRAY12 and GRAY14.

13 months agoavcodec/cscd: Check output buffer size for lzo.
Michael Niedermayer [Thu, 21 Jun 2018 23:18:20 +0000 (01:18 +0200)]
avcodec/cscd: Check output buffer size for lzo.

Fixes: Timeout
Fixes: 8665/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5768442610188288

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
13 months agoavcodec/ffv1dec: Check state transition table
Michael Niedermayer [Thu, 21 Jun 2018 20:10:23 +0000 (22:10 +0200)]
avcodec/ffv1dec: Check state transition table

Fixes: Timeout
Fixes: 8646/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5649968353247232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/escape124: Check buf_size against num_superblocks
Michael Niedermayer [Sun, 24 Jun 2018 17:23:02 +0000 (19:23 +0200)]
avcodec/escape124: Check buf_size against num_superblocks

Fixes: Timeout
Fixes: 8722/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-4843268402577408

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolavf/mpjpegdec: Mark local variable static
Mark Thompson [Fri, 22 Jun 2018 14:52:58 +0000 (15:52 +0100)]
lavf/mpjpegdec: Mark local variable static

13 months agolavfi/vf_tonemap_opencl: Mark local tables static
Mark Thompson [Sat, 23 Jun 2018 16:52:08 +0000 (17:52 +0100)]
lavfi/vf_tonemap_opencl: Mark local tables static

13 months agoconfigure: bump minimum required version of libaom
James Almer [Mon, 25 Jun 2018 19:04:32 +0000 (16:04 -0300)]
configure: bump minimum required version of libaom

Version 1.0.0 is the first release after the bitstream freeze.

Signed-off-by: James Almer <jamrial@gmail.com>
13 months agofrom RTCTIME to N*23, step is 23
Steven Liu [Mon, 25 Jun 2018 06:06:45 +0000 (14:06 +0800)]
from RTCTIME to N*23, step is 23
fix ticket: 7225

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
13 months agoavcodec/h264_parser: Reduce needed history for parsing mb index
Michael Niedermayer [Fri, 22 Jun 2018 19:45:59 +0000 (21:45 +0200)]
avcodec/h264_parser: Reduce needed history for parsing mb index

This fixes a bug/regression with very small packets
Fixes: output_file

Regression since: 0782fb6bcb32fe3ab956a99af4cc472ff81da0c2

Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/magicyuv: Check bits left in flags&1 branch
Michael Niedermayer [Sat, 23 Jun 2018 21:37:10 +0000 (23:37 +0200)]
avcodec/magicyuv: Check bits left in flags&1 branch

Fixes: Timeout
Fixes: 8690/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-6542020913922048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavformat/mxfdec: avoid index_table->nb_ptses overflow in mxf_compute_ptses_fake_index
Marton Balint [Tue, 12 Jun 2018 21:42:16 +0000 (23:42 +0200)]
avformat/mxfdec: avoid index_table->nb_ptses overflow in mxf_compute_ptses_fake_index

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: compute sample_count for all streams on seek
Marton Balint [Sat, 26 May 2018 09:39:55 +0000 (11:39 +0200)]
avformat/mxfdec: compute sample_count for all streams on seek

sample_count will be used for per-stream current_edit_unit.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: add support for returning the partition for mxf_edit_unit_absolute_o...
Marton Balint [Sat, 26 May 2018 10:24:01 +0000 (12:24 +0200)]
avformat/mxfdec: add support for returning the partition for mxf_edit_unit_absolute_offset and mxf_absolute_bodysid_offset

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: make current_edit_unit a parameter of mxf_compute_samples
Marton Balint [Thu, 24 May 2018 21:10:04 +0000 (23:10 +0200)]
avformat/mxfdec: make current_edit_unit a parameter of mxf_compute_samples

No change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: make edit_units_per_packet a track property
Marton Balint [Thu, 24 May 2018 08:30:12 +0000 (10:30 +0200)]
avformat/mxfdec: make edit_units_per_packet a track property

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: simply use the first essence element for non frame-wrapped partition...
Marton Balint [Wed, 13 Jun 2018 19:46:34 +0000 (21:46 +0200)]
avformat/mxfdec: simply use the first essence element for non frame-wrapped partition essence offset

Also add the canopus essence element to the list of the recognized essence
element keys.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: compute both essence_offset and essence_length in mxf_compute_essenc...
Marton Balint [Wed, 23 May 2018 21:20:44 +0000 (23:20 +0200)]
avformat/mxfdec: compute both essence_offset and essence_length in mxf_compute_essence_containers

Also compute the correct essence_offset and essence_length for all clip wrapped
essences.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: extend mxf_handle_missing_index_segment for all clip wrapped essences
Marton Balint [Sun, 20 May 2018 19:10:50 +0000 (21:10 +0200)]
avformat/mxfdec: extend mxf_handle_missing_index_segment for all clip wrapped essences

Also make sure we set a valid track index sid and a valid track edit rate in
order for the index to be useful.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: add some essence container uls from SMPTE draft
Marton Balint [Sat, 9 Jun 2018 16:50:22 +0000 (18:50 +0200)]
avformat/mxfdec: add some essence container uls from SMPTE draft

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: add support for determining essence wrapping scheme
Marton Balint [Thu, 17 May 2018 18:49:25 +0000 (20:49 +0200)]
avformat/mxfdec: add support for determining essence wrapping scheme

Some code is based on bmxlib-libmxf/mxf/mxf_utils.c.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavformat/mxfdec: store next_klv in KLVPacket
Marton Balint [Sun, 20 May 2018 15:17:42 +0000 (17:17 +0200)]
avformat/mxfdec: store next_klv in KLVPacket

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agolavfi/framesync: Add namespace prefix to framesync_get_class
Mark Thompson [Sun, 24 Jun 2018 18:25:37 +0000 (19:25 +0100)]
lavfi/framesync: Add namespace prefix to framesync_get_class

13 months agohwcontext_opencl: Remove unused variable
Mark Thompson [Sun, 24 Jun 2018 18:37:39 +0000 (19:37 +0100)]
hwcontext_opencl: Remove unused variable

Unused since a2613647c4f40b9e802cd21f37545ef1fdf370d1.

13 months agolibavutil/encryption_info: Allow multiple init info.
Jacob Trimble [Mon, 23 Apr 2018 17:33:58 +0000 (10:33 -0700)]
libavutil/encryption_info: Allow multiple init info.

It is possible for there to be multiple encryption init info structure.
For example, to support multiple key systems or in key rotation.  This
changes the AVEncryptionInitInfo struct to be a linked list so there
can be multiple structs without breaking ABI.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoffmpeg: Treat subtitles like audio and video for non-monotonic dts.
Hans Carlson [Thu, 21 Jun 2018 12:24:36 +0000 (14:24 +0200)]
ffmpeg: Treat subtitles like audio and video for non-monotonic dts.

Fixes ticket #4450.
Fixes ticket #6248.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agoavcodec/mjpegdec: Check for end of bitstream in ljpeg_decode_rgb_scan()
Michael Niedermayer [Thu, 21 Jun 2018 20:48:54 +0000 (22:48 +0200)]
avcodec/mjpegdec: Check for end of bitstream in ljpeg_decode_rgb_scan()

Fixes: Timeout
Fixes: 8648/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5108395525799936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolibavcodec/ffv1enc: minor cosmetic fix
Michael Niedermayer [Thu, 21 Jun 2018 20:04:23 +0000 (22:04 +0200)]
libavcodec/ffv1enc: minor cosmetic fix

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13 months agolavf/amr: Make the heuristic for auto-detection even stricter.
Carl Eugen Hoyos [Thu, 21 Jun 2018 22:08:13 +0000 (00:08 +0200)]
lavf/amr: Make the heuristic for auto-detection even stricter.

Fixes ticket #7270.

13 months agolavc/dpx: Support 10-bit packing method b (msbpad).
Carl Eugen Hoyos [Sat, 16 Jun 2018 15:47:46 +0000 (17:47 +0200)]
lavc/dpx: Support 10-bit packing method b (msbpad).

13 months agolavc/dpx: Support 12-bit packing method b (msbpad).
Carl Eugen Hoyos [Sat, 16 Jun 2018 15:11:58 +0000 (17:11 +0200)]
lavc/dpx: Support 12-bit packing method b (msbpad).

13 months agohwcontext_opencl: use ff_hwframe_map_replace()
Rostislav Pehlivanov [Fri, 20 Apr 2018 04:30:04 +0000 (05:30 +0100)]
hwcontext_opencl: use ff_hwframe_map_replace()

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
13 months agohwcontext_internal: add ff_hwframe_map_replace
Rostislav Pehlivanov [Fri, 20 Apr 2018 04:30:03 +0000 (05:30 +0100)]
hwcontext_internal: add ff_hwframe_map_replace

Used to fix unmapping when no direct interop exists between APIs.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
13 months agoavformat/movenc: allow hdlr name field to be empty
Gyan Doshi [Thu, 21 Jun 2018 06:03:00 +0000 (11:33 +0530)]
avformat/movenc: allow hdlr name field to be empty

Both QTFF and the ISOBMFF standards allow it.

Fixes #7262

13 months agolavfi: make vf_colorspace use functions from colorspace.c
Ruiling Song [Tue, 19 Jun 2018 01:57:32 +0000 (09:57 +0800)]
lavfi: make vf_colorspace use functions from colorspace.c

These functions are shared among colorspace related filters.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
13 months agolavfi: add opencl tonemap filter
Ruiling Song [Tue, 19 Jun 2018 01:57:31 +0000 (09:57 +0800)]
lavfi: add opencl tonemap filter

This filter does HDR(HDR10/HLG) to SDR conversion with tone-mapping.

An example command to use this filter with vaapi codecs:
FFMPEG -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device \
opencl=ocl@va -hwaccel vaapi -hwaccel_device va -hwaccel_output_format \
vaapi -i INPUT -filter_hw_device ocl -filter_complex \
'[0:v]hwmap,tonemap_opencl=t=bt2020:tonemap=linear:format=p010[x1]; \
[x1]hwmap=derive_device=vaapi:reverse=1' -c:v hevc_vaapi -profile 2 OUTPUT

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
13 months agolavfi: Add boxblur_opencl filter
Danil Iashchenko [Wed, 20 Jun 2018 01:33:02 +0000 (04:33 +0300)]
lavfi: Add boxblur_opencl filter

Behaves like existing boxblur filter.

13 months agoffplay: ignore keypress events before a window is created
Marton Balint [Mon, 11 Jun 2018 21:19:37 +0000 (23:19 +0200)]
ffplay: ignore keypress events before a window is created

Current ffplay code assumes that the read thread is in its main loop before any
key events are captured, but apparently on IOS even keypresses without a window
are forwared.

Fixes ticket #7252.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agoavcodec/libzvbi-teletextdec: propagate ERASE_PAGE flag for repeated subtitle page...
Marton Balint [Sun, 10 Jun 2018 22:53:13 +0000 (00:53 +0200)]
avcodec/libzvbi-teletextdec: propagate ERASE_PAGE flag for repeated subtitle page headers

This works around a libzvbi bug (a corner case in the teletext spec):

https://sourceforge.net/p/zapping/bugs/203/
https://sourceforge.net/p/zapping/patches/20/

Fixes samples/ffmpeg-bugs/trac/ticket2086/RBT_20100801_1835.ts.

Signed-off-by: Marton Balint <cus@passwd.hu>
13 months agolavf/mov: Do not fail hard for truncated stsz atoms.
Carl Eugen Hoyos [Sat, 16 Jun 2018 12:22:52 +0000 (14:22 +0200)]
lavf/mov: Do not fail hard for truncated stsz atoms.

Fixes ticket #6433.

13 months agoavformat/movenc: read track title from correct key
Gyan Doshi [Sat, 16 Jun 2018 10:01:51 +0000 (15:31 +0530)]
avformat/movenc: read track title from correct key

da9cc22d5bd allowed the MOV muxer to relay a custom stream handler name,
whether populated from the input stream or user-set. However, the entry
key didn't match the key set by the MOV demuxer, so it wasn't
effective. Fixed.

Due to the change, four FATE refs have to be updated. Verified that the
target payload of the tests hasn't changed in terms of CRC.

13 months agoavcodec/libx265: apply lavc maxrate, bufsize & rc_init_occupancy
Gyan Doshi [Mon, 18 Jun 2018 06:39:54 +0000 (12:09 +0530)]
avcodec/libx265: apply lavc maxrate, bufsize & rc_init_occupancy

CLI options -maxrate, -bufsize and -rc_init_occupancy can now be picked
up by the x265 wrapper.  Min. rc init has to be 1001 to avoid x265
setting it to vbv-bufsize.

13 months agoavdevice/v4l2enc: add video4linux2 name alias
Lou Logan [Thu, 14 Jun 2018 21:12:27 +0000 (13:12 -0800)]
avdevice/v4l2enc: add video4linux2 name alias

Makes the v4l2 outdev name consistent with the v4l2 indev name.

Signed-off-by: Lou Logan <lou@lrcd.com>
13 months agoavformat/mpegts: parse large PMTs with multiple tables
Aman Gupta [Mon, 11 Jun 2018 07:43:31 +0000 (00:43 -0700)]
avformat/mpegts: parse large PMTs with multiple tables

In 9152c1e4955, the mpegts parser was taught how to parse
PMT sections which contained multiple tables. That commit
fixed parsing of PMT packets from some cable providers,
which included a special SCTE table (0xc0) before the
standard program map table (0x2).

Sometimes, however, the combined 0xc0 and 0x2 tables are
larger than a single TS packet (188 bytes). The mpegts parser
already attempts to parse sections which span multiple packets,
but still assumed that the split section only contained one
table.

This patch fixes parsing of such a sample[1].

Before:

    Input #0, mpegts, from 'combined-pmt-tids-split.ts':
      Duration: 00:00:01.26, start: 39188.931756, bitrate: 597 kb/s
      Program 1
      No Program
        Stream #0:0[0xeff]: Audio: ac3, 48000 Hz, mono, fltp, 64 kb/s
        Stream #0:1[0xefd]: Audio: mp3, 0 channels, fltp
        Stream #0:2[0xefe]: Unknown: none

After:

    Input #0, mpegts, from 'combined-pmt-tids-split.ts':
      Duration: 00:00:01.27, start: 39188.931756, bitrate: 589 kb/s
      Program 1
        Stream #0:0[0xefd]: Video: h264 ([27][0][0][0] / 0x001B), none, 59.94 fps, 59.94 tbr, 90k tbn, 180k tbc
        Stream #0:1[0xefe](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
        Stream #0:2[0xeff](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, mono, fltp, 64 kb/s
        Stream #0:3[0xf00]: Data: scte_35
        Stream #0:4[0xf01]: Unknown: none (ETV1 / 0x31565445)
        Stream #0:5[0xf02]: Unknown: none (ETV1 / 0x31565445)
        Stream #0:6[0xf03]: Unknown: none ([192][0][0][0] / 0x00C0)

With the patch, the PMT is parsed correctly so the streams are
created in the correct order, are associated with "Program 1",
and their codecs are set correctly.

[1] https://s3.amazonaws.com/tmm1/combined-pmt-tids-split.ts

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
14 months agoRevert "avcodec/mediacodecdec: wait on first frame after input buffers are full"
Aman Gupta [Mon, 18 Jun 2018 18:53:27 +0000 (11:53 -0700)]
Revert "avcodec/mediacodecdec: wait on first frame after input buffers are full"

@xyz reported a regression on his Sony Xperia Z3 Tablet Compact where
playback would intermittently fail to start, essentially deadlocking in
the decoder. Bisecting narrowed down the issue to this commit, which was
meant as an optimization but is not necessary.

This reverts commit a75bb5496ac6e7e194f1c6fd3b87f02a52e74adb.

Signed-off-by: Aman Gupta <aman@tmm1.net>
14 months agoavcodec/videotoolboxenc: fix invalid session on iOS
Thomas Guillem [Thu, 14 Jun 2018 15:48:07 +0000 (17:48 +0200)]
avcodec/videotoolboxenc: fix invalid session on iOS

Cf. comment. Restart the VT session when the APP goes from foreground to
background and vice versa.

Signed-off-by: Aman Gupta <aman@tmm1.net>
14 months agoavcodec/videotoolboxenc: split initialization
Thomas Guillem [Mon, 11 Jun 2018 14:21:18 +0000 (16:21 +0200)]
avcodec/videotoolboxenc: split initialization

Split vtenc_init() into vtenc_init() (VTEncContext initialization) and
vtenc_configure_encoder() (creates the vt session).

This commit will allow to restart the vt session while encoding.

Signed-off-by: Aman Gupta <aman@tmm1.net>
14 months agoavcodec/videotoolboxenc: fix mutex/cond leak in error path
Thomas Guillem [Mon, 11 Jun 2018 14:21:17 +0000 (16:21 +0200)]
avcodec/videotoolboxenc: fix mutex/cond leak in error path

The leak could happen when the vtenc_create_encoder() function failed.

Signed-off-by: Aman Gupta <aman@tmm1.net>
14 months agoavcodec/vc1: remove unused ff_vc1_loop_filter_iblk
Jerome Borsboom [Wed, 6 Jun 2018 18:47:32 +0000 (20:47 +0200)]
avcodec/vc1: remove unused ff_vc1_loop_filter_iblk

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
14 months agoavcodec/vc1: rewrite vc1_decode_i_blocks to align with VC-1 spec
Jerome Borsboom [Tue, 12 Jun 2018 09:34:58 +0000 (11:34 +0200)]
avcodec/vc1: rewrite vc1_decode_i_blocks to align with VC-1 spec

Change vc1_decode_i_blocks to use vc1_put_blocks_clamped and
ff_vc1_i_loop_filter.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
14 months agoavcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped
Jerome Borsboom [Fri, 8 Jun 2018 09:01:26 +0000 (11:01 +0200)]
avcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped

Simple and Main Profile also need unsigned put_pixels_clamped. Add an argument
to choose between signed and unsigned put_pixels and change function name to
vc1_put_blocks_clamped.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
14 months agoRevert "avcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped"
Carl Eugen Hoyos [Mon, 18 Jun 2018 09:53:56 +0000 (11:53 +0200)]
Revert "avcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped"

This reverts commit 2065317db6dc3a219f8ed2de427fe7e19e02eb68.

I committed a wrong version of this patch.
Also reverts the follow-up commits 77a3dfb3 and 8331e591.

14 months agolibavfilter/opencl: Add macro for setting opencl kernel arguments
Danil Iashchenko [Fri, 15 Jun 2018 02:55:34 +0000 (05:55 +0300)]
libavfilter/opencl: Add macro for setting opencl kernel arguments

14 months agoavcodec/vc1: support multi-slice field interlaced pictures with hwaccel
Jerome Borsboom [Wed, 9 May 2018 05:50:28 +0000 (07:50 +0200)]
avcodec/vc1: support multi-slice field interlaced pictures with hwaccel

When using hardware accelerated decoding for multi-slice field interlaced pictures,
only the first slice was decoded. This patch adds the neccesary looping over the
remaining slices that may exist in field interlaced pictures. Additionally, we align
the calculation of mby_start for the second field with the method given in VC-1 spec.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
14 months agoavcodec/vaapi_vc1: slice_vertical_position starts from zero for the second field
Jerome Borsboom [Wed, 9 May 2018 05:50:23 +0000 (07:50 +0200)]
avcodec/vaapi_vc1: slice_vertical_position starts from zero for the second field

Contrary to VC-1 spec, VAAPI expects the row address of the first
macroblock row in the first slice to start from zero for the second
field in a field interlaced picture.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
14 months agofftools/cmdutils: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 07:53:24 +0000 (15:53 +0800)]
fftools/cmdutils: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agotests/bprint: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:04:52 +0000 (16:04 +0800)]
tests/bprint: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agoavutil/log: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:03:40 +0000 (16:03 +0800)]
avutil/log: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agolavf/tedcaptionsdec: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:02:57 +0000 (16:02 +0800)]
lavf/tedcaptionsdec: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agolavf/icecast: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:02:15 +0000 (16:02 +0800)]
lavf/icecast: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agolavfi/graphdump: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:01:35 +0000 (16:01 +0800)]
lavfi/graphdump: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agolavfi/af_amerge: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:00:49 +0000 (16:00 +0800)]
lavfi/af_amerge: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
14 months agolavc/pngdec: Replace the number by macro for bprint init
Jun Zhao [Sun, 10 Jun 2018 08:00:02 +0000 (16:00 +0800)]
lavc/pngdec: Replace the number by macro for bprint init

Replace the number by macro for bprint init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>