[FFmpeg-devel] Howto utilize GPU acceleration outside expected places?

martin schitter ms+git at mur.at
Fri Oct 11 02:32:58 EEST 2024



On 10.10.24 12:35, Anton Khirnov wrote:
> I have to wonder if it would actually help, given the overhead of
> copying the data to the GPU and back. Wouldn't it be more useful to
> write normal SIMD?

Yes -- that's indeed very good question!

I'm also not convinced that it will always show positive consequences 
for the actual processing performance, cause of the already mentioned 
upload/download requirements.

It's also very hard to examine this question by empiric means, because 
the wide range of possible hardware configurations and capabilities 
makes final answer resp. objective judgment nearly impossible.

Nevertheless, I think, solving this kind of tasks by compute shaders 
looks for nowadays developers more natural and intuitive than spending 
overly efforts on cryptic CPU based SIMD optimizations, although this 
other approach is still a valuable field of development.

How well it works in practice also depends on optimizations of the 
already established processing infrastructure, image data exchange 
pipeline and development advises available within the given framework.

One of the main reasons, why I'm interested in this kind of GPU 
utilization within ffmpeg, isn't so much performance related, but caused 
by the fact, that the available pixel formats defined by the vulkan hw 
acceleration subsystem look much more suitable and complete for high end 
video processing than their sws counterparts.

Well -- in fact it's more important that there is a minimal set of 
common pixel formats which are supported very well on either side and 
provide an optimized/efficient path for exchange between both worlds, 
but nearly lossless processing of floating point image data seems to fit 
much better into this other context.

Martin


More information about the ffmpeg-devel mailing list