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

7543 Commits

Author SHA1 Message Date
Zhong Li
dd662bbdd2 lavf/qsv_scale: add scaling modes support
low_power mode will use a fixed HW engine (SFC), thus can offload EU usage.
high quality mode will take EU usage (AVS sampler).

Performance and EU usage (Render usage) comparsion on Intel(R) Xeon(R) CPU E3-1225 v5 @ 3.30GHz:

High quality mode : ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal_2000frames.h264 \
-vf scale_qsv=w=1280:h=736:mode=hq -f null -
fps=389
RENDER usage: 28.10 (provided by MSDK metrics_monitor)

Low Power mode: ffmpeg -hwaccel qsv -c:v h264_qsv -i ~/bbb_sunflower_1080p_30fps_normal_2000frames.h264 \
-vf scale_qsv=w=1280:h=736:mode=low_power -f null -
fps=343
RENDER usage: 0.00

Low power mode (SFC) may be disabled if not supported by
MSDK/Driver/HW, and replaced by AVS mode interanlly.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-06-25 11:33:12 +08:00
Jun Zhao
ebcf4d354f lavfi/af_asetnsamples: Remove the redundant condition check
Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but
more clearly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-06-18 23:27:07 +08:00
Limin Wang
c9c1711f49 libavfilter/vf_blend.c: remove duplicate code with macro-defined function
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-06-14 13:37:45 +02:00
Limin Wang
24321b8751 libavfilter/vf_blend.c: remove duplicate code with same function
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-06-14 13:37:35 +02:00
Zhong Li
4208b428c4 lavf/qsv_vpp: add frame format option
1. Currently output format is hard-coded as NV12, thus means
   CSC is always done for not NV12 input such as P010.
   Follow original input format as default output.
2. Add an option to specify output format.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-06-14 10:27:33 +08:00
James Almer
b8f1542dcb avfilter/vf_gblur: add missing preprocessor check
Fixes compilation on x86_32

Signed-off-by: James Almer <jamrial@gmail.com>
2019-06-12 10:54:59 -03:00
Ruiling Song
83f9da7768 avfilter/vf_gblur: add x86 SIMD optimizations
The horizontal pass get ~2x performance with the patch
under single thread.

Tested overall performance using the command(avx2 enabled):
./ffmpeg -i 1080p.mp4 -vf gblur -f null /dev/null
./ffmpeg -i 1080p.mp4 -vf gblur=threads=1 -f null /dev/null
For single thread, the fps improves from 43 to 60, about 40%.
For multi-thread, the fps improves from 110 to 130, about 20%.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2019-06-12 08:53:11 +08:00
Limin Wang
5fc8d87ba6 libavfilter/vf_cover_rect.c: free the allocated frame
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-11 23:53:26 +02:00
Paul B Mahol
80e68ce116 avfilter/vf_normalize: fix filtering of RGB0 formats 2019-06-10 23:11:57 +02:00
Zhong Li
e62f625163 lavf/qsvvpp: add P010 output format support
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-06-10 13:48:41 +08:00
Zhong Li
ef56c28b25 lavf/qsvvpp: add extra_hw_frames support
extra_hw_frames is needed for some cases.
(eg: qsv decoding + qsv vpp + qsv look_ahead encoding, transcoding
 failed if no extra_hw_frames supported:
 ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal_2000frames.mp4 \
-vf vpp_qsv=w=1280:h=720:extra_hw_frames=100 -v verbose  -c:v h264_qsv \
-look_ahead 1 -look_ahead_depth 100 out1.mp4
)

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-06-10 13:48:06 +08:00
Paul B Mahol
a9bf656577 avfilter/vf_lut2: add slice threading 2019-06-09 14:07:00 +02:00
Mark Thompson
a53f9fde45 lavfi/vaapi: Fix build with libva 2.1 and 2.2
While the VAProcColorProperties structure was added in libva 2.1, the
colour primaries/transfer/space fields were not added until libva 2.3.
2019-06-07 21:15:29 +01:00
Xuewei Meng
78e1d7f421 libavfilter: Add derain filter
Remove the rain in the input image/video by applying the derain
methods based on convolutional neural networks. Training scripts
as well as scripts for model generation are provided in the
repository at https://github.com/XueweiMeng/derain_filter.git.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
2019-06-06 13:59:43 +08:00
Gyan Doshi
3be4490014 avfilter/framesync: fix shortest with eof_action=pass
Shifted check of shortest to after repeatlast,
to ensure shortest=1 is always honoured.
2019-06-06 10:19:14 +05:30
Paul B Mahol
d3f236b300 avilter/avf_showwaves: switch to activate in showwaves filter 2019-06-04 09:28:07 +02:00
Paul B Mahol
97ddc5d1f7 avfilter/af_anlmdn: add support for commands 2019-06-03 14:20:19 +02:00
Jun Zhao
0b7bfa8ad7 lavf/sr: Refine the coding style for init
We perfer the coding style like:

/* some stuff */
if (error) {
    /* error handling */
    return -(errorcode);
}
/* normal actions */
do_something()

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-06-03 13:04:23 +08:00
Jun Zhao
5c1fbc4239 lavf/sr: Don't need to check NULL before sws_freeContext
sws_freeContext have check the NULL pointer, so don't need to check
NULL before sws_freeContext.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-06-03 13:04:23 +08:00
Jun Zhao
51b0e81216 lavf/sr: Dump input pixel format in error message
Dump input pixel format in error message, it's will help to debugging

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-06-03 13:04:23 +08:00
Zhong Li
165eabf19b lavf/qsv: use av_cold for init/uninit
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-06-03 05:39:06 +08:00
Ruiling Song
94ceeba9f9 avfilter/vf_unsharp: enable slice threading
benchmarking with a simple command:
ffmpeg -i 1080p.mp4 -vf unsharp=la=3:ca=3 -an -f null /dev/null
with the patch, the fps increase from 50 to 120 on my local machine (i7-6770HQ).

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2019-06-03 10:49:57 +08:00
Jun Zhao
bbad0bc5ff lavfi/lut: Add slice threading support
Used the command for 1080p h264 clip as follow:

a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null
b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null

after enabled the slice threading, the fps change from:

a). 144fps to 258fps (lutyuv)
b). 94fps  to 153fps (lutrgb)

in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-06-03 09:38:28 +08:00
Jun Zhao
360bee8ca4 lavfi/colorlevels: Add slice threading support
Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevels -f null /dev/null

with 1080p h264 clip, the fps from 39 fps to 79 fps
in the local(Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz)

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-06-03 09:36:14 +08:00
Mark Thompson
ef2f89bbcc vf_scale_vaapi: Add options to configure output colour properties
The "out_color_matrix" and "out_range" properties match the same options
in vf_scale; the others attempt to follow the same pattern.
2019-06-02 17:30:41 +01:00
Mark Thompson
5051b7f898 lavfi/vaapi: Improve support for colour properties
Attempts to pick the set of supported colour properties best matching the
input.  Output is then set with the same values, except for the colour
matrix which may change when converting between RGB and YUV.
2019-06-02 17:30:41 +01:00
Mark Thompson
5fb9eb9ed2 vf_misc_vaapi: Add missing return value checks
Parameter buffer creation can fail.
2019-06-02 17:30:41 +01:00
Mark Thompson
6ed34a4379 lavfi/vaapi: Factorise out common code for parameter buffer setup
Also enables cropping on all VAAPI filters, inherited from the existing
support in scale_vaapi.
2019-06-02 17:30:41 +01:00
Mark Thompson
f1b359aaf5 vf_crop: Add support for cropping hardware frames
Set the cropping fields in the AVFrame.
2019-06-02 17:30:41 +01:00
Paul B Mahol
fcfe85220d avfilter/af_anlmdn: avoid creating frames with zero samples 2019-06-02 13:00:35 +02:00
Paul B Mahol
1a266a1ef9 avfilter/af_anlmdn: try to recover when cache becomes negative 2019-06-02 12:59:57 +02:00
Paul B Mahol
b535577465 avfilter/af_anlmdn: add smooth factor option 2019-06-02 11:58:49 +02:00
Paul B Mahol
cbaa60329a avfilter/vf_xmedian: remove limitation of only odd number of inputs 2019-06-02 11:07:46 +02:00
Carl Eugen Hoyos
d1b4ea2f61 lavfi/showspatial: Remove two write-only variables.
Fixes two warnings:
libavfilter/avf_showspatial.c:157:26: warning: variable ‘w’ set but not used
libavfilter/avf_showspatial.c:157:23: warning: variable ‘h’ set but not used
2019-05-31 22:30:46 +02:00
Paul B Mahol
b19550367f avfilter: add showspatial multimedia filter 2019-05-31 12:53:20 +02:00
Linjie Fu
6895b350c3 lavf/qsvvpp: avoid the double-free when working in sys memory mode
Currently, picref will be freed by calling av_frame_free(&picref) in
submit_frame() in qsvvpp.c when working in system memory mode,and normally it
is freed in filter_frame() in vf_vpp_qsv.c when working in other modes.

Double free happens when working in system memory mode, remove to
fix the memory issue.

Reproduce:
ffmpeg -init_hw_device qsv=foo -filter_hw_device foo -f rawvideo -pix_fmt nv12 -s:v 852x480 \
-i 852x480.nv12 -vf 'vpp_qsv=w=500:h=400' -f rawvideo -pix_fmt nv12 qsv.nv12

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-05-30 09:33:21 +08:00
Paul B Mahol
819ed1df94 avfilter/avf_aphasemeter: make use of av_rescale 2019-05-28 11:10:51 +02:00
Paul B Mahol
62c8707e2a avfilter/avf_showwaves: make use of av_rescale_q 2019-05-28 11:07:47 +02:00
Paul B Mahol
cd75396897 avfilter/avf_ahistogram: make use of av_rescale 2019-05-28 10:51:57 +02:00
Paul B Mahol
d2e76a1f96 avfilter/avf_showvolume: make use of av_rescale 2019-05-28 10:49:09 +02:00
Paul B Mahol
618f8bb0a4 avfilter/avf_abitscope: make use of av_rescale 2019-05-28 10:46:38 +02:00
Paul B Mahol
b16806b09d avfilter/avf_avectorscope: make use of av_rescale 2019-05-28 10:43:25 +02:00
Jun Zhao
9b069eb14e lavfi/sr: Change the backend type from flags to int
native and tensorflow is exclusive, so change the type from
flags to int.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-28 09:13:36 +08:00
Jun Zhao
b983e71bde lavfi/sr: Remove slice thread flag
sr didn't enable the slice threading, so remove the flag

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-28 09:13:36 +08:00
Paul B Mahol
5ddaedcaec avfilter/avf_showvolume: switch to activate 2019-05-27 18:44:19 +02:00
Paul B Mahol
293489d835 avfilter/af_superequalizer: switch to activate 2019-05-27 17:36:30 +02:00
Paul B Mahol
fc0de1c04b avfilter/avf_showfreqs: switch to activate 2019-05-26 17:11:17 +02:00
Marton Balint
1eb54323c8 avfilter/f_loop: warn about unset loop sizes
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-05-24 21:39:07 +02:00
Marton Balint
87e0247a6c avfilter/f_loop: fix video loop issues with 0 size or when size is bigger than input
Fixes infinte loop with -vf loop=loop=1 and also fixes looping when the input
is less frames than the specified loop size.

Possible regressions since ef1aadffc7.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-05-24 21:39:07 +02:00
Josh Allmann
4cfc34d9a8 avfilter/vf_scale_cuda: reset frame size after acquiring from hwframe
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-05-24 19:03:34 +02:00