[Ffmpeg-devel] [RFC] Addition of JIT accelerated scaler for ARM into libswscale

Guillaume POIRIER poirierg
Tue Jan 23 00:12:49 CET 2007


On 1/22/07, Siarhei Siamashka <siarhei.siamashka at gmail.com> wrote:


> A natural solution for getting good scaler performance is to use JIT style
> dynamic code generation. I spent full two days on the last weekend and got
> some initial scaler implementation working (it is quite simple and
> straightforward and uses less than 300 lines of code):
> https://garage.maemo.org/plugins/scmsvn/viewcvs.php/trunk/libswscale_nokia770/?root=mplayer
> Its API is quite similar to libswscale, but a bit simplified. You need to
> initialize scaler context by providing source and destination resolution,
> and also quality level setting. Code for scaling of a horizontal line of
> pixels is dynamically generated on this stage. Once context is initialized,
> it can be used to scale planar YUV image data and get results in YUY2
> format.

I may sound like a rookie to ask this, but could you tell me what
dynamic code generation precisely allows to do that can't be done with
"straight code"?
Also, why (optimized) dynamic code can be faster that "straight code"?

I have never written a single line of such kind of code, so I'm
curious. Plus, modern CPUs (PPC, x86 at least) make it harder to
program efficient dynamic code, so I heard.
For instance, if I remember correctly, P4 flushes its trace cache
whenever code cache is written.... pretty un-efficient, isn't it?


More information about the ffmpeg-devel mailing list