ffmpeg.git
12 months agoLICENSE: Remove an incorrect statement.
Carl Eugen Hoyos [Thu, 9 May 2019 22:55:10 +0000 (00:55 +0200)]
LICENSE: Remove an incorrect statement.

Missed in bc4137d4

12 months agoavcodec/prosumer: Only memset(0) what is needed.
Michael Niedermayer [Wed, 1 May 2019 17:43:40 +0000 (19:43 +0200)]
avcodec/prosumer: Only memset(0) what is needed.

Fixes: Timeout (11sec -> 0.08sec)
Fixes: 14406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5151210148986880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/fic: Check input size against minimal frame size
Michael Niedermayer [Wed, 1 May 2019 18:12:12 +0000 (20:12 +0200)]
avcodec/fic: Check input size against minimal frame size

Fixes: Timeout (22sec ->54ms)
Fixes: 14439/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5660988231122944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/pafvideo: Check input space for decode_0() before slow operations
Michael Niedermayer [Sun, 28 Apr 2019 23:23:41 +0000 (01:23 +0200)]
avcodec/pafvideo: Check input space for decode_0() before slow operations

Fixes: Timeout (11sec -> 2sec)
Fixes: 14403/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5697465698746368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/scpr: check remaining data after decode
Michael Niedermayer [Thu, 25 Apr 2019 18:23:26 +0000 (20:23 +0200)]
avcodec/scpr: check remaining data after decode

Fixes Timeout (29sec -> 14sec)
Fixes: 13713/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5756778069884928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agotools/crypto_bench: update the comment about build command
Jun Zhao [Wed, 8 May 2019 17:24:28 +0000 (01:24 +0800)]
tools/crypto_bench: update the comment about build command

commit cd62f9d557f missing the comment about build

Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
12 months agotools/crypto_bench: check malloc fail before using it
Jun Zhao [Wed, 8 May 2019 17:16:27 +0000 (01:16 +0800)]
tools/crypto_bench: check malloc fail before using it

Need to check malloc fail before using it, so adjust the location
in the code.

Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
12 months agoavfilter/af_atempo: Make ffplay display correct timestamps when seeking
Pavel Koshevoy [Wed, 8 May 2019 04:39:45 +0000 (22:39 -0600)]
avfilter/af_atempo: Make ffplay display correct timestamps when seeking

NOTE: this is a refinement of the patch from Paul B Mahol
offset all output timestamps by same amount of first input timestamp

12 months agoavformat/matroskaenc: Reduce usage of ebml_master
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:10 +0000 (01:41 +0200)]
avformat/matroskaenc: Reduce usage of ebml_master

After the last few commits, the functions for writing master elements
with CRC-32 elements didn't really make use of the ebml_master
structure any more, so remove these parameters from the functions.

The only things that still need to be kept are the positions of the
level 1 elements that are written preliminarily and updated later.
These positions are stored in the MatroskaMuxContext and
replace the corresponding ebml_master structures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Improve log messages for blocks
Andreas Rheinhardt [Tue, 23 Apr 2019 19:45:52 +0000 (21:45 +0200)]
avformat/matroskaenc: Improve log messages for blocks

Up until now, a block's relative offset has been reported as the offset
in the log messages output when writing blocks; given that it is
impossible to know the real offset from the beginning of the file at
this point due to the fact that it is not yet known how many bytes will
be used for the containing cluster's length field both the relative
offset in the cluster as well as the offset of the containing cluster
will be reported from now on.

Furthermore, the TrackNumber of the written block has been added to the
log output.

Also, the log message for writing vtt blocks has been brought in line
with the message for normal blocks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Don't waste bytes writing level 1 elements
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:08 +0000 (01:41 +0200)]
avformat/matroskaenc: Don't waste bytes writing level 1 elements

Up until now, the length field of most level 1 elements has been written
using eight bytes, although it is known in advance how much space the
content of said elements will take up so that it would be possible to
determine the minimal amount of bytes for the length field. This
commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Cosmetics and typo
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:07 +0000 (01:41 +0200)]
avformat/matroskaenc: Cosmetics and typo

Fixes intendation, whitespace, a typo and renames a variable
(dyn_bc->cluster_bc) to make its meaning clearer and to bring
it more in line with the naming of similar variables.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Write CRC-32 in non-seekable mode
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:06 +0000 (01:41 +0200)]
avformat/matroskaenc: Write CRC-32 in non-seekable mode

Given that in both the seekable as well as the non-seekable mode dynamic
buffers are used to write level 1 elements and that now no seeks are
used in the seekable case any more, the two modes can be combined; as a
consequence, the non-seekable mode automatically inherits the ability to
write CRC-32 elements.

There are no differences in case the output is seekable; when it is not
and writing CRC-32 elements is disabled, there can still be minor
differences because before this commit, the EBML ID and length field
were counted towards the cluster size limit; now they no longer are.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Avoid seeking when writing level 1 elements
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:05 +0000 (01:41 +0200)]
avformat/matroskaenc: Avoid seeking when writing level 1 elements

Up until now, the writing process for level 1 elements (those elements
for which CRC-32 elements are written by default) was this in case the
output was seekable: Write the EBML ID, write an "unkown length" EBML
number of the desired length, then write the element into a dynamic
buffer, then write the dynamic buffer (after possible calculation and
writing of the CRC-element), then seek back to the size element and
overwrite the unknown-size element with the real size. The seeking and
overwriting part has been eliminated by not writing the size initially.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Change variable types
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:04 +0000 (01:41 +0200)]
avformat/matroskaenc: Change variable types

A Matroska EBML ID can only be maximally four bytes long, so make the
variables denoting EBML IDs uint32_t instead of unsigned int to
better reflect this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Remove redundant check
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:03 +0000 (01:41 +0200)]
avformat/matroskaenc: Remove redundant check

All places where end_ebml_master_crc32_preliminary are used already
check for whether the output is seekable, so the check in the function
is redundant.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Improve log message
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:02 +0000 (01:41 +0200)]
avformat/matroskaenc: Improve log message

Since 4e3bdf729a80f868b014ceb02901d87198b545a5 there is no reason any
more to treat the seekable and non-seekable cases separate with regards
to the log message for a new cluster. This effectively reverts
d41aeea8a64bab5d7aacd602f7214f95baad109f.

Also improved the log message: "pts 80dts 0" -> "pts 80, dts 0".

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Simplify check for writing CRCs
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:01 +0000 (01:41 +0200)]
avformat/matroskaenc: Simplify check for writing CRCs

Up until now, the check for whether to write CRC32 elements was always
mkv->write_crc && mkv->mode != MODE_WEBM. This is equivalent to simply
set write_crc to zero in WebM-mode. And this is what this commit does.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Remove traces of secondary seek head
Andreas Rheinhardt [Fri, 19 Apr 2019 23:41:00 +0000 (01:41 +0200)]
avformat/matroskaenc: Remove traces of secondary seek head

Up until e7ddafd515dc9826915b739d0b977a63c21e96af the Matroska muxer
wrote a secondary seek head referencing all the clusters. When this
was changed, a (now completely wrong) comment remained and the unique
remaining seek head was still called main_seekhead. This has been
changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Don't waste bytes in EBML Header
Andreas Rheinhardt [Fri, 19 Apr 2019 23:40:59 +0000 (01:40 +0200)]
avformat/matroskaenc: Don't waste bytes in EBML Header

Up until now the EBML Header length field has been written with eight
bytes, although the EBML Header is always so small that only one byte
is needed for it. This patch saves seven bytes for every Matroska/Webm
file.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Slightly improve size bounds for cues
Andreas Rheinhardt [Fri, 19 Apr 2019 23:40:58 +0000 (01:40 +0200)]
avformat/matroskaenc: Slightly improve size bounds for cues

The upper bounds currently used for determining the size of a CuePoint's
length field can be improved somewhat; as a result, a CuePoint
containing three CueTrackPositions will now only need a size field
with one byte length.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Fix BlockGroup size calculation
Andreas Rheinhardt [Fri, 19 Apr 2019 23:40:57 +0000 (01:40 +0200)]
avformat/matroskaenc: Fix BlockGroup size calculation

The earlier code included the size of the BlockGroup's length field and
the EBML ID in the calculation of the size for the payload and ignored
the size of the  duration's length field. This meant that Blockgroups
corresponding to packets with size 2^(7n) - 17 - n - i, i = 0,..., n - 1,
n = 1,..., 8 (i.e. 110, 16364, 16365, 2097130..2097132, ...) were written
with length fields that are unnecessarily long.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/matroskaenc: Fix relative timestamp check
Andreas Rheinhardt [Fri, 19 Apr 2019 23:40:56 +0000 (01:40 +0200)]
avformat/matroskaenc: Fix relative timestamp check

At this point, ts already includes the ts_offset so that the relative
time written with the cluster is already given by ts - mkv->cluster_pts.
It is this number that needs to fit into an int16_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agolibavfilter/dnn: add more data type support for dnn model input
Guo, Yejun [Thu, 25 Apr 2019 02:14:42 +0000 (10:14 +0800)]
libavfilter/dnn: add more data type support for dnn model input

currently, only float is supported as model input, actually, there
are other data types, this patch adds uint8.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agolibavfilter/dnn: support multiple outputs for tensorflow model
Guo, Yejun [Thu, 25 Apr 2019 02:14:33 +0000 (10:14 +0800)]
libavfilter/dnn: support multiple outputs for tensorflow model

some models such as ssd, yolo have more than one output.

the clean up code in this patch is a little complex, it is because
that set_input_output_tf could be called for many times together
with ff_dnn_execute_model_tf, we have to clean resources for the
case that the two interfaces are called interleaved.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agolibavfilter/dnn: avoid memcpy for tensorflow dnn output
Guo, Yejun [Thu, 25 Apr 2019 02:14:25 +0000 (10:14 +0800)]
libavfilter/dnn: avoid memcpy for tensorflow dnn output

use TF_Tensor's cpu address to avoid extra memcpy.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agolibavfilter/dnn: determine dnn output during execute_model instead of set_input_output
Guo, Yejun [Thu, 25 Apr 2019 02:14:17 +0000 (10:14 +0800)]
libavfilter/dnn: determine dnn output during execute_model instead of set_input_output

Currently, within interface set_input_output, the dims/memory of the tensorflow
dnn model output is determined by executing the model with zero input,
actually, the output dims might vary with different input data for networks
such as object detection models faster-rcnn, ssd and yolo.

This patch moves the logic from set_input_output to execute_model which
is suitable for all the cases. Since interface changed, and so dnn_backend_native
also changes.

In vf_sr.c, it knows it's srcnn or espcn by executing the model with zero input,
so execute_model has to be called in function config_props

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agolibavfilter/dnn: remove limit for the name of DNN model input/output
Guo, Yejun [Thu, 25 Apr 2019 02:14:08 +0000 (10:14 +0800)]
libavfilter/dnn: remove limit for the name of DNN model input/output

remove the requirment that the name of DNN model input/output
should be "x"/"y",

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agolibavfilter/vf_sr: refine code to remove keyword 'else'
Guo, Yejun [Thu, 25 Apr 2019 02:14:01 +0000 (10:14 +0800)]
libavfilter/vf_sr: refine code to remove keyword 'else'

remove 'else' since there is always 'return' in 'if' scope,
so the code will be clean for later maintenance

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agolibavfilter/dnn_backend_tf.c: set layer_add_res for input layer
Guo, Yejun [Thu, 25 Apr 2019 02:13:49 +0000 (10:13 +0800)]
libavfilter/dnn_backend_tf.c: set layer_add_res for input layer

otherwise, the following check will return error if layer_add_res
is randomly initialized.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
12 months agoavfilter/af_afftfilt: switch to activate
Paul B Mahol [Wed, 8 May 2019 13:03:22 +0000 (15:03 +0200)]
avfilter/af_afftfilt: switch to activate

12 months agoconfigure: enable ffnvcodec, nvenc, nvdec for ppc6le
Ruta Gadkari [Tue, 12 Mar 2019 08:24:04 +0000 (13:54 +0530)]
configure: enable ffnvcodec, nvenc, nvdec for ppc6le

Adding the support to build FFMPEG with HW accelerated decode and encode on PPC64
little endian architecture.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
12 months agoavcodec/cuviddec: add capability check for maximum macroblock count
Ruta Gadkari [Fri, 3 May 2019 08:11:11 +0000 (13:41 +0530)]
avcodec/cuviddec: add capability check for maximum macroblock count

Cuvid supports clips with a limit on maximum number of macroblocks.
This check was missing after cuvidGetDecoderCaps API call allowing
unsupported clips to proceed.
Added the missing check, same as the one in hwaccel nvdec implementation.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
12 months agolavfi/gblur: doing several columns at the same time
Ruiling Song [Mon, 6 May 2019 03:48:31 +0000 (11:48 +0800)]
lavfi/gblur: doing several columns at the same time

Instead of doing each column one by one, doing several columns
together gives about 30% better performance.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
12 months agoconfigure: remove mlp parser dependency from truehd_core bsf
James Almer [Tue, 7 May 2019 20:42:07 +0000 (17:42 -0300)]
configure: remove mlp parser dependency from truehd_core bsf

It's no longer needed.

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/mlp_parser: split off shared code to its own file
James Almer [Sat, 4 May 2019 18:15:50 +0000 (15:15 -0300)]
avcodec/mlp_parser: split off shared code to its own file

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agodoc/filters: layout requirements for xstack
Gyan Doshi [Tue, 7 May 2019 12:24:24 +0000 (17:54 +0530)]
doc/filters: layout requirements for xstack

12 months agoavfilter/vf_xstack: set better error msg for
Gyan Doshi [Tue, 7 May 2019 10:30:40 +0000 (16:00 +0530)]
avfilter/vf_xstack: set better error msg for
missing layout

12 months agoswscale/ppc: Shorten power8 tests via a var
Lauri Kasanen [Tue, 30 Apr 2019 11:36:17 +0000 (14:36 +0300)]
swscale/ppc: Shorten power8 tests via a var

12 months agoswscale/ppc: VSX-optimize hScale16To*
Lauri Kasanen [Tue, 30 Apr 2019 11:25:38 +0000 (14:25 +0300)]
swscale/ppc: VSX-optimize hScale16To*

./ffmpeg -loop 1 -s 1200x1440 -i tux16.png \
    -s 2400x720 -f rawvideo -y -vframes 5 -pix_fmt yuv420p16le -nostats test.raw

./ffmpeg -loop 1 -s 1200x1440 -i tux16.png \
    -s 2400x720 -f rawvideo -y -vframes 5 -pix_fmt yuv420p -nostats test.raw

32-bit mul, power8 only

2x speedup for hScale8To19_vsx (x86 SSE2 is 2.37):
  30896 UNITS in hscale,    8192 runs,      0 skips
  63956 UNITS in hscale,    8192 runs,      0 skips

2.06 for hScale16To15_vsx:
  30531 UNITS in hscale,    8192 runs,      0 skips
  63161 UNITS in hscale,    8192 runs,      0 skips

12 months agoswscale/ppc: Indent
Lauri Kasanen [Tue, 30 Apr 2019 10:24:49 +0000 (13:24 +0300)]
swscale/ppc: Indent

12 months agoswscale/ppc: VSX-optimize hScale8To19
Lauri Kasanen [Tue, 30 Apr 2019 10:21:28 +0000 (13:21 +0300)]
swscale/ppc: VSX-optimize hScale8To19

./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
    -s 2400x720 -f rawvideo -y -vframes 5 -pix_fmt yuv420p16le -nostats test.raw

2.26 speedup (x86 SSE2 is 2.32):
  23772 UNITS in hscale,    4096 runs,      0 skips
  53862 UNITS in hscale,    4096 runs,      0 skips

12 months agolavc/qsv: extactly map profile
Zhong Li [Sun, 28 Apr 2019 12:27:48 +0000 (20:27 +0800)]
lavc/qsv: extactly map profile

Currently profile mapping is hard-coded, and not flexible to do extactly
map (E.g: libmfx treats H264 constrained baseline to be baseline profile).

vaapi profile mapping funtion provides a better soultion than current
qsv mapping.

Signed-off-by: Zhong Li <zhong.li@intel.com>
12 months agolavc/qsvdec: fix hevc level incorrectly map
Zhong Li [Sun, 28 Apr 2019 09:15:55 +0000 (17:15 +0800)]
lavc/qsvdec: fix hevc level incorrectly map

libmfx hevc level defination is same as h264, not level_idc of SPEC.

Signed-off-by: Zhong Li <zhong.li@intel.com>
12 months agolavc/qsvdec: add query function and provide error message
Zhong Li [Thu, 25 Apr 2019 10:51:10 +0000 (18:51 +0800)]
lavc/qsvdec: add query function and provide error message

It is helpful to know why some clips decoding failed.
Ticket#7330 is a good example, with this patch it is easily to
know bitstream codec level is out of support range.

Signed-off-by: Zhong Li <zhong.li@intel.com>
12 months agoavcodec/fits: Check bitpix
Michael Niedermayer [Sun, 5 May 2019 16:38:33 +0000 (18:38 +0200)]
avcodec/fits: Check bitpix

Reference: Table 8: Interpretation of valid BITPIX value from FITS standard 4.0
Fixes: runtime error: division by zero
Fixes: 14581/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5652382425284608

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>
12 months agoavfilter/af_rubberband: also do not ignore failures
Paul B Mahol [Mon, 6 May 2019 19:09:43 +0000 (21:09 +0200)]
avfilter/af_rubberband: also do not ignore failures

12 months agoavfilter/af_rubberband: handle case when no frame is given
Paul B Mahol [Mon, 6 May 2019 19:04:52 +0000 (21:04 +0200)]
avfilter/af_rubberband: handle case when no frame is given

12 months agoavcodec/vp9_raw_reorder: reset state when flushing
James Almer [Mon, 6 May 2019 03:22:32 +0000 (00:22 -0300)]
avcodec/vp9_raw_reorder: reset state when flushing

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavformat/aacdec: fix demuxing of small frames
James Almer [Thu, 25 Apr 2019 22:04:01 +0000 (19:04 -0300)]
avformat/aacdec: fix demuxing of small frames

10 bytes (id3v2 header amount of bytes) were being read before any checks
were made on the bitstream. The result was that we were overreading into
the next frame if the current one was 8 or 9 bytes long.

Fixes tickets #7271 and #7869.

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/hevcdec: Declare that VDPAU can handle HEVC 4:4:4 content
ManojGuptaBonda [Fri, 26 Apr 2019 04:13:36 +0000 (09:43 +0530)]
avcodec/hevcdec: Declare that VDPAU can handle HEVC 4:4:4 content

The latest generation video decoder on the Turing chips supports
decoding HEVC 4:4:4. This change adds AV_PIX_FMT_VDPAU as a valid format
for HEVC 4:4:4 8 bit.

12 months agoavcodec/vdpau_hevc: Pass sps and pps range extension flags to VDPAU
ManojGuptaBonda [Fri, 26 Apr 2019 04:13:37 +0000 (09:43 +0530)]
avcodec/vdpau_hevc: Pass sps and pps range extension flags to VDPAU

Pass SPS, PPS range extensions to VDPAU layer via
VdpPictureInfoHEVC444. Added VdpPictureInfoHEVC444 struct to
VdpPictureInfo union to populate the range extension params. Mapped
FF_PROFILE_HEVC_REXT to VDP_DECODER_PROFILE_HEVC_MAIN_444.

12 months agoavutil/hwcontext_vdpau: Map 444 pix fmts to new VdpYCbCr types
ManojGuptaBonda [Fri, 3 May 2019 20:57:53 +0000 (02:27 +0530)]
avutil/hwcontext_vdpau: Map 444 pix fmts to new VdpYCbCr types

New VdpYCbCr Formats VDP_YCBCR_FORMAT_Y_U_V_444 and,
VDP_YCBCR_FORMAT_Y_UV_444 have been added in VDPAU with libvdpau-1.2
to be used in get/putbits for YUV 4:4:4 surfaces. Earlier mapping of
AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_YV12 is not valid.

Hence this Change maps AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_Y_U_V_444
to access the YUV 4:4:4 surface via read-back API's of VDPAU.

12 months agolavf/rpl: Don't be case-sensitive detecting codecs.
Carl Eugen Hoyos [Sun, 5 May 2019 14:32:11 +0000 (16:32 +0200)]
lavf/rpl: Don't be case-sensitive detecting codecs.

Fixes ticket #7859
Reported and tested by Steffen Ohrendorf, steffen d ohrendorf a gmx d de

12 months agoavfilter/vf_freezedetect: fix missing freeze_start when the freeze length is around...
Marton Balint [Wed, 1 May 2019 17:11:52 +0000 (19:11 +0200)]
avfilter/vf_freezedetect: fix missing freeze_start when the freeze length is around the detection duration

Fixes ticket #7875.

Signed-off-by: Marton Balint <cus@passwd.hu>
12 months agoavdevice/decklink: fix checking video mode in SDK version 11
Marton Balint [Wed, 1 May 2019 10:47:43 +0000 (12:47 +0200)]
avdevice/decklink: fix checking video mode in SDK version 11

Apparently in the new SDK one cannot query if VANC output is supported, so we
will fall back to non-VANC output if enabling the video output with VANC fails.

Fixes ticket #7867.

Signed-off-by: Marton Balint <cus@passwd.hu>
12 months agoavfilter/f_interleave: switch to activate
Paul B Mahol [Fri, 3 May 2019 18:17:28 +0000 (20:17 +0200)]
avfilter/f_interleave: switch to activate

12 months agoavcodec/truehd_core: reset state when flushing
James Almer [Sun, 5 May 2019 01:10:40 +0000 (22:10 -0300)]
avcodec/truehd_core: reset state when flushing

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavfilter/vf_vibrance: add alternate option
Paul B Mahol [Sun, 5 May 2019 11:26:24 +0000 (13:26 +0200)]
avfilter/vf_vibrance: add alternate option

12 months agoavfilter/vf_vibrance: factor some calculations out of loop
Paul B Mahol [Sun, 5 May 2019 11:09:37 +0000 (13:09 +0200)]
avfilter/vf_vibrance: factor some calculations out of loop

12 months agoavcodec/h263dec: Fixed VA API, VDPAU, and VideoToolbox hardware acceleration due...
fumoboy007 [Mon, 29 Apr 2019 21:12:33 +0000 (14:12 -0700)]
avcodec/h263dec: Fixed VA API, VDPAU, and VideoToolbox hardware acceleration due to missing `hw_configs` property.

Bug originally introduced in commit 758fbc54fef2f31957b5c5f22e05e5fd9b04f631.

12 months agoconfigure: Do not overwrite src symlink if it already exists.
Carl Eugen Hoyos [Wed, 24 Apr 2019 22:42:48 +0000 (00:42 +0200)]
configure: Do not overwrite src symlink if it already exists.

Allows running fate from out-of-tree builds on wsl.

12 months agoavcodec/jvdec: Use ff_get_buffer() when the content is not reused
Michael Niedermayer [Fri, 3 May 2019 22:15:33 +0000 (00:15 +0200)]
avcodec/jvdec: Use ff_get_buffer() when the content is not reused

Fixes: Timeout (11sec -> 5sec)
Fixes: 14473/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JV_fuzzer-5761630857592832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/pnm_parser: clear state if buffer is discarded
Michael Niedermayer [Fri, 3 May 2019 21:21:19 +0000 (23:21 +0200)]
avcodec/pnm_parser: clear state if buffer is discarded

Fixes: Assertion failure
Fixes: 14484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5150016408125440

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>
12 months agoavfilter/f_realtime: add option to scale speed
Moritz Barsnick [Wed, 1 May 2019 14:12:59 +0000 (16:12 +0200)]
avfilter/f_realtime: add option to scale speed

12 months agoavfilter/af_amultiply: use pts from frame from first input
Paul B Mahol [Sat, 4 May 2019 09:28:14 +0000 (11:28 +0200)]
avfilter/af_amultiply: use pts from frame from first input

12 months agoavfilter/vf_vmafmotion: remove unused header
Paul B Mahol [Sat, 4 May 2019 09:09:47 +0000 (11:09 +0200)]
avfilter/vf_vmafmotion: remove unused header

12 months agoavisynth: adapt 239d02eff3ffe9f7d40caa21dde50fb4a0e94c24 to dlsym
Stephen Hutchinson [Sat, 30 Mar 2019 21:46:32 +0000 (17:46 -0400)]
avisynth: adapt 239d02eff3ffe9f7d40caa21dde50fb4a0e94c24 to dlsym

This commit was merged in a couple years ago as a no-op because we
had already switched from GetProcAddress to dlsym some time before
that.  However, not applying the actual cast causes warnings about
FARPROC and when attempting to build FFmpeg in MSVC with AviSynth-GCC
32-bit compatibility, those FARPROC warnings turn into FARPROC errors.

12 months agodoc/general.texi: add note about 32-bit GCC builds of AviSynth+
Stephen Hutchinson [Mon, 1 Apr 2019 00:12:55 +0000 (20:12 -0400)]
doc/general.texi: add note about 32-bit GCC builds of AviSynth+

12 months agodoc/general.texi: update AviSynth+ reference page
Stephen Hutchinson [Sun, 24 Mar 2019 20:25:39 +0000 (16:25 -0400)]
doc/general.texi: update AviSynth+ reference page

Directed to the AviSynth+ entry on AviSynth Wiki rather than to
the github repository, since the wiki page is both more informative
and has the relevant Git/download links.  The github releases page
is little more than a changelog.

12 months agodoc/general.texi: remove note about regressed AviSynth+ header
Stephen Hutchinson [Sun, 24 Mar 2019 20:29:33 +0000 (16:29 -0400)]
doc/general.texi: remove note about regressed AviSynth+ header

It's been fixed both AviSynth+-side and locally.

12 months agolibavformat/avisynth: enable additional pix_fmts
Stephen Hutchinson [Sun, 24 Mar 2019 20:25:37 +0000 (16:25 -0400)]
libavformat/avisynth: enable additional pix_fmts

These pix_fmts have been added to FFmpeg in the 31 months since
commit 92916e8542e425ca20daddb490261a5818643206 added support for
the larger number of pix_fmts that AviSynth+ can use. They were
present in AviSynth+ even then, just not in libavutil.

12 months agocompat/avisynth: update headers
Stephen Hutchinson [Sat, 30 Mar 2019 21:45:15 +0000 (17:45 -0400)]
compat/avisynth: update headers

As part of the update, it is now possible to test 32-bit GCC builds
of AviSynth+ with FFmpeg by using the AVS_WIN32_GCC32 define. Due to
different calling conventions between MSVC and GCC regarding 32-bit
Windows, this is unfortunately necessary.

12 months agoavfilter/vf_blend: remove unused header
Paul B Mahol [Fri, 3 May 2019 18:48:18 +0000 (20:48 +0200)]
avfilter/vf_blend: remove unused header

12 months agoaacdec: use float_dsp in apply_independent_coupling
Lynne [Fri, 12 Apr 2019 21:50:59 +0000 (22:50 +0100)]
aacdec: use float_dsp in apply_independent_coupling

Could not be used in apply_dependent_coupling because of alignment issues.

12 months agoavformat/mov: set AVFMT_SEEK_TO_PTS flag
Gyan Doshi [Thu, 2 May 2019 09:30:02 +0000 (15:00 +0530)]
avformat/mov: set AVFMT_SEEK_TO_PTS flag

Ever since 59ad504696, the demuxer expects its seek arg to be PTS
and adjusts internally to search index by DTS.

12 months agox86/v210dec: use named registers
James Almer [Fri, 3 May 2019 04:17:12 +0000 (01:17 -0300)]
x86/v210dec: use named registers

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agox86/v210dec: don't reserve more xmm regs than needed
James Almer [Fri, 3 May 2019 04:09:46 +0000 (01:09 -0300)]
x86/v210dec: don't reserve more xmm regs than needed

Prevents pointless register saving on win64 for the sse3 and avx
versions of the function.

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agox86/v210dec: remove duplicate load instruction
James Almer [Fri, 3 May 2019 04:08:34 +0000 (01:08 -0300)]
x86/v210dec: remove duplicate load instruction

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agofate/checkasm: add missing v210dec test
James Almer [Fri, 3 May 2019 04:07:38 +0000 (01:07 -0300)]
fate/checkasm: add missing v210dec test

Signed-off-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/x86/v210: fix operands of vpblendd used in new avx2 code
James Darnley [Thu, 2 May 2019 19:16:58 +0000 (21:16 +0200)]
avcodec/x86/v210: fix operands of vpblendd used in new avx2 code

Assembly failed when using yasm rather than nasm.

12 months agolavf/webm_chunk: Respect buffer size
Andreas Rheinhardt [Fri, 19 Apr 2019 22:03:14 +0000 (00:03 +0200)]
lavf/webm_chunk: Respect buffer size

The last argument of av_strlcpy is supposed to contain the size of the
destination buffer, but it was filled with the size of the source
string, effectively negating its very purpose.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agolibavcodec Adding ff_v210_planar_unpack AVX2
Michael Stoner [Sat, 16 Mar 2019 16:24:47 +0000 (09:24 -0700)]
libavcodec Adding ff_v210_planar_unpack AVX2

Replaced VSHUFPS with VPBLENDD to relieve port 5 bottleneck
AVX2 is 1.4x faster than AVX

12 months agocheckasm: add test for v210dec
James Darnley [Mon, 4 Mar 2019 18:50:35 +0000 (19:50 +0100)]
checkasm: add test for v210dec

12 months agoavcodec/v210dec: move DSP function setting into dedicated function
James Darnley [Mon, 4 Mar 2019 22:54:58 +0000 (23:54 +0100)]
avcodec/v210dec: move DSP function setting into dedicated function

Prepare for checkasm test.

12 months agoMerge commit 'c4642788e83b0858bca449f9b6e71ddb015dfa5d'
James Almer [Thu, 2 May 2019 16:50:31 +0000 (13:50 -0300)]
Merge commit 'c4642788e83b0858bca449f9b6e71ddb015dfa5d'

* commit 'c4642788e83b0858bca449f9b6e71ddb015dfa5d':
  time_internal: Prefix fallback versions of gmtime_r/localtime_r with ff_

Merged-by: James Almer <jamrial@gmail.com>
12 months agoMerge commit '9485cce6d55baf547e92ef1f54cad117f2a38287'
James Almer [Thu, 2 May 2019 16:48:43 +0000 (13:48 -0300)]
Merge commit '9485cce6d55baf547e92ef1f54cad117f2a38287'

* commit '9485cce6d55baf547e92ef1f54cad117f2a38287':
  time_internal: Do not attempt to override *time_r() macros

This commit is a noop, see a604de4fd89e8fe37d2f8163282060fcaa64ee3e

Merged-by: James Almer <jamrial@gmail.com>
12 months agoMerge commit 'c93e92f2b25f4174350ded3f59ad117ec8eb1fe4'
James Almer [Thu, 2 May 2019 16:46:31 +0000 (13:46 -0300)]
Merge commit 'c93e92f2b25f4174350ded3f59ad117ec8eb1fe4'

* commit 'c93e92f2b25f4174350ded3f59ad117ec8eb1fe4':
  configure: Include time.h when checking for gmtime_r and localtime_r

This commit is a noop, see 1b4dd59e5fbdebb8d9f13ad2dbdaa0179d0cce57

Merged-by: James Almer <jamrial@gmail.com>
12 months agoMerge commit 'c0bd865ad60da31282c5d8e1000c98366249c31e'
James Almer [Thu, 2 May 2019 16:11:21 +0000 (13:11 -0300)]
Merge commit 'c0bd865ad60da31282c5d8e1000c98366249c31e'

* commit 'c0bd865ad60da31282c5d8e1000c98366249c31e':
  configure: Add -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 for mingw as well

Merged-by: James Almer <jamrial@gmail.com>
12 months agoMerge commit '1e56173515826aa4d680d3b216d80a3879ed1c68'
James Almer [Thu, 2 May 2019 16:01:36 +0000 (13:01 -0300)]
Merge commit '1e56173515826aa4d680d3b216d80a3879ed1c68'

* commit '1e56173515826aa4d680d3b216d80a3879ed1c68':
  rtsp: add pkt_size option

Merged-by: James Almer <jamrial@gmail.com>
12 months agoavcodec/wavpackenc: use ff_clz()
Paul B Mahol [Thu, 2 May 2019 13:35:09 +0000 (15:35 +0200)]
avcodec/wavpackenc: use ff_clz()

12 months agoavcodec/cinepak: Add missing const
Michael Niedermayer [Thu, 2 May 2019 06:00:46 +0000 (08:00 +0200)]
avcodec/cinepak: Add missing const

Found-by: <mkver>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavfilter/vf_tonemap: add slice threading
Paul B Mahol [Tue, 30 Apr 2019 09:59:51 +0000 (11:59 +0200)]
avfilter/vf_tonemap: add slice threading

12 months agoavfilter/avf_abitscope: switch to activate
Paul B Mahol [Wed, 1 May 2019 19:17:55 +0000 (21:17 +0200)]
avfilter/avf_abitscope: switch to activate

12 months agoavfilter/af_biquads: add timeline support
Paul B Mahol [Wed, 1 May 2019 10:55:34 +0000 (12:55 +0200)]
avfilter/af_biquads: add timeline support

12 months agoavfilter/af_stereowiden: add timeline support
Paul B Mahol [Wed, 1 May 2019 10:40:25 +0000 (12:40 +0200)]
avfilter/af_stereowiden: add timeline support

12 months agoavfilter/af_extrastereo: add timeline support
Paul B Mahol [Wed, 1 May 2019 10:33:56 +0000 (12:33 +0200)]
avfilter/af_extrastereo: add timeline support

12 months agoavfilter/af_crossfeed: add timeline support
Paul B Mahol [Wed, 1 May 2019 10:31:52 +0000 (12:31 +0200)]
avfilter/af_crossfeed: add timeline support

12 months agoavcodec/agm: Check output size before allocation
Michael Niedermayer [Wed, 24 Apr 2019 15:41:13 +0000 (17:41 +0200)]
avcodec/agm: Check output size before allocation

Fixes: OOM
Fixes: 14198/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5723579234123776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 months agoavcodec/truemotion2: Fix 2 integer overflows in tm2_update_block()
Michael Niedermayer [Fri, 19 Apr 2019 23:05:44 +0000 (01:05 +0200)]
avcodec/truemotion2: Fix 2 integer overflows in tm2_update_block()

Fixes: signed integer overflow: -2147483648 + -1 cannot be represented in type 'int'
Fixes: 14107/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5694078680825856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>