Commit Graph

91592 Commits

Author SHA1 Message Date
Jun Zhao 1581caa7ca 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>
2018-08-10 18:48:25 +08:00
Clément Bœsch eb1860e017 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>
2018-08-09 19:56:26 +02:00
Mina e0539f0349 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>
2018-08-09 10:35:00 +05:30
Carl Eugen Hoyos 6130068453 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.
2018-08-09 00:44:07 +02:00
Colin NG af4c2acddd libavformat/dashdec: Fix for un-free memory
Fixes ticket #7338.
2018-08-08 23:55:25 +02:00
Shiyou Yin 90dc584d21 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>
2018-08-08 01:00:10 +02:00
James Almer b955a33314 ffmpeg: simplify refcounting packets for the muxing queue
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-07 18:42:35 -03:00
hwren f563e7868f avs2: correct avs2 description
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2018-08-08 00:13:13 +05:30
Carl Eugen Hoyos 81f25a1051 lavc/libx264: Support monochrome encoding. 2018-08-07 20:41:02 +02:00
Sergey Lavrushkin a66e74306a 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>
2018-08-07 13:28:04 -03:00
Sergey Lavrushkin 9d87897ba8 libavfilter: Code style fixes for pointers in DNN module and sr filter.
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2018-08-07 11:58:34 -03:00
Sergey Lavrushkin 4eb63efbda 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>
2018-08-07 11:58:03 -03:00
Steven Liu 243ecadad5 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>
2018-08-07 15:51:36 +08:00
Steven Liu 3b99bb3889 avformat/flvdec: reindent code for previous commit
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-08-07 15:50:47 +08:00
Steven Liu d37125fb91 avformat/flvdec: add flv_ignore_prevtag option into flvdec
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-08-07 15:48:23 +08:00
Steven Liu d54ae9b782 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>
2018-08-07 12:37:02 +08:00
Jacek Jendrzej 0cf5e6b5b4 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>
2018-08-07 12:31:55 +08:00
Jacek Jendrzej 2f45378ba1 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>
2018-08-07 12:31:49 +08:00
Zhong Li 6434b84460 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>
2018-08-07 11:26:40 +08:00
Zhong Li 6088b7b037 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>
2018-08-07 11:26:37 +08:00
Vittorio Giovara aa8e5eecac 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.
2018-08-06 18:35:52 +02:00
Vittorio Giovara 572ef567a5 vf_tonemap_opencl: Move update_metadata() to a shared file 2018-08-06 18:35:52 +02:00
Vittorio Giovara e467179cfb vf_tonemap[_opencl]: Move determine_signal_peak() to a shared file
The two functions are identical. Use the shared LumaCoeffients type too.
2018-08-06 18:35:52 +02:00
Vittorio Giovara ce7ca726b2 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.
2018-08-06 18:34:49 +02:00
Gyan Doshi 076b19660e avcodec/libaomenc: correct range for cpu-used
Valid range is [0,8] as stated in aom.git:aom/aomcx.h

Fixes #7343
2018-08-06 10:19:27 +05:30
Aman Gupta e77a3e996f avcodec/mediacodecdec: fix spurious newline in trace logging
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-08-05 12:31:13 -07:00
Michael Niedermayer 1940c27c82 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>
2018-08-04 16:17:01 +02:00
Michael Niedermayer 83dab8183e 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>
2018-08-04 16:17:01 +02:00
Michael Niedermayer 40c2f870ae 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>
2018-08-04 16:17:01 +02:00
Michael Niedermayer 47db5763e2 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>
2018-08-04 16:17:01 +02:00
Michael Niedermayer 6b67d7f059 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>
2018-08-04 16:17:01 +02:00
Aman Gupta 476fd6ba3a 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] a870e6a5c3
[2] 21ff3ae0b0
[3] https://bugzilla.gnome.org/show_bug.cgi?id=748867

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-08-03 11:06:46 -07:00
Nikolas Bowe 5aeb3b0080 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>
2018-08-03 02:10:14 +02:00
Michael Niedermayer 51ac3f43b8 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>
2018-08-03 02:08:16 +02:00
Michael Niedermayer 7dd836a3f9 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>
2018-08-03 02:08:16 +02:00
James Almer 2de5209d91 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>
2018-08-02 12:41:55 -03:00
James Almer ded339fb3c 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>
2018-08-02 12:41:54 -03:00
James Almer 692e323d89 avcodec/av1_parse: return size of the parsed OBU in parse_obu_header()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:54 -03:00
James Almer 1e126560c2 avformat/av1: return an error when no data is provided to ff_isom_write_av1c()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:53 -03:00
James Almer 4e937b1a60 avcodec/av1_parse: check for OBU header overread
Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:53 -03:00
James Almer e45ed15594 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>
2018-08-02 12:41:05 -03:00
James Almer b98bd60bfa 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>
2018-08-02 12:41:04 -03:00
Gyan Doshi c9118d4d64 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
2018-08-02 10:53:03 +05:30
James Almer 481741ece0 x86/pixelutils: don't use the AVX2 functions on CPUs known to be slow with them
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-31 22:14:53 -03:00
James Almer d5b3077ecf 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>
2018-07-31 22:14:42 -03:00
Carl Eugen Hoyos 1ffd63a445 tools/qt-faststart: Allow free atoms after moov atom. 2018-08-01 00:49:54 +02:00
Jun Zhao d36b8394f4 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>
2018-07-31 19:17:51 +08:00
Jun Zhao b8bf7408dc 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>
2018-07-31 19:09:35 +08:00
James Almer a9a433564d avcodec/h264_mp4toannexb_bsf: use enum constants for the NAL unit type values
Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-30 17:51:50 -03:00
Tobias Rapp ec517ad9f9 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>
2018-07-30 10:46:19 +02:00