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

103451 Commits

Author SHA1 Message Date
Wu Jianhua
4041c1029b libavfilter/x86/vf_gblur: add localbuf and ff_horiz_slice_avx2/512()
We introduced a ff_horiz_slice_avx2/512() implemented on a new algorithm.
In a nutshell, the new algorithm does three things, gathering data from
8/16 rows, blurring data, and scattering data back to the image buffer.
Here we used a customized transpose 8x8/16x16 to avoid the huge overhead
brought by gather and scatter instructions, which is dependent on the
temporary buffer called localbuf added newly.

Performance data:
ff_horiz_slice_avx2(old): 109.89
ff_horiz_slice_avx2(new): 666.67
ff_horiz_slice_avx512: 1000

Co-authored-by: Cheng Yanfei <yanfei.cheng@intel.com>
Co-authored-by: Jin Jun <jun.i.jin@intel.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-08-29 19:58:33 +02:00
Wu Jianhua
0c54ab20c2 tests/checkasm/vf_gblur.c: add check_verti_slice() for unit test
Co-authored-by: Cheng Yanfei <yanfei.cheng@intel.com>
Co-authored-by: Jin Jun <jun.i.jin@intel.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-08-29 19:58:33 +02:00
Wu Jianhua
68a2722aee libavfilter/x86/vf_gblur: add ff_verti_slice_avx2/512()
The new vertical slice with AVX2/512 acceleration can significantly
improve the performance of Gaussian Filter 2D.

Performance data:
ff_verti_slice_c: 32.57
ff_verti_slice_avx2: 476.19
ff_verti_slice_avx512: 833.33

Co-authored-by: Cheng Yanfei <yanfei.cheng@intel.com>
Co-authored-by: Jin Jun <jun.i.jin@intel.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-08-29 19:58:33 +02:00
Wu Jianhua
4a5e24721c libavfilter/x86/vf_gblur: add ff_postscale_slice_avx512()
Co-authored-by: Cheng Yanfei <yanfei.cheng@intel.com>
Co-authored-by: Jin Jun <jun.i.jin@intel.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-08-29 19:58:33 +02:00
Anton Khirnov
fdc0bb78fe lavu/slicethread: return ENOSYS rather than EINVAL in the dummy func
EINVAL is the wrong error code here, since the arguments passed to the
function are valid. The error is that the function is not implemented in
the build, which corresponds to ENOSYS.
2021-08-29 18:45:04 +02:00
Anton Khirnov
ca32d0462c lavfi/vf_scale: remove the nb_slices option
It was intended for debugging only and has been superseded by the
standalone tool for testing sliced scaling.
2021-08-29 18:44:54 +02:00
Anton Khirnov
03f3680080 fate/pixfmt: test xyz12le 2021-08-29 18:44:46 +02:00
Anton Khirnov
bdc1bdf3f5 FATE: allow multithreaded filtering 2021-08-29 18:44:38 +02:00
Anton Khirnov
834b8ad8a3 ffmpeg_filter: do not override -filter_threads with -threads
When both -filter_threads and -threads are specified, the latter takes
effect. Since -threads is an encoder option and -filter_threads is a
filter option, it makes sense for the -filter_threads to take
precedence.
2021-08-29 18:44:09 +02:00
Anton Khirnov
4a0d918c9e ffmpeg: reset the dict iterator before use 2021-08-29 18:43:01 +02:00
Jan Ekström
2f0113be3f avcodec/libx264: add support for setting chroma sample location 2021-08-29 15:05:37 +03:00
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