]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agoavformat/argo_asf: initialise file header inline
Zane van Iperen [Mon, 14 Sep 2020 23:22:22 +0000 (09:22 +1000)]
avformat/argo_asf: initialise file header inline

Garbage was left-over in the ArgoASFFileHeader::name field if the url
was too short. This zero-initialises it.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavutil/cuda_check: add missing dynlink_loader.h include
James Almer [Tue, 15 Sep 2020 22:29:07 +0000 (19:29 -0300)]
avutil/cuda_check: add missing dynlink_loader.h include

Fixes make checkheaders

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/Makefile: add vaapi_hevc.h to the SKIPHEADERS list
James Almer [Tue, 15 Sep 2020 22:28:20 +0000 (19:28 -0300)]
avcodec/Makefile: add vaapi_hevc.h to the SKIPHEADERS list

Fixes make checkheaders when vaapi is disabled

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/argo_asf: add missing avformat.h include
James Almer [Tue, 15 Sep 2020 22:27:45 +0000 (19:27 -0300)]
avformat/argo_asf: add missing avformat.h include

Fixes make checkheaders

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/mpc7, mpc7data: Avoid gaps in array
Andreas Rheinhardt [Tue, 15 Sep 2020 03:23:07 +0000 (05:23 +0200)]
avcodec/mpc7, mpc7data: Avoid gaps in array

The Musepack decoder uses static VLC tables to parse the bitstream.
There are 14 different quant tables VLCs and each of them has a varying
number of codes. The maximum number is 63, the average number is 25.3.
Up until now, the array containing the raw data was of type
uint16_t [7][2][64 * 2] (the 14 tables come in pairs of two, hence [7][2]
instead of [14]) and from this it follows that there were large gaps in
said array. This commit changes this by making it a continuous array
instead. Doing so saves about 2KB.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpc7, mpc7data: Make overlong arrays smaller
Andreas Rheinhardt [Tue, 15 Sep 2020 01:45:22 +0000 (03:45 +0200)]
avcodec/mpc7, mpc7data: Make overlong arrays smaller

For the VLC table arrays in mpc7_decode_init() this fixes
a regression introduced in 1e40dc920a838e35f1483b20bfcd417437e68741.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavdevice/decklink_dec: fix build with older SDK
Marton Balint [Mon, 14 Sep 2020 19:22:29 +0000 (21:22 +0200)]
avdevice/decklink_dec: fix build with older SDK

Apparently bmdFormatUnspecified needs SDK 11.0. It is just a fancy way of
checking for zero, so let's do that instead.

Fixes build issue since f1b908d20a8.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavcodec/mpc7: Don't pretend initializing static VLC tables can fail
Andreas Rheinhardt [Tue, 15 Sep 2020 02:26:37 +0000 (04:26 +0200)]
avcodec/mpc7: Don't pretend initializing static VLC tables can fail

It can't if one hasn't made a mistake at calculating the sizes;
and this is checked by asserts/aborts.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/motionpixels: Cleanup generically after init failure
Andreas Rheinhardt [Tue, 15 Sep 2020 01:22:36 +0000 (03:22 +0200)]
avcodec/motionpixels: Cleanup generically after init failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mobiclip: Fix heap-buffer-overflow
Andreas Rheinhardt [Tue, 15 Sep 2020 01:03:18 +0000 (03:03 +0200)]
avcodec/mobiclip: Fix heap-buffer-overflow

The MobiClip decoder uses adjacent pixels for prediction; yet when
accessing the left pixel, it was forgotten to clip the x coordinate.
This results in an heap-buffer-overflow. It can e.g. be reproduced with
the sample from https://samples.ffmpeg.org/V-codecs/MOHD/crap.avi when
forcing the video decoder to mobiclip.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mlpenc: Fix memleak upon init failure
Andreas Rheinhardt [Tue, 15 Sep 2020 00:35:27 +0000 (02:35 +0200)]
avcodec/mlpenc: Fix memleak upon init failure

If an error happens during init after an allocation has succeeded,
the already allocated data leaked up until now. Fix this by setting the
FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/indeo5: Fix memleaks upon allocation error
Andreas Rheinhardt [Mon, 14 Sep 2020 18:59:12 +0000 (20:59 +0200)]
avcodec/indeo5: Fix memleaks upon allocation error

ff_ivi_init_planes() might error out after having allocated some arrays.
Set the FF_CODEC_CAP_INIT_CLEANUP flag in order to free these arrays in
this case.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/ivi: Fix segfault on allocation error
Andreas Rheinhardt [Mon, 14 Sep 2020 18:32:33 +0000 (20:32 +0200)]
avcodec/ivi: Fix segfault on allocation error

If allocating the tiles array for indeo 4/5 fails, the context is in an
inconsistent state, because the counter for the number of tiles is > 0.
This will lead to a segfault when freeing the tiles' substructures.
Fix this by setting the number of tiles to zero if the allocation was
unsuccessful.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mobiclip: Fix memleak upon init failure
Andreas Rheinhardt [Tue, 15 Sep 2020 00:44:36 +0000 (02:44 +0200)]
avcodec/mobiclip: Fix memleak upon init failure

If an error happens during init after an allocation has succeeded,
the already allocated data leaked up until now. Fix this by setting the
FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/magicyuvenc: Fix memleak upon init failure
Andreas Rheinhardt [Tue, 15 Sep 2020 00:13:56 +0000 (02:13 +0200)]
avcodec/magicyuvenc: Fix memleak upon init failure

If an error happens during init after an allocation has succeeded,
the already allocated data leaked up until now. Fix this by setting the
FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/hcom: Cleanup generically upon init failure
Andreas Rheinhardt [Mon, 14 Sep 2020 15:39:55 +0000 (17:39 +0200)]
avcodec/hcom: Cleanup generically upon init failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/gif: Fix leaks upon allocation error
Andreas Rheinhardt [Mon, 14 Sep 2020 15:30:34 +0000 (17:30 +0200)]
avcodec/gif: Fix leaks upon allocation error

If one of several allocations the gif encoder performs in its init
function fails, the successful allocations leak. Fix this by adding the
FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dsicinvideo: Remove redundant code for freeing
Andreas Rheinhardt [Mon, 14 Sep 2020 00:26:37 +0000 (02:26 +0200)]
avcodec/dsicinvideo: Remove redundant code for freeing

The dsicinvideo decoder already has the FF_CODEC_CAP_INIT_CLEANUP flag
set, so it is unnecessary to directly clean up some already allocated
buffers in case another one could not be allocated in the init function,
as all buffers will be freed anyway later in the decoder's close
function.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/avrndec: Fix memleak on error
Andreas Rheinhardt [Sun, 13 Sep 2020 20:05:25 +0000 (22:05 +0200)]
avcodec/avrndec: Fix memleak on error

If ff_codec_open2_recursive() fails, the already allocated
AVCodecContext leaks. Fix this by setting the FF_CODEC_CAP_INIT_CLEANUP
flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/avrndec: Check allocation for success
Andreas Rheinhardt [Sun, 13 Sep 2020 19:57:50 +0000 (21:57 +0200)]
avcodec/avrndec: Check allocation for success

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/atrac1: Cleanup generically after init failure
Andreas Rheinhardt [Sun, 13 Sep 2020 18:54:18 +0000 (20:54 +0200)]
avcodec/atrac1: Cleanup generically after init failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/atrac1: Check allocation of AVFloatDSPContext
Andreas Rheinhardt [Sun, 13 Sep 2020 18:53:46 +0000 (20:53 +0200)]
avcodec/atrac1: Check allocation of AVFloatDSPContext

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolibavcodec/exr: fix incorrect translation of denorm mantissa
Mark Reid [Tue, 15 Sep 2020 02:14:46 +0000 (19:14 -0700)]
libavcodec/exr: fix incorrect translation of denorm mantissa

3 years agoavfilter/f_interleave: fix some issues with interleaving
Paul B Mahol [Tue, 15 Sep 2020 15:17:15 +0000 (17:17 +0200)]
avfilter/f_interleave: fix some issues with interleaving

3 years agoavcodec/decode: use a packet list to store packet properties
James Almer [Mon, 17 Aug 2020 15:06:55 +0000 (12:06 -0300)]
avcodec/decode: use a packet list to store packet properties

Keeping only the latest packet fed to the decoder works only for decoders that
return a frame immediately after every consumed packet. Decoders that consume
several packets before they return a frame will fill said frame with properties
taken from the last consumed packet instead of the earliest.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/packet: move AVPacketList definition and function helpers over from libavformat
James Almer [Mon, 17 Aug 2020 15:03:50 +0000 (12:03 -0300)]
avcodec/packet: move AVPacketList definition and function helpers over from libavformat

And replace the flags parameter with a function callback that can be used to
copy the contents of the packet (e.g, av_packet_ref and av_packet_copy_props).

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavfilter/x86/vf_convolution_init: there is asm only for 8bit depth
Paul B Mahol [Tue, 15 Sep 2020 06:10:47 +0000 (08:10 +0200)]
avfilter/x86/vf_convolution_init: there is asm only for 8bit depth

3 years agoavfilter/avf_concat: check for possible integer overflow
Paul B Mahol [Sun, 13 Sep 2020 11:33:49 +0000 (13:33 +0200)]
avfilter/avf_concat: check for possible integer overflow

Also check that segment delta pts is always bigger than input pts.

There is nothing much currently that can be done to recover from
this situation so just return AVERROR_INVALIDDATA error code.

3 years agoavfilter/af_amix: do not leave unset PTS for frames after first stream is over
Paul B Mahol [Sun, 13 Sep 2020 12:00:27 +0000 (14:00 +0200)]
avfilter/af_amix: do not leave unset PTS for frames after first stream is over

First stream is used only to get number of samples to put into each output frame.

3 years agoavcodec/cfhdenc: Fix leaks on allocation errors
Andreas Rheinhardt [Sun, 13 Sep 2020 23:37:07 +0000 (01:37 +0200)]
avcodec/cfhdenc: Fix leaks on allocation errors

The CineForm HD encoder attempts to allocate several buffers in its init
function; yet if only some of these allocations succeed, the
successfully allocated buffers leak. This is fixed by setting the
FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/snowdec: Use ff_snow_common_init() directly
Andreas Rheinhardt [Sat, 12 Sep 2020 21:40:02 +0000 (23:40 +0200)]
avcodec/snowdec: Use ff_snow_common_init() directly

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_premultiply: add missing AV_PIX_FMT_YUVA444P12
Mark Reid [Mon, 14 Sep 2020 02:55:01 +0000 (19:55 -0700)]
avfilter/vf_premultiply: add missing AV_PIX_FMT_YUVA444P12

query_formats says its supported, but is missing from switch statement leading to segfault

3 years agoavformat: add Argonaut Games BRP demuxer
Zane van Iperen [Mon, 7 Sep 2020 10:44:23 +0000 (20:44 +1000)]
avformat: add Argonaut Games BRP demuxer

Used in FMVs for FX Fighter and Croc. Supports BVID and BASF streams,
requests samples for anything else.

Due to the way BASF streams are contained in the file, only one is
supported. I have yet to see a BRP file with multiple.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavformat/argo_asf: add ASF_MIN_BUFFER_SIZE #define
Zane van Iperen [Fri, 4 Sep 2020 03:54:09 +0000 (13:54 +1000)]
avformat/argo_asf: add ASF_MIN_BUFFER_SIZE #define

For future use by the argo_brp demuxer

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavformat/argo_asf: split functionality into a header
Zane van Iperen [Sat, 5 Sep 2020 07:24:17 +0000 (17:24 +1000)]
avformat/argo_asf: split functionality into a header

For future use by the argo_brp demuxer.

Adds:
  - void ff_argo_asf_parse_file_header(ArgoASFFileHeader *hdr, const uint8_t *buf);
  - int  ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeader *hdr);
  - void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t *buf);
  - int  ff_argo_asf_fill_stream(AVStream *st, const ArgoASFChunkHeader *ckhdr);

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavformat/argo_asf: bail if invalid tag
Zane van Iperen [Sun, 6 Sep 2020 01:00:17 +0000 (11:00 +1000)]
avformat/argo_asf: bail if invalid tag

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavdevice/decklink_dec: add support for querying RP188 High Frame Rate timecode
Marton Balint [Sat, 5 Sep 2020 19:18:17 +0000 (21:18 +0200)]
avdevice/decklink_dec: add support for querying RP188 High Frame Rate timecode

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavdevice/decklink_dec: add support for rgb/yuv pixel format autodetection
Marton Balint [Wed, 15 Jul 2020 18:45:22 +0000 (20:45 +0200)]
avdevice/decklink_dec: add support for rgb/yuv pixel format autodetection

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavdevice/decklink_dec: use decklink_ctx->raw_format as bmdPixelFormat
Marton Balint [Wed, 15 Jul 2020 18:23:12 +0000 (20:23 +0200)]
avdevice/decklink_dec: use decklink_ctx->raw_format as bmdPixelFormat

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavdevice/decklink_common.h: remove unsupported decklink version ifdef
Marton Balint [Wed, 15 Jul 2020 18:06:22 +0000 (20:06 +0200)]
avdevice/decklink_common.h: remove unsupported decklink version ifdef

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat: use av_timecode_make_smpte_tc_string2
Marton Balint [Fri, 24 Jul 2020 14:26:58 +0000 (16:26 +0200)]
avformat: use av_timecode_make_smpte_tc_string2

WSD format has no frames stored for playback time.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavfilter/vf_showinfo: use av_timecode_make_smpte_tc_string2
Marton Balint [Fri, 24 Jul 2020 14:26:25 +0000 (16:26 +0200)]
avfilter/vf_showinfo: use av_timecode_make_smpte_tc_string2

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavcodec: use av_timecode_make_smpte_tc_string2 in hevc and h264 decoder
Marton Balint [Fri, 24 Jul 2020 14:26:04 +0000 (16:26 +0200)]
avcodec: use av_timecode_make_smpte_tc_string2 in hevc and h264 decoder

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agofftools/ffprobe: use av_timecode_make_smpte_tc_string2
Marton Balint [Fri, 24 Jul 2020 14:25:45 +0000 (16:25 +0200)]
fftools/ffprobe: use av_timecode_make_smpte_tc_string2

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavutil/timecode: add av_timecode_make_smpte_tc_string2
Marton Balint [Fri, 24 Jul 2020 13:09:32 +0000 (15:09 +0200)]
avutil/timecode: add av_timecode_make_smpte_tc_string2

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavutil/timecode: do not trash bits on invalid av_timecode_get_smpte arguments
Marton Balint [Sat, 5 Sep 2020 15:46:42 +0000 (17:46 +0200)]
avutil/timecode: do not trash bits on invalid av_timecode_get_smpte arguments

The function has no way to return error, so let's clip or calculate modulo.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavutil/timecode: cosmetics on av_timecode_get_smpte
Marton Balint [Mon, 20 Jul 2020 20:33:20 +0000 (22:33 +0200)]
avutil/timecode: cosmetics on av_timecode_get_smpte

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps
Marton Balint [Mon, 20 Jul 2020 19:38:21 +0000 (21:38 +0200)]
avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps

SMPTE 12M timecode can only count frames up to 39, because the tens-of-frames
value is stored in 2 bit. In order to resolve this 50/60 fps SMPTE timecode is
using the field bit (which is the same bit as the phase correction bit) to
signal the least significant bit of a 50/60 fps timecode. See SMPTE ST
12-1:2014 section 12.1.

Therefore we slightly change the format of the return value of
av_timecode_get_smpte_from_framenum and AV_FRAME_DATA_S12M_TIMECODE and start
using the previously unused Phase Correction bit as Field bit. (As the SMPTE
standard suggests)

We add 50/60 fps support to av_timecode_get_smpte_from_framenum by calling the
recently added av_timecode_get_smpte function in it which already handles this
properly.

This change affects the decklink indev and the DV and MXF muxers. MXF has no
fate test for 50/60fps content, DV does, therefore the changes.

MediaInfo (a recent version) confirms that half-frame timecode must be inserted
to DV. MXFInspect confirms valid timecode insertion to the System Item of MXF
files. For MXF, also see EBU R122.

Note that for DV the field flag is not used because in the HDV specs (SMPTE
370M) it is still defined as biphase mark polarity correction flag. So it
should not matter that the DV muxer overrides the field bit.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat: add Square SVS demuxer
Paul B Mahol [Fri, 11 Sep 2020 09:47:34 +0000 (11:47 +0200)]
avformat: add Square SVS demuxer

3 years agoavformat/moflex: make seeking more useful
Paul B Mahol [Thu, 10 Sep 2020 20:36:48 +0000 (22:36 +0200)]
avformat/moflex: make seeking more useful

3 years agoavcodec/mobiclip: add missing flush
Paul B Mahol [Thu, 10 Sep 2020 20:37:56 +0000 (22:37 +0200)]
avcodec/mobiclip: add missing flush

3 years agoavformat/flic: add support for seeking to start
Paul B Mahol [Thu, 10 Sep 2020 11:55:50 +0000 (13:55 +0200)]
avformat/flic: add support for seeking to start

3 years agoavcodec/cdgraphics: fix decoded output when seeking to start of file
Paul B Mahol [Wed, 9 Sep 2020 22:39:47 +0000 (00:39 +0200)]
avcodec/cdgraphics: fix decoded output when seeking to start of file

Also in cdg demuxer do not skip packets data, and remove
private context which is not really needed.

3 years agoavfilter/asrc_anullsrc: actually return correct EOF pts
Paul B Mahol [Sun, 13 Sep 2020 11:25:05 +0000 (13:25 +0200)]
avfilter/asrc_anullsrc: actually return correct EOF pts

3 years agoavfilter/asrc_anullsrc: give better limits to number of samples per frame
Paul B Mahol [Sun, 13 Sep 2020 11:10:54 +0000 (13:10 +0200)]
avfilter/asrc_anullsrc: give better limits to number of samples per frame

3 years agoavfilter/asrc_anullsrc: make number of output samples match duration
Paul B Mahol [Sun, 13 Sep 2020 11:08:35 +0000 (13:08 +0200)]
avfilter/asrc_anullsrc: make number of output samples match duration

3 years agoavformat/cdg: Fix integer overflow in duration computation
Michael Niedermayer [Sun, 19 Jul 2020 14:54:28 +0000 (16:54 +0200)]
avformat/cdg: Fix integer overflow in duration computation

Fixes: signed integer overflow: 8398407 * 300 cannot be represented in type 'int'
Fixes: 23914/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4702539290509312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools:target_dem_fuzzer: Split into a fuzzer fuzzing at the protocol level and one...
Michael Niedermayer [Sun, 19 Jul 2020 15:54:10 +0000 (17:54 +0200)]
tools:target_dem_fuzzer: Split into a fuzzer fuzzing at the protocol level and one fuzzing a fixed demuxer input

This should improve coverage and should improve the efficiency of seed files

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/crystalhd: Remove unused packet
Andreas Rheinhardt [Fri, 11 Sep 2020 14:28:25 +0000 (16:28 +0200)]
avcodec/crystalhd: Remove unused packet

Unused since 41b0561dc7246b72a834067da539ae98b1ec6631.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/av1dec: fix setting pix_fmt
James Almer [Sat, 12 Sep 2020 20:39:45 +0000 (17:39 -0300)]
avcodec/av1dec: fix setting pix_fmt

Fill the array with the software pix_fmt and move the avctx->hwaccel
check back to the proper place.
Also remove the avoid probing flag to ensure an external av1 decoder
will not set a pix_fmt we don't want during format probing.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/av1dec: update reference frame state on show_existing_frame
James Almer [Wed, 9 Sep 2020 22:14:01 +0000 (19:14 -0300)]
avcodec/av1dec: update reference frame state on show_existing_frame

As defined in Section 7.4

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/av1dec: set chroma_sample_location
James Almer [Wed, 9 Sep 2020 21:42:00 +0000 (18:42 -0300)]
avcodec/av1dec: set chroma_sample_location

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/av1dec: use av_cmp_q() to compare aspect ratio
James Almer [Wed, 9 Sep 2020 19:57:50 +0000 (16:57 -0300)]
avcodec/av1dec: use av_cmp_q() to compare aspect ratio

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/av1_parser: don't set AVCodecContext frame dimensions
James Almer [Wed, 9 Sep 2020 18:40:07 +0000 (15:40 -0300)]
avcodec/av1_parser: don't set AVCodecContext frame dimensions

Let the internal decoder take care of it, as frame reordering
may result in different values exported by either module.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec: add AV1 hardware accelerated decoder
Fei Wang [Wed, 9 Sep 2020 03:39:55 +0000 (11:39 +0800)]
avcodec: add AV1 hardware accelerated decoder

This AV1 decoder is currently only used for hardware accelerated decoding.
It can be extended into a native decoder in the future, so set its name to
"av1" and temporarily give it the lowest priority in the codec list.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/av1_parser: don't set AVCodecContext pixel format
James Almer [Wed, 9 Sep 2020 18:22:27 +0000 (15:22 -0300)]
avcodec/av1_parser: don't set AVCodecContext pixel format

This is a property a decoder must set, not a parser.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/mpc: Fix multiple numerical overflows in ff_mpc_dequantize_and_synth()
Michael Niedermayer [Sun, 10 May 2020 17:04:23 +0000 (19:04 +0200)]
avcodec/mpc: Fix multiple numerical overflows in ff_mpc_dequantize_and_synth()

Fixes: -2.4187e+09 is outside the range of representable values of type 'int'
Fixes: signed integer overflow: -14512205 + -2147483648 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC7_fuzzer-5747263166480384
Fixes: 23528/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC7_fuzzer-5747263166480384
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mobiclip: Check quantizer before table setup
Michael Niedermayer [Thu, 10 Sep 2020 21:59:53 +0000 (23:59 +0200)]
avcodec/mobiclip: Check quantizer before table setup

Fixes: index -1 out of bounds for type 'const uint8_t [6][16]'
Fixes: out of array read
Fixes: shift exponent -21 is negative
Fixes: 25422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5748258226569216
Fixes: shift exponent 8039082 is too large for 32-bit type 'int'
Fixes: 25430/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5698567770210304
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>
3 years agoavcodec/adpcm: take into account block_align when decoding ADPCM_PSX
Paul B Mahol [Fri, 11 Sep 2020 11:28:12 +0000 (13:28 +0200)]
avcodec/adpcm: take into account block_align when decoding ADPCM_PSX

Should reduce decoding overhead.

3 years agoavformat/brstm: remove custom allocation of table to hold coeffs
Paul B Mahol [Sat, 12 Sep 2020 12:49:15 +0000 (14:49 +0200)]
avformat/brstm: remove custom allocation of table to hold coeffs

3 years agoavformat/brstm: fix decoding brstm with custom coeff offsets
Paul B Mahol [Sat, 12 Sep 2020 12:45:31 +0000 (14:45 +0200)]
avformat/brstm: fix decoding brstm with custom coeff offsets

3 years agofate: use correct uint32 layer
Mark Reid [Sat, 12 Sep 2020 09:07:13 +0000 (02:07 -0700)]
fate: use correct uint32 layer

3 years agolavf/mov: Remove redundant code
Jun Zhao [Fri, 7 Aug 2020 12:48:42 +0000 (20:48 +0800)]
lavf/mov: Remove redundant code

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
3 years agodnn/openvino: add input/output name info
Ting Fu [Wed, 9 Sep 2020 01:52:19 +0000 (09:52 +0800)]
dnn/openvino: add input/output name info

show all input/output names when the input or output name not correct

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
3 years agodnn/openvino: support run inference via GPU
Ting Fu [Wed, 9 Sep 2020 01:52:18 +0000 (09:52 +0800)]
dnn/openvino: support run inference via GPU

for enabling OpenVINO GPU please:
1. install required OpenCL drivers, see: https://github.com/intel/compute-runtime/releases/tag/19.41.14441
2. build OpenVINO c lib with GPU enabled: use cmake config with: -DENABLE_CLDNN=ON
3. then make, and include the OpenVINO c lib in environment variables
detailed steps please refer: https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md

inference model with GPU please add: optioins=device=GPU

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
3 years agoavcodec/exr: initialize axmax and bxmin to 0
Paul B Mahol [Sat, 12 Sep 2020 08:06:35 +0000 (10:06 +0200)]
avcodec/exr: initialize axmax and bxmin to 0

They can be used uninitialized.

3 years agoavcodec/exr: add support data windows larger or outside display window
Mark Reid [Mon, 7 Sep 2020 21:54:35 +0000 (14:54 -0700)]
avcodec/exr: add support data windows larger or outside display window

3 years agoavcodec/utils: make the src paramater for ff_thread_ref_frame const
James Almer [Thu, 10 Sep 2020 13:38:01 +0000 (10:38 -0300)]
avcodec/utils: make the src paramater for ff_thread_ref_frame const

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavfilter/formats: Remove pointless checks
Andreas Rheinhardt [Thu, 10 Sep 2020 23:29:38 +0000 (01:29 +0200)]
avfilter/formats: Remove pointless checks

ff_formats_ref() takes a pointer to an AVFilterFormats and a pointer to
a pointer to an AVFilterFormats as arguments and adds the latter as an
owner to the list pointed to by the former; the latter is hereby always
the address of a list contained in an AVFilterFormatsConfig and can
therefore not be NULL. So remove the check for whether it is NULL; also
do the same for ff_channel_layouts_ref().

Also do the same for the unref functions where argument is never NULL
because it is always the address of an existing lvalue.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/formats: Don't typedef structure a second time
Andreas Rheinhardt [Thu, 10 Sep 2020 22:27:26 +0000 (00:27 +0200)]
avfilter/formats: Don't typedef structure a second time

Before commit 2f76476549a01ae2c4ec2a440e4b14c5aba64869, avfilter.h
contained no typedef for AVFilterChannelLayouts; all references to it
were done using its struct tag. formats.h meanwhile contained the
definition of the struct and a typedef for it. Said commit now added a
typedef in avfilter.h, too, bringing it in line with AVFilterFormats;
yet this means that there are two typedefs for AVFilterChannelLayouts
(in contrast to AVFilterFormats which is only typedef'ed in avfilter.h).

The problem is that older versions of GCC don't like this and error out:
http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2
is one of the FATE boxes that now fail to compile. So just remove the
typedef in formats.h.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agofftools, libavcodec, libavfilter: Add const to some AVCodec *
Andreas Rheinhardt [Thu, 10 Sep 2020 20:11:57 +0000 (22:11 +0200)]
fftools, libavcodec, libavfilter: Add const to some AVCodec *

The user has no business modifying the underlying AVCodec.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_subtitles: Remove obsolete LIBAVCODEC_VERSION_INT checks
Andreas Rheinhardt [Thu, 10 Sep 2020 19:55:52 +0000 (21:55 +0200)]
avfilter/vf_subtitles: Remove obsolete LIBAVCODEC_VERSION_INT checks

libavcodec major version is already 58.

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_subtitles: Remove unnecessary initialization of AVPacket
Andreas Rheinhardt [Thu, 10 Sep 2020 19:50:06 +0000 (21:50 +0200)]
avfilter/vf_subtitles: Remove unnecessary initialization of AVPacket

av_read_frame() can handle uninitialized packets.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_subtitles: Fix leaks on failure
Andreas Rheinhardt [Thu, 10 Sep 2020 19:39:28 +0000 (21:39 +0200)]
avfilter/vf_subtitles: Fix leaks on failure

init_subtitles() sometimes returned directly upon error without cleaning
up after itself. The easiest way to trigger this is by using
picture-based subtitles; it is also possible to run into this in case of
missing decoders or allocation failures.

Furthermore, return the proper error code in case of missing decoder.

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_uspp: Fix potential leak of dict on error
Andreas Rheinhardt [Thu, 10 Sep 2020 14:57:13 +0000 (16:57 +0200)]
avfilter/vf_uspp: Fix potential leak of dict on error

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/lavfutils: Avoid initializing packet
Andreas Rheinhardt [Thu, 10 Sep 2020 14:09:37 +0000 (16:09 +0200)]
avfilter/lavfutils: Avoid initializing packet

av_read_frame() can handle uninitialized packets.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/lavfutils: Fix memleak when avformat_find_stream_info() fails
Andreas Rheinhardt [Thu, 10 Sep 2020 14:07:28 +0000 (16:07 +0200)]
avfilter/lavfutils: Fix memleak when avformat_find_stream_info() fails

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/lavfutils: Don't use uninitialized pointers for freeing
Andreas Rheinhardt [Thu, 10 Sep 2020 13:36:11 +0000 (15:36 +0200)]
avfilter/lavfutils: Don't use uninitialized pointers for freeing

Happened on several error conditions, e.g. if there is just no decoder
for the format (like with svg images).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/utils: Avoid duplicating extradata from extract_extradata BSF
Andreas Rheinhardt [Mon, 7 Sep 2020 13:47:07 +0000 (15:47 +0200)]
avformat/utils: Avoid duplicating extradata from extract_extradata BSF

Instead move the extradata contained in packet side-data to its
destination. This is possible because the side data already has zeroed
padding.

Notice that the check for FF_MAX_EXTRADATA_SIZE has been dropped,
because said constant is from libavcodec/internal.h. If libavcodec
wanted to enforce this, it should do so in the extract_extradata BSF
instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/extract_extradata: Reindent after the last commit
Andreas Rheinhardt [Mon, 7 Sep 2020 13:01:23 +0000 (15:01 +0200)]
avcodec/extract_extradata: Reindent after the last commit

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/extract_extradata: Remove always-true check
Andreas Rheinhardt [Mon, 7 Sep 2020 12:44:04 +0000 (14:44 +0200)]
avcodec/extract_extradata: Remove always-true check

If a sequence header has already been found, it is certain that next
startcode (being disjoint from the sequence header startcode) can begin
at index four at the earliest.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/agm: Fix off by 1 error in decode_inter_plane()
Michael Niedermayer [Thu, 10 Sep 2020 16:52:48 +0000 (18:52 +0200)]
avcodec/agm: Fix off by 1 error in decode_inter_plane()

Fixes: Regression since 1f2096945709a32315da740691b5716da55893c3
Found-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/fastaudio: Remove redundant % 32
Michael Niedermayer [Tue, 8 Sep 2020 20:50:51 +0000 (22:50 +0200)]
avcodec/fastaudio: Remove redundant % 32

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoconfigure: Fix msa can't be disabled when '--cpu=loongson3a' assigned.
Shiyou Yin [Thu, 3 Sep 2020 06:29:52 +0000 (14:29 +0800)]
configure: Fix msa can't be disabled when '--cpu=loongson3a' assigned.

There are compiler and runtime check for MSA and MMI.
Remove the redundant setting of MSA and MMI for cores specified by "--cpu".

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mips: [loongson] Fixed mmi optimization
gxw [Thu, 3 Sep 2020 06:29:51 +0000 (14:29 +0800)]
avcodec/mips: [loongson] Fixed mmi optimization

Test case fate-checkasm-h264pred failed in latest community code.
This patch fixed the bug.

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/src_movie: Fix leak of packet upon error
Andreas Rheinhardt [Thu, 10 Sep 2020 01:14:39 +0000 (03:14 +0200)]
avfilter/src_movie: Fix leak of packet upon error

If allocating the AVFrame to contain a decoded frame fails, the AVPacket
containing the data intended to be decoded leaks. This commit fixes
this.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/src_movie: Remove unnecessary secondary AVPacket
Andreas Rheinhardt [Thu, 10 Sep 2020 00:21:59 +0000 (02:21 +0200)]
avfilter/src_movie: Remove unnecessary secondary AVPacket

The movie and amovie filters currently use two packets. One of the two,
pkt0, is the owner of the returned packet; it is also the destination
packet for av_read_frame(). The other one pkt is initially (i.e. after
av_read_frame()) a copy of pkt0; copy means that the contents of both
are absolutely the same: They both point to the same AVBufferRef and the
same side data. This violation of the refcounted packet API is only
possible because pkt is not considered to own its data. Only pkt0 is
ever unreferenced.
The reason for pkt's existence seems to be historic:
The API used for decoding audio (namely avcodec_decode_audio4()) could
consume frames partially, i.e. it could return multiple frames for one
packet and therefore it returned how much of the input buffer had been
consumed. The caller was then supposed to update the packet's data and
size pointer to reflect this and call avcodec_decode_audio4() again with
the updated packet to get the next frame.
But before the introduction of refcounted AVPackets where knowledge and
responsibility about what to free lies with the underlying AVBuffer such
a procedure required a spare packet (or one would need to record the
original data and size fields separately to restore them before freeing
the packet; notice that this code has been written when AVPackets still
had a destruct field). But these times are long gone, so just remove the
secondary AVPacket.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/src_movie: Remove unneeded resetting of AVPacket
Andreas Rheinhardt [Thu, 10 Sep 2020 00:13:51 +0000 (02:13 +0200)]
avfilter/src_movie: Remove unneeded resetting of AVPacket

av_read_frame() already returns clean packets on error.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/brstm: clip timestamp when seeking into acceptable range
Paul B Mahol [Thu, 10 Sep 2020 15:23:41 +0000 (17:23 +0200)]
avformat/brstm: clip timestamp when seeking into acceptable range

3 years agoavformat/mca: clip timestamp when seeking into acceptable range
Paul B Mahol [Thu, 10 Sep 2020 15:20:19 +0000 (17:20 +0200)]
avformat/mca: clip timestamp when seeking into acceptable range