summaryrefslogtreecommitdiff
path: root/libavfilter/qsvvpp.c
Commit message (Collapse)AuthorAge
* lavfi/qsvvpp: do not mix up FFmpeg and SDK error codeHaihao Xiang2021-08-09
| | | | | | | | 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>
* lavfi/qsvvpp: support async depthFei Wang2021-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Async depth will allow qsv filter cache few frames, and avoid force switch and end filter task frame by frame. This change will improve performance for some multi-task case, for example 1:N transcode( decode + vpp + encode) with all QSV plugins. Performance data test on my Coffee Lake Desktop(i7-8700K) by using the following 1:8 transcode test case improvement: 1. Fps improved from 55 to 130. 2. Render/Video usage improved from ~61%/~38% to ~100%/~70%.(Data get from intel_gpu_top) test CMD: ffmpeg -v verbose -init_hw_device qsv=hw:/dev/dri/renderD128 -filter_hw_device \ hw -hwaccel qsv -hwaccel_output_format qsv -c:v h264_qsv -i 1920x1080.264 \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - \ -vf 'vpp_qsv=w=1280:h=720:async_depth=4' -c:v h264_qsv -r:v 30 -preset 7 -g 33 -refs 2 -bf 3 -q 24 -f null - Signed-off-by: Fei Wang <fei.w.wang@intel.com> Reviewed-by: Linjie Fu <linjie.justin.fu@gmail.com> Signed-off-by: Zhong Li <zhongli_dev@126.com>
* qsv: dump more info in error, debug and verbose modeHaihao Xiang2021-01-23
| | | | | | | | Dump iopattern mode and the SDK error/warning desciptions for qsv based filters and iopattern mode for qsvenc Signed-off-by: Haihao Xiang <haihao.xiang@intel.com> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com
* lavf/qsv: Add functions to print mfx iopattern, warning and errorHaihao Xiang2021-01-23
| | | | | | | | It is a copy of the relevant part in lavc/qsv but use different function names to avoid multiple definition when linking lavc and lavf statically. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com
* lavf/qsvvpp: add P010 output format supportZhong Li2019-06-10
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavf/qsvvpp: add extra_hw_frames supportZhong Li2019-06-10
| | | | | | | | | | | | 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>
* lavf/qsvvpp: avoid the double-free when working in sys memory modeLinjie Fu2019-05-30
| | | | | | | | | | | | | | | | 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>
* lavu/hwcontext_qsv: Add support for AV_PIX_FMT_BGRA.Zhong Li2018-10-11
| | | | | | | | | | | | | | | | | RGB32(AV_PIX_FMT_BGRA on intel platforms) format may be used as overlay with alpha blending. So add AV_PIX_FMT_BGRA format support. One example of alpha blending overlay: ffmpeg -hwaccel qsv -c:v h264_qsv -i BA1_Sony_D.jsv -filter_complex 'movie=lena-rgba.png,hwupload=extra_hw_frames=16[a];[0:v][a]overlay_qsv=x=10:y=10' -c:v h264_qsv -y out.mp4 Rename RGB32 to be BGRA to make it clearer as Mark Thompson's suggestion. V2: Add P010 format support else will introduce HEVC 10bit encoding regression. Thanks for LinJie's discovery. Signed-off-by: Zhong Li <zhong.li@intel.com> Verified-by: Fu, Linjie <linjie.fu@intel.com>
* Merge commit 'e05e5920a4e1f1f15cc8a7c843159d519f6ec18e'James Almer2018-09-11
|\ | | | | | | | | | | | | * commit 'e05e5920a4e1f1f15cc8a7c843159d519f6ec18e': qsv: Error out if getting session handle failed in avfilter Merged-by: James Almer <jamrial@gmail.com>
| * qsv: Error out if getting session handle failed in avfilterZhong Li2018-08-23
| | | | | | | | | | | | | | | | | | Solve some issues found by an automated code scansion. Suppress the complain "variables 'handle' is used but maybe uninitialized". Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | lavf/qsv: clone the frame which may be managed by frameworkRuiling Song2018-04-21
| | | | | | | | | | | | | | | | | | | | For filters based on framesync, the input frame was managed by framesync, so we should not directly keep and destroy it, instead we make a clone of it here, or else double-free will occur. But for other filters not based on framesync, we still need to free the input frame inside filter_frame. Signed-off-by: Ruiling Song <ruiling.song@intel.com>
* | Merge commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42'James Almer2018-04-13
|\| | | | | | | | | | | | | * commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42': qsv: adding Multi Frame Encode support Merged-by: James Almer <jamrial@gmail.com>
| * qsv: adding Multi Frame Encode supportMaxym Dmytrychenko2018-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting from API 1.25 helps to improve performance of the simultaneous encode, 1:N scenario, like: ./avconv -y -hwaccel qsv -c:v h264_qsv -r 30000/1001 -i ~/bbb_sunflower_1080p_60fps_normal.mp4 -vframes 600 -an \ -filter_complex "split=2[s1][s2]; [s1]scale_qsv=1280:720[o1]; [s2]scale_qsv=960:540[o2]" \ -map [o1] -c:v h264_qsv -b:v 3200k -minrate 3200k -maxrate 3200k -f rawvideo /tmp/3200a.264 \ -map [o2] -c:v h264_qsv -b:v 1750k -minrate 1750k -maxrate 1750k -f rawvideo /tmp/1750a.264 Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
* | Merge commit 'ea25ccd1b2a980df8d43cc1f86a23e3c094090a6'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'ea25ccd1b2a980df8d43cc1f86a23e3c094090a6': qsv: Join the derived session to the parent Merged-by: James Almer <jamrial@gmail.com>
| * qsv: Join the derived session to the parentLuca Barbato2017-09-27
| | | | | | | | | | Should improve the performance on multiple transcoding from a single source.
* | Merge commit 'a5a6ac1a123a927e5bed984ed757a29b7ff87dab'James Almer2017-11-11
|/ | | | | | | | * commit 'a5a6ac1a123a927e5bed984ed757a29b7ff87dab': libavfilter/overlay_qsv: Add QSV overlay vpp filter libavfilter/vf_vpp: Add common filters of the qsv vpp Merged-by: James Almer <jamrial@gmail.com>
* libavfilter/overlay_qsv: Add QSV overlay vpp filterHuang, Zhengxu2017-09-17
The filter supports two inputs and (implicitly) scaling the second input during composition, unlike the software overlay. The code has been separated into common interface and qsv overlay implementation. The common part mainly creates the qsv session and manages the surface which is nearly the same for all qsv filters. So the qsvvpp.c/qsvvpp.h API can be used by other QSV vpp filters to reduce code redundancy. Usage: -hwaccel qsv -c:v mpeg2_qsv -r 25 -i in.m2v -hwaccel qsv -c:v h264_qsv -i in.h264 -filter_complex "overlay_qsv=eof_action=repeat:x=(W-w)/2:y=(H-h)/2" -b 2M -maxrate 3M -c:v h264_qsv -y out.h264 Two inputs should have different sizes otherwise one will be completely covered or you need to scale the second input as follows: -hwaccel qsv -c:v mpeg2_qsv -r 25 -i in.m2v -hwaccel qsv -c:v h264_qsv -i in.h264 -filter_complex "overlay_qsv=w=720:h=576:x=(W-w)/2:y=(H-h)/2" -b 2M -maxrate 3M -c:v h264_qsv -y out.h264 Signed-off-by: ChaoX A Liu <chaox.a.liu@gmail.com> Signed-off-by: Zhengxu Huang <zhengxu.maxwell@gmail.com> Signed-off-by: Andrew Zhang <huazh407@gmail.com> Change-Id: I5c381febb0af6e2f9622c54ba00490ab99d48297 Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>