[FFmpeg-devel] [RFC] DXVA2 decoding and FFmpeg

Hendrik Leppkes h.leppkes at gmail.com
Sat Jun 13 14:20:07 CEST 2015


On Thu, Jun 11, 2015 at 8:54 PM, wm4 <nfxjfg at googlemail.com> wrote:
> On Thu, 11 Jun 2015 17:24:45 +0200
> Stefano Sabatini <stefasab at gmail.com> wrote:
>
>> Next step would be the use of YASM, but I only want to test if the
>> general approach is fine (and if the API is not too specific). Also if
>> someone wants to step up and port it to YASM I'm all for it, since
>> ASM/YASM is far from being my area of expertise.
>
> Personally, I'd probably just
> 1. export the GPU memcpy function, and
> 2. export a function to copy AVFrames using this function

I concur. A basic optimized memcpy with specific constraints (ie.
requires aligned input/output, always copies in 16-byte chunks, so
in/out buffers need to be padded appropriately), to keep the required
ASM code simple.
These constraints are generally always fulfilled if you have a GPU
frame on the input, since they will have appropriate strides (and if
in question, we control allocation of the GPU surfaces as well), and
we control the output memory buffer anyway.

On top of that a convenience function that deals with pixel formats,
strides, planes, and whatnot, and then uses this function.
A generic C version of the basic copy function shouldn't be needed, we
could just use memcpy for that.. or a tiny wrapper that calls memcpy,
anyway.

- Hendrik


More information about the ffmpeg-devel mailing list