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

103440 Commits

Author SHA1 Message Date
Paul Buxton
e07ada3dac avfilter: add grayworld video filter
Implements a gray world color correction algorithm
using a log scale LAB colorspace.

Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2021-08-29 13:31:37 +02:00
Paul B Mahol
02fcd485f9 avfilter/af_acrossover: check for rest of sample formats 2021-08-29 10:29:15 +02:00
Paul B Mahol
fdb4c03555 avfilter/vf_tpad: rescale EOF pts for case outlink time_base differs 2021-08-29 01:47:23 +02:00
Paul B Mahol
3b780e818a avfilter/af_crystalizer: refactor some code 2021-08-29 00:09:29 +02:00
Paul B Mahol
5f55467c0b avfilter/af_crystalizer: fix some minor issues
Do multiplications instead of divisions and use floats
where makes sense.
2021-08-29 00:09:29 +02:00
Paul B Mahol
5673a48425 avcodec/mlpdec: add flush support
Fixes spurious lossless check failures when seeking.
2021-08-29 00:09:29 +02:00
Michael Niedermayer
a4c98c507e avformat/avidec: Use 64bit for frame number in odml index parsing
Fixes: signed integer overflow: 1179337772 + 1392508928 cannot be represented in type 'int'
Fixes: 34088/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5846945303232512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-28 20:47:24 +02:00
Michael Niedermayer
104a8399ae avcodec/mjpegbdec: Skip SOS on AVDISCARD_ALL as does mjpeg
Fixes: NULL pointer dereference
Fixes: 36342/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-4579188072906752
Fixes: 36344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5049579300061184
Fixes: 36345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5301149845553152
Fixes: 36374/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-6056312352931840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-28 20:03:54 +02:00
Michael Niedermayer
909faca929 avcodec/mjpegdec: Check for bits left in mjpeg_decode_scan_progressive_ac()
Fixes: Timeout
Fixes: 36262/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-4969052454912000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-28 20:03:21 +02:00
maryam ebrahimzadeh
2c0d522963 avcodec/wmaprodec: return value check for init_get_bits
Also replace init_get_bits with init_get_bits8().
2021-08-28 19:18:45 +02:00
Paul B Mahol
8c1b65feb6 avfilter/af_afreqshift: do not forget to update coeffs at runtime 2021-08-28 18:52:08 +02:00
Paul B Mahol
1da2dd5c77 avfilter: add atilt filter 2021-08-28 18:51:04 +02:00
Paul B Mahol
b53a7d2d4d avfilter: add adecorrelate filter 2021-08-28 18:46:39 +02:00
Andreas Rheinhardt
0871273a2f avformat/flac_picture: Reindentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-28 15:25:18 +02:00
Andreas Rheinhardt
e304f5f758 avformat/flac_picture: Simplify parsing title
Don't allocate the buffer for the title ourselves, leave it to
av_dict_set(). This simplifies freeing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-28 15:25:18 +02:00
Andreas Rheinhardt
c1f4858242 avformat/flac_picture: Try to reuse buffer for attached picture
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-28 15:25:18 +02:00
Andreas Rheinhardt
b10a8a30db avformat/oggparsevorbis: Avoid tmp bufs when parsing VorbisComment
A single VorbisComment consists of a length field and a
non-NUL-terminated string of the form "key=value". Up until now,
when parsing such a VorbisComment, zero-terminated duplicates of
key and value would be created. This is wasteful if these duplicates
are freed shortly afterwards, as happens in particular in case of
attached pictures: In this case value is base64 encoded and only
needed to decode the actual data.

Therefore this commit changes this: The buffer is temporarily modified
so that both key and value are zero-terminated. Then the data is used
in-place and restored to its original state afterwards.

This requires that the buffer has at least one byte of padding. All
buffers currently have AV_INPUT_BUFFER_PADDING_SIZE bytes padding,
so this is ok.

Finally, this also fixes weird behaviour from ogm_chapter():
It sometimes freed given to it, leaving the caller with dangling
pointers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-28 15:25:18 +02:00
Andreas Rheinhardt
f1d89d6dd0 avformat/oggparsevorbis: Factor parsing a single VorbisComment out
This is in preparation for further commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-28 15:25:18 +02:00
Lynne
033105a739
h274: remove optimization pragma
This results in warnings on compilers which don't support it,
objections were raised during the review process about it but went unnoticed,
and the speed benefit is highly compiler and version specific, and
also not very critical.

We generally hand-write assembly to optimize loops like that, rather
than use compiler magic, and for 40% best case scenario, it's simply
not worth it.

Plus, tree vectorization is still problematic with GCC and disabled by default
for a good reason, so enabling it locally is sketchy.
2021-08-28 15:13:55 +02:00
Shubhanshu Saxena
1da524121c doc/filters.texi: Include dnn_processing in docs of sr and derain filter
Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-28 16:19:07 +08:00
Shubhanshu Saxena
660a205b05 lavfi/dnn: Rename InferenceItem to LastLevelTaskItem
This patch renames the InferenceItem to LastLevelTaskItem in the
three backends to avoid confusion among the meanings of these structs.

The following are the renames done in this patch:

1. extract_inference_from_task -> extract_lltask_from_task
2. InferenceItem -> LastLevelTaskItem
3. inference_queue -> lltask_queue
4. inference -> lltask
5. inference_count -> lltask_count

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-28 16:19:07 +08:00
Shubhanshu Saxena
1544d6fa0a libavfilter: Remove Async Flag from DNN Filter Side
Remove async flag from filter's perspective after the unification
of async and sync modes in the DNN backend.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-28 16:19:07 +08:00
Shubhanshu Saxena
70b4dca054 libavfilter: Remove synchronous functions from DNN filters
This commit removes the unused sync mode specific code from the DNN
filters since the sync and async mode are now unified from the
filters' perspective.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-28 16:19:07 +08:00
Shubhanshu Saxena
60b4d07cf6 libavfilter: Unify Execution Modes in DNN Filters
This commit unifies the async and sync mode from the DNN filters'
perspective. As of this commit, the Native backend only supports
synchronous execution mode.

Now the user can switch between async and sync mode by using the
'async' option in the backend_configs. The values can be 1 for
async and 0 for sync mode of execution.

This commit affects the following filters:
1. vf_dnn_classify
2. vf_dnn_detect
3. vf_dnn_processing
4. vf_sr
5. vf_derain

This commit also updates the filters vf_dnn_detect and vf_dnn_classify
to send only the input frame and send NULL as output frame instead of
input frame to the DNN backends.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-28 16:19:07 +08:00
Shubhanshu Saxena
d39580ac11 lavfi/dnn: Task-based Inference in Native Backend
This commit rearranges the code in Native Backend to use the TaskItem
for inference.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-28 16:19:07 +08:00
Jai Luthra
d91542e618 avfilter/signature: fix integer rounding cast precedence
Co-authored-by: Oscar <oscar_davids@outlook.com>
Signed-off-by: Jai Luthra <me@jailuthra.in>
2021-08-28 13:30:02 +05:30
Jan Ekström
9dd410c804 avfilter/vf_scale: reset color matrix in case of identity & non-RGB
Fixes passing through mismatching metadata from the input side
when RGB input (from f.ex. H.264 or HEVC) gets converted to YCbCr.

Fixes #9132
2021-08-28 01:20:09 +03:00
Andreas Rheinhardt
ffc00e5b16 avfilter/graphdump: Use pointer to const for pointer to static strings
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-27 18:17:07 +02:00
Andreas Rheinhardt
76ff9640be avfilter/graphdump: Don't return truncated string
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-27 18:17:04 +02:00
Andreas Rheinhardt
48348cd4ab avfilter/graphdump: Don't silently truncate channel layout string
64B are not enough any more.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-27 18:16:59 +02:00
Andreas Rheinhardt
daeef7d220 avfilter/graphdump: Properly initialize AVBPrint
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-27 18:16:35 +02:00
Andreas Rheinhardt
831718bbab avformat/movenc: Avoid calling strlen multiple times
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-27 10:47:35 +02:00
Andreas Rheinhardt
64020dfe08 avformat/vorbiscomment: Don't compute strlen twice
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-27 10:47:23 +02:00
Paul B Mahol
dc34bf45c5 avfilter/vf_colorcorrect: add median analyze mode 2021-08-27 10:04:04 +02:00
Paul B Mahol
0cacef58fa avfilter/vf_blend: use float for opacity calculations 2021-08-27 09:35:33 +02:00
Paul B Mahol
a6f00d4e82 avfilter/aeval: fix forgotten EOF case for activate
Bring fate test how it was previously.
2021-08-26 19:23:03 +02:00
maryam ebrahimzadeh
3e24e8108d avcodec/vc1dec: return value check for init_get_bits
As the second argument for init_get_bits(avctx and buf) can be crafted,
a return value check for this function call is necessary,
so replace init_get_bits with init_get_bits8 and add return value check.
2021-08-26 09:23:15 +02:00
Stéphane Cerveau
f9fbe2f9a9 avcodec/wmadec: handle run_level_decode error
Consider data as invalid if ff_wma_run_level_decode
gets out with an error.

It avoids an unpleasant sound distorsion.

See http://trac.ffmpeg.org/ticket/9358
2021-08-26 09:20:56 +02:00
Olivier Crête
521388edb7 avcodec/wma: Return specific error code
This way, the calling function can just forward it instead of
making it up.

Signed-off-by: Olivier Crête <olivier.crete@collabora.com>
2021-08-26 09:20:56 +02:00
Paul B Mahol
c1c7f2b61f avfilter/avf_showwaves: remove invalid multiplication by 2
Fixes output of average filter.
2021-08-26 09:16:35 +02:00
maryam ebrahimzadeh
ad88cce3f8 avcodec/vp6: return value check for init_get_bits
As the second argument for init_get_bits(buf) can be crafted,
a return value check for this function call is necessary.
Also replace init_get_bits with init_get_bits8.

Signed-off-by: Peter Ross <pross@xvid.org>
2021-08-26 17:06:57 +10:00
Andreas Rheinhardt
afeefb306e avcodec/bsf: Avoid allocation for AVBSFInternal
Do this by allocating AVBSFContext together with the data that is
currently in AVBSFInternal; or rather: Put AVBSFContext at the beginning
of a new structure called FFBSFContext (which encompasses more than just
the internal fields and is a proper context in its own right, hence the
name) and remove the AVBSFInternal altogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:54 +02:00
Andreas Rheinhardt
52bd399972 avformat/aviobuf: Use ffio_fill for padding
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:54 +02:00
Andreas Rheinhardt
f5f984c9c3 avformat/aviobuf: Avoid allocation when using dynamic buffer
This can be achieved by allocating the AVIOContext and
the dynamic buffer's opaque and internal write buffer together.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:54 +02:00
Andreas Rheinhardt
45bfe8b838 avformat/avio: Move internal AVIOContext fields to avio_internal.h
Currently AVIOContext's private fields are all over AVIOContext.
This commit moves them into a new structure in avio_internal.h instead.
Said structure contains the public AVIOContext as its first element
in order to avoid having to allocate a separate AVIOContextInternal
which is costly for those use cases where one just wants to access
an already existing buffer via the AVIOContext-API.
For these cases ffio_init_context() can't fail and always returned zero,
which was typically not checked. Therefore it has been made to not
return anything.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:54 +02:00
Andreas Rheinhardt
530ac6aa30 avformat/aviobuf: Make ffio_set_buf_size() static
Possible since 9c3adb7ce2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:54 +02:00
Andreas Rheinhardt
19093100fd avformat/utils: Move ffio_limit() to aviobuf
It is the more natural place for it given that it only deals with I/O;
in fact, the function already has the ffio prefix and its declaration
already is in avio_internal.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:53 +02:00
Andreas Rheinhardt
e75ab15fd4 avformat/matroskadec: Read RealAudio extradata directly
Don't use the avio-API to read a few bytes at fixed offsets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:53 +02:00
Andreas Rheinhardt
7cfff1512c avformat/aviobuf: Avoid calling function twice due to FFMAX()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:53 +02:00
Andreas Rheinhardt
81b6186920 avutil/log: Reorder elements of AVClass to make it smaller
Putting child_next besides child_class_iterate is actually nicer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-25 23:01:53 +02:00