ffmpeg.git
59 min agoavcodec/sunrast: Fix indention master
Michael Niedermayer [Sat, 21 Sep 2019 16:06:24 +0000 (18:06 +0200)]
avcodec/sunrast: Fix indention

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
59 min agoavcodec/sunrast: Fix return type for "unsupported (compression) type"
Michael Niedermayer [Sat, 21 Sep 2019 16:06:02 +0000 (18:06 +0200)]
avcodec/sunrast: Fix return type for "unsupported (compression) type"

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
59 min agoavutil/opt: Fix type specifier
Andreas Rheinhardt [Sat, 21 Sep 2019 09:15:42 +0000 (11:15 +0200)]
avutil/opt: Fix type specifier

This bug has been introduced in 9e0a071e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 hours agoavfilter/vf_v360: add fixed pixel padding options
Paul B Mahol [Sun, 22 Sep 2019 12:01:14 +0000 (14:01 +0200)]
avfilter/vf_v360: add fixed pixel padding options

5 hours agoavfilter/vf_v360: remove intermediate variables
Paul B Mahol [Sun, 22 Sep 2019 09:29:03 +0000 (11:29 +0200)]
avfilter/vf_v360: remove intermediate variables

21 hours agotools/patcheck: remove gcc-2.95 compat check
James Zern [Fri, 20 Sep 2019 07:04:06 +0000 (00:04 -0700)]
tools/patcheck: remove gcc-2.95 compat check

this conflicts with the current contributing guidance:
http://ffmpeg.org/developer.html#Contributing
FFmpeg is programmed in the ISO C90 language with a few additional
features from ISO C99, namely:
...
for loops with variable definition (‘for (int i = 0; i < 8; i++)’);

Signed-off-by: James Zern <jzern@google.com>
21 hours agoavfilter/vf_v360: fix comparison with float value
Paul B Mahol [Sat, 21 Sep 2019 19:35:39 +0000 (21:35 +0200)]
avfilter/vf_v360: fix comparison with float value

21 hours agoavfilter/vf_v360: simplify xyz_to_dfisheye() calculations
Paul B Mahol [Sat, 21 Sep 2019 19:33:03 +0000 (21:33 +0200)]
avfilter/vf_v360: simplify xyz_to_dfisheye() calculations

21 hours agoavfilter/vf_v360: simplify dfisheye_to_xyz() calculations
Paul B Mahol [Sat, 21 Sep 2019 19:17:37 +0000 (21:17 +0200)]
avfilter/vf_v360: simplify dfisheye_to_xyz() calculations

24 hours agoavfilter/avf_showfreqs: fix check for failed allocation
Paul B Mahol [Sat, 21 Sep 2019 17:07:42 +0000 (19:07 +0200)]
avfilter/avf_showfreqs: fix check for failed allocation

25 hours agoavformat/latmenc: fix context used for logging
James Almer [Sat, 21 Sep 2019 15:31:11 +0000 (12:31 -0300)]
avformat/latmenc: fix context used for logging

Signed-off-by: James Almer <jamrial@gmail.com>
26 hours agoavfilter/vf_v360: simplify ball_to_xyz() calculations
Paul B Mahol [Sat, 21 Sep 2019 14:21:36 +0000 (16:21 +0200)]
avfilter/vf_v360: simplify ball_to_xyz() calculations

26 hours agoavfilter/vf_v360: simplify xyz_to_ball() calculations
Paul B Mahol [Sat, 21 Sep 2019 14:07:16 +0000 (16:07 +0200)]
avfilter/vf_v360: simplify xyz_to_ball() calculations

27 hours agoavfilter/vf_v360: add hammer projection
Paul B Mahol [Sat, 21 Sep 2019 13:29:18 +0000 (15:29 +0200)]
avfilter/vf_v360: add hammer projection

32 hours agoavfilter/vf_v360: use lrintf() in kernel
Paul B Mahol [Sat, 21 Sep 2019 08:45:15 +0000 (10:45 +0200)]
avfilter/vf_v360: use lrintf() in kernel

32 hours agoavfilter/vf_v360: fix small artifacts between corners in EAC format
Paul B Mahol [Sat, 21 Sep 2019 08:31:59 +0000 (10:31 +0200)]
avfilter/vf_v360: fix small artifacts between corners in EAC format

43 hours agoavformat/hashenc: add streamhash muxer
Moritz Barsnick [Thu, 12 Sep 2019 09:23:06 +0000 (11:23 +0200)]
avformat/hashenc: add streamhash muxer

Implemented as a variant of the hash muxer, reusing most functions,
and making use of the previously introduced array of hashes.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavformat/hashenc: use an array of hashes
Moritz Barsnick [Thu, 12 Sep 2019 09:23:05 +0000 (11:23 +0200)]
avformat/hashenc: use an array of hashes

Only the first element of the array is used currently, the other
elements are in preparation for a new muxer calculating multiple
hashes.

Also move alloc/init code from the write_header() functions to
dedicated init() functions, and the cleanup code from the
write_trailer() functions to dedicated deinit() functions.

hash_free() and framehash_free() turn out to be identical here,
but will differ in the subsequent commit, so they are not consolidated.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavformat/hashenc: rearrange options definition
Moritz Barsnick [Thu, 12 Sep 2019 09:23:04 +0000 (11:23 +0200)]
avformat/hashenc: rearrange options definition

Only the frame* muxers support the format_version option.
Use macros to ease the proliferation of identical options to
coming muxers as well.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavutil/encryption_info: Don't pass NULL to memcpy
Andreas Rheinhardt [Wed, 18 Sep 2019 00:03:58 +0000 (02:03 +0200)]
avutil/encryption_info: Don't pass NULL to memcpy

The pointer arguments to memcpy (and several other functions of the
C standard library) are not allowed to be NULL, not even when the number
of bytes to copy is zero. An AVEncryptionInitInfo's data pointer is
explicitly allowed to be NULL and yet av_encryption_init_info_add_side_data
unconditionally used it as a source pointer to copy from. This commit changes
this so that copying is only done if the number of bytes to copy is > 0.

Fixes ticket #8141 as well as a part of ticket #8150.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agotools/target_dec_fuzzer: fuzz channels and sample_rate too
Michael Niedermayer [Fri, 20 Sep 2019 08:25:34 +0000 (10:25 +0200)]
tools/target_dec_fuzzer: fuzz channels and sample_rate too

This should increase coverage over more audio decoders.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavcodec/utils: Check channels fully earlier
Michael Niedermayer [Fri, 20 Sep 2019 08:25:05 +0000 (10:25 +0200)]
avcodec/utils: Check channels fully earlier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavformat/rtpenc_mpegts: copy metadata to mpegts sub-muxer
Moritz Barsnick [Mon, 2 Jul 2018 11:38:04 +0000 (13:38 +0200)]
avformat/rtpenc_mpegts: copy metadata to mpegts sub-muxer

Fixes #7293.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavformat/aiffdec: parse replaygain metadata
Moritz Barsnick [Wed, 13 Mar 2019 09:17:40 +0000 (10:17 +0100)]
avformat/aiffdec: parse replaygain metadata

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavutil/opt: Print out numeric values of option constants
Soft Works [Tue, 17 Sep 2019 01:09:05 +0000 (01:09 +0000)]
avutil/opt: Print out numeric values of option constants

It's often not obvious how option constants relate to numerical values.
Defaults are sometimes printed as numbers and from/to are always printed as numbers.
Printing the numeric values of options constants avoids this confusion.
It also allows to see which constants are equivalent.

Before this patch:

  -segment_list_type <int>        E........ set the segment list type (from -1 to 4) (default -1)
     flat                         E........ flat format
     csv                          E........ csv format
     ext                          E........ extended format
     ffconcat                     E........ ffconcat format
     m3u8                         E........ M3U8 format
     hls                          E........ Apple HTTP Live Streaming compatible

Afterwards:

  -segment_list_type <int>        E........ set the segment list type (from -1 to 4) (default -1)
     flat            0            E........ flat format
     csv             1            E........ csv format
     ext             3            E........ extended format
     ffconcat        4            E........ ffconcat format
     m3u8            2            E........ M3U8 format
     hls             2            E........ Apple HTTP Live Streaming compatible

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavutil/opt: Fix printing integer option defaults
Soft Works [Tue, 17 Sep 2019 01:36:33 +0000 (01:36 +0000)]
avutil/opt: Fix printing integer option defaults

Integer values should not be printed using format specifier '%g' which leads to inexact display in case of higher values.

Before this patch:
  -trans_color       <int>        .D.V..... color value [...] (default 1.67772e+07)

Afterwards:
  -trans_color       <int>        .D.V..... color value [...] (default 16777215)

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavcodec/ac3enc: Fix invalid shift
Andreas Rheinhardt [Thu, 19 Sep 2019 22:17:06 +0000 (00:17 +0200)]
avcodec/ac3enc: Fix invalid shift

Fixes the FATE-tests unknown_layout-ac3, ac3-fixed-encode, ac3-encode
and eac3-encode. It furthermore fixes the ac3-encoder bugs mentioned in
tickets #7994, #8144 and #8159.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavcodec/g723_1dec: Fix invalid shift
Andreas Rheinhardt [Thu, 19 Sep 2019 22:17:04 +0000 (00:17 +0200)]
avcodec/g723_1dec: Fix invalid shift

Fixes the FATE-tests g723_1-dec-1, g723_1-dec-2 and g723_1-dec-4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
43 hours agoavcodec/tdsc: Fix undefined shifts
Andreas Rheinhardt [Thu, 19 Sep 2019 22:16:59 +0000 (00:16 +0200)]
avcodec/tdsc: Fix undefined shifts

Fixes the tdsc FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
45 hours agoavfilter/vf_v360: remove uneeded array element
Paul B Mahol [Fri, 20 Sep 2019 19:41:12 +0000 (21:41 +0200)]
avfilter/vf_v360: remove uneeded array element

45 hours agoavfilter/vf_v360: add support for mirroring to ball input format
Paul B Mahol [Fri, 20 Sep 2019 19:34:46 +0000 (21:34 +0200)]
avfilter/vf_v360: add support for mirroring to ball input format

46 hours agoavfilter/vf_v360: adjust kernel after latest change
Paul B Mahol [Fri, 20 Sep 2019 17:14:38 +0000 (19:14 +0200)]
avfilter/vf_v360: adjust kernel after latest change

46 hours agoavfilter/vf_v360: fix various artifacts with cubemaps
Paul B Mahol [Fri, 20 Sep 2019 16:14:41 +0000 (18:14 +0200)]
avfilter/vf_v360: fix various artifacts with cubemaps

46 hours agoavfilter/vf_v360: improve description about s in comments
Paul B Mahol [Fri, 20 Sep 2019 15:40:34 +0000 (17:40 +0200)]
avfilter/vf_v360: improve description about s in comments

47 hours agolibavfilter/dnn: support multiple outputs for native mode
Guo, Yejun [Fri, 20 Sep 2019 03:56:10 +0000 (11:56 +0800)]
libavfilter/dnn: support multiple outputs for native mode

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
47 hours agolibavfilter/dnn/dnn_backend_native: find the input operand according to input name
Guo, Yejun [Fri, 20 Sep 2019 03:56:03 +0000 (11:56 +0800)]
libavfilter/dnn/dnn_backend_native: find the input operand according to input name

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2 days agoFATE/dnn: add unit test for layer maximum
Guo, Yejun [Fri, 20 Sep 2019 03:55:55 +0000 (11:55 +0800)]
FATE/dnn: add unit test for layer maximum

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2 days agolibavfilter/dnn: add layer maximum for native mode.
Guo, Yejun [Fri, 20 Sep 2019 03:55:48 +0000 (11:55 +0800)]
libavfilter/dnn: add layer maximum for native mode.

The reason to add this layer is that it is used by srcnn in vf_sr.
This layer is currently ignored in native mode. After this patch,
we can add multiple outputs support for native mode.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2 days agoDelete unused branch in libaomenc
elliottk [Sun, 15 Sep 2019 21:02:50 +0000 (14:02 -0700)]
Delete unused branch in libaomenc

this branch is leftover from libvpxenc+vp8

Signed-off-by: James Zern <jzern@google.com>
2 days agoavcodec/libvpxenc: add ROI-based encoding support for VP8/VP9
Guo, Yejun [Thu, 12 Sep 2019 10:25:21 +0000 (18:25 +0800)]
avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9

example command line to verify it:
./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M tmp.webm

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: James Zern <jzern@google.com>
2 days agoavformat/movenc: don't hardcode the colr box size
James Almer [Fri, 20 Sep 2019 00:32:40 +0000 (21:32 -0300)]
avformat/movenc: don't hardcode the colr box size

Signed-off-by: James Almer <jamrial@gmail.com>
2 days agolavc/cook: Remove an incorrect comment.
Carl Eugen Hoyos [Thu, 19 Sep 2019 23:36:13 +0000 (01:36 +0200)]
lavc/cook: Remove an incorrect comment.

Multichannel cook was implemented in 67da3182.

2 days agoavformat/mpegts: add support for EPG extraction from mpegts
Anthony Delannoy [Wed, 21 Aug 2019 09:46:56 +0000 (11:46 +0200)]
avformat/mpegts: add support for EPG extraction from mpegts

Signed-off-by: Marton Balint <cus@passwd.hu>
2 days agoavcodec: add EPG codec ID
Anthony Delannoy [Wed, 21 Aug 2019 09:36:15 +0000 (11:36 +0200)]
avcodec: add EPG codec ID

Signed-off-by: Marton Balint <cus@passwd.hu>
2 days agoavformat/mpegts: add all well known PIDs and TIDs to mpegts.h
Anthony Delannoy [Fri, 26 Jul 2019 09:41:00 +0000 (11:41 +0200)]
avformat/mpegts: add all well known PIDs and TIDs to mpegts.h

Signed-off-by: Marton Balint <cus@passwd.hu>
2 days agoavfilter/dnn: fix inclusion guard in dnn/dnn_backend_native_layer_depth2space.h
Marton Balint [Thu, 19 Sep 2019 19:28:10 +0000 (21:28 +0200)]
avfilter/dnn: fix inclusion guard in dnn/dnn_backend_native_layer_depth2space.h

Fixes fate-source failure.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 days agoavfilter/vf_v360: add ball projection format
Paul B Mahol [Thu, 19 Sep 2019 16:36:19 +0000 (18:36 +0200)]
avfilter/vf_v360: add ball projection format

3 days agoFATE/dnn: add unit test for dnn depth_to_space layer
Guo, Yejun [Thu, 5 Sep 2019 06:00:54 +0000 (14:00 +0800)]
FATE/dnn: add unit test for dnn depth_to_space layer

'make fate-dnn-layer-depth2space' to run the test

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
3 days agolibavfilter/dnn: separate depth_to_space layer from dnn_backend_native.c to a new...
Guo, Yejun [Thu, 5 Sep 2019 06:00:46 +0000 (14:00 +0800)]
libavfilter/dnn: separate depth_to_space layer from dnn_backend_native.c to a new file

the logic is that one layer in one separated source file to make
the source files simple for maintaining.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
3 days agoFATE/dnn: add unit test for dnn conv2d layer
Guo, Yejun [Thu, 5 Sep 2019 06:00:39 +0000 (14:00 +0800)]
FATE/dnn: add unit test for dnn conv2d layer

'make fate-dnn-layer-conv2d' to run the test

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
3 days agolibavfilter/dnn: separate conv2d layer from dnn_backend_native.c to a new file
Guo, Yejun [Thu, 5 Sep 2019 06:00:28 +0000 (14:00 +0800)]
libavfilter/dnn: separate conv2d layer from dnn_backend_native.c to a new file

the logic is that one layer in one separated source file to make
the source files simple for maintaining.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
3 days agoavcodec/v210enc: move v210_enc_8/10 function to template file
Limin Wang [Tue, 17 Sep 2019 03:42:28 +0000 (11:42 +0800)]
avcodec/v210enc: move v210_enc_8/10 function to template file

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavcodec/v210enc: make 8bit and 10bit process consistent
Limin Wang [Tue, 17 Sep 2019 03:42:27 +0000 (11:42 +0800)]
avcodec/v210enc: make 8bit and 10bit process consistent

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavcodec/v210enc: add depth parameter for WRITE_PIXELS and CLIP
Limin Wang [Tue, 17 Sep 2019 03:42:26 +0000 (11:42 +0800)]
avcodec/v210enc: add depth parameter for WRITE_PIXELS and CLIP

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavutil/common: Fix undefined shift
Andreas Rheinhardt [Wed, 18 Sep 2019 03:26:07 +0000 (05:26 +0200)]
avutil/common: Fix undefined shift

av_mod_uintp2_c uses a bitwise AND with (1 << p) - 1 to clear the high
bits of an unsigned int. But this is undefined if p == 31, because 1 is
an int and 2^31 is not representable in an int. So make 1 unsigned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavcodec/avpacket: Improve allocating packets
Andreas Rheinhardt [Wed, 18 Sep 2019 03:26:05 +0000 (05:26 +0200)]
avcodec/avpacket: Improve allocating packets

av_mallocz + av_init_packet leads to the same result as av_mallocz +
av_packet_unref, but faster.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavcodec/mjpegdec: Unify switch statements
Andreas Rheinhardt [Wed, 18 Sep 2019 03:25:59 +0000 (05:25 +0200)]
avcodec/mjpegdec: Unify switch statements

This has been forgotten in d5a3a20d.

Found via PVS-Studio (see ticket #8156).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavformat/utils: Preserve integrity of linked list
Andreas Rheinhardt [Mon, 19 Aug 2019 21:56:19 +0000 (23:56 +0200)]
avformat/utils: Preserve integrity of linked list

1. Instead of relying on ff_packet_list_get to get the oldest element in
an AVPacketList, ff_read_packet used its own ad-hoc code. Said code
forgot to set the end of the list to NULL if the last element of the
list has been removed, thereby leaving the list in an inconsistent state.
2. Furthermore, if the list was not empty, the oldest element of the
list would always be copied into another packet structure before it was
known whether the oldest entry of the list would be removed. This makes
the ownership confusing and potentially copies unnecessarily.

Both of these issues have been fixed. ff_packet_list_get is used now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavformat/internal: Improve documentation of ff_packet_list_get
Andreas Rheinhardt [Mon, 19 Aug 2019 21:56:18 +0000 (23:56 +0200)]
avformat/internal: Improve documentation of ff_packet_list_get

The documentation of ff_packet_list_get currently didn't match the
actual usage:
1. It said that the destination packet is supposed to be initialized.
But this makes no sense given that it will be overwritten completely and
flacenc, mp3enc and ttaenc ignored this.
2. ff_packet_list_get returns an int, although it can't fail in case the
packet list is not empty (for which there is an assert). Again, several
callers didn't check for any return value.
In both cases, the documentation has been adapted to match actual usage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 days agocheckasm/opusdsp: declare opus_deemphasis as a function returning a float
James Almer [Wed, 18 Sep 2019 14:23:36 +0000 (11:23 -0300)]
checkasm/opusdsp: declare opus_deemphasis as a function returning a float

Fixes ticket #8175

Signed-off-by: James Almer <jamrial@gmail.com>
4 days agodoc: various spelling, grammar and formatting fixes
Moritz Barsnick [Tue, 17 Sep 2019 08:21:02 +0000 (10:21 +0200)]
doc: various spelling, grammar and formatting fixes

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
4 days agolavf/mpegts: Support demuxing AVS2.
hwrenx [Wed, 18 Sep 2019 00:18:13 +0000 (02:18 +0200)]
lavf/mpegts: Support demuxing AVS2.

4 days agoavfilter/vf_v360: add mercator projection
Paul B Mahol [Tue, 17 Sep 2019 20:15:07 +0000 (22:15 +0200)]
avfilter/vf_v360: add mercator projection

5 days agotools/target_dec_fuzzer: Adjust threshold for binkvideo
Michael Niedermayer [Sat, 14 Sep 2019 21:39:49 +0000 (23:39 +0200)]
tools/target_dec_fuzzer: Adjust threshold for binkvideo

Fixes: Timeout (89sec -> 7sec)
Fixes: 17035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-5737222422134784

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>
5 days agoavformat/mov: Check for EOF in mov_read_meta()
Michael Niedermayer [Fri, 30 Aug 2019 23:25:03 +0000 (01:25 +0200)]
avformat/mov: Check for EOF in mov_read_meta()

Fixes: Timeout (195sec -> 2ms)
Fixes: 16735/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5090676403863552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agofftools/ffmpeg_opt: Fix signed integer overflow
Andreas Rheinhardt [Mon, 16 Sep 2019 15:55:01 +0000 (17:55 +0200)]
fftools/ffmpeg_opt: Fix signed integer overflow

Fixes ticket #8154.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/mov: Fix memleak
Andreas Rheinhardt [Mon, 16 Sep 2019 15:54:59 +0000 (17:54 +0200)]
avformat/mov: Fix memleak

When the mov/mp4 demuxer encounters an error during decrypting a packet,
it returns the error, yet doesn't free the packet, so that the packet
leaks. This has been fixed in this commit.

Fixes the memleaks from ticket #8150.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavcodec/hevcdec: Fix memleak of a53_caption
Michael Niedermayer [Sun, 30 Jun 2019 17:40:37 +0000 (19:40 +0200)]
avcodec/hevcdec: Fix memleak of a53_caption

Fixes: 15295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5675655187922944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavcodec/ttaenc: Fix undefined shift
Andreas Rheinhardt [Sun, 15 Sep 2019 20:01:20 +0000 (22:01 +0200)]
avcodec/ttaenc: Fix undefined shift

ttaenc contained (1 << unary) - 1 as an argument for a function
expecting an unsigned int. unary can be as big as 31 in this case.
The type of the shift and the whole expression is int, because 1 fits
into an integer, so that the behaviour is undefined if unary == 31
as the result of the shift can't be represented in an int §. Subtraction
by 1 (which makes the result of the whole expression representable in
an int) doesn't change that this is undefined (it usually leads to
signed integer overflow which is undefined, too).

The solution is simple: Make 1 unsigned to change the type of the
whole expression to unsigned int (as the function expects anyway).

Fixes ticket #8153.

§: This of course presupposes the common int range of -2^31..2^31-1

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agolavc/g729dec: Support decoding Sipro ACELP.KELVIN.
Carl Eugen Hoyos [Mon, 16 Sep 2019 18:57:53 +0000 (20:57 +0200)]
lavc/g729dec: Support decoding Sipro ACELP.KELVIN.

Fixes ticket #4799.
Analyzed-by: Aleksandr Ustinov
5 days agoavcodec/allcodecs: make libdav1d the preferred AV1 decoder
James Almer [Sun, 15 Sep 2019 14:29:56 +0000 (11:29 -0300)]
avcodec/allcodecs: make libdav1d the preferred AV1 decoder

It's considerably faster than libaom in most systems.

Reviewed-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com>
6 days agoavfilter/vf_v360: add slice threading to remap calculation
Paul B Mahol [Mon, 16 Sep 2019 16:41:51 +0000 (18:41 +0200)]
avfilter/vf_v360: add slice threading to remap calculation

6 days agoavfilter/vf_v360: refactor creation of remap data
Paul B Mahol [Mon, 16 Sep 2019 16:16:57 +0000 (18:16 +0200)]
avfilter/vf_v360: refactor creation of remap data

6 days agoavfilter/vf_v360: reverse order of remap for loops
Paul B Mahol [Mon, 16 Sep 2019 16:03:16 +0000 (18:03 +0200)]
avfilter/vf_v360: reverse order of remap for loops

6 days agoavfilter/vf_v360: simplify allocating remap data
Paul B Mahol [Mon, 16 Sep 2019 15:58:08 +0000 (17:58 +0200)]
avfilter/vf_v360: simplify allocating remap data

6 days agoavfilter/vf_v360: move some local variables to private filter context
Paul B Mahol [Mon, 16 Sep 2019 15:53:58 +0000 (17:53 +0200)]
avfilter/vf_v360: move some local variables to private filter context

6 days agoavfilter/vf_v360: rename r_tmp variables
Paul B Mahol [Mon, 16 Sep 2019 15:50:16 +0000 (17:50 +0200)]
avfilter/vf_v360: rename r_tmp variables

6 days agoavcodec/videotoolboxenc: warn user when output will use a different profile/level...
Rick Kern [Mon, 16 Sep 2019 13:02:02 +0000 (09:02 -0400)]
avcodec/videotoolboxenc: warn user when output will use a different profile/level than requested.

Signed-off-by: Rick Kern <kernrj@gmail.com>
6 days agoavcodec/videotoolboxenc: add H264 Extended profile and level
Limin Wang [Tue, 20 Aug 2019 11:04:29 +0000 (19:04 +0800)]
avcodec/videotoolboxenc: add H264 Extended profile and level

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
6 days agoavcodec/videotoolboxenc: fix encoding frame crash on iOS 11
sharpbai [Tue, 13 Aug 2019 06:18:21 +0000 (14:18 +0800)]
avcodec/videotoolboxenc: fix encoding frame crash on iOS 11

On iOS 11, encoding a frame may return error with log
"Error encoding frame 0", which means vtenc_output_callback
is called with status=0 and sample_buffer=NULL. Then the
encoding session will be crashed on next callback wether or not
closing the codec context.

Let us look through the link below introducing VTCompressionOutputCallback,

https://developer.apple.com/documentation/videotoolbox/vtcompressionoutputcallback?language=objc

"status=0" (noErr) means compression was successful.
"sampleBuffer=NULL" means the frame was dropped when compression
was successful (status=0) or compression was not successful (status!=0).

So we should not set AVERROR_EXTERNAL on "status=0" and "sample_buffer=NULL"
as it is not a error.

The fix is that we only set AVERROR_EXTERNAL with status value non zero.
When sample_buffer is NULL and status value is zero, we simply return
with no other operation.

This crash often occurs on iOS 11 for example encoding 720p@25fps.

Signed-off-by: sharpbai <sharpbai@gmail.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
6 days agoavfilter/vf_stereo3d: assert that out variable is valid
Paul B Mahol [Mon, 16 Sep 2019 09:45:28 +0000 (11:45 +0200)]
avfilter/vf_stereo3d: assert that out variable is valid

6 days agoavfilter/vf_stereo3d: merge same code in case branches
Paul B Mahol [Mon, 16 Sep 2019 09:41:50 +0000 (11:41 +0200)]
avfilter/vf_stereo3d: merge same code in case branches

6 days agoavfilter/vf_shuffleplanes: remove not needed line
Paul B Mahol [Mon, 16 Sep 2019 09:28:03 +0000 (11:28 +0200)]
avfilter/vf_shuffleplanes: remove not needed line

6 days agoavfilter/vf_ciescope: remove dead assignments
Paul B Mahol [Mon, 16 Sep 2019 09:22:16 +0000 (11:22 +0200)]
avfilter/vf_ciescope: remove dead assignments

6 days agoavfilter/window_func: clarify intention in dolph window calculation
Paul B Mahol [Mon, 16 Sep 2019 08:57:09 +0000 (10:57 +0200)]
avfilter/window_func: clarify intention in dolph window calculation

6 days agoavfilter/vf_v360: add missing av_assert0()
Paul B Mahol [Mon, 16 Sep 2019 08:40:47 +0000 (10:40 +0200)]
avfilter/vf_v360: add missing av_assert0()

6 days agoavfilter/vf_avgblur: remove dupe assignment
Paul B Mahol [Mon, 16 Sep 2019 08:31:05 +0000 (10:31 +0200)]
avfilter/vf_avgblur: remove dupe assignment

6 days agoavfilter/af_headphone: return on error immediately
Paul B Mahol [Mon, 16 Sep 2019 08:27:42 +0000 (10:27 +0200)]
avfilter/af_headphone: return on error immediately

6 days agoavfilter/x86/vf_360: add most of >8 depth asm
Paul B Mahol [Sun, 15 Sep 2019 16:13:26 +0000 (18:13 +0200)]
avfilter/x86/vf_360: add most of >8 depth asm

6 days agoavformat/vividas: Remove align offset which is always masked off
Michael Niedermayer [Sat, 31 Aug 2019 20:33:56 +0000 (22:33 +0200)]
avformat/vividas: Remove align offset which is always masked off

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavformat/vividas: remove dead assignment
Michael Niedermayer [Sat, 31 Aug 2019 20:32:32 +0000 (22:32 +0200)]
avformat/vividas: remove dead assignment

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavformat/cdxl: Fix integer overflow in intermediate
Michael Niedermayer [Fri, 30 Aug 2019 22:20:39 +0000 (00:20 +0200)]
avformat/cdxl: Fix integer overflow in intermediate

Fixes: signed integer overflow: 65535 * 65312 cannot be represented in type 'int'
Fixes: 16704/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6294115603447808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavcodec/cfhd: Check that cropped size is smaller than full
Michael Niedermayer [Thu, 29 Aug 2019 16:59:10 +0000 (18:59 +0200)]
avcodec/cfhd: Check that cropped size is smaller than full

Fixes: signed integer overflow: 57342 * 120830 cannot be represented in type 'int'
Fixes: 16426/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5758744817827840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
6 days agotools/target_dec_fuzzer: increase snows threshold
Michael Niedermayer [Thu, 29 Aug 2019 19:08:42 +0000 (21:08 +0200)]
tools/target_dec_fuzzer: increase snows threshold

snow allows creating large output from tiny input, like other
wavelet codecs

Fixes: Timeout (82sec -> 1.5sec)
Fixes: 9520/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6286612576075776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavcodec/hevcdec: repeat character in skiped
Michael Niedermayer [Wed, 28 Aug 2019 17:01:41 +0000 (19:01 +0200)]
avcodec/hevcdec: repeat character in skiped

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agorepeat an even number of characters in occured
Michael Niedermayer [Wed, 28 Aug 2019 17:04:42 +0000 (19:04 +0200)]
repeat an even number of characters in occured

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavformat/hcom: Tell the compiler about set but not read variables
Michael Niedermayer [Wed, 28 Aug 2019 17:07:23 +0000 (19:07 +0200)]
avformat/hcom: Tell the compiler about set but not read variables

This avoids 3 warnings

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agodoc/examples/decode_audio: Fix "warning: ISO C90 forbids mixed declarations and code"
Michael Niedermayer [Wed, 28 Aug 2019 17:09:46 +0000 (19:09 +0200)]
doc/examples/decode_audio: Fix "warning: ISO C90 forbids mixed declarations and code"

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agoavcodec/gdv: Replace assert() checking bitstream by if()
Michael Niedermayer [Wed, 28 Aug 2019 19:53:05 +0000 (21:53 +0200)]
avcodec/gdv: Replace assert() checking bitstream by if()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agolibavcodec/utils: Free threads on init failure
Michael Niedermayer [Tue, 27 Aug 2019 15:21:00 +0000 (17:21 +0200)]
libavcodec/utils: Free threads on init failure

Fixes: Multiple memleaks
Fixes: ffmpeg-memory-leak

Found-by: Francis Provencher <francis@protekresearchlab.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>