[FFmpeg-devel] FASTDIV macro

Siarhei Siamashka siarhei.siamashka
Sun Nov 9 16:00:10 CET 2008


On Sunday 09 November 2008, Michael Niedermayer wrote:
> On Sun, Nov 09, 2008 at 04:00:15PM +0200, Siarhei Siamashka wrote:
[...]
> > Here is some very crude synthetic benchmarking program attached. Of
> > course it does not take into account possible cache misses on the table
> > access and also the fact that sometimes we may need to use expressions
> > like
> > "b==1 ? a : FASTDIV(a, b)".
>
> the b==1 special case can be avoided if you replace the >>32 by something
> out of 24..31 and adjust the table accordingly, in that respect its also
> possible to finetune the values so they have fewer bits set if this would
> be faster, and i think it is for some ARM ...

Shifting by 32 is faster than by 24..31, so this does not have much
practical value.

On the other hand, increasing the size of the table in order to extend the
range of acceptable input arguments may have sense. I have a patch for
ffvorbis which makes a bit more use of FASTDIV macro.

-- 
Best regards,
Siarhei Siamashka




More information about the ffmpeg-devel mailing list