ffmpeg.git
5 hours agoavcodec/prosumer: Error out if decompress() stops reading data master
Michael Niedermayer [Sat, 12 Jan 2019 21:36:00 +0000 (22:36 +0100)]
avcodec/prosumer: Error out if decompress() stops reading data

if 0 is encountered in the LUT then decompress() will continue to output 0 bytes but never read more data.
Without a specification it is impossible to say if this is invalid or a feature.
None of the valid prosumer files tested cause a 0 to be read, so it is likely
not a intended feature.

Fixes: Timeout
Fixes: 11266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5681827423977472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 hours agoavcodec/prosumer: Reduce lut size
Michael Niedermayer [Sat, 12 Jan 2019 21:29:27 +0000 (22:29 +0100)]
avcodec/prosumer: Reduce lut size

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 hours agoavcodec/prosumer: Simplify code slightly in decompress()
Michael Niedermayer [Sat, 12 Jan 2019 20:56:14 +0000 (21:56 +0100)]
avcodec/prosumer: Simplify code slightly in decompress()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 hours agoavcodec/tiff: Check for 12bit gray fax
Michael Niedermayer [Sat, 12 Jan 2019 18:37:18 +0000 (19:37 +0100)]
avcodec/tiff: Check for 12bit gray fax

Fixes: Assertion failure
Fixes: 11898/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5759794191794176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 hours agoavutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()
Michael Niedermayer [Tue, 25 Dec 2018 22:15:20 +0000 (23:15 +0100)]
avutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()

This is strongly based on code by Marton Balint, and depends on the previous commit

Fixes: Timeout
Fixes: 11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 11209 ms
After:  Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in  4104 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 hours agoavutil/mem: Optimize fill32() by unrolling and using 64bit
Michael Niedermayer [Thu, 17 Jan 2019 21:35:10 +0000 (22:35 +0100)]
avutil/mem: Optimize fill32() by unrolling and using 64bit

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
26 hours agoavcodec/mips: [loongson] optimize put_hevc_pel_bi_pixels_8 with mmi.
Shiyou Yin [Fri, 18 Jan 2019 06:42:20 +0000 (14:42 +0800)]
avcodec/mips: [loongson] optimize put_hevc_pel_bi_pixels_8 with mmi.

Optimize put_hevc_pel_bi_pixels_8 with mmi in the case width=8/16/24/32/48/64.
This optimization improved HEVC decoding performance 2%(1.77x to 1.81x, tested on loongson 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 days agolavc/hls: Cosmetics: Fix indentation for free_segment_list
Jun Zhao [Mon, 14 Jan 2019 15:42:09 +0000 (23:42 +0800)]
lavc/hls: Cosmetics: Fix indentation for free_segment_list

Commit 673d8cfd518 missed the indent

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2 days agolavu/frame: Fix typo.
Carl Eugen Hoyos [Fri, 18 Jan 2019 11:34:19 +0000 (12:34 +0100)]
lavu/frame: Fix typo.

3 days agoavcodec/libx264: add support for ROI-based encoding
Guo, Yejun [Thu, 10 Jan 2019 08:54:30 +0000 (16:54 +0800)]
avcodec/libx264: add support for ROI-based encoding

This patch just enables the path from ffmpeg to libx264,
the more encoders can be added later.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 days agoavutil: add ROI (Region Of Interest) data struct and bump version
Guo, Yejun [Thu, 10 Jan 2019 08:53:30 +0000 (16:53 +0800)]
avutil: add ROI (Region Of Interest) data struct and bump version

The encoders such as libx264 support different QPs offset for different MBs,
it makes possible for ROI-based encoding. It makes sense to add support
within ffmpeg to generate/accept ROI infos and pass into encoders.

Typical usage: After AVFrame is decoded, a ffmpeg filter or user's code
generates ROI info for that frame, and the encoder finally does the
ROI-based encoding.

The ROI info is maintained as side data of AVFrame.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 days agoavfilter/vf_paletteuse: don't constantly free and realloc internal frames
James Almer [Tue, 15 Jan 2019 04:14:34 +0000 (01:14 -0300)]
avfilter/vf_paletteuse: don't constantly free and realloc internal frames

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: James Almer <jamrial@gmail.com>
3 days agoavfilter/extractplanes: add support for 12-bit YUVA formats
Gyan Doshi [Thu, 17 Jan 2019 09:31:11 +0000 (15:01 +0530)]
avfilter/extractplanes: add support for 12-bit YUVA formats

At present, 16-bit auto-scaled format results in incorrect alpha
extraction.

4 days agoavformat/hcom: check probe buffer size
Paul B Mahol [Wed, 16 Jan 2019 09:26:53 +0000 (10:26 +0100)]
avformat/hcom: check probe buffer size

5 days agoavcodec/dirac_arith: Treat overread as error
Michael Niedermayer [Tue, 8 Jan 2019 22:40:54 +0000 (23:40 +0100)]
avcodec/dirac_arith: Treat overread as error

Fixes: Timeout
Fixes: 11663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016

Before:Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016 in 26006 ms
After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016 in 106 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavcodec/diracdec: Propagate errors from dirac_get_arith_uint()
Michael Niedermayer [Tue, 8 Jan 2019 22:29:38 +0000 (23:29 +0100)]
avcodec/diracdec: Propagate errors from dirac_get_arith_uint()

Testcase: 11663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavcodec/ac3dec: Optimize frame start search
Michael Niedermayer [Tue, 8 Jan 2019 17:11:47 +0000 (18:11 +0100)]
avcodec/ac3dec: Optimize frame start search

Fixes: Timeout
Fixes: 11619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520
Fixes: 11620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5711996515778560
Fixes: 11658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5701006524940288

Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 20338 ms
After:  Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5632398021099520 in 11825 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavcodec/lzw: Check for end of input
Michael Niedermayer [Fri, 11 Jan 2019 21:38:35 +0000 (22:38 +0100)]
avcodec/lzw: Check for end of input

Fixes: Timeout
Fixes: 11873/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5093495044308992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agolavd/iec61883: Fix the include path for poll.h.
Carl Eugen Hoyos [Tue, 15 Jan 2019 23:13:49 +0000 (00:13 +0100)]
lavd/iec61883: Fix the include path for poll.h.

5 days agolavf/rtpproto: Use the correct patch when including poll.h
Carl Eugen Hoyos [Mon, 14 Jan 2019 17:21:15 +0000 (18:21 +0100)]
lavf/rtpproto: Use the correct patch when including poll.h

Fixes a warning using musl:
In file included from libavformat/rtpproto.c:43:0:
/usr/local/musl/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>

5 days agoavcodec/hcom: get rid of single line brackets
Paul B Mahol [Tue, 15 Jan 2019 10:34:11 +0000 (11:34 +0100)]
avcodec/hcom: get rid of single line brackets

5 days agoavformat: add HCOM demuxer
Paul B Mahol [Wed, 2 Jan 2019 16:47:30 +0000 (17:47 +0100)]
avformat: add HCOM demuxer

5 days agoavcodec: add HCOM decoder
Paul B Mahol [Wed, 2 Jan 2019 17:50:38 +0000 (18:50 +0100)]
avcodec: add HCOM decoder

6 days agoffmpeg_opt: Print a warning if more than one -vf/-af option was specified.
Carl Eugen Hoyos [Mon, 14 Jan 2019 12:34:22 +0000 (13:34 +0100)]
ffmpeg_opt: Print a warning if more than one -vf/-af option was specified.

Fixes ticket #4184.

6 days agolavf/mov: Do not fail hard for more invalid atoms.
Carl Eugen Hoyos [Mon, 14 Jan 2019 11:44:01 +0000 (12:44 +0100)]
lavf/mov: Do not fail hard for more invalid atoms.

This is what several other players do and what FFmpeg already does for the sidx atom.

Fixes ticket #7679.

6 days agoavcodec/tests/rangecoder: initialize array to avoid valgrind warning
Michael Niedermayer [Fri, 4 Jan 2019 01:46:29 +0000 (02:46 +0100)]
avcodec/tests/rangecoder: initialize array to avoid valgrind warning

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavcodec/gdv: Optimize and factorize scaling loops
Michael Niedermayer [Fri, 4 Jan 2019 18:51:04 +0000 (19:51 +0100)]
avcodec/gdv: Optimize and factorize scaling loops

Fixes: Timeout
Fixes: 11067/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768

Before change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 34386 ms
After  change: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5686623711264768 in 24327 ms

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoapi-h264-slice-test: fix arguments and help
Rafaël Carré [Thu, 10 Jan 2019 11:00:27 +0000 (12:00 +0100)]
api-h264-slice-test: fix arguments and help

This program only takes 2 arguments
Remove comment that was never right

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavcodec/vc1: fix B predictor validity for 4-MV MBs
Jerome Borsboom [Mon, 14 Jan 2019 08:05:24 +0000 (09:05 +0100)]
avcodec/vc1: fix B predictor validity for 4-MV MBs

The B predictor for 4-MV MBs in interlace field pictures is not used
for blocks 0 and 2 when the picture is 1 MB wide.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
7 days agoavcodec/vp3: ref_frame/ref_frames are only required when HAVE_THREADS=1
Peter Ross [Fri, 4 Jan 2019 02:06:07 +0000 (13:06 +1100)]
avcodec/vp3: ref_frame/ref_frames are only required when HAVE_THREADS=1

7 days agocheckasm/af_afir: relax the max allowed absolute difference
James Almer [Thu, 10 Jan 2019 23:33:06 +0000 (20:33 -0300)]
checkasm/af_afir: relax the max allowed absolute difference

Should fix failures on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
7 days agoavfilter/af_anlmdn: add timeline support
Paul B Mahol [Sun, 13 Jan 2019 10:55:01 +0000 (11:55 +0100)]
avfilter/af_anlmdn: add timeline support

8 days agoavfilter: add maskfun filter
Paul B Mahol [Mon, 19 Nov 2018 12:11:24 +0000 (13:11 +0100)]
avfilter: add maskfun filter

8 days agolavc: Allow very high bitrates in AVCPBProperties after next version bump.
Carl Eugen Hoyos [Thu, 10 Jan 2019 21:23:39 +0000 (22:23 +0100)]
lavc: Allow very high bitrates in AVCPBProperties after next version bump.

8 days agolavc/tiff: Support CMYK images.
Carl Eugen Hoyos [Sat, 12 Jan 2019 16:27:48 +0000 (17:27 +0100)]
lavc/tiff: Support CMYK images.

Fixes ticket #3459.

8 days agolavc/psd: Support CMYK images.
Carl Eugen Hoyos [Fri, 11 Jan 2019 02:20:38 +0000 (03:20 +0100)]
lavc/psd: Support CMYK images.

Based on a05635e by Michael Niedermayer.

Fixes ticket #6797.

8 days agoavcodec/h264_slice: Fix integer overflow in implicit_weight_table()
Michael Niedermayer [Fri, 4 Jan 2019 19:00:38 +0000 (20:00 +0100)]
avcodec/h264_slice: Fix integer overflow in implicit_weight_table()

Fixes: signed integer overflow: 2 * 2132811760 cannot be represented in type 'int'
Fixes: 11156/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6237685933408256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 days agoavcodec/exr: set layer_match in all branches
Michael Niedermayer [Tue, 25 Dec 2018 20:30:54 +0000 (21:30 +0100)]
avcodec/exr: set layer_match in all branches

Otherwise it is left to the value from the previous iteration

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 days agoavcodec/exr: Check for duplicate channel index
Michael Niedermayer [Tue, 25 Dec 2018 17:41:58 +0000 (18:41 +0100)]
avcodec/exr: Check for duplicate channel index

Fixes: Out of memory
Fixes: 11582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5730204559867904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 days agoavcodec/vc1: fix decoding of old WMV3 format
Jerome Borsboom [Sat, 12 Jan 2019 15:14:00 +0000 (16:14 +0100)]
avcodec/vc1: fix decoding of old WMV3 format

The position of the second MV predicitor candidate is slightly different
for the old WMV3 format indicated by RES_RTM_FLAG. This patch fixes
decoding of niceday.wmv on the samples server.

Fixes: #6641

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
8 days agoavcodec/vc1: shuffle calculation of MV predictor candidates
Jerome Borsboom [Fri, 11 Jan 2019 14:36:47 +0000 (15:36 +0100)]
avcodec/vc1: shuffle calculation of MV predictor candidates

The B predictor for 4-MV macroblocks is only out of bounds when
the A predictor is also out of bounds.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
8 days agoavfilter/af_anlmdn: rework how denoising strength is used
Paul B Mahol [Sat, 12 Jan 2019 14:33:39 +0000 (15:33 +0100)]
avfilter/af_anlmdn: rework how denoising strength is used

Make into account patch size.

8 days agoavcodec/dstdec: use appropriate alignment
Peter Ross [Mon, 24 Dec 2018 09:09:18 +0000 (20:09 +1100)]
avcodec/dstdec: use appropriate alignment

this was a typo in my original dst decoder. there is no requirement for
64-byte alignment here. the change does not affect decoder performance.

Signed-off-by: Peter Ross <pross@xvid.org>
9 days agolavc/hevc_parser: report detailed log when missing picture occurs
Linjie Fu [Fri, 11 Jan 2019 08:07:33 +0000 (16:07 +0800)]
lavc/hevc_parser: report detailed log when missing picture occurs

Report the detailed log with buf_size in parse_nal_units to provide
more information when picture could not be found.

Match the behaviour in h264_parser.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 days agoavcodec/nuv: add FF_CODEC_CAP_INIT_CLEANUP
Michael Niedermayer [Fri, 11 Jan 2019 01:15:08 +0000 (02:15 +0100)]
avcodec/nuv: add FF_CODEC_CAP_INIT_CLEANUP

Fixes: memleak
Fixes: 12244/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-5099447273390080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 days agoavfilter/af_anlmdn: do not output more samples than received
Paul B Mahol [Fri, 11 Jan 2019 15:51:49 +0000 (16:51 +0100)]
avfilter/af_anlmdn: do not output more samples than received

9 days agodstdec: big-endian compatiblity
Peter Ross [Sun, 6 Jan 2019 10:38:47 +0000 (21:38 +1100)]
dstdec: big-endian compatiblity

9 days agointreadwrite: add AV_RL64A, AV_WL64A
Peter Ross [Mon, 7 Jan 2019 11:12:13 +0000 (22:12 +1100)]
intreadwrite: add AV_RL64A, AV_WL64A

macros for reading and writing 64-bit aligned little-endian values.

these macros are used by the DST decoder and give a performance boost
on platforms that where the compiler must guard against unaligned
memory access.

9 days agoavfilter/af_anlmdn: drain samples at end
Paul B Mahol [Fri, 11 Jan 2019 10:45:42 +0000 (11:45 +0100)]
avfilter/af_anlmdn: drain samples at end

9 days agoavfilter/af_anlmdn: do not trim first samples
Paul B Mahol [Fri, 11 Jan 2019 10:23:59 +0000 (11:23 +0100)]
avfilter/af_anlmdn: do not trim first samples

Instead denoise from start, assumming missing samples are silence.

9 days agoavfilter/af_anlmdn: log used parameters
Paul B Mahol [Fri, 11 Jan 2019 10:14:35 +0000 (11:14 +0100)]
avfilter/af_anlmdn: log used parameters

10 days agoavfilter/af_anlmdn: use lut table to calculate weights
Paul B Mahol [Thu, 10 Jan 2019 11:00:56 +0000 (12:00 +0100)]
avfilter/af_anlmdn: use lut table to calculate weights

10 days agoavfilter: add anlmdn filter x86 SIMD optimizations
Paul B Mahol [Wed, 9 Jan 2019 12:33:02 +0000 (13:33 +0100)]
avfilter: add anlmdn filter x86 SIMD optimizations

10 days agolavfi/f_select: Cosmetics, move a function.
Carl Eugen Hoyos [Thu, 10 Jan 2019 19:14:08 +0000 (20:14 +0100)]
lavfi/f_select: Cosmetics, move a function.

Silences a warning when only aselect was enabled:
libavfilter/f_select.c:421:12: warning: 'query_formats' defined but not used

10 days agolavfi/f_select: Fix aselect filter standalone compilation.
Carl Eugen Hoyos [Thu, 10 Jan 2019 19:10:50 +0000 (20:10 +0100)]
lavfi/f_select: Fix aselect filter standalone compilation.

10 days agolavfi/Makefile: Fix bwdif filter standalone compilation.
Carl Eugen Hoyos [Thu, 10 Jan 2019 19:02:26 +0000 (20:02 +0100)]
lavfi/Makefile: Fix bwdif filter standalone compilation.

10 days agoconfigure: Fix hymt decoder standalone compilation.
Carl Eugen Hoyos [Thu, 10 Jan 2019 18:58:34 +0000 (19:58 +0100)]
configure: Fix hymt decoder standalone compilation.

10 days agolavc/qsvenc: set pict_type to be I for IDR frames.
Zhong Li [Wed, 12 Dec 2018 07:44:18 +0000 (15:44 +0800)]
lavc/qsvenc: set pict_type to be I for IDR frames.

Signed-off-by: Zhong Li <zhong.li@intel.com>
10 days agolavc/qsvenc: add VDENC support for H264
Linjie Fu [Thu, 29 Nov 2018 06:14:22 +0000 (14:14 +0800)]
lavc/qsvenc: add VDENC support for H264

Add VDENC(lowpower mode) support for QSV H264

It's an experimental function(like lowpower in vaapi) with
some limitations:
- CBR/VBR require HuC which should be explicitly loaded via i915
module parameter(i915.enable_guc=2 for linux kernel version >= 4.16)

Use option "-low_power 1" to enable VDENC.
Add in dump_video_param() to show the status of VDENC in runtime log.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
11 days agoavfilter/af_anlmdn: ignore too small values
Paul B Mahol [Wed, 9 Jan 2019 20:00:16 +0000 (21:00 +0100)]
avfilter/af_anlmdn: ignore too small values

12 days agoavfilter: add anlmdn audio filter
Paul B Mahol [Sat, 19 May 2018 20:06:27 +0000 (22:06 +0200)]
avfilter: add anlmdn audio filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 days agoavcodec/libdav1d: properly free all output picture references
James Almer [Tue, 8 Jan 2019 15:09:21 +0000 (12:09 -0300)]
avcodec/libdav1d: properly free all output picture references

Dav1dPictures contain more than one buffer reference, so we're forced to use the
API properly to free them all.

Reviewed-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com>
12 days agoavcodec/vp3data: use more compact data type
Peter Ross [Sun, 6 Jan 2019 22:01:14 +0000 (09:01 +1100)]
avcodec/vp3data: use more compact data type

13 days agoavcodec/qpeg: Optimize long runs in qpeg_decode_intra() not spanning a full row
Michael Niedermayer [Mon, 7 Jan 2019 01:44:50 +0000 (02:44 +0100)]
avcodec/qpeg: Optimize long runs in qpeg_decode_intra() not spanning a full row

Fixes: Timeout
Fixes: 11354/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5766275943366656

Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5766275943366656 in 9470 ms
After : Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5766275943366656 in  134 ms

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 days agoavformat/file: Fix file delete for Windows
Karthick Jeyapal [Mon, 31 Dec 2018 07:37:49 +0000 (13:07 +0530)]
avformat/file: Fix file delete for Windows

Fixes bug id : 7638

2 weeks agoavcodec/huffyuvdec: Check that slices do not exceed frame height
Michael Niedermayer [Sun, 6 Jan 2019 11:17:06 +0000 (12:17 +0100)]
avcodec/huffyuvdec: Check that slices do not exceed frame height

Fixes: Out of array access
Fixes: 12367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5662313959391232
Fixes: 12370/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5670984961490944
Fixes: 12376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5644026183680000
Fixes: 12383/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5722087214284800
Fixes: 12390/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5696653095337984
Fixes: 12408/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5729689379799040

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>
2 weeks agoavcodec/huffyuvdec: Check that slice height is non negative.
Michael Niedermayer [Sun, 6 Jan 2019 10:15:35 +0000 (11:15 +0100)]
avcodec/huffyuvdec: Check that slice height is non negative.

Fixes: out of array access
Fixes: 12381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5705474280783872
Fixes: 12384/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5725303345774592
Fixes: 12389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5704033050820608
Fixes: 12391/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5707284146028544

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>
2 weeks agoconfigure: add dxva2 extralibs to avcodec
James Almer [Sun, 6 Jan 2019 15:18:46 +0000 (12:18 -0300)]
configure: add dxva2 extralibs to avcodec

DXVA2 may be enabled even when every relevant module is disabled,
which would result in the dependency generator not including its
extralibs to avcodec.

Fixes ticket #7642.

Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agoavcodec/bsf_list: implement a AVBSFContext.flush callback
James Almer [Sun, 6 Jan 2019 03:31:47 +0000 (00:31 -0300)]
avcodec/bsf_list: implement a AVBSFContext.flush callback

Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agoavcodec/gdv: Optimize unscaled loop
Michael Niedermayer [Fri, 4 Jan 2019 19:22:34 +0000 (20:22 +0100)]
avcodec/gdv: Optimize unscaled loop

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agoavfilter/af_afir: adjust min partition size
Paul B Mahol [Sat, 5 Jan 2019 08:38:27 +0000 (09:38 +0100)]
avfilter/af_afir: adjust min partition size

Minimal value allowed by our FFT is 16 thus min partition size is 8.

2 weeks agotools/target_dec_fate: Add entries from around issue 500 to 700
Michael Niedermayer [Sat, 29 Dec 2018 00:54:50 +0000 (01:54 +0100)]
tools/target_dec_fate: Add entries from around issue 500 to 700

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agoavformat/vapoursynth: properly initialize err variable in read_header_vs()
nu774 [Thu, 3 Jan 2019 17:17:02 +0000 (02:17 +0900)]
avformat/vapoursynth: properly initialize err variable in read_header_vs()

The variable "err" is not initialized, and set only when something went wrong.
When everything is OK, nobody sets it, so using it result in UB.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agodoc/encoders: Update docs for libxavs2
Jun Zhao [Sun, 30 Dec 2018 05:59:17 +0000 (13:59 +0800)]
doc/encoders: Update docs for libxavs2

Update standard libavcodec options for libxavs2

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2 weeks agolavc/libxavs2: Cosmetics: Fix indentation for switch statement
Jun Zhao [Sun, 30 Dec 2018 05:27:21 +0000 (13:27 +0800)]
lavc/libxavs2: Cosmetics: Fix indentation for switch statement

Cosmetics: Fix indentation for switch statement like the Linux
kerenl style.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2 weeks agolavc/libdavs2: Cosmetics: Fix indentation for switch statement
Jun Zhao [Sun, 30 Dec 2018 05:21:07 +0000 (13:21 +0800)]
lavc/libdavs2: Cosmetics: Fix indentation for switch statement

Cosmetics: Fix indentation for switch statement like the Linux
kerenl style.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2 weeks agodoc/ffmpeg: clarify behaviour of -discard
Gyan Doshi [Fri, 4 Jan 2019 10:17:33 +0000 (15:47 +0530)]
doc/ffmpeg: clarify behaviour of -discard

Discarding all frames is universally supported as it happens in fftools
whereas selective discarding relies on the demuxer.

2 weeks agodoc/ffmpeg: update entry for stream disable options
Gyan Doshi [Fri, 4 Jan 2019 09:48:15 +0000 (15:18 +0530)]
doc/ffmpeg: update entry for stream disable options

-vn/-an/-sn/-dn can now be used to block input streams from a file.

2 weeks agoavformat/hlsenc: free variant streams after write all variant streams info
Steven Liu [Sat, 22 Dec 2018 15:43:47 +0000 (23:43 +0800)]
avformat/hlsenc: free variant streams after write all variant streams info

fix ticket: 7631

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 weeks agoavcodec/fft_template: improve performance of the ff_fft_init in fft_template
Steven Liu [Wed, 26 Dec 2018 08:09:49 +0000 (16:09 +0800)]
avcodec/fft_template: improve performance of the ff_fft_init in fft_template

Before patch:
init nbits = 17, get 10000 samples, average cost: 16175 us
After patch:
init nbits = 17, get 10000 samples, average cost: 14989 us

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 weeks agofate: add tests/fate/hlsenc.mak for hls FATE
Steven Liu [Mon, 24 Dec 2018 09:42:09 +0000 (17:42 +0800)]
fate: add tests/fate/hlsenc.mak for hls FATE

init add three test examples:
1. check no endlist at the end
2. check endlist at the end
3. check hls_list_size 0 full list

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 weeks agox86/af_afir: use three operand form forat some instructions
James Almer [Fri, 4 Jan 2019 02:36:19 +0000 (23:36 -0300)]
x86/af_afir: use three operand form forat some instructions

Fixes compilation with old yasm versions.

Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agolibavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S
Manoj Gupta [Fri, 28 Dec 2018 23:12:53 +0000 (15:12 -0800)]
libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S

Some of the assembly functions e.g. ff_h264_idct_dc_add_neon
has code like:
        movrel          x14, X(ff_h264_idct_add_neon)

Linker cannot resolve them fully at link time and emits dynamic
relocations.
Use explicit labels instead so that no dynamic relocations are
needed at all.

This avoids lld complains about text relocations.

For background, see https://crbug.com/917919

Signed-off-by: Manoj Gupta <manojgupta@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agoavdevice/dshow: Fixed some minor memory leaks
Oliver Collyer [Thu, 3 Jan 2019 07:41:12 +0000 (07:41 +0000)]
avdevice/dshow: Fixed some minor memory leaks

Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agox86/af_afir: add ff_fcmul_add_avx()
James Almer [Thu, 3 Jan 2019 00:09:25 +0000 (21:09 -0300)]
x86/af_afir: add ff_fcmul_add_avx()

fcmul_add_c: 1228.8
fcmul_add_sse3: 334.3
fcmul_add_avx: 186.3

Tested on a Core i5 4460 @ 3.2GHz

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agocheckasm: add an af_afir test
James Almer [Wed, 2 Jan 2019 23:54:34 +0000 (20:54 -0300)]
checkasm: add an af_afir test

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agoavfilter/af_afir: split off fcmul_add into a DSP context
James Almer [Wed, 2 Jan 2019 23:54:18 +0000 (20:54 -0300)]
avfilter/af_afir: split off fcmul_add into a DSP context

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agox86/af_afir: fix processing the last element
James Almer [Wed, 2 Jan 2019 23:48:59 +0000 (20:48 -0300)]
x86/af_afir: fix processing the last element

ff_fcmul_add_sse3() is now identical to the C version.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 weeks agoffmpeg: allow disabling streams by type for inputs
Gyan Doshi [Sat, 29 Dec 2018 10:49:09 +0000 (16:19 +0530)]
ffmpeg: allow disabling streams by type for inputs

-vn/-an/-sn/-dn now works for input. Streams are still registered in
input_streams but they can't be automatically selected or mapped or
filtered.

2 weeks agoffmpeg: skip disabled streams
Gyan Doshi [Sat, 29 Dec 2018 10:47:05 +0000 (16:17 +0530)]
ffmpeg: skip disabled streams

Fully discarded streams can't be selected for output or mapped or filtered.
Previously, a few packets from such streams, probably buffered for
stream probing, would get smuggled into output files.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agomov: Remove duration-of-last-frame heuristic hack
Derek Buitenhuis [Mon, 24 Dec 2018 19:47:55 +0000 (14:47 -0500)]
mov: Remove duration-of-last-frame heuristic hack

This breaks totally valid files that get caught in its heuristic.

This, according to the commit message, is my own doing, having asked
Michael to implement this check and providing a sample that was
"wrong". I am now atoning for my sins, and removing this hack, having
seen the light (aka that this was silly to do in the first place).

Resotores correct behavior on valid files.

This reverts commit 8e5e84c2a2a21a979b48e80c5a8dd44754ab3f21.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2 weeks agoavformat/anm: use ff_get_extradata()
Paul B Mahol [Wed, 2 Jan 2019 15:28:46 +0000 (16:28 +0100)]
avformat/anm: use ff_get_extradata()

2 weeks agoavformat/yop: use ff_get_extradata()
Paul B Mahol [Wed, 2 Jan 2019 15:25:26 +0000 (16:25 +0100)]
avformat/yop: use ff_get_extradata()

2 weeks agoavformat/acm: use ff_get_extradata()
Paul B Mahol [Wed, 2 Jan 2019 15:21:46 +0000 (16:21 +0100)]
avformat/acm: use ff_get_extradata()

2 weeks agoaformat/bfi: use ff_get_extradata()
Paul B Mahol [Wed, 2 Jan 2019 15:14:19 +0000 (16:14 +0100)]
aformat/bfi: use ff_get_extradata()

2 weeks agoavfilter/vf_detelecine: fix obvious frame memory leaks
Paul B Mahol [Wed, 2 Jan 2019 14:34:41 +0000 (15:34 +0100)]
avfilter/vf_detelecine: fix obvious frame memory leaks

2 weeks agoavcodec/bfi: Provide non NULL context to av_log()
Michael Niedermayer [Mon, 31 Dec 2018 20:32:37 +0000 (21:32 +0100)]
avcodec/bfi: Provide non NULL context to av_log()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agoavcodec/bink: Provide non NULL context to av_log()
Michael Niedermayer [Mon, 31 Dec 2018 20:32:37 +0000 (21:32 +0100)]
avcodec/bink: Provide non NULL context to av_log()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agoavcodec/mss2: Provide non NULL context to av_log()
Michael Niedermayer [Mon, 31 Dec 2018 20:32:37 +0000 (21:32 +0100)]
avcodec/mss2: Provide non NULL context to av_log()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 weeks agoavcodec/imc: Provide non NULL context to av_log()
Michael Niedermayer [Mon, 31 Dec 2018 20:32:37 +0000 (21:32 +0100)]
avcodec/imc: Provide non NULL context to av_log()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>