]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agompegvideodata: drop useless comments
Anton Khirnov [Mon, 9 Mar 2020 13:11:29 +0000 (14:11 +0100)]
mpegvideodata: drop useless comments

4 years agoavformat/webmdashenc: Remove write_trailer
Andreas Rheinhardt [Thu, 26 Dec 2019 10:53:32 +0000 (11:53 +0100)]
avformat/webmdashenc: Remove write_trailer

It doesn't do anything: All allocated blocks have already been freed in
write_header.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/mxfenc: allow all frame rates if -strict mode is set to unofficial or lower
Marton Balint [Thu, 5 Mar 2020 20:36:20 +0000 (21:36 +0100)]
avformat/mxfenc: allow all frame rates if -strict mode is set to unofficial or lower

There was no consensus wheter or not to allow unofficial frame rates due to
possible interoperability issues, a compromise is to only allow it if -strict
mode is set to unofficial.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mxfenc: factorize timecode checking and setting
Marton Balint [Tue, 3 Mar 2020 22:13:07 +0000 (23:13 +0100)]
avformat/mxfenc: factorize timecode checking and setting

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mxfenc: add some missing content package rates
Marton Balint [Fri, 28 Feb 2020 00:29:51 +0000 (01:29 +0100)]
avformat/mxfenc: add some missing content package rates

Fixes ticket #8523.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mxfenc: move content package rates and timebase combinations to a separate...
Marton Balint [Fri, 28 Feb 2020 00:21:04 +0000 (01:21 +0100)]
avformat/mxfenc: move content package rates and timebase combinations to a separate struct

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mxf: get rid of samples per frame array usage
Marton Balint [Fri, 28 Feb 2020 00:10:45 +0000 (01:10 +0100)]
avformat/mxf: get rid of samples per frame array usage

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/audiointerleave: disallow using a samples_per_frame array
Marton Balint [Thu, 27 Feb 2020 23:26:20 +0000 (00:26 +0100)]
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>
4 years agoavformat/smoothstreaming: Fix memleaks on errors
Andreas Rheinhardt [Thu, 26 Dec 2019 10:53:28 +0000 (11:53 +0100)]
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>
4 years agoavformat/matroskaenc: Check BlockAdditional size before use
Andreas Rheinhardt [Sun, 26 Jan 2020 05:10:27 +0000 (06:10 +0100)]
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>
4 years agoavformat/avienc: Use AV_STRINGIFY for compile time constant
Andreas Rheinhardt [Sat, 14 Mar 2020 17:08:45 +0000 (18:08 +0100)]
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>
4 years agoavformat/nutenc: Drop redundant frees
Andreas Rheinhardt [Sat, 14 Mar 2020 16:32:17 +0000 (17:32 +0100)]
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>
4 years agoavfilter/af_anequalizer: fix off by one in reallocation
Paul B Mahol [Sat, 14 Mar 2020 18:39:04 +0000 (19:39 +0100)]
avfilter/af_anequalizer: fix off by one in reallocation

4 years agoavformat/mux: Unify setting number of muxed packets
Andreas Rheinhardt [Thu, 12 Mar 2020 17:54:08 +0000 (18:54 +0100)]
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>
4 years agoavformat/mux: Remove redundant checks for write errors
Andreas Rheinhardt [Thu, 12 Mar 2020 17:54:07 +0000 (18:54 +0100)]
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>
4 years agolibavcodec, libpostproc: Remove outcommented START/STOP_TIMER
Andreas Rheinhardt [Fri, 13 Mar 2020 13:06:01 +0000 (14:06 +0100)]
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>
4 years agoavformat/mxfenc: Reorder fields in MXFIndexEntry to make it smaller
Andreas Rheinhardt [Fri, 13 Mar 2020 10:18:40 +0000 (11:18 +0100)]
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>
4 years agolavf/tty: Reduce probe score to fix ffmetadata auto-detection.
Carl Eugen Hoyos [Thu, 12 Mar 2020 23:53:16 +0000 (00:53 +0100)]
lavf/tty: Reduce probe score to fix ffmetadata auto-detection.

Fixes ticket #8568.

4 years agoavfilter/f_sendcmd: add more useful variables
Paul B Mahol [Fri, 13 Mar 2020 16:19:33 +0000 (17:19 +0100)]
avfilter/f_sendcmd: add more useful variables

4 years agoconfigure: Add llviddsp to mvha select
Thierry Foucu [Thu, 12 Mar 2020 16:32:22 +0000 (09:32 -0700)]
configure: Add llviddsp to mvha select

4 years agodiracdec: rewrite golomb reader
Lynne [Sun, 1 Mar 2020 11:23:53 +0000 (11:23 +0000)]
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.

4 years agochangelog: add entry for the Vulkan hwcontext and filters
Lynne [Thu, 12 Mar 2020 20:20:22 +0000 (20:20 +0000)]
changelog: add entry for the Vulkan hwcontext and filters

4 years agohwcontext_vulkan: support more than one plane per DMABUF layer
Lynne [Thu, 12 Mar 2020 18:59:12 +0000 (18:59 +0000)]
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.

4 years agohwcontext_vulkan: duplicate DMABUF objects before importing them
Lynne [Thu, 12 Mar 2020 18:03:43 +0000 (18:03 +0000)]
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.

4 years agohwcontext_vulkan: initialize semaphores of DMABUF imports
Lynne [Thu, 12 Mar 2020 18:01:07 +0000 (18:01 +0000)]
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.

4 years agohwcontext_vulkan: only convert image layout for transfers if necessary
Lynne [Thu, 12 Mar 2020 16:57:14 +0000 (16:57 +0000)]
hwcontext_vulkan: only convert image layout for transfers if necessary

4 years agohwcontext_vulkan: minor corrections for DMABUF mapping
Lynne [Thu, 12 Mar 2020 16:46:01 +0000 (16:46 +0000)]
hwcontext_vulkan: minor corrections for DMABUF mapping

We need to consider the amount of layers instead of the image's planes.

4 years agoavformat/avidec: recognize H265 fourcc as hevc
Paul B Mahol [Fri, 6 Mar 2020 20:16:49 +0000 (21:16 +0100)]
avformat/avidec: recognize H265 fourcc as hevc

Fixes decoding of came2_2020-01-13__20-38-58_21-00-00__Chn2.avi

4 years agoavformat/vpk: add seeking support
Paul B Mahol [Thu, 12 Mar 2020 17:47:39 +0000 (18:47 +0100)]
avformat/vpk: add seeking support

4 years agoavfilter/vf_dnn_processing.c: add frame size change support for planar yuv format
Guo, Yejun [Fri, 21 Feb 2020 12:40:07 +0000 (20:40 +0800)]
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>
4 years agoavfilter/vf_dnn_processing.c: add planar yuv format support
Guo, Yejun [Fri, 21 Feb 2020 06:20:48 +0000 (14:20 +0800)]
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>
4 years agoavfilter/vf_dnn_processing.c: use swscale for uint8<->float32 convert
Guo, Yejun [Thu, 20 Feb 2020 07:25:57 +0000 (15:25 +0800)]
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>
4 years agoavformat/hlsenc: set the options when open the key info files
Steven Liu [Thu, 12 Mar 2020 06:00:45 +0000 (14:00 +0800)]
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>
4 years agoavformat/hlsenc: Fix initial setting for start_pts
Hongcheng Zhong [Fri, 6 Mar 2020 03:58:22 +0000 (11:58 +0800)]
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>
4 years agoavcodec/cbs_jpeg: Check length for SOS
Michael Niedermayer [Sat, 7 Mar 2020 14:42:58 +0000 (15:42 +0100)]
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>
4 years agoavcodec/adpcm: Fix invalid shift in AV_CODEC_ID_ADPCM_PSX
Michael Niedermayer [Sun, 1 Mar 2020 21:46:34 +0000 (22:46 +0100)]
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>
4 years agoavcodec/mpeg12dec: Fix invalid shift in mpeg2_fast_decode_block_intra()
Michael Niedermayer [Thu, 5 Dec 2019 21:35:03 +0000 (22:35 +0100)]
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>
4 years agolsws/input: Do not change transparency range.
Carl Eugen Hoyos [Sat, 15 Feb 2020 09:07:51 +0000 (10:07 +0100)]
lsws/input: Do not change transparency range.

Fixes ticket #8509.

4 years agoavcodec/wavpack: check for allocation failure
Paul B Mahol [Wed, 11 Mar 2020 20:53:27 +0000 (21:53 +0100)]
avcodec/wavpack: check for allocation failure

4 years agoavcodec/wavpack: fix some syle issues
Paul B Mahol [Wed, 11 Mar 2020 20:50:02 +0000 (21:50 +0100)]
avcodec/wavpack: fix some syle issues

4 years agoavcodec/wavpack: add support for DSD files
David Bryant [Mon, 9 Mar 2020 22:23:53 +0000 (15:23 -0700)]
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>
4 years agolavc/aarch64: Remove unneeded file vp9mc_aarch64.c
Carl Eugen Hoyos [Wed, 11 Mar 2020 13:36:07 +0000 (14:36 +0100)]
lavc/aarch64: Remove unneeded file vp9mc_aarch64.c

4 years agolavc/aarch64: Fix suffix of new file vp9mc_aarch64.
Carl Eugen Hoyos [Wed, 11 Mar 2020 13:29:22 +0000 (14:29 +0100)]
lavc/aarch64: Fix suffix of new file vp9mc_aarch64.

4 years agolavc/aarch64: Fix compilation with --disable-neon
Carl Eugen Hoyos [Wed, 11 Mar 2020 12:16:47 +0000 (13:16 +0100)]
lavc/aarch64: Fix compilation with --disable-neon

Fixes ticket #8565.

4 years agolavc/aarch64: Move non-neon vp9 copy functions out of neon source file.
Carl Eugen Hoyos [Wed, 11 Mar 2020 12:01:02 +0000 (13:01 +0100)]
lavc/aarch64: Move non-neon vp9 copy functions out of neon source file.

Fixes part of ticket #8565.

4 years agoMakefile: Delete more created files when running "make distclean".
Carl Eugen Hoyos [Wed, 11 Mar 2020 10:39:44 +0000 (11:39 +0100)]
Makefile: Delete more created files when running "make distclean".

4 years agoavfilter/Makefile: remove dnn files when calling make clean
James Almer [Tue, 10 Mar 2020 15:55:11 +0000 (12:55 -0300)]
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>
4 years agofate/adpcm: add adpcm_ima_alp tests
Zane van Iperen [Mon, 9 Mar 2020 13:07:47 +0000 (13:07 +0000)]
fate/adpcm: add adpcm_ima_alp tests

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/cbs_h2645: Treat slices without data as invalid
Andreas Rheinhardt [Mon, 9 Dec 2019 22:26:03 +0000 (23:26 +0100)]
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>
4 years agoavcodec/cbs_h2645: Remove dead code to delete trailing zeroes
Andreas Rheinhardt [Mon, 9 Dec 2019 22:26:02 +0000 (23:26 +0100)]
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>
4 years agoavcodec/v4l2_m2m: Avoid using intermediate buffer
Andreas Rheinhardt [Tue, 3 Mar 2020 04:20:05 +0000 (05:20 +0100)]
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>
4 years agoavformat/movenc: add ICC profile support to colr atom
vectronic [Mon, 23 Sep 2019 20:43:06 +0000 (21:43 +0100)]
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>
4 years agoavformat/mov: whitespace indent
vectronic [Mon, 23 Sep 2019 20:43:05 +0000 (21:43 +0100)]
avformat/mov: whitespace indent

Signed-off-by: vectronic <hello.vectronic@gmail.com>
4 years agoavformat/mov: add ICC profile support for colr atom
vectronic [Mon, 23 Sep 2019 20:43:04 +0000 (21:43 +0100)]
avformat/mov: add ICC profile support for colr atom

Signed-off-by: vectronic <hello.vectronic@gmail.com>
4 years agoAPI: add AV_PKT_DATA_ICC_PROFILE to AVPacketSideDataType
vectronic [Mon, 23 Sep 2019 20:43:02 +0000 (21:43 +0100)]
API: add AV_PKT_DATA_ICC_PROFILE to AVPacketSideDataType

Signed-off-by: vectronic <hello.vectronic@gmail.com>
4 years agolavc/vaapi_encode_h265: fix conf_win_xxx_offset for 4:2:2/4:4:4 encoding
Linjie Fu [Sun, 8 Mar 2020 08:28:46 +0000 (16:28 +0800)]
lavc/vaapi_encode_h265: fix conf_win_xxx_offset for 4:2:2/4:4:4 encoding

Use desc->log2_chroma_w/h to calculate the sps->conf_win_right/bottom_offset.

Based on Table 6-1, SubWidthC and SubHeightC depend on chroma format(log2_chroma_w/h).

Based on D-28 and D-29, set the correct cropped width/height.

croppedWidth  = pic_width_in_luma_samples âˆ’
                SubWidthC * ( conf_win_right_offset + conf_win_left_offset );

croppedHeight = pic_height_in_luma_samples âˆ’
                SubHeightC * ( conf_win_bottom_offset + conf_win_top_offset );

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavformat/libzmq: Make default pkt_size value consistent with amqp
Andriy Gelman [Sun, 8 Mar 2020 20:33:29 +0000 (16:33 -0400)]
avformat/libzmq: Make default pkt_size value consistent with amqp

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat: Add AMQP version 0-9-1 protocol support
Andriy Gelman [Sun, 8 Mar 2020 21:25:31 +0000 (17:25 -0400)]
avformat: Add AMQP version 0-9-1 protocol support

Supports connecting to a RabbitMQ broker via AMQP version 0-9-1.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/alp: tweak probe function to return MAX-1
Zane van Iperen [Mon, 9 Mar 2020 11:55:19 +0000 (11:55 +0000)]
avformat/alp: tweak probe function to return MAX-1

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agoavformat: add demuxer for LEGO Racers' ALP format
Zane van Iperen [Sun, 8 Mar 2020 12:09:10 +0000 (12:09 +0000)]
avformat: add demuxer for LEGO Racers' ALP format

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec: add decoder for High Voltage Software's ALP ADPCM
Zane van Iperen [Sun, 8 Mar 2020 12:09:02 +0000 (12:09 +0000)]
avcodec: add decoder for High Voltage Software's ALP ADPCM

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/udp: support w32pthreads compat
phunkyfish [Mon, 2 Mar 2020 20:48:41 +0000 (20:48 +0000)]
avformat/udp: support w32pthreads compat

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agofftools/ffmpeg_opt: remove bogus warning of multiple -af and -vf usage
Marton Balint [Sat, 29 Feb 2020 21:51:33 +0000 (22:51 +0100)]
fftools/ffmpeg_opt: remove bogus warning of multiple -af and -vf usage

This is redundant after the last patch and also fixes ticket #7712.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agofftools/ffmpeg_opt: warn about overwritten parsed options
Marton Balint [Sat, 29 Feb 2020 21:44:28 +0000 (22:44 +0100)]
fftools/ffmpeg_opt: warn about overwritten parsed options

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agofftools/ffplay: fix possible memory leak in decoder
Marton Balint [Thu, 5 Mar 2020 22:28:12 +0000 (23:28 +0100)]
fftools/ffplay: fix possible memory leak in decoder

Fixes ticket #8549.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoffmpeg: default hwaccel_output_format to cuda when hwaccel is cuvid
Timo Rothenpieler [Fri, 6 Mar 2020 13:35:13 +0000 (14:35 +0100)]
ffmpeg: default hwaccel_output_format to cuda when hwaccel is cuvid

This ensures old commandlines using -hwaccel cuvid don't break due to
the recent removal of the the cuvid-specific hwaccel bringup.

4 years agodoc/demuxers: update mov section
Gyan Doshi [Sun, 26 Jan 2020 15:02:18 +0000 (20:32 +0530)]
doc/demuxers: update mov section

Add details and all options for mov.c demuxer.

4 years agodump_extradata: Insert extradata even for small packets
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:26 +0000 (23:19 +0100)]
dump_extradata: Insert extradata even for small packets

3469cfab added a check for whether the extradata coincided with the
beginning of the packet's data in order not to add extradata to packets
that already have it. But the check used was buggy for packets whose
size is smaller than the extradata's size. This commit fixes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Cosmetics
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:25 +0000 (23:19 +0100)]
h264_mp4toannexb: Cosmetics

Mainly reindentation, but some variables were also put into a smaller
scope.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Improve overread checks
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:24 +0000 (23:19 +0100)]
h264_mp4toannexb: Improve overread checks

1. Left shifts of signed values are undefined as soon as the result is
no longer representable in the target type. Therefore make nal_size
an uint32_t and drop the check for whether it is < 0.
2. The two checks for overreads (whether the length field is contained
in the packet and whether the actual unit is contained in the packet)
can be combined into one because the packet is padded, i.e. a potential
overread caused by reading the length field without checking whether
said length field is actually part of the packet's buffer is allowed
as one always stays within the padding. But one has to be aware of
a pitfall: The comparison must be performed in (at least) int64_t as
otherwise buf_end - buf might be promoted to uint32_t in which case
an already occured overread would appear as a very large number.
A comment explaining this has been added, too.
3. Units of size zero are now silently dropped; the earlier code would
instead read the first byte of the next length field (or the first byte
of padding) to infer the type of the current unit.
4. Futhermore, the earlier code returned the wrong error code. This has
been fixed, too.

Fixes #8290.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Stop reallocating the output buffer
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:23 +0000 (23:19 +0100)]
h264_mp4toannexb: Stop reallocating the output buffer

Up until now, h264_mp4toannexb would grow the output packet's buffer by
the desired amount every time another NAL unit of the input packet has
been read; this commit changes this: The input buffer is now essentially
parsed twice, once to determine the final size of the output packet and
once to write the output packet's data.

Fixes: Timeout
Fixes: 19322/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_MP4TOANNEXB_fuzzer-5688407821123584
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Consistently use pointer comparisons
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:22 +0000 (23:19 +0100)]
h264_mp4toannexb: Consistently use pointer comparisons

h264_mp4toannexb_filter currently uses both indices/offsets as well as
direct pointers comparisons for the checks whether one has reached or
even surpassed the end. This commit removes the offsets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Copy one NAL unit at a time
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:21 +0000 (23:19 +0100)]
h264_mp4toannexb: Copy one NAL unit at a time

If processing an input NAL unit triggers the insertion of data from
extradata in front of said NAL unit, the output packet is grown (i.e.
reallocated) once to accomodate both the new extradata as well as the
input NAL unit itself; this has been changed: In such a situation, the
packet is now grown twice. While this is bad for performance, it allows
to simplify the code and ultimately to stop reallocating the packet
altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Try to avoid four byte startcodes
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:20 +0000 (23:19 +0100)]
h264_mp4toannexb: Try to avoid four byte startcodes

According to the H.264 specifications, the only NAL units that need to
have four byte startcodes in H.264 Annex B format are SPS/PPS units and
units that start a new access unit. Before af7e953a, the first of these
conditions wasn't upheld as already existing in-band parameter sets
would not automatically be written with a four byte startcode, but only
when they already were at the beginning of their input packets. But it
made four byte startcodes be used too often as every unit that is written
together with a parameter set that is inserted from extradata received a
four byte startcode although a three byte start code would suffice
unless the unit itself were a parameter set.

FATE has been updated to reflect the changes. Although the patch leaves
the extradata unchanged, the size of the extradata according to the FATE
reports changes. This is due to a quirk in ff_h2645_packet_split which
is used by extract_extradata: If the input is Annex B, the first zero of
a four byte startcode is considered a part of the last unit (if any).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Simplify extradata insertion
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:19 +0000 (23:19 +0100)]
h264_mp4toannexb: Simplify extradata insertion

Up until now, h264_mp4toannexb stored the offset of the first SPS and
the first PPS in the (output) extradata in its context and used these
two numbers together with the size of the extradata and the pointer to
the extradata to determine what to insert when inserting extradata. This
led to some very long lines like "s->pps_offset != -1 ? s->pps_offset :
ctx->par_out->extradata_size - s->sps_offset". Therefore now pointers to
SPS and PPS are stored along with their respective sizes, so that e.g.
the above line can be changed to "s->sps_size".

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Don't forget numOfPictureParameterSets
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:18 +0000 (23:19 +0100)]
h264_mp4toannexb: Don't forget numOfPictureParameterSets

The format of an AVCDecoderConfigurationRecord, the out-of-band
extradata of H.264 in mp4, is as follows: First four bytes containing
version, profile and level, one byte for the length size and one byte
each for the number of SPS, followed by the SPS (each with its own size
field), followed by a byte containing the number of PPS followed by the
PPS with their size fields. While the number of SPS/PPS may be zero, the
bytes containing these numbers are mandatory. Yet the byte containing
the number of PPS has been ignored in two places:
1. In the initial check for whether the extradata can contain an
AVCDecoderConfigurationRecord. The minimum size is 7, not 6.
2. No check is made for whether the extradata ended right after the last
byte of the last SPS of the SPS array. Instead the first byte of the
padding is read as if it were part of the extradata and contained the
number of PPS (namely zero, given that the padding is zeroed). No error
or warning was ever raised.
This has been changed. Such truncated extradata is now considered
invalid; the check for 2. has been incorporated into the general size
check.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Add a comment about possible overread
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:17 +0000 (23:19 +0100)]
h264_mp4toannexb: Add a comment about possible overread

Before reading a 16bit size field during parsing of extradata, no check
is performed to make sure that said length field is actually contained
in the extradata. Given that this overread is not dangerous (the extradata
is supposed to be padded), only a comment for it has been added; the error
itself will be detected as part of the normal check for overreads.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Improve extradata overread checks
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:16 +0000 (23:19 +0100)]
h264_mp4toannexb: Improve extradata overread checks

Currently during parsing the extradata, h264_mp4toannexb checks for
overreads by adding the size of the current unit to the current position
pointer and comparing this to the end position of the extradata. But
pointer comparisons and pointer arithmetic are only defined if it does not
exceed the object it is used on (one past the last element of an array
is allowed, too). In practice, this might lead to overflows. Therefore
the check has been changed to use bytestream2_get_bytes_left() which
means that the pointers get subtracted and the result gets compared to
the available size.

Furthermore, the error code has been fixed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoh264_mp4toannexb: Switch to GetByteContext to read extradata
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:15 +0000 (23:19 +0100)]
h264_mp4toannexb: Switch to GetByteContext to read extradata

This is done in order to improve readability. No functional change is
intended with this commit at all; in particular, the unsafe read
functions are used throughout as h264_extradata_to_annexb already
performs its own checks. (These checks will nevertheless be improved
in further commits.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agobytestream: Make get_bytes_left compatible with overread
Andreas Rheinhardt [Sat, 14 Dec 2019 22:19:14 +0000 (23:19 +0100)]
bytestream: Make get_bytes_left compatible with overread

bytestream2_get_bytes_left returns an unsigned int; as a result,
it returns big positive numbers if an overread already happened,
making it unsuitable for scenarios where one wants to allow this
in a controlled way (because the buffer is actually padded so that
no segfaults can happen). So change it to return an ordinary int.

Also, bytestream2_get_bytes_left_p has been modified in the same way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/cbs_av1_syntax_template: Set seen_frame_header only after successfull uncompr...
Michael Niedermayer [Sat, 14 Dec 2019 17:43:24 +0000 (18:43 +0100)]
avcodec/cbs_av1_syntax_template: Set seen_frame_header only after successfull uncompressed_header()

Fixes: assertion failure
Fixes: 19301/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_FRAME_MERGE_fuzzer-5743212006473728
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavf/dashdec: add 3GPP TS26.247 probe in dash demuxer
Jun Zhao [Wed, 19 Feb 2020 03:51:20 +0000 (11:51 +0800)]
lavf/dashdec: add 3GPP TS26.247 probe in dash demuxer

Enabled the 3GP-DASH Release-10/Relase-11(3GPP TS26.247) profile
to dash demuxer probe.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/dashdec: Add ts to the list of allowed extensions.
Jun Zhao [Wed, 19 Feb 2020 05:20:45 +0000 (13:20 +0800)]
lavf/dashdec: Add ts to the list of allowed extensions.

Dashdec can able to handle MPEG-2 TS streams by default as well,
used MP4Box to create the segmented MPEG-2 TS files for
verification.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agodoc/filters: add missed framesync part in filter docs
Jun Zhao [Sun, 1 Mar 2020 12:06:31 +0000 (20:06 +0800)]
doc/filters: add missed framesync part in filter docs

Add missed framesync part in filter docs.

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavcodec/siren: Check several indexes
Michael Niedermayer [Sat, 29 Feb 2020 23:00:25 +0000 (00:00 +0100)]
avcodec/siren: Check several indexes

Fixes: Multiple out of array accesses
Fixes: 20817/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-5754041227542528.fuzz
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>
4 years agoffmpeg: remove superfluous custom cuvid hwaccel
James Almer [Tue, 3 Mar 2020 16:16:55 +0000 (13:16 -0300)]
ffmpeg: remove superfluous custom cuvid hwaccel

It's a duplicate of the properly implemented nvdec libavcodec hwaccel

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/f_sendcmd: implement expr flag
Paul B Mahol [Fri, 28 Feb 2020 22:11:32 +0000 (23:11 +0100)]
avfilter/f_sendcmd: implement expr flag

Make possible to parse expressions and store results as arguments
for target filters.

4 years agoavcodec/cuviddec: use AVCodec.bsfs to filter packets
James Almer [Sun, 1 Mar 2020 02:57:48 +0000 (23:57 -0300)]
avcodec/cuviddec: use AVCodec.bsfs to filter packets

Simplifies code considerably.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_v360: simplify some unnecessary indirections
Paul B Mahol [Tue, 3 Mar 2020 11:41:30 +0000 (12:41 +0100)]
avfilter/vf_v360: simplify some unnecessary indirections

4 years agoavfilter/vf_v360: add half equirectangular input format
Paul B Mahol [Tue, 3 Mar 2020 11:21:16 +0000 (12:21 +0100)]
avfilter/vf_v360: add half equirectangular input format

4 years agoavfilter/vf_v360: add half equirectangular output format
Paul B Mahol [Tue, 3 Mar 2020 11:03:42 +0000 (12:03 +0100)]
avfilter/vf_v360: add half equirectangular output format

4 years agoavfilter/vf_sr.c: refine code to use AVPixFmtDescriptor.log2_chroma_h/w
Guo, Yejun [Fri, 21 Feb 2020 11:29:12 +0000 (19:29 +0800)]
avfilter/vf_sr.c: refine code to use AVPixFmtDescriptor.log2_chroma_h/w

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Reviewed-by: Pedro Arthur <bygrandao@gmail.com>
4 years agoavcodec/adpcm: Clip step index for ADPCM_IMA_APM
Michael Niedermayer [Sun, 1 Mar 2020 21:30:00 +0000 (22:30 +0100)]
avcodec/adpcm: Clip step index for ADPCM_IMA_APM

Fixes: out of array access
Fixes: 20828/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APM_fuzzer-5712770106654720
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>
4 years agoavformat/segment: Don't set extradata size twice
Andreas Rheinhardt [Mon, 2 Mar 2020 04:35:20 +0000 (05:35 +0100)]
avformat/segment: Don't set extradata size twice

ff_alloc_extradata() already sets the size of the extradata so doing it
again is unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mxfenc: use a zero based continuity counter
Marton Balint [Sat, 29 Feb 2020 00:25:56 +0000 (01:25 +0100)]
avformat/mxfenc: use a zero based continuity counter

The standard does not seem to require the counter to be zero based, but some
checker tools (MyriadBits MXFInspect, Interra Baton) have validations against 0
start...

Fixes ticket #6781.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_v360: add truncated square pyramid input format
Paul B Mahol [Mon, 2 Mar 2020 18:05:13 +0000 (19:05 +0100)]
avfilter/vf_v360: add truncated square pyramid input format

4 years agoavfilter/vf_v360: add truncated square pyramid output format
Paul B Mahol [Mon, 2 Mar 2020 16:40:21 +0000 (17:40 +0100)]
avfilter/vf_v360: add truncated square pyramid output format

4 years agoavfilter/vf_v360: fix cylindrical input format
Paul B Mahol [Sun, 1 Mar 2020 10:24:31 +0000 (11:24 +0100)]
avfilter/vf_v360: fix cylindrical input format

4 years agoavfilter/vf_v360: cleanup some code
Paul B Mahol [Sun, 1 Mar 2020 09:33:36 +0000 (10:33 +0100)]
avfilter/vf_v360: cleanup some code

4 years agoavfilter/vf_v360: improve interpolation for equirect input at poles
Paul B Mahol [Sat, 29 Feb 2020 21:27:11 +0000 (22:27 +0100)]
avfilter/vf_v360: improve interpolation for equirect input at poles