[FFmpeg-devel] [PATCH] lavc/amfenc: DXVA2 textures support implementation by AMF encoder
sw at jkqxz.net
Sun Apr 22 18:49:05 EEST 2018
On 19/04/18 03:18, Song, Ruiling wrote:
>> Note that OpenCL <-> D3D11 won't work on AMD for normal video surfaces
>> (NV12) because there is no support for multiple-plane textures, so it's only going
>> to work with DXVA2 currently. Intel has an extension
>> ("cl_intel_d3d11_nv12_media_sharing") which adds a simple hack overloading
>> the subresource index and therefore it is usable on Intel GPUs, but other vendors
>> don't have that.
> For OpenCL NV12 support, I think we can use two separate images as arguments,
> one image for Y plane, and another image for UV plane.
> I think AMD OpenCL should support (CL_RG + CL_UNORM_INT8), right?
> So, we can get same behavior across different OpenCL vendors.
This is exactly what it does already, in a standard way with both DXVA2 and VAAPI - NV12 as R/UNORM_INT8 + RG/UNORM_INT8 is indeed usable for AMD on Windows with DXVA2 interop and via direct upload.
The problematic case is D3D11, because the standard cl_khr_d3d11_sharing extension does not support multiple-plane formats. I would prefer that AMD has an OpenCL-only extension to do it like Intel does, but an alternative route using AMF to do the mapping isn't horrible (though it would be quite confusing if it isn't transparent to the user).
More information about the ffmpeg-devel