aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/d3d12va_decode.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/d3d12va_decode: remove extra spaces for declarationTong Wu2024-04-031-2/+2
| | | | Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/d3d12va_decode: fix different 'const' qualifiers warningTong Wu2024-02-081-1/+1
| | | | Signed-off-by: Tong Wu <tong1.wu@intel.com>
* lavc/d3d12va: Improve behaviour on missing decoder supportMark Thompson2024-02-041-4/+8
| | | | | | Distinguish between a decoder being entirely missing and a decoder which requires features which are not present in the incomplete implementation in libavcodec and therefore can't be used.
* avcodec/d3d12va_decode: check existance before assigning a new indexTong Wu2024-01-261-7/+7
| | | | | | | | | | | | | Fixes #10759. It can happen in H.264, MPEG2, VC1 that the current frame resource memory is already in ref_resource. For example, for a interlaced frame, the same curr memory is passed twice. For the second time it could possibly reference itself. When this happens the curr is already given an index and in ref_resources. When the reference frame index is required, we should check the existance in the ref_resources first before assigning a new index for it. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/d3d12va: remove unused variablesJames Almer2024-01-241-5/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/d3d12va_decode: don't change the resource state if the referenced ↵Wu Jianhua2024-01-051-6/+6
| | | | | | | | | | | | | | | | | | | | frame is the same as the current frame This commit removes the follow warning and error: D3D12 WARNING: ID3D12CommandList::ResourceBarrier: Called on the same subresource(s) of Resource(0x000002236E0E00D0:'Unnamed ID3D12Resource Object') in separate Barrier Descs which is inefficient and likely unintentional. Desc[0] and Desc[1] on (subresource : 4294967295). [RESOURCE_MANIPULATION WARNING #1008: RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS] D3D12 ERROR: ID3D12CommandList::ResourceBarrier: Before state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x000002236E0E00D0:'Unnamed ID3D12Resource Object') (subresource: 0) specified by transition barrier does not match with the state (0x20000: D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE) specified in the previous call to ResourceBarrier [RESOURCE_MANIPULATION ERROR #527: RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH] Tested-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
* avcodec/d3d12va_decode|dxva2: add a warning to replace assertionTong Wu2024-01-051-2/+1
| | | | | | | | Previous assertion was not useful. Now a warning is added to replace it. For get_surface_index, we should return a zero index in case the index is not found. But a warning is necessary to notify. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/d3d12va_decode: delete an empty line and fix a fuction alignmentTong Wu2024-01-051-2/+1
| | | | Signed-off-by: Tong Wu <tong1.wu@intel.com>
* d3d12va: Add a missing include for the declaration of ↵Martin Storsjö2023-12-211-0/+1
| | | | | | | | | | | | | ff_d3d12va_get_surface_index This fixes the following build error: src/libavcodec/d3d12va_decode.c:49:10: error: no previous prototype for function 'ff_d3d12va_get_surface_index' [-Werror,-Wmissing-prototypes] 49 | unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, | ^ Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec: add D3D12VA hardware accelerated H264 decodingWu Jianhua2023-12-211-0/+538
The implementation is based on: https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-video-overview With the Direct3D 12 video decoding support, we can render or process the decoded images by the pixel shaders or compute shaders directly without the extra copy overhead, which is beneficial especially if you are trying to render or post-process a 4K or 8K video. The command below is how to enable d3d12va: ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4 Signed-off-by: Wu Jianhua <toqsxw@outlook.com> Signed-off-by: Tong Wu <tong1.wu@intel.com>