summaryrefslogtreecommitdiffstats
path: root/libavcodec/dxva2.c
Commit message (Collapse)AuthorAgeFilesLines
* lavc: Add per-thread surfaces in get_hw_frame_parameters()Mark Thompson2018-02-111-4/+0
| | | | | | | | This number is definitely required when frame threading is enabled, so add it here rather than forcing all users to handle it themselves. DXVA2 contained this addition in specific code as well (therefore being added twice in the internal case) - just remove it from there.
* lavc: external hardware frame pool initializationwm42017-10-191-31/+24
| | | | | | | | | | | | This adds a new API, which allows the API user to query the required AVHWFramesContext parameters. This also reduces code duplication across the hwaccels by introducing ff_decode_get_hw_frames_ctx(), which uses the new API function. It takes care of initializing the hw_frames_ctx if needed, and does additional error handling and API usage checking. Support for VDA and Cuvid missing. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* dxva: DXVA2_ModeHEVC_VLD_Main10 does not support Mainwm42017-07-221-2/+1
| | | | | | | | This mode apparently does not support decoding of HEVC Main (8 bit). With D3D11 and Intel drivers on Windows 10 I get green corruption, while using DXVA2_ModeHEVC_VLD_Main works. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* dxva: verbose-log decoder GUID listwm42017-06-271-0/+47
| | | | | | Helpful for debugging. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dxva: support DXGI_FORMAT_420_OPAQUE decodingwm42017-06-271-2/+11
| | | | | | | | | | | | Some devices (some phones, apparently) will support only this opaque format. Of course this won't work with CLI, because copying data directly is not supported. Automatic frame allocation (setting AVCodecContext.hw_device_ctx) does not support this mode, even if it's the only supported mode. But since opaque surfaces are generally less useful, that's probably ok. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dxva: fix some warningswm42017-06-271-9/+7
| | | | | | | | | | Some existed since forever, some are new. The cast in get_surface() is silly, but unless we change the av_log function signature, or all callers of ff_dxva2_get_surface_index(), it's needed to remove the const warning. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dxva: add declarative profile checkswm42017-06-271-20/+44
| | | | | | | | | | | | | | | | | | | Make supported codec profiles part of each dxva_modes entry. Every DXVA2 mode is representative for a codec with a subset of supported profiles, so reflecting that in dxva_modes seems appropriate. In practice, this will more strictly check MPEG2 profiles, will stop relying on the surface format checks for selecting the correct HEVC profile, and remove the verbose messages for mismatching H264/HEVC profiles. Instead of the latter, it will now print the more nebulous "No decoder device for codec found" verbose message. This also respects AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH. Move the Main10 HEVC entry before the normal one to make this work better. Originally inspired by VLC's code. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-081-5/+658
| | | | | | | | | | This also adds support to avconv (which is trivial due to the new hwaccel API being generic enough). The new decoder setup code in dxva2.c is significantly based on work by Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* dxva: move d3d11 locking/unlocking to functionswm42017-06-081-18/+28
| | | | | | | | | I want to make it non-mandatory to set a mutex in the D3D11 device context, and replacing it with user callbacks seems like the best solution. This is preparation for it. Also makes the code slightly more readable. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* dxva: preparations for new hwaccel APIwm42017-06-081-12/+20
| | | | | | | | | | | | The actual hwaccel code will need to access an internal context instead of avctx->hwaccel_context, so add a new DXVA_CONTEXT() macro, that will dispatch between the "old" external and the new internal context. Also, the new API requires a new D3D11 pixfmt, so all places which check for the pixfmt need to be adjusted. Introduce a ff_dxva2_is_d3d11() function, which does the check. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* dxva2: get the slice number directly from the surface in D3D11VASteve Lhomme2017-01-121-7/+7
| | | | | | | | | No need to loop through the known surfaces, we'll use the requested surface anyway. The loop is only done for DXVA2. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* dxva2: Make ff_dxva2_get_surface() static and drop its name prefixSteve Lhomme2017-01-081-4/+4
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* dxva2: Adjust printf length modifiers where appropriateDiego Biurrun2016-11-291-5/+5
|
* dxva2: fix surface selection when compiled with both d3d11va and dxva2Hendrik Leppkes2016-11-071-1/+2
| | | | | | | Fixes a regression introduced in be630b1e08ebe8f766b1798accd6b8e5e096f5aa Signed-off-by: Anton Khirnov <anton@khirnov.net>
* d3d11va: Use the proper decoding slice indexSteve Lhomme2016-10-051-1/+10
| | | | | | | | | | | | The decoding buffer index expected by D3D11VA is the one from the ID3D11Texture2D not the one from the ID3D11VideoDecoderOutputView array in AVD3D11VAContext. Otherwise, when providing decoder slices that do not start from 0, pictures appear in bogus order. For an invalid index crashes and image corruption can occur. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* d3d11va: don't keep the context lock while waiting for a frameSteve Lhomme2016-07-111-3/+9
| | | | | | also fixes a deadlock found by Денис Кулаков <kudesnik33ra@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* d3d11va: WindowsPhone requires a mutex around ID3D11VideoContextSteve Lhomme2015-09-171-2/+13
|
* mpegvideo: Drop mpegvideo.h where not neededVittorio Giovara2015-09-131-1/+0
| | | | Add necessary headers in .c files.
* dxva2: Add ifdefs around structs that might not be availableMartin Storsjö2015-06-011-0/+4
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* D3D11va: add a Direct3D11 video decoder similar to DXVA2Steve Lhomme2015-05-251-31/+130
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dxva2: Directly use AVFramesMichael Niedermayer2014-04-011-6/+6
| | | | | | | The assumption of (MPEG) Picture and H264Picture layout matching might not hold true in the future. Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* dxva2: Use correct printf format stringsDiego Biurrun2014-01-211-6/+6
|
* dxva2: Add missing #includesDiego Biurrun2014-01-211-0/+8
|
* dxva2: Log errors verboselySam Lantinga2014-01-211-9/+18
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dxva2: Retry IDirectXVideoDecoder_BeginFrame()Sam Lantinga2014-01-211-6/+13
| | | | | | If the function returns E_PENDING retry for a fixed number of times. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* h264: deMpegEncContextizeAnton Khirnov2013-02-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the changes are just trivial are just trivial replacements of fields from MpegEncContext with equivalent fields in H264Context. Everything in h264* other than h264.c are those trivial changes. The nontrivial parts are: 1) extracting a simplified version of the frame management code from mpegvideo.c. We don't need last/next_picture anymore, since h264 uses its own more complex system already and those were set only to appease the mpegvideo parts. 2) some tables that need to be allocated/freed in appropriate places. 3) hwaccels -- mostly trivial replacements. for dxva, the draw_horiz_band() call is moved from ff_dxva2_common_end_frame() to per-codec end_frame() callbacks, because it's now different for h264 and MpegEncContext-based decoders. 4) svq3 -- it does not use h264 complex reference system, so I just added some very simplistic frame management instead and dropped the use of ff_h264_frame_start(). Because of this I also had to move some initialization code to svq3. Additional fixes for chroma format and bit depth changes by Janne Grunau <janne-libav@jannau.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mpegvideo: split ff_draw_horiz_band().Anton Khirnov2013-02-151-1/+1
| | | | Split out dependency on MpegEncContext.
* Replace memset(0) by zero initializations.Diego Biurrun2012-03-281-2/+1
| | | | Also remove one pointless zero initialization in rangecoder.c.
* cosmetics: Remove extra newlines at EOFAlex Converse2012-01-271-1/+0
|
* DxVA2: unbreak build after [657ccb5ac75ce34e62bd67f228d9bd36db72189e]Jean-Baptiste Kempf2011-07-101-1/+1
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Moved reusable functions from dxva2_h264.c to dxva2.cLaurent Aimar2010-01-231-0/+154
Originally committed as revision 21407 to svn://svn.ffmpeg.org/ffmpeg/trunk
OpenPOWER on IntegriCloud