Commit Graph

96974 Commits

Author SHA1 Message Date
Marton Balint 331b96acb5 avformat/mxfenc: factorize timecode checking and setting
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Marton Balint ae4d00b97f avformat/mxfenc: add some missing content package rates
Fixes ticket #8523.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Marton Balint f69154b2c4 avformat/mxfenc: move content package rates and timebase combinations to a separate struct
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Marton Balint 27a8146990 avformat/mxf: get rid of samples per frame array usage
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Marton Balint aef2016bb0 avformat/audiointerleave: disallow using a samples_per_frame array
Only MXF used an actual sample array, and that is unneeded there because simple
rounding rules can be used instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Andreas Rheinhardt abbb466368 avformat/smoothstreaming: Fix memleaks on errors
If an AVFormatContext could be allocated, but white-/blacklists couldn't
be copied, the AVFormatContext would leak as it was only accessible
through a local variable that goes out of scope when one goes to fail.

Furthermore, in case writing a header of a submuxer failed, the options
used for said call could leak.

Both of these memleaks have been fixed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 22:07:27 +01:00
Andreas Rheinhardt 6e9cc96429 avformat/matroskaenc: Check BlockAdditional size before use
Don't read a 64bit number before having checked that the data is at
least 8 bytes long.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 22:07:27 +01:00
Andreas Rheinhardt b49af89e03 avformat/avienc: Use AV_STRINGIFY for compile time constant
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 22:07:27 +01:00
Andreas Rheinhardt a4a98f15b2 avformat/nutenc: Drop redundant frees
Should writing the header fail, the allocations already performed will
be freed during deinit so remove the frees in nut_write_header().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 22:07:27 +01:00
Paul B Mahol 6fbc7f092e avfilter/af_anequalizer: fix off by one in reallocation 2020-03-14 19:39:04 +01:00
Andreas Rheinhardt fa5bff611d avformat/mux: Unify setting number of muxed packets
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 18:24:04 +01:00
Andreas Rheinhardt 5c5ab88967 avformat/mux: Remove redundant checks for write errors
If writing a packet didn't directly return an error, the AVIOContext's
error flag is checked for errors (if existing) by write_packet(). And if
write_packet() didn't indicate an error, its callers checked the error
flag of the AVIOContext (if existing). The latter check is redundant.

The reason for checking twice lies in the FFmpeg-Libav split: The check
in write_packet() has been added in 9ad1e0c1 in Libav. FFmpeg already
had the other checks (since aec9390a), but when 9ad1e0c1 was merged
(in 1f1c1008), no one noticed the redundant checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 18:24:04 +01:00
Andreas Rheinhardt cc2a9509ce libavcodec, libpostproc: Remove outcommented START/STOP_TIMER
as well as includes of libavutil/timer.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 18:24:04 +01:00
Andreas Rheinhardt 1fea6795a3 avformat/mxfenc: Reorder fields in MXFIndexEntry to make it smaller
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 18:24:04 +01:00
Carl Eugen Hoyos b601e24ab3 lavf/tty: Reduce probe score to fix ffmetadata auto-detection.
Fixes ticket #8568.
2020-03-14 15:38:34 +01:00
Paul B Mahol 8f222573e9 avfilter/f_sendcmd: add more useful variables 2020-03-13 17:19:33 +01:00
Thierry Foucu 86e599d9f4 configure: Add llviddsp to mvha select 2020-03-13 09:35:33 +01:00
Lynne 675bb1f4f9 diracdec: rewrite golomb reader
This version is able to output multiple coefficients at a time and
is able to altogether remove actual golomb code parsing.
Its also able to partially recover the last coefficient in case
the packet is incomplete.

Total decoder performance gain for 8bit 420 1080p lossless: 40%.
Total decoder performance gain for 10bit 420 1080p lossless: 40%.

clang was able to vectorize the loop much better than
my handwritten assembly, but gcc was very naive and didn't.

Lookup table is a rewritten version of vc2hqdecode.
2020-03-12 20:26:48 +00:00
Lynne d778be6e4a changelog: add entry for the Vulkan hwcontext and filters 2020-03-12 20:20:22 +00:00
Lynne 6353b9e4ab hwcontext_vulkan: support more than one plane per DMABUF layer
Requires the dmabuf modifiers extension.
Allows for importing of compressed images with a second plane.
2020-03-12 18:59:12 +00:00
Lynne b31959d776 hwcontext_vulkan: duplicate DMABUF objects before importing them
The specifications are very vague about who has ownership, and in this case,
Vulkan takes ownership of all DMABUF FDs passed to it, causing errors
to occur if someone gave us images for mapping which were meant to be kept.
The old behavior worked with one-way VAAPI and DMABUF imports, but was broken
with clients like wlroots' dmabuf-capture.
2020-03-12 18:16:11 +00:00
Lynne 501bd57bdb hwcontext_vulkan: initialize semaphores of DMABUF imports
There was a recent change in Intel's driver that triggered a driver-internal
error if the semaphore given to the command buffer wasn't initialized.
Given that the specifications require the semaphore to be initialized,
this is within spec. Unlike what's causing it in the first place, which is
that there are no ways to extract/import dma sync objects from DMABUFs,
so we must leave our semaphores bare.
2020-03-12 18:16:11 +00:00
Lynne 9086af2a0a hwcontext_vulkan: only convert image layout for transfers if necessary 2020-03-12 18:16:11 +00:00
Lynne 08d0a8992d hwcontext_vulkan: minor corrections for DMABUF mapping
We need to consider the amount of layers instead of the image's planes.
2020-03-12 18:16:11 +00:00
Paul B Mahol d4d74707fb avformat/avidec: recognize H265 fourcc as hevc
Fixes decoding of came2_2020-01-13__20-38-58_21-00-00__Chn2.avi
2020-03-12 18:57:39 +01:00
Paul B Mahol f0349df7c7 avformat/vpk: add seeking support 2020-03-12 18:47:39 +01:00
Guo, Yejun e35f966853 avfilter/vf_dnn_processing.c: add frame size change support for planar yuv format
The Y channel is handled by dnn, and also resized by dnn. The UV channels
are resized with swscale.

The command to use espcn.pb (see vf_sr) looks like:
./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y -y tmp.espcn.jpg

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Reviewed-by: Pedro Arthur <bygrandao@gmail.com>
2020-03-12 18:22:51 +08:00
Guo, Yejun bd50453894 avfilter/vf_dnn_processing.c: add planar yuv format support
Only the Y channel is handled by dnn, the UV channels are copied
without changes.

The command to use srcnn.pb (see vf_sr) looks like:
./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Reviewed-by: Pedro Arthur <bygrandao@gmail.com>
2020-03-12 18:22:39 +08:00
Guo, Yejun d86a8c056b avfilter/vf_dnn_processing.c: use swscale for uint8<->float32 convert
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Reviewed-by: Pedro Arthur <bygrandao@gmail.com>
2020-03-12 18:22:18 +08:00
Steven Liu 31bc1c44d6 avformat/hlsenc: set the options when open the key info files
make the options same as segments for the http put method

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2020-03-12 14:00:45 +08:00
Hongcheng Zhong 5c72bb62a9 avformat/hlsenc: Fix initial setting for start_pts
This patch fixes Bug #8469
If x264 baseline profile is used with other profiles,
start_pts will be initialized to audio stream's first pts,
while the duration is calculated based on video stream's pts.
In this patch the start_pts is initialized with the correct stream's first pts.

Signed-off-by: Hongcheng Zhong <sj.hc_Zhong@sjtu.edu.cn>
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
2020-03-12 13:00:29 +08:00
Michael Niedermayer 1812352d76 avcodec/cbs_jpeg: Check length for SOS
Fixes: out of array access
Fixes: 19734/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5673507031875584
Fixes: 19353/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5703944462663680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-12 00:14:10 +01:00
Michael Niedermayer 0a11ef68f0 avcodec/adpcm: Fix invalid shift in AV_CODEC_ID_ADPCM_PSX
Fixes: left shift of negative value -1
Fixes: 20859/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5720391507247104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-11 23:57:04 +01:00
Michael Niedermayer c40df2166c avcodec/mpeg12dec: Fix invalid shift in mpeg2_fast_decode_block_intra()
Fixes: left shift of negative value -695
Fixes: 19232/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5702856963522560
Fixes: 19555/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5741218147598336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-11 23:51:36 +01:00
Carl Eugen Hoyos 5f8c383452 lsws/input: Do not change transparency range.
Fixes ticket #8509.
2020-03-11 22:55:49 +01:00
Paul B Mahol b3c46e26aa avcodec/wavpack: check for allocation failure 2020-03-11 21:54:27 +01:00
Paul B Mahol 2c08cd284d avcodec/wavpack: fix some syle issues 2020-03-11 21:54:27 +01:00
David Bryant 9a13ed522f avcodec/wavpack: add support for DSD files
Add support for WavPack DSD files to the existing WavPack decoder using
avcodec/dsd to perform the 8:1 decimation to 32-bit float samples. We must
serialize the dsd2pcm operation (cross-boundary filtering) but would like
to use frame-level multithreading for the CPU-intensive DSD decompression,
and this is accomplished with ff_thread_report/await_progress(). Because
the dsd2pcm operation is independent across channels we use slice-based
multithreading for that part.

Also a few things were removed from the existing WavPack decoder that
weren't being used (primarily the SavedContext stuff) and the WavPack
demuxer was enhanced to correctly determine the sampling rate of DSD
files (and of course to no longer reject them).

Signed-off-by: David Bryant <david@wavpack.com>
2020-03-11 21:11:36 +01:00
Carl Eugen Hoyos 34d7c8d942 lavc/aarch64: Remove unneeded file vp9mc_aarch64.c 2020-03-11 14:36:07 +01:00
Carl Eugen Hoyos 951bd25572 lavc/aarch64: Fix suffix of new file vp9mc_aarch64. 2020-03-11 14:29:22 +01:00
Carl Eugen Hoyos 213c796561 lavc/aarch64: Fix compilation with --disable-neon
Fixes ticket #8565.
2020-03-11 14:16:48 +01:00
Carl Eugen Hoyos 9a21754904 lavc/aarch64: Move non-neon vp9 copy functions out of neon source file.
Fixes part of ticket #8565.
2020-03-11 14:16:40 +01:00
Carl Eugen Hoyos 613de37a6c Makefile: Delete more created files when running "make distclean". 2020-03-11 11:43:01 +01:00
James Almer 36aaee2a65 avfilter/Makefile: remove dnn files when calling make clean
Also remove the ancient reference to libmpcodecs while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
2020-03-11 14:11:37 +08:00
Zane van Iperen 33be368202 fate/adpcm: add adpcm_ima_alp tests
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-10 20:22:32 +01:00
Andreas Rheinhardt 66fac1ff7c avcodec/cbs_h2645: Treat slices without data as invalid
Slices that end after their header (meaning slices after the header
without any data before the rbsp_stop_one_bit or possibly without any
rbsp_stop_one_bit at all) are invalid and are now dropped. This ensures
that one doesn't run into two asserts in cbs_h2645_write_slice_data().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fixes: 19629/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-5676822528524288
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-10 20:22:32 +01:00
Andreas Rheinhardt 8f701932b3 avcodec/cbs_h2645: Remove dead code to delete trailing zeroes
Trailing zeroes are already discarded when splitting a fragment, which
makes the code to remove them when decomposing slices dead code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-10 20:22:32 +01:00
Andreas Rheinhardt 6ee7375ef5 avcodec/v4l2_m2m: Avoid using intermediate buffer
Up until now, v4l2_m2m would write via snprintf() into an intermediate
buffer and then copy from there (via strncpy()) to the end buffer. This
commit changes this by removing the intermediate buffer.

The call to strncpy() was actually of the form strncpy(dst, src,
strlen(src) + 1) which is unsafe in general, but safe in this instance
because dst and src were both of the same size and src was a proper
zero-terminated string. But this nevertheless led to a compiler warning
"‘strncpy’ specified bound depends on the length of the source argument
[-Wstringop-overflow=]" in GCC 9.2. strlen() was unnecessary anyway.

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-10 15:17:16 -03:00
vectronic dc1c3c640d avformat/movenc: add ICC profile support to colr atom
If 'write_colr' movflag is set, then movflag 'prefer_icc' can
be used to first look for an AV_PKT_DATA_ICC_PROFILE entry to
encode.

If ICC profile doesn't exist, default behaviour enabled by
'write_colr' occurs.

Signed-off-by: vectronic <hello.vectronic@gmail.com>
2020-03-10 15:11:47 +00:00
vectronic 99e3409873 avformat/mov: whitespace indent
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2020-03-10 15:10:47 +00:00