Commit Graph

9283 Commits

Author SHA1 Message Date
Andreas Rheinhardt
1b20853fb3 avfilter/internal: Factor out executing a filter's execute_func
The current way of doing it involves writing the ctx parameter twice.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-15 21:33:25 +02:00
Paul B Mahol
32b56af6fb avfilter/vf_colorcorrect: add subsampling formats support 2021-08-15 20:16:49 +02:00
Paul B Mahol
efcee3fe0f avfilter/vf_colorcorrect: remove code touching Y component
It is not needed operation.
2021-08-15 20:16:49 +02:00
Paul B Mahol
83860a3d8c avfilter/avf_showspectrum: add unwrapped phase data mode 2021-08-15 17:01:11 +02:00
Nicolas George
85a6404d7e lavfi/formats: describe conversion in negotiation structure. 2021-08-14 09:17:45 +02:00
Nicolas George
86d3dd5627 lavfi/formats: put merge functions in structures.
It makes the code clearer and will allow adding new stages
of negotiation easier.
2021-08-14 09:17:45 +02:00
Andreas Rheinhardt
c44c03221d avfilter/vf_transpose_npp: Use correct array name
Fixes build failures since 18ec426a86.

Found-by: Gregory Beauregard
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-13 22:44:47 +02:00
Andreas Rheinhardt
18ec426a86 avfilter/formats: Factor common function combinations out
Several combinations of functions happen quite often in query_format
functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts))
is very common. This commit therefore adds functions that are equivalent
to commonly used function combinations in order to reduce code
duplication.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-13 17:36:22 +02:00
Andreas Rheinhardt
3dc6e4d602 avfilter/vf_scale: Avoid unnecessary indirection
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-12 15:25:43 +02:00
Andreas Rheinhardt
35b1f46d79 avfilter/avfilter: Use av_memdup where appropriate
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-11 16:49:20 +02:00
Paul B Mahol
c245963a21 avfilter/af_join: fix eof timestamps and blocking in many scenarios 2021-08-10 21:00:45 +02:00
Shubhanshu Saxena
2063745a93 lavfi/dnn: DNNAsyncExecModule Execution Failure Handling
This commit adds the case handling if the asynchronous execution
of a request fails by checking the exit status of the thread when
joining before starting another execution. On failure, it does the
cleanup as well.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
371e5672f3 lavfi/dnn_backend_tf: Error Handling for tf_create_inference_request
This commit includes the check for the case when the newly created
TFInferRequest is NULL.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
009b2e5b5e lavfi/dnn: Extract Common Parts from get_output functions
The frame allocation and filling the TaskItem with execution
parameters is common in the three backends. This commit shifts
this logic to dnn_backend_common.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
4d627acefa lavfi/dnn_backend_tf: Add TF_Status to TFRequestItem
Since requests are running in parallel, there is inconsistency in
the status of the execution. To resolve it, we avoid using mutex
as it would result in single TF_Session running at a time. So add
TF_Status to the TFRequestItem

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
a3db9b5405 lavfi/dnn_backend_tf: Error Handling for execute_model_tf
This patch adds error handling for cases where the execute_model_tf
fails, clears the used memory in the TFRequestItem and finally pushes
it back to the request queue.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
0985e9283c lavfi/dnn: Async Support for TensorFlow Backend
This commit enables async execution in the TensorFlow backend
and adds function to flush extra frames.

The async execution mechanism executes the TFInferRequests on
a separate thread which is joined before the next execution of
same TFRequestItem/while freeing the model.

The following is the comparison of this mechanism with the existing
sync mechanism on TensorFlow C API 2.5 CPU variant.

Async Mode: 4m32.846s
Sync Mode: 5m17.582s

The above was performed on super resolution filter using SRCNN model.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
e6ae8fc18e lavfi/dnn_backend_tf: TFInferRequest Execution and Documentation
This commit adds a function for execution of TFInferRequest and documentation
for functions related to TFInferRequest.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
c716578588 lavfi/dnn: Common Function to Get Async Result in DNN Backends
This commits refactors the get async result function for common
use in all three backends.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Shubhanshu Saxena
86f0a4f9de lavfi/dnn: Add Async Execution Mechanism and Documentation
This commit adds an async execution mechanism for common use
in the TensorFlow and Native backends.
This commit also adds the documentation of typedefs and functions in
the async module for common use in DNN backends.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-08-10 22:27:27 +08:00
Haihao Xiang
43aeeab764 lavfi/qsvvpp: do not mix up FFmpeg and SDK error code
The function ff_qsvvpp_filter_frame should return a FFmpeg error code if
there is an error. However it might return a SDK error code without this
patch.

Reviewed-by: Soft Works <softworkz@hotmail.com>
2021-08-09 22:57:05 -03:00
Andreas Rheinhardt
7fbf1f21ab avfilter/asrc_flite: Don't define an object by accident
The flite filter apparently only wanted to declare a struct,
but mistakenly also defined an unused and zero-initialized element
with external linkage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-08 18:40:45 +02:00
Andreas Rheinhardt
465ddcb600 avfilter/vf_vif: Make ff_compute_vif2 static
Only used here; the vif.h header can then be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-08 17:44:57 +02:00
Andreas Rheinhardt
71eb8f8fa9 avfilter/vf_vif: Fix mismatch in number of array elements
The function definition used float *data_buf[14], although there are
only 13 elements (and only 13 are used); the declaration used 13.
Given that the type will be converted to float **data_buf anyway,
this is not in violation of the C specs, but nevertheless a bug.

GCC 11 has a new warning for this -Warray-parameter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-08 17:44:57 +02:00
Paul B Mahol
7dfdc15a27 avfilter/avf_showspectrum: fix another case of frames queuing up 2021-08-08 16:56:17 +02:00
Paul B Mahol
6b11c12cf3 avfilter/avf_showspectrum: improve dBFS scale legend
Make it more intuitive looking and correct for non-log scaling.
Add option to set upper limit of input audio value in dBFS.
2021-08-07 13:08:48 +02:00
James Almer
83946906fb avfilter/vsrc_testsrc: add a return at the end of non-void functions
Fixes compilation with GCC 11 when configured with --disable-optimizations

Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-06 21:22:49 -03:00
James Almer
1cd43d8a5e avfilter/vf_showinfo: add support for H.274 Film Grain Characteristics frame side data
Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-06 09:56:44 -03:00
Andreas Rheinhardt
ef54590f83 avfilter/internal: Don't include libavcodec/(avcodec|internal).h
The reasons for including them don't exist any longer: ff_tlog() has
been moved to libavutil/internal.h and FF_QSCALE_TYPE_* has been moved
to qp_table.h.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-05 21:15:25 +02:00
Paul B Mahol
2678b4f81b avfilter/avf_showspectrum: add option to control dynamic range for colors 2021-08-05 21:11:40 +02:00
Andreas Rheinhardt
2b6e008577 avfilter/internal: Move ff_norm_qscale() to qp_table.h
It is the natural header for it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-05 19:59:00 +02:00
Andreas Rheinhardt
304cb08693 avfilter/avfilter: Remove unused partial_buf
It is unused since 02aa0701ae.
The corresponding size field is write-only since then.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-05 17:53:43 +02:00
Linjie Fu
9f14396a51 lavfi/vf_scale: use default swscale flags for scaler
Currently the default swscale flags for simple filter graph is bicubic,
however for complex filter graph it uses bilinear as decleared in scale
filter.

$ffmpeg -v verbose -i input.mp4 -vf format=yuv420p,scale=800x600 -an -f null -
[Parsed_scale_1 @ 0x7f86d2c160c0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x4

$ffmpeg -v verbose -i input.mp4 -filter_complex format=yuv420p,scale=800x600 -an -f null -
[Parsed_scale_1 @ 0x7f8779e046c0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x2

Use default swscale flags (bicubic currently) for scale filter.
- Remove flags="bilinear" from vf_scale
- Update the FATE refs

Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-08-05 22:23:49 +08:00
Paul B Mahol
9dbf95f209 avfilter/f_graphmonitor: use sample_count_in/out 2021-08-05 15:42:48 +02:00
Paul B Mahol
c317862c88 avfilter/avfilter: add sample_count_in and sample_count_out 2021-08-05 15:42:48 +02:00
Paul B Mahol
82123e133d avfilter/avf_showspectrum: add lreplace sliding mode 2021-08-04 22:42:44 +02:00
Paul B Mahol
b1388cd6c5 avfilter/avf_showspectrum: proper rational multiplication 2021-08-04 22:11:41 +02:00
Paul B Mahol
20ebcbd520 avfilter/avf_showspectrum: fix last frame/eof timestamp 2021-08-04 21:52:58 +02:00
Martin Storsjö
6d2365882f libavfilter: Fix implicit declarations of av_cpu_max_align
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-08-04 20:58:15 +03:00
Andreas Rheinhardt
cc6f6a1eef avfilter/vf_vpp_qsv: Don't overrun stack array
8b83dad825 added another potentially used
video enhancement filter without increasing a define for the number of
such options which is used as the size of stack array. This can lead to
a buffer overrun if all filters are used simultaneously. So increase
said number.

Fixes Coverity ticket #1489775.

Reviewed-by: Linjie Fu <linjie.justin.fu@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-04 12:50:37 +02:00
Paul B Mahol
3b298640e1 avfilter/af_afftfilt: make sure that tx buffers size are always aligned 2021-08-04 10:13:46 +02:00
Paul B Mahol
16b4331bd1 avfilter/avf_showspectrum: use proper function return value instead of hardcoded number 2021-08-04 10:09:39 +02:00
Paul B Mahol
b3117f376d avfilter/vaf_spectrumsynth: switch to TX FFT from avutil 2021-08-04 10:04:58 +02:00
Paul B Mahol
a428d2a487 avfilter/af_afftfilt: switch to TX FFT from avutil 2021-08-04 09:35:06 +02:00
Andreas Rheinhardt
6e66e2c321 avfilter/internal: Don't include framepool.h, thread.h
They are not used by the header at all and only used by very few files;
so include the headers in their users instead of in internal.h.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-04 03:03:25 +02:00
James Almer
e0b84d1069 avfilter/avfilter: use av_frame_copy() to copy frame data
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-03 18:41:31 -03:00
Fei Wang
8b83dad825 avfilter/vf_vpp_qsv: add scale mode option
The option allow user to set diffenent scaling mode from
auto/low-power/high-quality.

More details:
https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxExtVPPScaling

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-08-03 22:20:00 +08:00
Paul B Mahol
ae94868a57 avfilter/avf_showfreqs: switch to TX FFT from avutil 2021-07-30 09:44:51 +02:00
Paul B Mahol
0068b3d0f0 avfilter/avf_showcqt: switch to TX FFT from avutil 2021-07-27 21:16:28 +02:00
Paul B Mahol
925d41ebd4 avfilter/af_afftdn: switch to TX FFT from avutil 2021-07-27 20:48:40 +02:00