[FFmpeg-devel] Why not integrate libyuv as a scale filter
Devin Heitmueller
dheitmueller at ltnglobal.com
Mon Jul 23 20:33:42 EEST 2018
> On Jul 23, 2018, at 1:16 PM, Nicolas George <george at nsup.org> wrote:
>
> Jeff (2018-07-23):
>> It seems like libyuv has better performace on scaling than libswscale.
>> So I'm wondering is there anyone has tried integrating libyuv as a
>> scale filter before. I mean link it as a 3rd party lib, and then call
>> it's API through a wrap filter. Just like how libavcodec use libx264.
>> If not, why? Is there any licensee issue? Effort worth pay on it?
>
> Finding out why it has better performance (figures?) and integrating the
> same optimizations would be more in line with the project policy, I
> think.
>
> Regards,
>
> --
> Nicolas George
Hello,
I’ve used libyuv in a couple of projects in the past. Nice little library and easy to bolt into an existing application when you need a quick scaling, colorspace conversion, or rotation in the most common YUV colorspaces found in decoders and graphics chipsets (e.g. stuff like NV12). It also has pretty good optimized assembly for ARM for common use cases, making it perform well on such platforms. Because it’s got a relatively simple API and build setup, it’s my “go to” library when my requirements are simple and I want to cross-compile for some embedded target.
That said, it takes a pretty simplistic approach to operations such as scaling and CSC, generally only providing a single scheme for each. You can probably get comparable performance from libswscale if you adjust the tuning parameters to match whatever scaling algorithm libyuv internally implements.
As Nicolas suggested, if you have some specific use case you can describe where libyuv significant outperforms libswscale, it would be great to see some numbers and discuss. It’s possible it has some optimized assembly worth looking closer at, but my gut reaction is that it’s likely just that libswscale’s defaults to a higher quality scaler (at the associated cost), and you can achieve comparable numbers as found in libyuv by tweaking the configuration.
Devin
---
Devin Heitmueller - LTN Global Communications
dheitmueller at ltnglobal.com
More information about the ffmpeg-devel
mailing list