summaryrefslogtreecommitdiff
path: root/libavcodec/qsv_internal.h
Commit message (Collapse)AuthorAgeFilesLines
* lavu/hwcontext_qsv: Update after adding support for VAAPI on WindowsSil Vilerino2023-04-241-3/+2
| | | | | | | | | | | | | - qsv_internal.h: Remove unnecessary include va_drm.h - qsv_internal.h: Enable AVCODEC_QSV_LINUX_SESSION_HANDLE on Linux/VA only - hwcontext_qsv.c: Do not allow child_device_type VAAPI for Windows until support is added, keep D3D11/DXVA2 as more prioritary defaults. Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/ Signed-off-by: Sil Vilerino <sivileri@microsoft.com> Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
* lavc/qsvdec: update HDR side data on output AVFrameHaihao Xiang2022-12-011-0/+6
| | | | | | | The SDK may provides HDR metadata for HDR streams via mfxExtBuffer attached on output mfxFrameSurface1 Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/qsvenc: enlarge the maximum number of ExtParam buffers on mfxEncodeCtrlHaihao Xiang2022-10-251-1/+1
| | | | | | | | | The next commit and other commits in future will use more ExtParam buffers. And combine 2 free functions into single one Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/qsv: specify Shift for each format tooHaihao Xiang2022-10-101-1/+1
| | | | Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/qsv: create mfx session using oneVPL for decoding/encodingHaihao Xiang2022-08-121-0/+1
| | | | | | | | If qsv hwdevice is available, use the mfxLoader handle in qsv hwdevice to create mfx session. Otherwise create mfx session with a new mfxLoader handle. This is in preparation for oneVPL support
* qsv: restrict OPAQUE memory to MFX_VERSION < 2.0Haihao Xiang2022-08-121-0/+1
| | | | | | | | OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsv: restrict user plugin to MFX_VERSION < 2.0Haihao Xiang2022-08-121-0/+2
| | | | | | | | User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsv: remove mfx/ prefix from mfx headersHaihao Xiang2022-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to CFLAGS when running 'configure --enable-libmfx' for old versions of libmfx, if so, mfx headers without mfx/ prefix can be included too. If libmfx comes without pkg-config support, we may do a small change to the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can find the mfx headers without mfx/ prefix After applying this change, we won't need to change #include for mfx headers when mfx headers are installed under a new directory. This is in preparation for oneVPL support (mfx headers in oneVPL are installed under vpl directory)
* libavcodec/qsvenc: add ROI support to qsv encoderWenbin Chen2022-06-171-0/+4
| | | | | | | | | Use The mfxEncoderCtrl parameter to enable ROI. Get side data "AVRegionOfInterest" and use it to configure "mfxExtEncoderROI" which is the MediaSDK's ROI configuration. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* libavcodec/qsvdec: Add more pixel format support to qsvdecWenbin Chen2022-04-061-0/+3
| | | | | | | | Qsv decoder only supports directly output nv12 and p010 to system memory. For other format, we need to download frame from qsv format to system memory. Now add other supported format to qsvdec. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* lavc/qsvdec: export AVFilmGrainParams side dataHaihao Xiang2022-01-291-0/+3
| | | | | | | When AV_CODEC_EXPORT_DATA_FILM_GRAIN is present, AV1 decoder should disable film grain application and export the corresponding side data Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/qsv: allow to add more parameter buffers to QSV frameHaihao Xiang2022-01-291-1/+7
| | | | Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec/qsvenc: Fix leak and crash when encoding H.264 due to A53_CCAndreas Rheinhardt2021-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | | Since commit 3bbe0c210b05fc6fbd7b1d4bbd8479db7f2cf957, the Payloads array of every QSVFrame leaks as soon as the frame is reused; the leak is small and not very noticeable, but if there is an attempt to use said array the ensuing crash is much more noticeable. This happens when encoding H.264 with A53 CC side data. Furthermore, if said array can not be allocated at all, an AVFrame leaks. Fix all of this by not allocating the array separately at all; put it in QSVFrame instead and restore the Payloads array upon reusing the frame. Finally, use av_freep() instead of av_free() to free the payload entries. Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/qsv: Make ff_qsv_map_error() staticAndreas Rheinhardt2021-09-081-5/+0
| | | | | | It is only an auxiliary function to ff_qsv_print_(error|warning)(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavcodec/qsv: enabling d3d11va support, added mfxhdlpairArtem Galin2021-09-081-1/+1
| | | | | | | | | Adding DX11 relevant device type checks and adjusting callbacks with proper MediaSDK pair type support. Extending structure for proper MediaSDK pair type support. Signed-off-by: Artem Galin <artem.galin@intel.com>
* avcodec/qsv: Remove unused ff_qsv_level_to_mfx()Andreas Rheinhardt2021-08-081-1/+0
| | | | | | Unused since 00d0a4aa9eda8553113e51556123c46648a5f31b. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/qsv: fix make checkheaders warningJun Zhao2020-06-141-0/+2
| | | | | | | | | | | | | make checkheaders will get warning as follow: In file included from libavcodec/qsv_internal.h.c:1: ./libavcodec/qsv_internal.h:24:5: warning: "CONFIG_VAAPI" is not defined, evaluates to 0 [-Wundef] 24 | #if CONFIG_VAAPI | ^~~~~~~~~~~~ include "config.h" to fix the warning Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/qsv: remove the unused funtion ff_qsv_profile_to_mfx()Zhong Li2019-12-291-1/+0
| | | | Signed-off-by: Zhong Li <zhongli_dev@126.com>
* lavc/qsvdec: Add GPU-accelerated memory copy supportLinjie Fu2019-10-091-3/+4
| | | | | | | | | | | | | | | | GPU copy enables or disables GPU accelerated copying between video and system memory. This may lead to a notable performance improvement. Memory must be sequent and aligned with 128x64. CMD: ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -c:v h264_qsv -gpu_copy on -i input.h264 -f null - or: ffmpeg -c:v h264_qsv -gpu_copy on -i input.h264 -f null - Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsv: add memory type messageZhong Li2019-09-261-0/+3
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsv: Fix MSDK initialization failure in system memory modeZhong Li2019-09-261-1/+27
| | | | | | | | | | | | MSDK does not create internal acceleration device on Linux, So MFXVideoCORE_SetHandle() is necessary. It has been added for ff_qsv_init_session_device(). But missed for ff_qsv_init_internal_session() due to commit 1f26a23 overwrited commit db89f45 Fix #7030 Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsv: make function qsv_map_fourcc() can be called externallyZhong Li2019-08-201-0/+2
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvdec: add function ff_qsv_map_picstruct()Zhong Li2019-08-201-0/+2
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvdec: fix hevc level incorrectly mapZhong Li2019-05-071-0/+1
| | | | | | libmfx hevc level defination is same as h264, not level_idc of SPEC. Signed-off-by: Zhong Li <zhong.li@intel.com>
* qsv: fix the dangerous macro definitionsZhong Li2019-03-281-2/+2
| | | | | Signed-off-by: Zhong Li <zhong.li@intel.com> Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
* Merge commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42'James Almer2018-04-131-0/+4
|\ | | | | | | | | | | | | * commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42': qsv: adding Multi Frame Encode support Merged-by: James Almer <jamrial@gmail.com>
| * qsv: adding Multi Frame Encode supportMaxym Dmytrychenko2018-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 '52ed83fa1a7f5170447eff6fad0b6c57119596e9'James Almer2018-04-131-0/+3
|\ \ | |/ | | | | | | | | | | * commit '52ed83fa1a7f5170447eff6fad0b6c57119596e9': lavc/qsvdec: expose frame pic_type and key_frame Merged-by: James Almer <jamrial@gmail.com>
| * lavc/qsvdec: expose frame pic_type and key_frameZhong Li2018-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently pict_type and key_frame are unset. Add an extra param to fetch the picture type from qsv decoder The judgement “key frame is equal to IDR frame” only suitable for H264. For HEVC, all IRAP frames are key frames, and other codecs have no IDR frame. Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
| * qsv: Add ability to create a session from a deviceMark Thompson2017-04-021-3/+6
| |
| * qsvdec: Pass the correct profile to libmfxMark Thompson2016-11-141-0/+1
| | | | | | | | | | | | | | | | | | This was correct for H.26[45], because libmfx uses the same values derived from profile_idc and the constraint_set flags, but it is wrong for other codecs. Also avoid passing FF_LEVEL_UNKNOWN (-99) as the level, as this is certainly invalid.
* | qsv: Add ability to create a session from a deviceMark Thompson2017-06-141-3/+6
| | | | | | | | (cherry picked from commit 4936a48b1e6fc2147599541f8b25f43a8a9d1f16)
* | Merge commit '4ab61cd983b539749bd621ea271624ddb5196a8e'Mark Thompson2017-03-301-1/+12
|\ \ | |/ | | | | | | | | | | * commit '4ab61cd983b539749bd621ea271624ddb5196a8e': qsv{enc,dec}: extend the internal frame allocator Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsv{enc,dec}: extend the internal frame allocatorAnton Khirnov2016-11-071-1/+12
| | | | | | | | | | | | | | Handle the internal frame requests, which is required by the HEVC encoding plugin. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit '00aeedd84105a17f414185bd33ecadebeddb3a27'Mark Thompson2017-03-301-2/+8
|\ \ | |/ | | | | | | | | | | * commit '00aeedd84105a17f414185bd33ecadebeddb3a27': qsv{dec,enc}: use a struct as a memory id with internal memory allocator Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsv{dec,enc}: use a struct as a memory id with internal memory allocatorAnton Khirnov2016-11-071-2/+8
| | | | | | | | | | | | | | This will allow implementing the allocator more fully, which is needed by the HEVC encoder plugin with video memory input. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit '404e51478ecad060249d5b9bee6ab39a8a9d8c1c'Mark Thompson2017-03-301-3/+2
|\ \ | |/ | | | | | | | | | | | | | | * commit '404e51478ecad060249d5b9bee6ab39a8a9d8c1c': qsv{dec,enc}: always use an internal mfxFrameSurface1 Minor fixups for differences in the QSV encoder because of a53cc. Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsv{dec,enc}: always use an internal mfxFrameSurface1Anton Khirnov2016-11-071-3/+2
| | | | | | | | | | | | | | | | For encoding, this avoids modifying the input surface, which we are not allowed to do. This will also be useful in the following commits. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
* | Merge commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4'Mark Thompson2017-03-121-0/+3
|\ \ | |/ | | | | | | | | | | * commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4': qsvenc: print warnings from encode/init Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsvenc: print warnings from encode/initAnton Khirnov2016-07-221-0/+3
| |
* | Merge commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49'Mark Thompson2017-03-121-1/+4
|\ \ | |/ | | | | | | | | | | * commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49': qsv: print more complete error messages Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsv: print more complete error messagesAnton Khirnov2016-07-221-1/+4
| | | | | | | | Include the libmfx error code and its description
* | Merge commit '536bb17e9659c5ed7576a218d4085cdd6d5742fa'Hendrik Leppkes2016-11-141-0/+2
|\ \ | |/ | | | | | | | | | | * commit '536bb17e9659c5ed7576a218d4085cdd6d5742fa': qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as well Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as wellAnton Khirnov2016-07-031-0/+2
| | | | | | | | | | | | | | Stop hardcoding NV12. Also, move this function to the shared code, it will be used by the encoder as well.
| * qsvdec: support getting the session from an AVHWFramesContextAnton Khirnov2016-06-211-0/+11
| |
* | qsv: Merge libav implementationMark Thompson2016-10-311-26/+14
| | | | | | | | | | | | | | Merged as-at libav 398f015, and therefore includes outstanding skipped merges 04b17ff and 130e1f1. All features not in libav are preserved, and no options change.
* | Merge commit '9c0bc1e980a99106d6749ec632f166b87275871e'Derek Buitenhuis2016-02-241-0/+2
|\ \ | |/ | | | | | | | | | | * commit '9c0bc1e980a99106d6749ec632f166b87275871e': qsv: add a missing #include Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * qsv: add a missing #includeAnton Khirnov2016-02-181-0/+2
| | | | | | | | Needed for enum AVCodecID
* | qsvenc: write a53 caption data to SEIWill Kelleher2015-11-301-0/+3
| | | | | | | | | | | | Signed-off-by: Will Kelleher <wkelleher@gogoair.com> Previous version reviewed-by: Ivan Uskov <ivan.uskov@nablet.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'f5c4d38c78347b09478e21a661befff4b2d44643'Michael Niedermayer2015-07-191-0/+2
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'f5c4d38c78347b09478e21a661befff4b2d44643': qsvdec: properly handle asynchronous decoding Conflicts: libavcodec/qsvdec.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>