]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agofate/oggopus-demux: fix fate failure
Lynne [Fri, 1 May 2020 00:36:43 +0000 (01:36 +0100)]
fate/oggopus-demux: fix fate failure

Failure was due to the extra comment printed by libavcodec/utils.c since
side data is used to signal the skipped samples.

4 years agoavfilter/af_adelay: Check sscanf() return value
Limin Wang [Sun, 29 Mar 2020 00:08:05 +0000 (08:08 +0800)]
avfilter/af_adelay: Check sscanf() return value

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter/vf_mix: Check sscanf() return value
Limin Wang [Sun, 29 Mar 2020 01:08:13 +0000 (09:08 +0800)]
avfilter/vf_mix: Check sscanf() return value

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agooggdec: add support for proper demuxing of chained Opus files and streams
Lynne [Tue, 28 Apr 2020 11:25:46 +0000 (12:25 +0100)]
oggdec: add support for proper demuxing of chained Opus files and streams

Part of this patch is based on Paul B Mahol's patch from last year.

This also allows for single-stream parameter/codec changes.

4 years agooggdec: use ffio_ensure_seekback() to seek back on incorrect data
Lynne [Tue, 28 Apr 2020 11:55:17 +0000 (12:55 +0100)]
oggdec: use ffio_ensure_seekback() to seek back on incorrect data

This cleans up the code and simplifies it.
It also speeds up parsing since the old pb position was incorrect.

4 years agooggdec: verify page checksum
Lynne [Tue, 28 Apr 2020 11:52:11 +0000 (12:52 +0100)]
oggdec: verify page checksum

This makes decoding far more robust, since OggS, the ogg magic,
can be commonly found randomly in streams, which previously made
the demuxer think there's a new stream or a change in such.

4 years agooggdec: eliminate copies and extra buffers
Lynne [Tue, 28 Apr 2020 11:41:34 +0000 (12:41 +0100)]
oggdec: eliminate copies and extra buffers

This also makes implementing CRC checking far simpler and more robust.

4 years agoavformat/utils: change the duration to int64_t for update_initial_durations
Limin Wang [Tue, 28 Apr 2020 23:49:24 +0000 (07:49 +0800)]
avformat/utils: change the duration to int64_t for update_initial_durations

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/cbs_h265: fix writing extension_data bits
James Almer [Mon, 20 Apr 2020 18:25:58 +0000 (15:25 -0300)]
avcodec/cbs_h265: fix writing extension_data bits

We only care about the right most bit.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/v4l2_context: Log warning when all capture buffers are in userspace
Andriy Gelman [Thu, 30 Apr 2020 14:58:37 +0000 (10:58 -0400)]
avcodec/v4l2_context: Log warning when all capture buffers are in userspace

v4l2_m2m uses device memory mapped buffers to store dequeued
frames/packets (reference counted by AVBufferRef). When the reference
count drops to zero, the buffer ownership is returned back to the
device, so that they can re-filled with frames/packets.

There are some cases when all the capture buffers are in userspace
(i.e. due to internal buffering in ffmpeg). On the s5p-mfc this causes
an infinite wait when polling to dequeue the buffers, which can be
prevented by increasing the total number of buffers. This commit adds a
warning when all the capture buffers are dequeued.

Reviewed-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavfoundation: Fix building on iOS
Martin Storsjö [Thu, 30 Apr 2020 10:34:13 +0000 (13:34 +0300)]
avfoundation: Fix building on iOS

Apparently the changes from 3c9185bf3a83395d12a987f626dbdb985eac4320
aren't enough; even with that in place, I got errors like this
when trying to build for iOS:

src/libavdevice/avfoundation.m:135:5: error:
      'AVCaptureDeviceTransportControlsPlaybackMode' is unavailable: not
      available on iOS
    AVCaptureDeviceTransportControlsPlaybackMode observed_mode;
    ^

4 years agoavfilter/af_crossfeed: make options runtime configurable
Paul B Mahol [Thu, 30 Apr 2020 10:04:27 +0000 (12:04 +0200)]
avfilter/af_crossfeed: make options runtime configurable

4 years agoavfilter/af_crossfeed: make slope configurable
Paul B Mahol [Thu, 30 Apr 2020 09:58:04 +0000 (11:58 +0200)]
avfilter/af_crossfeed: make slope configurable

4 years agoavfilter/af_crossfeed: fix calculation of alpha parameter
Paul B Mahol [Thu, 30 Apr 2020 09:44:48 +0000 (11:44 +0200)]
avfilter/af_crossfeed: fix calculation of alpha parameter

Use A in calculation.

4 years agoavfilter: add asubboost filter
Paul B Mahol [Wed, 22 Apr 2020 13:29:16 +0000 (15:29 +0200)]
avfilter: add asubboost filter

4 years agotools: fix const specifier for AVInputFormat
Josh de Kock [Wed, 29 Apr 2020 10:45:49 +0000 (11:45 +0100)]
tools: fix const specifier for AVInputFormat

Signed-off-by: Josh de Kock <josh@itanimul.li>
4 years agoavcodec/avpacket: Don't write into non-writable buffer
Andreas Rheinhardt [Wed, 12 Feb 2020 12:27:17 +0000 (13:27 +0100)]
avcodec/avpacket: Don't write into non-writable buffer

The data of an AVPacket may be a part of the data of an AVBufferRef;
Therefore av_grow_packet() doesn't reallocate if the available space in
the actual buffer is sufficient for the enlargement. But given that it
also zeroes the padding it also needs to make sure that the buffer is
actually writable; this commit implements this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/hdsenc: Add explicit deinit function
Andreas Rheinhardt [Wed, 23 Oct 2019 11:46:46 +0000 (13:46 +0200)]
avformat/hdsenc: Add explicit deinit function

hdsenc already had an explicit function to free all allocations in case
of an error, but it was not marked as deinit function, so that it was
not called automatically when the AVFormatContext for muxing gets freed.

Using an explicit deinit function also makes the code cleaner by
allowing to return immediately without "goto fail".

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/v4l2_buffers: don't prevent enqueue capture buffer to driver
Ming Qian [Mon, 16 Mar 2020 02:02:08 +0000 (10:02 +0800)]
avcodec/v4l2_buffers: don't prevent enqueue capture buffer to driver

Enqueue/dequeue of the capture buffers should continue while draining.

Reference: linux/Documentation/media/uapi/v4l/dev-decoder.rst

    "The client must continue to handle both queues independently,
     similarly to normal decode operation. This includes:
     ...
     - queuing and dequeuing CAPTURE buffers, until a buffer marked with
       the V4L2_BUF_FLAG_LAST flag is dequeued"

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavcodec/tiff: assert that raw tiff dng blit does not write over the end of a line
Michael Niedermayer [Sat, 15 Feb 2020 16:12:38 +0000 (17:12 +0100)]
avcodec/tiff: assert that raw tiff dng blit does not write over the end of a line

Found-by: 黄宁 <tsukimurarin@163.com>
Reviewed-by: Nick Renieris <velocityra@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/tiff: Check for planar DNG images
Michael Niedermayer [Sat, 15 Feb 2020 16:10:47 +0000 (17:10 +0100)]
avcodec/tiff: Check for planar DNG images

The DNG code hardcodes plane 0 at some places, so its better to disallow cases
that have more planes.

Fixes: eg_crash
Found-by: 黄宁 <tsukimurarin@163.com>
Reviewed-by: Nick Renieris <velocityra@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/tiff: Replace width overriding for bayer by assert
Michael Niedermayer [Sat, 15 Feb 2020 15:42:07 +0000 (16:42 +0100)]
avcodec/tiff: Replace width overriding for bayer by assert

This is less confusing

Reviewed-by: Nick Renieris <velocityra@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/tiff: Some checks on bpp for DNG
Michael Niedermayer [Sat, 15 Feb 2020 15:19:08 +0000 (16:19 +0100)]
avcodec/tiff: Some checks on bpp for DNG

dng spec 1.5.0.0
"BitsPerSample
Supported values are from 8 to 32 bits/sample. The depth must be the same for each sample if
SamplesPerPixel is not equal to 1."

Fixes: eg_crash
Found-by: 黄宁 <tsukimurarin@163.com>
Reviewed-by: Nick Renieris <velocityra@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/txd: Check for input size against the header size.
Michael Niedermayer [Tue, 18 Feb 2020 22:14:16 +0000 (23:14 +0100)]
avcodec/txd: Check for input size against the header size.

Fixes: Timeout (21sec -> 80ms)
Fixes: 20673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TXD_fuzzer-5177453863763968
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/svq1dec: Check that there is data left after the header
Michael Niedermayer [Tue, 18 Feb 2020 22:28:33 +0000 (23:28 +0100)]
avcodec/svq1dec: Check that there is data left after the header

Fixes: Timeout (21sec -> 255ms)
Fixes: 20709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ1_fuzzer-5085075089915904
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 agolavc/libopenh264enc: set slice_mode option to deprecated
Linjie Fu [Wed, 29 Apr 2020 03:00:50 +0000 (11:00 +0800)]
lavc/libopenh264enc: set slice_mode option to deprecated

"slice mode" option seems to be unnecessary since it could be
determined by -slices/max_nal_size.

default:        SM_FIXEDSLCNUM_SLICE mode with cpu-number slices.
-slices N:      SM_FIXEDSLCNUM_SLICE mode with N slices.
-max_nal_size:  SM_SIZELIMITED_SLICE mode with limited size slices.

Add FF_API_OPENH264_SLICE_MODE macro to remove this option after
LIBAVCODEC_VERSION_MAJOR = 59.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavc/libopenh264enc: prompt slice number changing inside libopenh264
Linjie Fu [Wed, 29 Apr 2020 03:00:49 +0000 (11:00 +0800)]
lavc/libopenh264enc: prompt slice number changing inside libopenh264

Libopenh264enc would set the slice according to the number of cpu cores
if uiSliceNum equals to 0 (auto) in SM_FIXEDSLCNUM_SLICE mode.

Prompt a warning for user to catch this.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavc/libopenh264enc: add bit rate control select support
Linjie Fu [Wed, 29 Apr 2020 03:00:48 +0000 (11:00 +0800)]
lavc/libopenh264enc: add bit rate control select support

RC_BITRATE_MODE:
    set BITS_EXCEEDED to iCurrentBitsLevel and allows QP adjust
    in RcCalculatePictureQp().

RC_BUFFERBASED_MODE:
    use buffer status to adjust the video quality.

RC_TIMESTAMP_MODE:
    bit rate control based on timestamp, introduced in release 1.4.

Default to use RC_QUALITY_MODE.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavc/libopenh264enc: add default gop size and bit rate
Linjie Fu [Wed, 29 Apr 2020 03:00:47 +0000 (11:00 +0800)]
lavc/libopenh264enc: add default gop size and bit rate

It would be 200kbps bitrate with gop size = 12 by default
which generated too many IDR frames in rather low bit rate.
The quality would be poor.

Set these default values to -1 to check whether it's specified
by user explicitly.

Use 2Mbps bitrate as nvenc sugguested, and leave gop size
untouched in libopenh264.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolavc/libopenh264enc: Add qmin/qmax support
Linjie Fu [Wed, 29 Apr 2020 03:00:46 +0000 (11:00 +0800)]
lavc/libopenh264enc: Add qmin/qmax support

Clip iMinQp/iMaxQp to (1, 51) for user specified qp range.

If not set, leave iMinQp/iMaxQp untouched and use the values (0, 51)
initialized in FillDefault(), and the QP range would be adjusted to the
defaults inside libopenh264 library according to the iUsageType, (12, 42)
for iUsageType == CAMERA_VIDEO_REAL_TIME which is default.

<https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375>

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavfilter/vf_v360: make FOV adjusted for dual fisheye too
Paul B Mahol [Wed, 29 Apr 2020 17:16:12 +0000 (19:16 +0200)]
avfilter/vf_v360: make FOV adjusted for dual fisheye too

Remove any usage of padding for this format.

4 years agoavfilter/af_amix: make weights option runtime configured
Paul B Mahol [Tue, 28 Apr 2020 10:01:04 +0000 (12:01 +0200)]
avfilter/af_amix: make weights option runtime configured

4 years agoMAINTAINERS: add myself to the general developers list
Limin Wang [Sun, 26 Apr 2020 10:50:09 +0000 (18:50 +0800)]
MAINTAINERS: add myself to the general developers list

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_v360: adjustment out_pad and in_pad maximum value to 1/10
Steven Liu [Tue, 21 Apr 2020 14:54:39 +0000 (22:54 +0800)]
avfilter/vf_v360: adjustment out_pad and in_pad maximum value to 1/10

Because not every user know about in_pad and out_pad reasonable value range
so maybe try to set 1.0, but setting 1.0 is so hugh to get an fatal error.

Suggested-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agotests/api/api-h264-slice-test: remove unused bool header
Linjie Fu [Wed, 1 Apr 2020 04:52:24 +0000 (12:52 +0800)]
tests/api/api-h264-slice-test: remove unused bool header

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
4 years agolibavcodec/libx264: fix reference frame computation based on level
Josh Brewster [Thu, 16 Apr 2020 20:50:29 +0000 (22:50 +0200)]
libavcodec/libx264: fix reference frame computation based on level

The current implementation allows passing levels to libavcodec as
integers (such as "31" instead of "3.1").

However, in this case, the maximum reference frame value per level was
ignored because libavcodec converted the string to 310 instead of 31.

Since libx264 has correctly parsed the level to int
(x4->params.i_level_idc), we should rely on this value instead of
attempting to parse the level string on our own.

Signed-off-by: Josh Brewster <josh.brewster@protonmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
4 years agolavf/mp3enc: fix ID3v1 year metadata setting issue
Jun Zhao [Mon, 20 Apr 2020 07:59:39 +0000 (15:59 +0800)]
lavf/mp3enc: fix ID3v1 year metadata setting issue

Follow the http://id3.org/ID3v1, setting the year metadata
for ID3v1.

fix #8623

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavformat/dashenc: use av_reallocp_array()
Limin Wang [Sun, 26 Apr 2020 09:49:20 +0000 (17:49 +0800)]
avformat/dashenc: use av_reallocp_array()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/dashenc: use local variable and avoid calculate duration multiple times
Limin Wang [Sun, 26 Apr 2020 09:49:19 +0000 (17:49 +0800)]
avformat/dashenc: use local variable and avoid calculate duration multiple times

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/dashenc: cosmetics
Limin Wang [Sun, 26 Apr 2020 09:49:18 +0000 (17:49 +0800)]
avformat/dashenc: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/v4l2_m2m_enc: Enable frame level rate control by default
Andriy Gelman [Tue, 28 Apr 2020 16:39:39 +0000 (12:39 -0400)]
avcodec/v4l2_m2m_enc: Enable frame level rate control by default

Without this setting, bitrate and qmin/qmax options have no
effect on the s5p-mfc hardware encoder.

Reviewed-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavcodec/v4l2_m2m_enc: Reduce log verbosity for some params
Andriy Gelman [Tue, 28 Apr 2020 16:39:19 +0000 (12:39 -0400)]
avcodec/v4l2_m2m_enc: Reduce log verbosity for some params

Currently the user gets unhelpful warnings when some default parameters
are not supported by the device. The verbosity of these log messages has
been changed to AV_LOG_DEBUG.

Reviewed-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoswscale/vscale: Increase type strictness
Andreas Rheinhardt [Sun, 26 Apr 2020 06:52:29 +0000 (08:52 +0200)]
swscale/vscale: Increase type strictness

libswscale/vscale.c makes extensive use of function pointers and in
doing so it converts these function pointers to and from a pointer to
void. Yet this is actually against the C standard:
C90 only guarantees that one can convert a pointer to any incomplete
type or object type to void* and back with the result comparing equal
to the original which makes pointers to void generic pointers to
incomplete or object type. Yet C90 lacks a generic function pointer
type.
C99 additionally guarantees that a pointer to a function of one type may
be converted to a pointer to a function of another type with the result
and the original comparing equal when converting back.
This makes any function pointer type a generic function pointer type.
Yet even this does not make pointers to void generic function pointers.

Both GCC and Clang emit warnings for this when in pedantic mode.

This commit fixes this by using a union that can hold one member of any
of the required function pointer types to store the function pointer.
This works even for C90.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/nvenc: add hardware config metadata
Mark Thompson [Mon, 13 Apr 2020 15:33:18 +0000 (16:33 +0100)]
avcodec/nvenc: add hardware config metadata

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agoavformat: only allow a single bitstream filter when muxing
Marton Balint [Sat, 18 Apr 2020 08:49:54 +0000 (10:49 +0200)]
avformat: only allow a single bitstream filter when muxing

Current muxers only use a single bitstream filter, so there is no need to
maintain code which operates on a list of bitstream filters. When multiple
bitstream filters are needed muxers can simply use a list bitstream filter.

If there is a use case in the future when different bitstream filters should be
added at subsequent packets then a new API possibly involving reconfiguring the
list bitstream filter can be added knowing the exact requirements.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agofate: hevc: Skip a few large testcases if large tests are disabled
Martin Storsjö [Thu, 23 Apr 2020 07:15:03 +0000 (10:15 +0300)]
fate: hevc: Skip a few large testcases if large tests are disabled

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agofate: Skip the dnxhd-uhd-hr-sq tests of large tests are disabled
Martin Storsjö [Thu, 23 Apr 2020 07:13:06 +0000 (10:13 +0300)]
fate: Skip the dnxhd-uhd-hr-sq tests of large tests are disabled

These tests are also in the same size range as the previously
skipped 2k and 4k tests.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoffmpeg: Remove the hw_device_ctx global
Mark Thompson [Mon, 13 Apr 2020 15:33:21 +0000 (16:33 +0100)]
ffmpeg: Remove the hw_device_ctx global

The ad-hoc libmfx setup code is the only place its still used, so move it
into that file.

4 years agoffmpeg: Use hardware config metadata with encoders
Mark Thompson [Mon, 13 Apr 2020 15:33:20 +0000 (16:33 +0100)]
ffmpeg: Use hardware config metadata with encoders

This can support encoders which want frames and/or device contexts.  For
the device case, it currently picks the first initialised device of the
desired type to give to the encoder - a new option would be needed if it
were necessary to choose between multiple devices of the same type.

4 years agoffmpeg: Make filter hardware device selection clearer
Mark Thompson [Mon, 13 Apr 2020 15:33:19 +0000 (16:33 +0100)]
ffmpeg: Make filter hardware device selection clearer

Also move it into a dedicated function in the hardware file.

4 years agolavc/vaapi_encode: Add hardware config metadata
Mark Thompson [Mon, 13 Apr 2020 15:33:17 +0000 (16:33 +0100)]
lavc/vaapi_encode: Add hardware config metadata

These encoders all accept VAAPI surfaces in a hardware frames context.

4 years agolavc/qsvenc: Add hardware config metadata
Mark Thompson [Mon, 13 Apr 2020 15:33:16 +0000 (16:33 +0100)]
lavc/qsvenc: Add hardware config metadata

All of these encoders can accept libmfx surfaces directly in a hardware
frames context, or they can accept software frames if a suitable device
is supplied to use.

4 years agolavc: Extend hardware config metadata to encoders
Mark Thompson [Mon, 13 Apr 2020 15:33:15 +0000 (16:33 +0100)]
lavc: Extend hardware config metadata to encoders

4 years agolavc: Rename hwaccel.h to hwconfig.h
Mark Thompson [Mon, 13 Apr 2020 15:33:14 +0000 (16:33 +0100)]
lavc: Rename hwaccel.h to hwconfig.h

This already applied to decoders as well as hwaccels, and adding encoder
support was going to make the name even more inaccurate.

4 years agoavcodec/cbs_h265_syntax_template: Check num_negative/positive_pics when inter_ref_pic...
Michael Niedermayer [Sat, 4 Apr 2020 22:11:15 +0000 (00:11 +0200)]
avcodec/cbs_h265_syntax_template: Check num_negative/positive_pics when inter_ref_pic_set_prediction_flag is set

Fixes: out of array access
Fixes: 20446/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-5707770718584832
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/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()
Michael Niedermayer [Wed, 5 Feb 2020 23:33:40 +0000 (00:33 +0100)]
avcodec/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()

Fixes: Timeout (105sec -> 1sec)
Fixes: 20479/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5769846937878528
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 agoavformat/movenc: cosmetics
Limin Wang [Sat, 25 Apr 2020 14:29:03 +0000 (22:29 +0800)]
avformat/movenc: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_pixscope: also show standard deviation of zoomed area
Paul B Mahol [Sun, 26 Apr 2020 10:15:12 +0000 (12:15 +0200)]
avfilter/vf_pixscope: also show standard deviation of zoomed area

4 years agoavcodec/dirac_vlc: Fix integer overflow in ff_dirac_golomb_read_32/16bit()
Michael Niedermayer [Fri, 24 Apr 2020 20:55:55 +0000 (22:55 +0200)]
avcodec/dirac_vlc: Fix integer overflow in ff_dirac_golomb_read_32/16bit()

Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int32_t' (aka 'int')
Fixes: 21245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5683334274613248
Change to int16_t suggested by Lynne

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/bsf: simplify the code
Limin Wang [Sat, 18 Apr 2020 04:17:16 +0000 (12:17 +0800)]
avcodec/bsf: simplify the code

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/f_interleave: no need to check for inlink eof if non-empty queue
Paul B Mahol [Sat, 25 Apr 2020 11:35:22 +0000 (13:35 +0200)]
avfilter/f_interleave: no need to check for inlink eof if non-empty queue

Also set state to ready if there is any inlink with queued frame.

4 years agoavfilter/f_interleave: make sure that all frames in inlink queue are used
Paul B Mahol [Sat, 25 Apr 2020 11:07:13 +0000 (13:07 +0200)]
avfilter/f_interleave: make sure that all frames in inlink queue are used

4 years agoavfilter/f_interleave: add duration option
Paul B Mahol [Sat, 25 Apr 2020 10:35:22 +0000 (12:35 +0200)]
avfilter/f_interleave: add duration option

4 years agoffplay: set stream_index to -1 earlier to prevent segfault
Peter Ross [Sat, 25 Apr 2020 01:25:15 +0000 (11:25 +1000)]
ffplay: set stream_index to -1 earlier to prevent segfault

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/vp9: prevent null pointer use on init_frames() failure
Peter Ross [Sat, 25 Apr 2020 01:25:15 +0000 (11:25 +1000)]
avcodec/vp9: prevent null pointer use on init_frames() failure

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: James Almer <jamrial@gmail.com>
4 years agolavu/version: bump minor version for DOVI sidedata
Jun Zhao [Thu, 23 Apr 2020 11:02:03 +0000 (19:02 +0800)]
lavu/version: bump minor version for DOVI sidedata

bump minor version for DOVI sidedata, because added the dovi_meta.h
as lavu API part. Also update APIchanges.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavcodec: add support for Cunning Developments' ADPCM
Zane van Iperen [Sat, 18 Apr 2020 00:20:39 +0000 (00:20 +0000)]
avcodec: add support for Cunning Developments' ADPCM

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodnn-layer-mathbinary-test: Fix tests for cases with extra intermediate precision
Martin Storsjö [Thu, 23 Apr 2020 06:19:25 +0000 (09:19 +0300)]
dnn-layer-mathbinary-test: Fix tests for cases with extra intermediate precision

This fixes tests on 32 bit x86 mingw with clang, which uses x87
fpu by default.

In this setup, while the get_expected function is declared to
return float, the compiler is (especially given the optimization
flags set) free to keep the intermediate values (in this case,
the return value from the inlined function) in higher precision.

This results in the situation where 7.28 (which actually, as
a float, ends up as 7.2800002098), multiplied by 100, is
728.000000 when really forced into a 32 bit float, but 728.000021
when kept with higher intermediate precision.

For the multiplication case, a more suitable epsilon would e.g.
be 2*FLT_EPSILON*fabs(expected_output), but just increase the
current hardcoded threshold for now.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavcodec/mjpeg2jpeg_bsf: Remove unnecessary header
Andreas Rheinhardt [Tue, 21 Apr 2020 02:19:07 +0000 (04:19 +0200)]
avcodec/mjpeg2jpeg_bsf: Remove unnecessary header

libavutil/mem.h is unneeded since 33d18982fa03feb061c8f744a4f0a9175c1f63ab,
the commit that introduced the new packet-based bsf API, because with
this switch the allocations were no longer performed directly, but by
av_new_packet().

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/noise_bsf: Remove unnecessary headers
Andreas Rheinhardt [Tue, 21 Apr 2020 02:09:20 +0000 (04:09 +0200)]
avcodec/noise_bsf: Remove unnecessary headers

With 33d18982fa03feb061c8f744a4f0a9175c1f63ab, the commit introducing
the new packet-based bsf API, a new buffer was no longer allocated
directly, but via av_new_packet(), so that libavutil/mem.h was no longer
needed.

Moreover since commit dc99ee6b08e54de13b4c82ff265609b6ab83e3d8
av_packet_make_writable() is employed which copies the data in case it
is unavoidable so that string.h is no longer used (it was used for
memcpy()).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/dump_extradata_bsf: Remove unnecessary header
Andreas Rheinhardt [Tue, 21 Apr 2020 01:51:57 +0000 (03:51 +0200)]
avcodec/dump_extradata_bsf: Remove unnecessary header

Since 33d18982fa03feb061c8f744a4f0a9175c1f63ab (the commit that
introduced the new bsf API) allocating an enlarged buffer in case
extradata needs to be added to a packet is done via av_new_packet(),
so that libavutil/mem.h is no longer needed.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/dca_core_bsf: Remove unnecessary header
Andreas Rheinhardt [Tue, 21 Apr 2020 01:49:42 +0000 (03:49 +0200)]
avcodec/dca_core_bsf: Remove unnecessary header

This bsf never needed libavutil/mem.h.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/chomp_bsf: Remove unnecessary header
Andreas Rheinhardt [Tue, 21 Apr 2020 01:47:01 +0000 (03:47 +0200)]
avcodec/chomp_bsf: Remove unnecessary header

This bsf never needed internal.h.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/vp9_raw_reorder_bsf: Remove unnecessary header
Andreas Rheinhardt [Tue, 21 Apr 2020 01:39:06 +0000 (03:39 +0200)]
avcodec/vp9_raw_reorder_bsf: Remove unnecessary header

This bsf doesn't have any options, so including libavutil/opt.h is
unnecessary.

Reviewed-by: Peter Ross <pross@xvid.org>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mux: Remove unnecessary headers
Andreas Rheinhardt [Tue, 21 Apr 2020 00:57:25 +0000 (02:57 +0200)]
avformat/mux: Remove unnecessary headers

mux.c was split from utils.c in 55f9037f38bc3beacb2f5a17408c1d24c077d7fd
and during this split all headers were simply copied without checking if
they were only needed in the part that stayed in utils.c (or whether
these haeders were needed at all). As a result quite a lot of headers
in mux.c are unnecessary. This commit removes them.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/utils: Remove superfluous headers
Andreas Rheinhardt [Mon, 20 Apr 2020 23:09:19 +0000 (01:09 +0200)]
avformat/utils: Remove superfluous headers

stdarg.h has been included in 780d7897a9c9295b43f1f0e9b49a11f99cd402c3
for ff_url_join(). This header became unnecessary when this function was
moved into a separate file in df9f22d42b0905385629a9d368bb5a1eef2b45ef.

libavutil/pixdesc.h has been included for av_get_pix_fmt_name() in
603b8bc2a109978c8499b06d2556f1433306eca7 and is unused since commit
2fb7501938b7103624c9bef740ca498258cacdab that removed the stuff belonging
to FF_API_FORMAT_PARAMETERS. Notice that this file still uses
AV_PIX_FMT_NONE and that therefore the header libavutil/pixfmt.h has
been included (this header is included in pixdesc.h as well as also in
libavutil/internal.h which is also included).

libavutil/time_internal.h has been included for gmtime_r() in commit
e7dd97b5d8cd6ea150446591f37a5946e8ab7cfb; it is unused since commit
b72a7b96f84e5f16dd93b60668aecfda99442c71 which basically moved the code
making use of gmtime_r() to libavutil/dict.c to use in
avpriv_dict_set_timestamp().

audiointerleave.h has been added in c26e58e32cf430f060209e0d6088181f4426b3ce
because of ff_interleave_compare_dts() (at that time the muxing code
was not split from utils.c yet); said function became static in commit
101e1f6ff90c3365bfde05469ae26d2ee7f71f3e, making this header redundant.

metadata.h has been mostly included for what now resides in
libavutil/dict.h. The stuff that now resides in metadata.h has only been
used briefly: From commits ed7694d8cf4633da444237f4df7efc48936419d2 to
d60a9f52eb42dc76dea9996c8ba3567ae98a9a04.

riff.h has been added in 45da8124a09d0ac5f9d8174884584c5f80309d0c
because riff.h once contained declarations for (ff_)codec_get_tag().
This was changed in bfe5454cd238b16e7977085f880205229103eccb.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/webvttdec: Remove write-only variable
Andreas Rheinhardt [Fri, 17 Apr 2020 01:47:25 +0000 (03:47 +0200)]
avformat/webvttdec: Remove write-only variable

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/r3d: Remove write-only array
Andreas Rheinhardt [Sun, 22 Mar 2020 04:24:19 +0000 (05:24 +0100)]
avformat/r3d: Remove write-only array

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agolibavcodec/avpacket: Don't simply forward return value of av_dict_set()
Andreas Rheinhardt [Fri, 17 Apr 2020 13:55:57 +0000 (15:55 +0200)]
libavcodec/avpacket: Don't simply forward return value of av_dict_set()

The documentation of av_dict_set() states that values >= 0 indicate
success, whereas av_packet_unpack_dictionary() implies that return
values > 0 are impossible. So only forward the return value of
av_dict_set() in av_packet_unpack_dictionary() on error.

(Btw: av_dict_set() does currently not return values > 0.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/hevc_mp4toannexb_bsf: Check nalu_size
Michael Niedermayer [Sun, 19 Apr 2020 16:24:55 +0000 (18:24 +0200)]
avcodec/hevc_mp4toannexb_bsf: Check nalu_size

Fixes: Timeout (29sec -> 5ms)
Fixes: 20237/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_MP4TOANNEXB_fuzzer-5165615044362240
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 agolibavcodec/jpeg2000dec.c: ROI marker support
Gautam Ramakrishnan [Thu, 23 Apr 2020 04:06:07 +0000 (09:36 +0530)]
libavcodec/jpeg2000dec.c: ROI marker support

This patch adds support for decoding images
with a Region of Interest. Allows decoding
samples such as p0_03.j2k. This patch should
fix ticket #4681.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoscale_vulkan: take frame cropping parameters in account when scaling
Lynne [Thu, 23 Apr 2020 17:09:00 +0000 (18:09 +0100)]
scale_vulkan: take frame cropping parameters in account when scaling

Then sample_aspect_ratio line at the bottom was cargo-culted from the vaapi
scaling filter, but its unnecesary.

4 years agooverlay_vulkan: add support for overlaying images with an alpha channel
Lynne [Thu, 23 Apr 2020 17:08:14 +0000 (18:08 +0100)]
overlay_vulkan: add support for overlaying images with an alpha channel

4 years agoconfigure: enable ffnvcodec, nvenc, nvdec for aarch64
ManojGuptaBonda [Thu, 23 Apr 2020 04:03:35 +0000 (09:33 +0530)]
configure: enable ffnvcodec, nvenc, nvdec for aarch64

Adding the support to build FFMPEG with HW accelerated decode(nvdec) and
encode on aarch64 architecture.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agoavformat/mpegtsenc: use av_log_once for data stream warning
Gyan Doshi [Wed, 22 Apr 2020 11:23:51 +0000 (16:53 +0530)]
avformat/mpegtsenc: use av_log_once for data stream warning

4 years agodoc/APIChanges: add AV_PKT_DATA_DOVI_CONF entry
Jun Zhao [Wed, 22 Apr 2020 11:47:32 +0000 (19:47 +0800)]
doc/APIChanges: add AV_PKT_DATA_DOVI_CONF entry

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavc/version: bump minor version for DOVI sidedata
Jun Zhao [Wed, 22 Apr 2020 11:22:56 +0000 (19:22 +0800)]
lavc/version: bump minor version for DOVI sidedata

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/movenc: enable dvcC/dvvC box support from DOVI sidedata
Jun Zhao [Sat, 11 Apr 2020 13:11:11 +0000 (21:11 +0800)]
lavf/movenc: enable dvcC/dvvC box support from DOVI sidedata

enable dvcC/dvvC box support from DOVI sidedata.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agofftools/ffprobe: support DOVI sidedata
Jun Zhao [Sat, 11 Apr 2020 13:10:00 +0000 (21:10 +0800)]
fftools/ffprobe: support DOVI sidedata

support DOVI sidedata.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/dump: dump DOVI side data
Jun Zhao [Sat, 11 Apr 2020 13:09:03 +0000 (21:09 +0800)]
lavf/dump: dump DOVI side data

dump DOVI side data.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/mov: support dvcC/dvvC box for DOVI
vacingfang [Sat, 11 Apr 2020 13:00:50 +0000 (21:00 +0800)]
lavf/mov: support dvcC/dvvC box for DOVI

support dvcC/dvcC box from spec Dolby Vision Streams Within the
ISO Base MediaFile Format Version 2.1.2
(https://www.dolby.com/in/en/technologies/dolby-vision/dolby-vision\
-bitstreams-within-the-iso-base-media-file-format-v2.1.2.pdf)

export the DOVI information to sidedata.

Signed-off-by: vacingfang <vacingfang@tencent.com>
4 years agolavf/mpegts: support DOVI Video Stream Descriptor
vacingfang [Sat, 11 Apr 2020 12:57:40 +0000 (20:57 +0800)]
lavf/mpegts: support DOVI Video Stream Descriptor

support DOVI Video Stream Descriptor from Dolby Vision Streams
Within the MPEG-2 Transport Stream Format V1.2

From the spec: https://www.dolby.com/us/en/technologies/\
dolby-vision/dolby-vision-bitstreams-in-mpeg-2-transport-\
stream-multiplex-v1.2.pdf.

export the DOVI information with sidedata.

Signed-off-by: vacingfang <vacingfang@tencent.com>
4 years agolavutil: add DOVI related header
vacingfang [Sat, 11 Apr 2020 12:54:11 +0000 (20:54 +0800)]
lavutil: add DOVI related header

add DOVI related struct

Signed-off-by: vacingfang <vacingfang@tencent.com>
4 years agolavc: add a new sidedata type for DOVI
Jun Zhao [Sat, 11 Apr 2020 13:07:15 +0000 (21:07 +0800)]
lavc: add a new sidedata type for DOVI

add a new sidedata type for DOVI.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agompeg4videoenc: Don't crash with -fsanitize=bounds
Vitaly Buka [Wed, 22 Apr 2020 04:34:19 +0000 (21:34 -0700)]
mpeg4videoenc: Don't crash with -fsanitize=bounds

Also the patch makes this code consistent with mpeg4videodec.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000dec.c: Support for CRG marker
Gautam Ramakrishnan [Wed, 22 Apr 2020 18:34:39 +0000 (00:04 +0530)]
libavcodec/jpeg2000dec.c: Support for CRG marker

This patch adds support to skip the CRG marker.
The CRG marker, is an informational marker.
Allows samples such as p0_03.j2k to be decoded.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/iff: Check length before memcpy() in decode_deep_rle32()
Michael Niedermayer [Mon, 20 Apr 2020 22:03:40 +0000 (00:03 +0200)]
avcodec/iff: Check length before memcpy() in decode_deep_rle32()

Fixes: out of array read
Fixes: 20796/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5111364702175232.fuzz
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/iff: Fix invalid pointer intermediates in decode_deep_rle32()
Michael Niedermayer [Mon, 20 Apr 2020 22:03:39 +0000 (00:03 +0200)]
avcodec/iff: Fix invalid pointer intermediates in decode_deep_rle32()

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavd/avfoundation.m: Do not use transport controls for screen capture devices.
Thilo Borgmann [Sat, 4 Apr 2020 11:51:17 +0000 (13:51 +0200)]
lavd/avfoundation.m: Do not use transport controls for screen capture devices.

4 years agolavd/avfoundation.m: Remove transport controls for iOS.
Thilo Borgmann [Sat, 4 Apr 2020 11:49:46 +0000 (13:49 +0200)]
lavd/avfoundation.m: Remove transport controls for iOS.