1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

103862 Commits

Author SHA1 Message Date
Andreas Rheinhardt
386a4989df avutil/opt: Remove outdated version check
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-27 05:42:48 +02:00
Paul B Mahol
e2d40cd1d5 avfilter/vf_blend: add softdifference blend mode 2021-09-26 23:34:47 +02:00
Paul B Mahol
53f8a03123 avfilter/vf_colorchannelmixer: add extended preserve color support 2021-09-26 20:27:24 +02:00
Paul B Mahol
e4327f97b1 avfilter/vf_colorchannelmixer: simplify code a little 2021-09-26 20:27:24 +02:00
Paul B Mahol
34102f8c07 avfilter/vf_colorlevels: add preserve color option 2021-09-26 20:27:23 +02:00
Paul B Mahol
4727e30ec3 avfilter/vf_colorlevels: refactor code so all components are processed in same loop
This is also faster.
2021-09-26 20:27:23 +02:00
Soft Works
8983c3d7e4 avfilter/elbg: Extend filter to include alpha values in the quantization procedure
Usage example:

ffmpeg -y -loglevel verbose -i "..\fate-suite\apng\o_sample.png" -filter_complex "elbg=pal8=1:use_alpha=1" -frames:v 1 out.png

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:34:08 +02:00
Michael Niedermayer
0e45886e6e avcodec/apedec: Fix integer overflow in filter_fast_3320()
Fixes: signed integer overflow: 2145649668 + 3956526 cannot be represented in type 'int'
Fixes: 38351/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4647077926273024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:22:42 +02:00
Michael Niedermayer
8e67cfe15b tools/target_dec_fuzzer: Adjust threshold for WMV2
Fixes: Timeout
Fixes: 37737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-4923012999151616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:22:22 +02:00
Michael Niedermayer
451ceb5131 avformat/mov: Fix last mfra check
Fixes: signed integer overflow: 9223372036854775360 + 536870912 cannot be represented in type 'long'
Fixes: 37940/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6095637855207424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:22:18 +02:00
Michael Niedermayer
20afd3a63a avcodec/mxpegdec: Check for AVDISCARD_ALL
Fixes: Fixes NULL pointer dereference
Fixes: 36610/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6052641783283712
Fixes: 37907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-4725170850365440
Fixes: 37904/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6367889262247936
Fixes: 38085/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-5175270823297024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:22:08 +02:00
Michael Niedermayer
991b3deea9 avcodec/h274: fix bad left shifts
Fixes: left shift of negative value -3
Fixes: 37788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6024714540154880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:21:59 +02:00
Michael Niedermayer
5f835efbca avcodec/flicvideo: Check remaining bytes in FLI*COPY
Fixes: Timeout
Fixes: 37795/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-4846536543043584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:21:55 +02:00
Michael Niedermayer
018b611b4b avcodec/utils: ARGO writes 4x4 blocks without regard to the image dimensions
Fixes: out of array access
Fixes: 37197/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5877046382297088

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 17:21:40 +02:00
Manuel Stoeckl
32329397e2 swscale: add input/output support for X2BGR10LE
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Manuel Stoeckl
0760d9153c lavu/pix_fmt: add pixel format for x2bgr10
The new format (given in big/little endian forms) matches the
existing X2RGB10 format, except with B and R channels switched.

AV_PIX_FMT_X2BGR10 data often is created by OpenGL programs
whose buffers use the GL_RGB10 internal format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Manuel Stoeckl
ca594df622 swscale/yuv2rgb: fix conversion to X2RGB10
This resolves a problem where conversions from YUV to X2RGB10LE
would produce color values a factor 4 too small, because an 8-bit
value was placed in a 10-bit channel.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Andreas Rheinhardt
78ec2f3bd7 avcodec/internal: Update AVCodecInternal.is_copy documentation
Forgotten in 1f4cf92cfb.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:29 +02:00
Andreas Rheinhardt
b9fd9bce73 avcodec/avcodec: Simplify check for flushing of bsf
Just check for the existence of the bsf. This is equivalent to
the old criterion of the AVCodecContext being a decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:29 +02:00
Andreas Rheinhardt
29e23ac71d avcodec/avcodec: Remove redundant assert
It is now checked by FATE that no encoder capable of flushing
uses frame threads, so this now redundant runtime check can
be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:29 +02:00
Andreas Rheinhardt
d6176eeeec avcodec/tests/avcodec: Check codec caps for consistency
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:19 +02:00
Andreas Rheinhardt
482850992c avcodec/avcodec: Make sanity check stricter
If an AVCodec has a private class, its priv_data_size must be > 0
and at the end of a successful call to avcodec_open2()
the AVCodecContext's priv_data must exist and its first element
must be a pointer to said AVClass. This should not be conditional
on priv_data_size being > 0 (which is tested by FATE) or
on the private context having been successfully allocated
(which has to have happened at that point). So remove these
preconditions to make the test stricter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:19 +02:00
Andreas Rheinhardt
2b0f29507f avcodec/tests/avcodec: Sanity check AVCodec.priv_data_size
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:18 +02:00
Andreas Rheinhardt
5aac4b669a avcodec/j2kenc: Fix AV_OPT_TYPE_CONST offsets
They are supposed to be zero.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:18 +02:00
Andreas Rheinhardt
497c490a4e avcodec/tests/avcodec: Check consistency of function pointers
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:15 +02:00
Andreas Rheinhardt
d77798309f avcodec/tests/avcodec: Test AVCodec and AVCodecDescriptor consistency
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:01 +02:00
Andreas Rheinhardt
0d97317429 avcodec/tests/avcodec: Add basic sanity checks for AVCodec properties
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:03:56 +02:00
Andreas Rheinhardt
136865413c avcodec/tests/utils: Rename to avcodec
The current name comes from a time in which libavcodec/utils.c
contained the whole core of libavcodec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 12:56:08 +02:00
Andreas Rheinhardt
f348a967a3 avfilter/formats: Avoid reallocations for video in ff_all_formats()
Up until now, the list of pixfmts is reallocated every time an entry
is added to it; there are currently 196 pixel formats, so this matters:
It causes 5541704 calls to av_realloc_array() in a typical FATE run,
which is the majority for said function (8095768 calls) and even
a large chunk of the calls to av_realloc() itself (12589508 calls).

Fix this by using ff_formats_pixdesc_filter() instead.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 12:42:36 +02:00
Andreas Rheinhardt
99feb59cf7 avfilter/formats: Make ff_formats_pixdesc_filter return AVFilterFormats*
Up until now, it has returned the AVFilterFormats list via
an AVFilterFormats** parameter; the actual return value was an int
that was always AVERROR(ENOMEM) on error. The AVFilterFormats**
argument was a pure output parameter which was only documented
by naming the parameter rfmts. Yet nevertheless all callers
initialized the underlying AVFilterFormats* to NULL.

This commit changes this to return a pointer to AVFilterFormats
directly. This is more in line with the API in general, as it
allows to avoid checks for intermediate values.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 12:41:33 +02:00
Andreas Rheinhardt
aff855148a avfilter/vf_swaprect: Use ff_formats_pixdesc_filter()
Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 12:29:59 +02:00
Paul B Mahol
7b5df3b545 avfilter/vf_colorbalance: fix min/max check that can never be true
While here change doubles to floats.
2021-09-26 11:20:45 +02:00
Paul B Mahol
314ee127f3 avfilter/vf_selectivecolor: reduce number of operations with r/g/b/a pointers 2021-09-26 10:17:17 +02:00
Paul B Mahol
69f4fdd10d avfilter/vf_selectivecolor: refactor some repeating calculations 2021-09-26 10:17:17 +02:00
Andreas Rheinhardt
2b787ef766 avformat/dv: Set AVFMTCTX_NOHEADER flag
Audio streams are only added when a packet is read.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 08:51:58 +02:00
Andreas Rheinhardt
3022f74874 avformat/argo_asf: Use memcpy to copy string without its NUL
This avoids a -Wstringop-truncation warning from GCC which takes
issue with the fact that the destination might not be NUL-terminated.

Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 08:51:41 +02:00
Andreas Rheinhardt
2882286a08 avformat/jvdec: Make sizeof(JVFrame) smaller to save memory
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 01:43:18 +02:00
Maryla
9f4708c22d webp: fix transforms after a palette with pixel packing.
When a color indexing transform with 16 or fewer colors is used,
WebP uses "pixel packing", i.e. storing several pixels in one byte,
which virtually reduces the width of the image (see WebPContext's
reduced_width field). This reduced_width should always be used when
reading and applying subsequent transforms.

Updated patch with added fate test.
The source image dual_transform.webp can be downloaded by cloning
https://chromium.googlesource.com/webm/libwebp-test-data/

Fixes: 9368
Signed-off-by: James Zern <jzern@google.com>
2021-09-25 15:31:36 -07:00
Andreas Rheinhardt
0a6eed319d fate/subtitles: Add JACOsub remuxing test
This muxer was untested up until now; had it been tested, it would
have been obvious that it has been broken for years.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 23:26:38 +02:00
Andreas Rheinhardt
54e8dcce8e avformat/jacosubenc: Fix writing extradata
The terminating '\0' is no longer included in the size of
the extradata output by the demuxer since commit
36e61e24e7.
E.g. if one remuxes the JACOsub sample JACOsub_capability_tester.jss
from the FATE suite, one receives a file not recognized as JACOsub
before this patch.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 23:11:56 +02:00
Andreas Rheinhardt
9348d06fc6 avcodec/qsvenc: Remove dead code for user-provided buffers
Dead since commit 93016f5d1d
which ensured that the packets received by encoders are always blank.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 22:58:17 +02:00
Andreas Rheinhardt
dd0a7fdfc0 avcodec/qsvenc: Fix memleaks upon allocation errors
Fixes leaks in case the allocation of the H.264-specific stuff fails.
Fixes Coverity issues #1442911 and #1442914.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 22:58:17 +02:00
Zhao Zhili
44c64b103e swresample/aarch64: fix relocation out of range error
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-09-25 21:55:29 +03:00
Zhao Zhili
378ad2f8fd lavc/aarch64: fix relocation out of range error
Use a temporary label instead of global function symbol for b.gt.

Signed-off-by: Martin Storsjö <martin@martin.st>
2021-09-25 21:55:29 +03:00
Limin Wang
0463f5d6d5 avcodec/libsvtav1: Fix value range for rc mode
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:37:01 +08:00
Limin Wang
64e2fb3f9d avcodec/libsvtav1: make coded GOP type configurable
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:35:54 +08:00
Limin Wang
04b89e8ae3 avcodec/libsvtav1: Fix duplicate definition of caps_internal
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:35:40 +08:00
Paul B Mahol
d098e16f09 avfilter/vf_v360: refactor uf/vf scaling 2021-09-24 22:30:37 +02:00
James Almer
970264a74f avcodec/av1_parser: constify some variables
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-24 00:04:37 -03:00
Wenbin Chen
f2891fbded libavutil/hwcontext_qsv: fix a bug for mapping qsv frame to vaapi
Command below failed.
ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128
-init_hw_device qsv=qs@va -hwaccel qsv -hwaccel_device qs
-filter_hw_device va -c:v h264_qsv
-i 1080P.264 -vf "hwmap,format=vaapi" -c:v h264_vaapi output.264

Cause: Assign pair->first directly to data[3] in vaapi frame.
pair->first is *VASurfaceID while data[3] in vaapi frame is
VASurfaceID. I fix this line of code. Now the command above works.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2021-09-23 22:59:11 -03:00