ffmpeg.git
8 months agoavcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()
Michael Niedermayer [Sat, 4 Aug 2018 00:34:11 +0000 (02:34 +0200)]
avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()

396078 -> 268468 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/ivi: Only clip samples when needed in ivi_output_plane()
Michael Niedermayer [Sat, 4 Aug 2018 00:31:58 +0000 (02:31 +0200)]
avcodec/ivi: Only clip samples when needed in ivi_output_plane()

435740 -> 396078 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/indeo5: require initial valid intra/gop headers not just later
Michael Niedermayer [Sat, 4 Aug 2018 00:19:15 +0000 (02:19 +0200)]
avcodec/indeo5: require initial valid intra/gop headers not just later

Fixes: Timeout
Fixes: 9308/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5284853581873152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/microdvddec: limit style characters in parsing
Michael Niedermayer [Sat, 4 Aug 2018 00:56:56 +0000 (02:56 +0200)]
avcodec/microdvddec: limit style characters in parsing

Fixes: Timeout
Fixes: 9293/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MICRODVD_fuzzer-5643972541153280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolibavutil: Adds gray floating-point pixel formats.
Sergey Lavrushkin [Fri, 3 Aug 2018 15:02:49 +0000 (18:02 +0300)]
libavutil: Adds gray floating-point pixel formats.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavf/mov.c: Set start_time for all streams (in case of edit lists).
Sasi Inguva [Mon, 6 Aug 2018 23:28:50 +0000 (16:28 -0700)]
lavf/mov.c: Set start_time for all streams (in case of edit lists).

Fixes vorbis mp4 audio files, with edit list specified. Since
st->skip_samples is not set in case of vorbis , ffmpeg computes the
start_time as negative.

Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agolavfi/vf_libvmaf: update to use libvmaf v1.3.9
Kyle Swanson [Tue, 7 Aug 2018 22:05:16 +0000 (15:05 -0700)]
lavfi/vf_libvmaf: update to use libvmaf v1.3.9

Signed-off-by: Kyle Swanson <kswanson@netflix.com>
8 months agolavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.
Jun Zhao [Wed, 8 Aug 2018 06:31:27 +0000 (14:31 +0800)]
lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.

add ONLY_IF_THREADS_ENABLED where it is missing.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
8 months agolavfi/selectivecolor: fix neutral color filtering
Clément Bœsch [Thu, 9 Aug 2018 17:22:02 +0000 (19:22 +0200)]
lavfi/selectivecolor: fix neutral color filtering

Neutrals are supposed to be anything not black (0,0,0) and not white
(N,N,N).

Previous neutral filtering code was too strict by excluding colors with
any of its RGB component maxed instead of just the white color.

Reported-by: Royi Avital <royiavital@yahoo.com>
8 months agolavfi/xbr: update filter url
Mina [Wed, 8 Aug 2018 19:49:02 +0000 (21:49 +0200)]
lavfi/xbr: update filter url

Existing link is broken.
This patch updates the existing url with a working one.

Signed-off-by: Mina <minasamy_@hotmail.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
8 months agolavf/mov: Force HEVC codec_id for code-point dvh1 and an hvcC atom.
Carl Eugen Hoyos [Mon, 6 Aug 2018 22:33:40 +0000 (00:33 +0200)]
lavf/mov: Force HEVC codec_id for code-point dvh1 and an hvcC atom.

The mp4 registration authority accepted a code-point for Dolby Vision
HEVC that was already used as a fourcc for DVCPRO 100.

Fixes ticket #7347.

8 months agolibavformat/dashdec: Fix for un-free memory
Colin NG [Wed, 8 Aug 2018 17:27:07 +0000 (17:27 +0000)]
libavformat/dashdec: Fix for un-free memory

Fixes ticket #7338.

8 months agoMAINTAINERS: add myself to MIPS section
Shiyou Yin [Thu, 26 Jul 2018 03:46:23 +0000 (11:46 +0800)]
MAINTAINERS: add myself to MIPS section

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoffmpeg: simplify refcounting packets for the muxing queue
James Almer [Mon, 6 Aug 2018 00:34:14 +0000 (21:34 -0300)]
ffmpeg: simplify refcounting packets for the muxing queue

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavs2: correct avs2 description
hwren [Tue, 7 Aug 2018 10:39:34 +0000 (18:39 +0800)]
avs2: correct avs2 description

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
8 months agolavc/libx264: Support monochrome encoding.
Carl Eugen Hoyos [Tue, 7 Aug 2018 18:41:02 +0000 (20:41 +0200)]
lavc/libx264: Support monochrome encoding.

8 months agolibavfilter: Fixes warnings for unused variables in dnn_srcnn.h, dnn_espcn.h, dnn_bac...
Sergey Lavrushkin [Sat, 28 Jul 2018 09:55:02 +0000 (12:55 +0300)]
libavfilter: Fixes warnings for unused variables in dnn_srcnn.h, dnn_espcn.h, dnn_backend_tf.c.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolibavfilter: Code style fixes for pointers in DNN module and sr filter.
Sergey Lavrushkin [Fri, 27 Jul 2018 16:34:02 +0000 (19:34 +0300)]
libavfilter: Code style fixes for pointers in DNN module and sr filter.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agolibavfilter: Adds on the fly generation of default DNN models for tensorflow backend...
Sergey Lavrushkin [Fri, 27 Jul 2018 16:31:55 +0000 (19:31 +0300)]
libavfilter: Adds on the fly generation of default DNN models for tensorflow backend instead of storing binary model.

Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 months agoavformat/flvdec: add flv_full_metadata option into flvdec
Steven Liu [Tue, 7 Aug 2018 07:51:36 +0000 (15:51 +0800)]
avformat/flvdec: add flv_full_metadata option into flvdec

output all the metadata context when use this option.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/flvdec: reindent code for previous commit
Steven Liu [Tue, 7 Aug 2018 07:50:47 +0000 (15:50 +0800)]
avformat/flvdec: reindent code for previous commit

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/flvdec: add flv_ignore_prevtag option into flvdec
Steven Liu [Tue, 7 Aug 2018 07:48:23 +0000 (15:48 +0800)]
avformat/flvdec: add flv_ignore_prevtag option into flvdec

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/dashdec: remove unused functions and process code
Steven Liu [Tue, 7 Aug 2018 04:37:02 +0000 (12:37 +0800)]
avformat/dashdec: remove unused functions and process code

Based on a patch for hls by Richard Shaffer

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/dashdec: Fix memleak when resolve_content_path
Jacek Jendrzej [Tue, 7 Aug 2018 03:32:05 +0000 (11:32 +0800)]
avformat/dashdec: Fix memleak when resolve_content_path

Can be reproduced with:  valgrind  --leak-check=full  -v ffmpeg -i
http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agoavformat/dashdec: fix for ticket #7336
Jacek Jendrzej [Tue, 7 Aug 2018 03:30:04 +0000 (11:30 +0800)]
avformat/dashdec: fix for ticket #7336

fix for ticket #7336

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agofftools/qsv: add extra_hw_frames support
Zhong Li [Wed, 25 Jul 2018 08:05:38 +0000 (16:05 +0800)]
fftools/qsv: add extra_hw_frames support

Currently extra_hw_frames can't be applied to qsv since it
doesn't call function avcodec_get_hw_frames_parameters().

Give an option to fix ticket #7261 though it is not a perfect soultion
(allocate the minimum pool size internally and automatically).

Signed-off-by: Zhong Li <zhong.li@intel.com>
8 months agolavc/qsvenc: expose qp of encoded frames
Zhong Li [Fri, 1 Jun 2018 10:21:28 +0000 (18:21 +0800)]
lavc/qsvenc: expose qp of encoded frames

Requirement from ticket #7254.
Currently only H264 supported by MSDK.

Signed-off-by: Zhong Li <zhong.li@intel.com>
8 months agovf_tonemap: Update hdr metadata with the new peak value
Vittorio Giovara [Wed, 25 Jul 2018 15:45:46 +0000 (17:45 +0200)]
vf_tonemap: Update hdr metadata with the new peak value

Less effective than the approach in vf_tonemap_opencl because there
is no peak detection, but it's still a good idea to implement this.

8 months agovf_tonemap_opencl: Move update_metadata() to a shared file
Vittorio Giovara [Wed, 25 Jul 2018 15:02:45 +0000 (17:02 +0200)]
vf_tonemap_opencl: Move update_metadata() to a shared file

8 months agovf_tonemap[_opencl]: Move determine_signal_peak() to a shared file
Vittorio Giovara [Wed, 25 Jul 2018 14:44:50 +0000 (16:44 +0200)]
vf_tonemap[_opencl]: Move determine_signal_peak() to a shared file

The two functions are identical. Use the shared LumaCoeffients type too.

8 months agovf_tonemap: Fix logic for detecting the maximum peak of untagged sources
Vittorio Giovara [Wed, 25 Jul 2018 15:21:04 +0000 (17:21 +0200)]
vf_tonemap: Fix logic for detecting the maximum peak of untagged sources

When there is no metadata attached to a frame, take into account both
the PQ and HLG transfers, and change the HLG default value to 10:
the value of 12 is the maximum range in scene referred light, but
the reference OOTF maps this from 0 to 1000 cd/m² on the ideal HLG
monitor.

This matches what vf_tonemap_opencl does.

8 months agoavcodec/libaomenc: correct range for cpu-used
Gyan Doshi [Sun, 5 Aug 2018 06:03:45 +0000 (11:33 +0530)]
avcodec/libaomenc: correct range for cpu-used

Valid range is [0,8] as stated in aom.git:aom/aomcx.h

Fixes #7343

8 months agoavcodec/mediacodecdec: fix spurious newline in trace logging
Aman Gupta [Sun, 5 Aug 2018 19:31:07 +0000 (12:31 -0700)]
avcodec/mediacodecdec: fix spurious newline in trace logging

Signed-off-by: Aman Gupta <aman@tmm1.net>
8 months agoavcodec/pnm_parser: Avoid reparsing failed data.
Michael Niedermayer [Sat, 28 Jul 2018 12:09:32 +0000 (14:09 +0200)]
avcodec/pnm_parser: Avoid reparsing failed data.

Alternatively the parser could be re implemented / redesigned so as to better
and more efficiently find frame boundaries

Fixes: Timeout
Fixes: 9210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-4770771833454592
Fixes: 9214/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5741633353023488
Fixes: 9219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-6249230237696000
Fixes: 9550/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAM_fuzzer-5312669836902400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/simple_idct_template: Fix several integer overflows
Michael Niedermayer [Sat, 28 Jul 2018 10:18:05 +0000 (12:18 +0200)]
avcodec/simple_idct_template: Fix several integer overflows

Fixes: simple_idct_template.c:184:30: runtime error: signed integer overflow: -1065517056 - 1392182838 cannot be represented in type 'int'
Fixes: simple_idct_template.c:269:21: runtime error: signed integer overflow: 16384 * 259254 cannot be represented in type 'int'
Fixes: simple_idct_template.c:164:17: runtime error: signed integer overflow: 21407 * 210162 cannot be represented in type 'int'
Fixes: simple_idct_template.c:167:17: runtime error: signed integer overflow: 21407 * 210162 cannot be represented in type 'int'
Fixes: simple_idct_template.c:169:19: runtime error: signed integer overflow: 22725 * 259190 cannot be represented in type 'int'
Fixes: simple_idct_template.c:171:19: runtime error: signed integer overflow: 19265 * 259190 cannot be represented in type 'int'
Fixes: simple_idct_template.c:173:19: runtime error: signed integer overflow: 12873 * 259190 cannot be represented in type 'int'
Fixes: simple_idct_template.c:183:28: runtime error: signed integer overflow: 1860878336 + 585177665 cannot be represented in type 'int'
Fixes: simple_idct_template.c:159:17: runtime error: signed integer overflow: 16384 * 189520 cannot be represented in type 'int'
Fixes: simple_idct_template.c:170:22: runtime error: signed integer overflow: 19265 * 130147 cannot be represented in type 'int'
Fixes: simple_idct_template.c:174:23: runtime error: signed integer overflow: -22725 * 130147 cannot be represented in type 'int'
Fixes: simple_idct_template.c:183:20: runtime error: signed integer overflow: 16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:184:22: runtime error: signed integer overflow: -16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:185:22: runtime error: signed integer overflow: -16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:186:20: runtime error: signed integer overflow: 16384 * -175206 cannot be represented in type 'int'
Fixes: simple_idct_template.c:195:26: runtime error: signed integer overflow: 19265 * 150747 cannot be represented in type 'int'
Fixes: simple_idct_template.c:198:27: runtime error: signed integer overflow: -22725 * 150747 cannot be represented in type 'int'
Fixes: simple_idct_template.c:184:37: runtime error: signed integer overflow: 21407 * -171941 cannot be represented in type 'int'
Fixes: simple_idct_template.c:185:37: runtime error: signed integer overflow: 21407 * -171941 cannot be represented in type 'int'
Fixes: simple_idct_template.c:192:27: runtime error: signed integer overflow: -12873 * 206341 cannot be represented in type 'int'
Fixes: simple_idct_template.c:185:30: runtime error: signed integer overflow: 1196441600 + 1703756981 cannot be represented in type 'int'
Fixes: simple_idct_template.c:176:23: runtime error: signed integer overflow: -12873 * 168461 cannot be represented in type 'int'
Fixes: simple_idct_template.c:191:27: runtime error: signed integer overflow: -22725 * -140062 cannot be represented in type 'int'
Fixes: simple_idct_template.c:197:26: runtime error: signed integer overflow: 19265 * -140062 cannot be represented in type 'int'
Fixes: simple_idct_template.c:183:34: runtime error: signed integer overflow: 8867 * -243046 cannot be represented in type 'int'
Fixes: simple_idct_template.c:186:34: runtime error: signed integer overflow: 8867 * -243046 cannot be represented in type 'int'
Fixes: simple_idct_template.c:186:28: runtime error: signed integer overflow: -816234496 - 2139878414 cannot be represented in type 'int'
Fixes: simple_idct_template.c:188:26: runtime error: signed integer overflow: 12873 * -239872 cannot be represented in type 'int'
Fixes: simple_idct_template.c:165:16: runtime error: signed integer overflow: 8867 * -260084 cannot be represented in type 'int'
Fixes: simple_idct_template.c:166:16: runtime error: signed integer overflow: 8867 * -260084 cannot be represented in type 'int'
Fixes: 9135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6324422955761664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/aacdec_template: Check for duplicate elements
Michael Niedermayer [Sat, 28 Jul 2018 09:42:37 +0000 (11:42 +0200)]
avcodec/aacdec_template: Check for duplicate elements

Fixes: Timeout
Fixes: 9552/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-6027842339995648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/aacpsdsp_template: Fix integer overflow in ps_stereo_interpolate_c()
Michael Niedermayer [Sat, 28 Jul 2018 08:59:09 +0000 (10:59 +0200)]
avcodec/aacpsdsp_template: Fix integer overflow in ps_stereo_interpolate_c()

Fixes: signed integer overflow: -1813244069 + -1407981383 cannot be represented in type 'int'
Fixes: 8823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5643295618236416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/flvenc: Check audio packet size
Michael Niedermayer [Sat, 28 Jul 2018 13:03:50 +0000 (15:03 +0200)]
avformat/flvenc: Check audio packet size

Fixes: Assertion failure
Fixes: assert_flvenc.c:941_1.swf

Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/mediacodecdec: fix SEGV on modern nvidia decoders
Aman Gupta [Tue, 31 Jul 2018 21:33:08 +0000 (14:33 -0700)]
avcodec/mediacodecdec: fix SEGV on modern nvidia decoders

This code came originally from gstreamer, where it was added in [1]
as a work-around for the Tegra 3. (The alignment was changed in [2]
as a response to [3], from 32-bit to 16-bit).

gstreamer only used this workaround in the case where the decoder
didn't return a slice-height property, but when the code was copied
into avcodec the conditional got lost. This commit restores the guard
and prefers the slice-height from the decoder when it is available.

This fixes segfaults decoding 1920x1080 h264 and mpeg2 videos on the
NVidia SHIELD after upgrading to Android Oreo.

[1] https://github.com/GStreamer/gst-plugins-bad/commit/a870e6a5c30dd85240fe75c7409cc1cf1b86541d
[2] https://github.com/GStreamer/gst-plugins-bad/commit/21ff3ae0b0127bd82951d278ca24f2d54133b7cd
[3] https://bugzilla.gnome.org/show_bug.cgi?id=748867

Signed-off-by: Aman Gupta <aman@tmm1.net>
8 months agolavc/svq3: Fix regression decoding some files.
Nikolas Bowe [Tue, 31 Jul 2018 00:22:02 +0000 (17:22 -0700)]
lavc/svq3: Fix regression decoding some files.

Fixes some SVQ3 encoded files which fail to decode correctly after 6d6faa2a2d.
These files exhibit lots of artifacts and logs show "Media key encryption is not implemented".
However they decode without artifacts before 6d6faa2a2d.
The attatched patch allows these files to successfully decode, but also reject media key files.

Tested on the files in #6094 and http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/mlp_parser: Check if synccode is within buffer
Michael Niedermayer [Sun, 29 Jul 2018 11:16:37 +0000 (13:16 +0200)]
avcodec/mlp_parser: Check if synccode is within buffer

Fixes: undefined shift
Fixes: 9216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-6281404575907840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/qtrle: Check remaining bytestream in qtrle_decode_XYbpp()
Michael Niedermayer [Sun, 29 Jul 2018 10:40:48 +0000 (12:40 +0200)]
avcodec/qtrle: Check remaining bytestream in qtrle_decode_XYbpp()

Fixes: Timeout
Fixes: 9213/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-5649753332252672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/matroskaenc: filter and reorder AV1 OBUs
James Almer [Mon, 23 Jul 2018 15:33:55 +0000 (12:33 -0300)]
avformat/matroskaenc: filter and reorder AV1 OBUs

Make sure to not write forbidden OBUs to CodecPrivate, and do the same with
unnecessary OBUs for packets.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavformat/av1: reorder OBUs before writting them in ff_isom_write_av1c()
James Almer [Mon, 30 Jul 2018 18:15:43 +0000 (15:15 -0300)]
avformat/av1: reorder OBUs before writting them in ff_isom_write_av1c()

Make sure Sequence Header is first, and only allow one of its kind.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/av1_parse: return size of the parsed OBU in parse_obu_header()
James Almer [Mon, 30 Jul 2018 18:14:24 +0000 (15:14 -0300)]
avcodec/av1_parse: return size of the parsed OBU in parse_obu_header()

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavformat/av1: return an error when no data is provided to ff_isom_write_av1c()
James Almer [Mon, 23 Jul 2018 16:15:06 +0000 (13:15 -0300)]
avformat/av1: return an error when no data is provided to ff_isom_write_av1c()

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/av1_parse: check for OBU header overread
James Almer [Mon, 23 Jul 2018 16:12:43 +0000 (13:12 -0300)]
avcodec/av1_parse: check for OBU header overread

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/libaomdec: auto insert dump_extra bitstream filter
James Almer [Mon, 23 Jul 2018 15:32:47 +0000 (12:32 -0300)]
avcodec/libaomdec: auto insert dump_extra bitstream filter

Some containers, like Matroska, may propagate key frames with no Sequence
Header OBU since it's provided in extradata instead.
With this change, the Sequence Header will be appended to the packet data
before calling aom_codec_decode().

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet
James Almer [Mon, 23 Jul 2018 22:16:30 +0000 (19:16 -0300)]
avcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet

~4x speedup in dump_extradata()

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavformat/avs: add descriptive name and url
Gyan Doshi [Thu, 2 Aug 2018 05:17:10 +0000 (10:47 +0530)]
avformat/avs: add descriptive name and url

AVS now more commonly refers to the Chinese AVS format. This demuxer
processes video files for Creature Shock game

8 months agox86/pixelutils: don't use the AVX2 functions on CPUs known to be slow with them
James Almer [Wed, 1 Aug 2018 01:14:53 +0000 (22:14 -0300)]
x86/pixelutils: don't use the AVX2 functions on CPUs known to be slow with them

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agox86/pixelutils: add missing preprocessor wrapper to the AVX2 functions
James Almer [Wed, 1 Aug 2018 01:03:22 +0000 (22:03 -0300)]
x86/pixelutils: add missing preprocessor wrapper to the AVX2 functions

Should fix compilation with old yasm/nasm

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agotools/qt-faststart: Allow free atoms after moov atom.
Carl Eugen Hoyos [Wed, 11 Jul 2018 23:24:39 +0000 (01:24 +0200)]
tools/qt-faststart: Allow free atoms after moov atom.

8 months agoavutil/pixelutils: sad_32x32 sse2/avx2 optimizations.
Jun Zhao [Mon, 9 Jul 2018 16:41:00 +0000 (00:41 +0800)]
avutil/pixelutils: sad_32x32 sse2/avx2 optimizations.

add ff_pixelutils_sad_32x32_sse2, ff_pixelutils_sad_{a,u}_32x32_sse2,
ff_pixelutils_sad_32x32_avx22, ff_pixelutils_sad_{a,u}_32x32_avx2

use perf record/report profiling, get instructions:u for avx2 sad_32x32:

  72.05%  pixelutils  pixelutils     [.] block_sad_32x32_c
  18.50%  pixelutils  pixelutils     [.] block_sad_16x16_c
   4.78%  pixelutils  pixelutils     [.] block_sad_8x8_c
   2.69%  pixelutils  pixelutils     [.] block_sad_4x4_c
   0.89%  pixelutils  pixelutils     [.] block_sad_2x2_c
   0.16%  pixelutils  pixelutils     [.] ff_pixelutils_sad_32x32_avx2
   0.16%  pixelutils  pixelutils     [.] ff_pixelutils_sad_u_32x32_avx2
   0.12%  pixelutils  pixelutils     [.] ff_pixelutils_sad_a_32x32_avx2

sse2 sad_32x32 instructions:u like:

  71.86%  pixelutils  pixelutils     [.] block_sad_32x32_c
  18.42%  pixelutils  pixelutils     [.] block_sad_16x16_c
   4.81%  pixelutils  pixelutils     [.] block_sad_8x8_c
   2.68%  pixelutils  pixelutils     [.] block_sad_4x4_c
   0.88%  pixelutils  pixelutils     [.] block_sad_2x2_c
   0.29%  pixelutils  pixelutils     [.] ff_pixelutils_sad_32x32_sse2
   0.26%  pixelutils  pixelutils     [.] ff_pixelutils_sad_u_32x32_sse2
   0.23%  pixelutils  pixelutils     [.] ff_pixelutils_sad_a_32x32_sse2

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agolavutil/pixelutils: add sad_32x32 in pixelutils API.
Jun Zhao [Mon, 9 Jul 2018 16:34:26 +0000 (00:34 +0800)]
lavutil/pixelutils: add sad_32x32 in pixelutils API.

add sad_32x32 in pixelutils API, and update the fate.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agoavcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values
James Almer [Sun, 29 Jul 2018 21:22:25 +0000 (18:22 -0300)]
avcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agofate: add tests for audio channel up-/downmixing with pan filter
Tobias Rapp [Thu, 19 Jul 2018 11:59:37 +0000 (13:59 +0200)]
fate: add tests for audio channel up-/downmixing with pan filter

Add tests for upmixing and downmixing with audio channel counts that
have a corresponding default layout and also tests where there is no
default layout.

Update the existing "stereo4" test so it actually outputs stereo like
the other stereo tests. Rename the previous "stereo4" test into
"upmix1".

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
8 months agotests/audiogen: raise channel count limit to 12
Tobias Rapp [Thu, 19 Jul 2018 09:49:33 +0000 (11:49 +0200)]
tests/audiogen: raise channel count limit to 12

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
8 months agolibavformat/dashenc: Fix relative URI of HLS master playlist
Antonio Morell [Thu, 26 Jul 2018 13:22:21 +0000 (14:22 +0100)]
libavformat/dashenc: Fix relative URI of HLS master playlist

8 months agodoc/formats: Add documentation for skip_estimate_duration_from_pts
Michael Niedermayer [Tue, 24 Jul 2018 22:49:39 +0000 (00:49 +0200)]
doc/formats: Add documentation for skip_estimate_duration_from_pts

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
8 months agoconfigure: add missing aandcttables dependency to asv1 and asv2 encoders
James Almer [Mon, 30 Jul 2018 00:30:00 +0000 (21:30 -0300)]
configure: add missing aandcttables dependency to asv1 and asv2 encoders

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoconfigure: add missing aandcttables dependency to mpegvideoenc
James Almer [Mon, 30 Jul 2018 00:22:28 +0000 (21:22 -0300)]
configure: add missing aandcttables dependency to mpegvideoenc

Also remove the superfluous aandcttables dependency from all the modules
that only need it because of mpegvideoenc

Fixes ticket #7333

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agolavfi/nlmeans: fix aarch64 assembly with clang
Jan Ekström [Thu, 26 Jul 2018 20:45:01 +0000 (23:45 +0300)]
lavfi/nlmeans: fix aarch64 assembly with clang

Clang is more strict about some things.

8 months agocmdutils: print a more descriptive error message in show_help_bsf() when no bsf is...
James Almer [Sat, 28 Jul 2018 03:58:29 +0000 (00:58 -0300)]
cmdutils: print a more descriptive error message in show_help_bsf() when no bsf is specified

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL
James Almer [Sat, 28 Jul 2018 03:51:57 +0000 (00:51 -0300)]
avcodec/bitstream_filters: check the input argument of av_bsf_get_by_name() for NULL

Fixes crashes like "ffmpeg -h bsf" caused by passing NULL to strcmp()

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec/diracdec: Check bytes count in else branch in decode_lowdelay() too
Michael Niedermayer [Sun, 22 Jul 2018 19:42:16 +0000 (21:42 +0200)]
avcodec/diracdec: Check bytes count in else branch in decode_lowdelay() too

Fixes: signed integer overflow: 8 * 340018243 cannot be represented in type 'int'
Fixes: 9441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5194665207791616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/diracdec: Check slice numbers for overflows in relation to picture dimensions
Michael Niedermayer [Sun, 22 Jul 2018 19:26:24 +0000 (21:26 +0200)]
avcodec/diracdec: Check slice numbers for overflows in relation to picture dimensions

Fixes: signed integer overflow: 88 * 33685506 cannot be represented in type 'int'
Fixes: 9433/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5725943535501312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream...
Michael Niedermayer [Sun, 22 Jul 2018 18:45:39 +0000 (20:45 +0200)]
avcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream and we also have a -1 special case

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 9291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6324345860259840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/dirac_dwt_template: Fix several integer overflows in horizontal_compose_daub97i()
Michael Niedermayer [Sun, 22 Jul 2018 17:11:04 +0000 (19:11 +0200)]
avcodec/dirac_dwt_template: Fix several integer overflows in horizontal_compose_daub97i()

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 8926/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6047609228623872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavcodec/diracdec: Prevent integer overflow in intermediate in global_mv()
Michael Niedermayer [Sun, 22 Jul 2018 16:58:34 +0000 (18:58 +0200)]
avcodec/diracdec: Prevent integer overflow in intermediate in global_mv()

Fixes: signed integer overflow: -393471 * 5460 cannot be represented in type 'int'
Fixes: 8890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6299775379963904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/librtmp: fix returning EOF from Read/Write
Timo Rothenpieler [Wed, 25 Jul 2018 22:37:35 +0000 (00:37 +0200)]
avformat/librtmp: fix returning EOF from Read/Write

Ticket #7052

8 months agofate: remove unnecessary reference file for fate-encryption-info
James Almer [Thu, 26 Jul 2018 03:38:01 +0000 (00:38 -0300)]
fate: remove unnecessary reference file for fate-encryption-info

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agoavcodec: add missing files missed in previous commits
James Almer [Fri, 27 Jul 2018 13:59:38 +0000 (10:59 -0300)]
avcodec: add missing files missed in previous commits

Fixes compilation.

Signed-off-by: James Almer <jamrial@gmail.com>
8 months agolavc, doc, configure: add avs2 video decoder wrapper
hwren [Fri, 27 Jul 2018 03:50:19 +0000 (11:50 +0800)]
lavc, doc, configure: add avs2 video decoder wrapper

Tested-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agolavf: add avs2 fourcc
hwren [Fri, 27 Jul 2018 03:48:50 +0000 (11:48 +0800)]
lavf: add avs2 fourcc

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agolavc: add AVS2/IEEE 1857.4 parser
hwren [Fri, 27 Jul 2018 03:44:59 +0000 (11:44 +0800)]
lavc: add AVS2/IEEE 1857.4 parser

Tested-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
8 months agodoc/protocols: documents tcp_mss
Jun Zhao [Sun, 6 May 2018 15:02:42 +0000 (23:02 +0800)]
doc/protocols: documents tcp_mss

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agolavf/tcp: add option to setting Maximum Segment Size
Jun Zhao [Sun, 6 May 2018 14:56:01 +0000 (22:56 +0800)]
lavf/tcp: add option to setting Maximum Segment Size

This can change the the MSS value announced to the other end in
the initial TCP packet, it's can be used when failed Path MTU
discovery.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
8 months agoswresample/swresample: Fix input channel count in resample_first computation
Michael Niedermayer [Tue, 24 Jul 2018 20:44:12 +0000 (22:44 +0200)]
swresample/swresample: Fix input channel count in resample_first computation

Found-by: Marcin Gorzel <gorzel@google.com>
Reviewed-by: Marcin Gorzel <gorzel@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoavformat/mov: Check default_encrypted_sample before use in mov_read_sample_encryption...
Michael Niedermayer [Sat, 21 Jul 2018 15:20:44 +0000 (17:20 +0200)]
avformat/mov: Check default_encrypted_sample before use in mov_read_sample_encryption_info()

Fixes: 2018-0721-sample
Fixes: null pointer dereference

Found-by: Nikita Knyzhov (knnikita@yandex.ru)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoswresample: Use channel count in rematrix initialization
Marcin Gorzel [Tue, 24 Jul 2018 13:55:47 +0000 (14:55 +0100)]
swresample: Use channel count in rematrix initialization

Rematrixing supports up to 64 channels. However, there is only a limited number of channel layouts defined. Since the in/out channel count is currently obtained from the channel layout, for undefined layouts (e.g. for 9, 10, 11 channels etc.) the rematrixing fails.

This patch changes rematrix init methods to use in (used) and out channel count directly instead of computing it from channel layout.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 months agoconfigure: Force pie for Android.
Carl Eugen Hoyos [Wed, 25 Jul 2018 18:43:02 +0000 (20:43 +0200)]
configure: Force pie for Android.

Position-independent executables are required since Lollipop.

Reported-by: Mohammed Bey Ahmed Khernache
8 months agoavutil/hwcontext_d3d11va: fix type arguments passed to IDXGIAdapter2_GetDesc()
James Almer [Mon, 23 Jul 2018 23:42:08 +0000 (20:42 -0300)]
avutil/hwcontext_d3d11va: fix type arguments passed to IDXGIAdapter2_GetDesc()

libavutil/hwcontext_d3d11va.c: In function 'd3d11va_device_create':
libavutil/hwcontext_d3d11va.c:554:46: warning: passing argument 2 of 'pAdapter->lpVtbl->GetDesc' from incompatible pointer type [-Wincompatible-pointer-types]
         hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
                                              ^
libavutil/hwcontext_d3d11va.c:554:46: note: expected 'DXGI_ADAPTER_DESC * {aka struct DXGI_ADAPTER_DESC *}' but argument is of type 'DXGI_ADAPTER_DESC2 * {aka struct DXGI_ADAPTER_DESC2 *}'

Reviewed-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: James Almer <jamrial@gmail.com>
8 months agolavf/isom: Make auxiliary_offsets consistently uint64_t.
Carl Eugen Hoyos [Tue, 24 Jul 2018 20:32:59 +0000 (22:32 +0200)]
lavf/isom: Make auxiliary_offsets consistently uint64_t.

Fixes a compilation warning if size_t != uint64_t:
libavformat/mov.c: In function ‘mov_read_saio’:
libavformat/mov.c:6207:45: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         encryption_index->auxiliary_offsets = auxiliary_offsets;
                                             ^

8 months agolavf/flvdec: Remove an outdated comment.
Carl Eugen Hoyos [Wed, 25 Jul 2018 13:08:43 +0000 (15:08 +0200)]
lavf/flvdec: Remove an outdated comment.

The buffer size was increased in b2fecce3 to prepare for 790a3cdf.

8 months agodoc/mailing-list-faq: user lists are subscribe only
Lou Logan [Tue, 24 Jul 2018 21:33:31 +0000 (13:33 -0800)]
doc/mailing-list-faq: user lists are subscribe only

Includes a few other minor changes and updates.

Signed-off-by: Lou Logan <lou@lrcd.com>
8 months agoavformat/mxfdec: drop invalid index table segments when sorting them
Marton Balint [Wed, 4 Jul 2018 21:42:56 +0000 (23:42 +0200)]
avformat/mxfdec: drop invalid index table segments when sorting them

This way if an index table segment is present multiple times, we can always use
the proper one instead of the invalid one.

Fixes seeking in the sample of ticket #5671.

Signed-off-by: Marton Balint <cus@passwd.hu>
8 months agoavfilter: Add colorconstancy filter
Mina [Mon, 16 Jul 2018 08:20:02 +0000 (10:20 +0200)]
avfilter: Add colorconstancy filter

Signed-off-by: Mina <minasamy_@hotmail.com>
9 months agoavcodec/cdgraphics: Clear first frame only once
Michael Niedermayer [Sun, 15 Jul 2018 12:12:56 +0000 (14:12 +0200)]
avcodec/cdgraphics: Clear first frame only once

frame_number will not increase if nothing is output

Fixes: Timeout
Fixes: 9057/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-4844661498707968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/tscc: Do not duplicate images
Michael Niedermayer [Sun, 15 Jul 2018 12:04:05 +0000 (14:04 +0200)]
avcodec/tscc: Do not duplicate images

This improves speed

Fixes: Timeout
Fixes: 9010/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TSCC_fuzzer-6042614817095680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/tscc: Move reading the side data palette before other checks
Michael Niedermayer [Sun, 15 Jul 2018 12:01:40 +0000 (14:01 +0200)]
avcodec/tscc: Move reading the side data palette before other checks

We do not want to loose the side data in case of errors

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/bink: set color range
Paul B Mahol [Sun, 22 Jul 2018 08:19:03 +0000 (10:19 +0200)]
avcodec/bink: set color range

9 months agoavcodec/bink: add 'k' version support
Paul B Mahol [Wed, 18 Jul 2018 19:17:29 +0000 (21:17 +0200)]
avcodec/bink: add 'k' version support

9 months agoavformat/bink: move code for skipping unknown fields to correct place
Paul B Mahol [Mon, 16 Jul 2018 10:54:47 +0000 (12:54 +0200)]
avformat/bink: move code for skipping unknown fields to correct place

9 months agoavcodec/parser: move parsers list and related API to its own file
James Almer [Sat, 21 Jul 2018 17:21:16 +0000 (14:21 -0300)]
avcodec/parser: move parsers list and related API to its own file

And add it to the CONFIGURABLE_COMPONENTS list in Makefile. This way, changes
to the new file will be tracked and the usual warning to suggest re-running
configure will be shown.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
9 months agodoc/filters: use radius instead of kernel in avgblur
Danil Iashchenko [Fri, 20 Jul 2018 16:31:19 +0000 (19:31 +0300)]
doc/filters: use radius instead of kernel in avgblur

9 months agolavc/fft_template: Do not define unneded functions with --enable-small.
Carl Eugen Hoyos [Sat, 21 Jul 2018 12:05:41 +0000 (14:05 +0200)]
lavc/fft_template: Do not define unneded functions with --enable-small.

Fixes the following warnings:
In file included from libavcodec/fft_fixed.c:21:0:
libavcodec/fft_template.c:528:6: warning: ‘pass_big’ defined but not used [-Wunused-function]
 PASS(pass_big)
      ^
libavcodec/fft_template.c:505:13: note: in definition of macro ‘PASS’
 static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
             ^~~~
CC      libavcodec/ffv1.o
In file included from libavcodec/fft_float.c:21:0:
libavcodec/fft_template.c:528:6: warning: ‘pass_big’ defined but not used [-Wunused-function]
 PASS(pass_big)
      ^
libavcodec/fft_template.c:505:13: note: in definition of macro ‘PASS’
 static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
             ^~~~

9 months agolibavcodec/ppc: Fix HEVC AltiVec routines with --enable-small
A. Wilcox [Sat, 21 Jul 2018 05:42:00 +0000 (00:42 -0500)]
libavcodec/ppc: Fix HEVC AltiVec routines with --enable-small

GCC requires the argument to vec_splat_u32 to be a literal.  The easiest
way to accomplish this is to change 'shift' to be const in scale (as it
is in the transform routine above), and convert both routines to be
inline.  This way, GCC can coerce the values to literals.

Tested on a 970 (Apple G5) and POWER9 (Talos II); passed fate and played
a clip of Big Buck Bunny correctly.

Fixes ticket #7048

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
9 months agoavcodec/extract_extradata_bsf: make sure a Sequence Header was found for av1
James Almer [Fri, 20 Jul 2018 23:43:40 +0000 (20:43 -0300)]
avcodec/extract_extradata_bsf: make sure a Sequence Header was found for av1

A packet may have Metadata OBUs but no Sequence Header OBU, which is
useless as extradata.

Signed-off-by: James Almer <jamrial@gmail.com>
9 months agoavcodec: bump micro version after previous changes
James Almer [Fri, 20 Jul 2018 18:49:13 +0000 (15:49 -0300)]
avcodec: bump micro version after previous changes

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