summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_qsv.c
Commit message (Collapse)AuthorAge
* lavu/hwcontext_qsv: fix the memory leakLinjie Fu2019-07-30
| | | | | | | av_dict_free child_device_opts to fix the memory leak. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* hwcontext_qsv: Try to select a matching VAAPI device by defaultMark Thompson2019-06-02
| | | | | | | Tries to find a device backed by the i915 kernel driver and loads the iHD VAAPI driver to use with it. This reduces confusion on machines with multiple DRM devices and removes the surprising requirement to set the LIBVA_DRIVER_NAME environment variable to use libmfx at all.
* lavu/hwcontext_qsv: Fix the realign check for hwuploadLinjie Fu2019-04-30
| | | | | | | | | | Fix the aligned check in hwupload, input surface should be 16 aligned too. Partly fix #7830. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavu/hwcontext_qsv: Mark a pointer as const.Carl Eugen Hoyos2019-04-16
| | | | | Silences a warning: libavutil/hwcontext_qsv.c:912:15: warning: assignment discards 'const' qualifier from pointer target type
* lavu/qsv: allow surface size larger than requirementZhong Li2019-03-18
| | | | | | | Just like commit 6829a079444e10818a847e153121fb458cc5c0a8, surface size larger than requirement should not be treated as error. Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavu/qsv: make a copy as libmfx alignment requirement for uploadingZhong Li2018-10-11
| | | | | | | | | | | | | | Libmfx requires 16 bytes aligned input/output for uploading. Currently only output is 16 byte aligned and assigning same width/height to input with smaller buffer size actually, thus definitely will cause segment fault. Can reproduce with any 1080p nv12 rawvideo input: ffmpeg -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -f rawvideo -pix_fmt nv12 -s:v 1920x1080 -i 1080p_nv12.yuv -vf 'format=nv12,hwupload=extra_hw_frames=16,hwdownload,format=nv12' -an -y out_nv12.yuv It can fix #7418 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 '21733b39d0af5211d7b9f168ff3667ea86362e2b'Mark Thompson2018-10-06
|\ | | | | | | | | | | | | | | | | * commit '21733b39d0af5211d7b9f168ff3667ea86362e2b': lavu/qsv: fix a random hwupload failure regression Fixes CID #1439585. Merged-by: Mark Thompson <sw@jkqxz.net>
| * lavu/qsv: fix a random hwupload failure regressionZhong Li2018-10-03
| | | | | | | | | | | | | | | | Variable 'ret' hasn't been initialized,thus introducing a random hwupload failure regression due to qsv session uninitialized. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '642fd4769becc2f4827f8375a3d9e8edd2f5df77'James Almer2018-09-11
|\| | | | | | | | | | | | | * commit '642fd4769becc2f4827f8375a3d9e8edd2f5df77': qsvvpp: Perform full init only when needed Merged-by: James Almer <jamrial@gmail.com>
| * qsvvpp: Perform full init only when neededJoe Olivas2018-09-04
| | | | | | | | | | | | | | | | | | | | | | Removing unused VPP sessions by initializing only when used in order to help reduce CPU utilization. Thanks to Maxym for the guidance. Signed-off-by: Joe Olivas <joseph.k.olivas@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | 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 '86499771d1228d8303c8eb6509e20c0caaa02da5'James Almer2018-03-29
|\| | | | | | | | | | | | | * commit '86499771d1228d8303c8eb6509e20c0caaa02da5': qsv: align surface width/height to 16. Merged-by: James Almer <jamrial@gmail.com>
| * qsv: align surface width/height to 16.Ruiling Song2018-03-21
| | | | | | | | | | | | | | | | | | | | Per MediaSDK documentation, it requires width/height to 16 alignment. Without this patch, hwupload pipeline may fail if 16 alignment is not met. Although this patch also apply 16 alignment to qsv encoder/decoder, it will not bring any side-effect to them as they are already aligned. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '8ca39b855a7b0e4d9f726fa9d285bc8edcb953e6'Mark Thompson2018-03-05
|\| | | | | | | | | | | | | * commit '8ca39b855a7b0e4d9f726fa9d285bc8edcb953e6': qsv: Default PicStruct to progressive Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsv: Default PicStruct to progressiveRuiling Song2018-02-22
| | | | | | | | | | | | | | | | The PicStruct is required by MediaSDK, so give a default value. hwupload does not work without this. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * hwcontext: Perform usual initialisation on derived device contextsMark Thompson2018-02-11
| | | | | | | | | | The initialisation should be common. For libmfx, it was previously happening in the derivation function and this moves it out.
* | Merge commit 'e23190269fb6e8217d080918893641ba3e0e3556'Mark Thompson2018-01-16
|\| | | | | | | | | | | | | * commit 'e23190269fb6e8217d080918893641ba3e0e3556': lavu/qsv: add log message for libmfx version Merged-by: Mark Thompson <sw@jkqxz.net>
| * lavu/qsv: add log message for libmfx versionZhong Li2017-12-29
| | | | | | | | | | | | | | It is benefit to diagnose issues related to different libmfx version. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | lavu/qsv: remove unused variableZhong Li2017-11-20
| | | | | | | | | | | | | | Fixes build warning of "variable 's' is declared but not used" Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* | Merge commit 'ccbb31c14b766ef666ef2daa8c467e478183a957'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'ccbb31c14b766ef666ef2daa8c467e478183a957': qsv: Make sure the session is set with the latest version Merged-by: James Almer <jamrial@gmail.com>
| * qsv: Make sure the session is set with the latest versionLuca Barbato2017-09-27
| | | | | | | | It is needed to have the calls to MFXJoinSession succeed.
| * hwcontext_qsv: Implement mapping frames to the child device typeMark Thompson2017-04-30
| |
| * hwcontext_qsv: Implement mapping frames from the child device typeMark Thompson2017-04-30
| | | | | | | | Factorises out existing surface initialisation code to reuse.
| * hwcontext_qsv: Support derivation from child devicesMark Thompson2017-04-30
| |
* | hwcontext: Perform usual initialisation on derived device contextsMark Thompson2017-10-09
| | | | | | | | | | | | | | The initialisation should be common. For libmfx, it was previously happening in the derivation function and this moves it out. For VAAPI, it fixes some failures when deriving from a DRM device because this initialisation did not run.
* | hwcontext_qsv: Implement mapping frames to the child device typeMark Thompson2017-06-14
| | | | | | | | (cherry picked from commit e1c5d56b18b82e3fb42382b1b1f972e8b371fc38)
* | hwcontext_qsv: Implement mapping frames from the child device typeMark Thompson2017-06-14
| | | | | | | | | | | | Factorises out existing surface initialisation code to reuse. (cherry picked from commit eaa5e0710496db50fc164806e5f49eaaccc83bb5)
* | hwcontext_qsv: Support derivation from child devicesMark Thompson2017-06-14
| | | | | | | | (cherry picked from commit aa51bb3d2756ed912ee40645efccf5f4a9609696)
* | Merge commit 'e8bbacbf529049c401bfeea70d5e0b5d2c8b6de6'Mark Thompson2017-03-30
|\| | | | | | | | | | | | | * commit 'e8bbacbf529049c401bfeea70d5e0b5d2c8b6de6': hwcontext_qsv: support frame mapping Merged-by: Mark Thompson <sw@jkqxz.net>
| * hwcontext_qsv: support frame mappingAnton Khirnov2016-11-07
| | | | | | | | Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit '8ea15afbf2c1ec89b5d4bac1f0b8345e4b906a5d'Mark Thompson2017-03-30
|\| | | | | | | | | | | | | * commit '8ea15afbf2c1ec89b5d4bac1f0b8345e4b906a5d': hwcontext_qsv: transfer data through the child context when VPP fails Merged-by: Mark Thompson <sw@jkqxz.net>
| * hwcontext_qsv: transfer data through the child context when VPP failsAnton Khirnov2016-11-07
| | | | | | | | | | | | | | | | Uploading/downloading data through VPP may not work for some formats, in that case we can still try to call av_hwframe_transfer_data() on the child context. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit 'b91ce4860054430d3712deb0d9487cac2fcb7d68'Mark Thompson2017-03-30
|\| | | | | | | | | | | | | * commit 'b91ce4860054430d3712deb0d9487cac2fcb7d68': hwcontext_qsv: do not fail when download/upload VPP session creation fails Merged-by: Mark Thompson <sw@jkqxz.net>
| * hwcontext_qsv: do not fail when download/upload VPP session creation failsAnton Khirnov2016-11-07
| | | | | | | | | | | | | | Certain pixel formats (e.g. P8) might not be supported for download/upload through VPP operations, but can still be used otherwise. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit 'b115a35ea62b8f479b48d99a601f0e157517301e'Mark Thompson2017-03-30
|\| | | | | | | | | | | | | * commit 'b115a35ea62b8f479b48d99a601f0e157517301e': hwcontext_qsv: add support for the P8 format Merged-by: Mark Thompson <sw@jkqxz.net>
| * hwcontext_qsv: add support for the P8 formatAnton Khirnov2016-11-07
| | | | | | | | | | | | | | | | | | | | | | | | When using GPU surfaces with QSV, one needs to supply a frame allocator, which will be invoked to pass surface pools to libmfx. For encoding, this allocator gets invoked not only for the pool of input frames, but also for a separate pool of (apparently) reconstructed frames and another pool of MFX_FOURCC_P8, which on Windows needs to return D3DFMT_P8 D3D surfaces. Those are probably used to store the encoded bitstream on the GPU. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit 'd20c118975220a0256027d1c2410bade94b8534d'Hendrik Leppkes2016-11-14
|\| | | | | | | | | | | | | * commit 'd20c118975220a0256027d1c2410bade94b8534d': hwcontext_qsv: add support for p010 Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * hwcontext_qsv: add support for p010Anton Khirnov2016-07-03
| |
* | Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da'James Almer2016-09-28
|/ | | | | | | | | | | * commit '59e7361cc791e5103be1712dc59a2055f118d0da': hwcontext: add a QSV implementation Conflicts: doc/APIchanges libavutil/version.h Merged-by: James Almer <jamrial@gmail.com>
* hwcontext: add a QSV implementationAnton Khirnov2016-06-21