]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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.

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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 years 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 years 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 years agolavf/mpegts: Support demuxing AVS2.
hwrenx [Wed, 18 Sep 2019 00:18:13 +0000 (02:18 +0200)]
lavf/mpegts: Support demuxing AVS2.

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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()

4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years agotools/target_dec_fuzzer: Adjust motionpixels threshold
Michael Niedermayer [Sun, 25 Aug 2019 15:24:41 +0000 (17:24 +0200)]
tools/target_dec_fuzzer: Adjust motionpixels threshold

Fixes: Timeout (151sec -> 173ms)
Fixes: 16053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-5647069169057792
Fixes: 16053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-5108957126852608
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 agoavutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros.
gxw [Tue, 6 Aug 2019 11:11:16 +0000 (19:11 +0800)]
avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros.

Changing details as following:
1. The previous order of parameters are irregular and difficult to
   understand. Adjust the order of the parameters according to the
   rule: (RTYPE, input registers, input mask/input index/..., output registers).
   Most of the existing msa macros follow the rule.
2. Remove the redundant macro SLDI_Bn_0 and use SLDI_Bn instead.

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/videotoolboxdec: fix crop handling when multithreaded
Rodger Combs [Sat, 7 Sep 2019 03:31:06 +0000 (22:31 -0500)]
lavc/videotoolboxdec: fix crop handling when multithreaded

This was partially fixed by 233cd89, but it made changes to AVFrame fields
from within end_frame, which doesn't work consistently when multithreading
is enabled. This is what the post_process function is for.

Signed-off-by: Aman Gupta <aman@tmm1.net>
4 years agoavcodec/v4l2: fix compile with older videodev2.h
Aman Gupta [Fri, 13 Sep 2019 23:30:13 +0000 (16:30 -0700)]
avcodec/v4l2: fix compile with older videodev2.h

Some of these symbols are only defined in newer kernel releases.

Signed-off-by: Aman Gupta <aman@tmm1.net>
4 years agoavcodec/libdav1d: use the library default for the filmgrain option
James Almer [Sun, 15 Sep 2019 14:09:39 +0000 (11:09 -0300)]
avcodec/libdav1d: use the library default for the filmgrain option

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/rmdec.c: fix brackets around arguments
James Almer [Sun, 15 Sep 2019 14:04:33 +0000 (11:04 -0300)]
avformat/rmdec.c: fix brackets around arguments

Regression since 78f52b4fe3

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/rmdec.c: fix left shift of negative value in rm_sync()
James Almer [Sun, 15 Sep 2019 03:06:34 +0000 (00:06 -0300)]
avformat/rmdec.c: fix left shift of negative value in rm_sync()

Fixes ticket 8143.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_stereo3d: add tb (top-bottom) aliases
Paul B Mahol [Sun, 15 Sep 2019 08:50:12 +0000 (10:50 +0200)]
avfilter/vf_stereo3d: add tb (top-bottom) aliases

4 years agoavfilter/vf_v360: refactor dimensions and offsets calculations
Paul B Mahol [Sun, 15 Sep 2019 08:37:42 +0000 (10:37 +0200)]
avfilter/vf_v360: refactor dimensions and offsets calculations

4 years agodoc/filters: add another v360 example
Paul B Mahol [Sat, 14 Sep 2019 17:50:47 +0000 (19:50 +0200)]
doc/filters: add another v360 example