[FFmpeg-devel] [PATCH] WMA Voice decoder

Reimar Döffinger Reimar.Doeffinger
Thu Jan 21 21:11:58 CET 2010


On Thu, Jan 21, 2010 at 02:59:15PM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, Jan 21, 2010 at 2:45 PM, Reimar D?ffinger
> <Reimar.Doeffinger at gmx.de> wrote:
> > That's going to be silly slow, you should use
> > y = x - 9 * MULH(477218589, x); // y = x % 9
> > (you could here add a "assert(y == x % 9);" to make sure there's no bug
> > while testing it).
> > y = y * 5 + 6;
> > Apart from that it should be identical.
> 
> Ah, I see, changed locally. I guess I could also change the top line
> (block_num * 1877) to MUL16(), would that be faster?

Somewhere I guess so. But it's not that important I guess.
Btw. while it will be slower on x86, the division by 9 can also be done as
7282 * i - ((i & 0xf000) >> 3)



More information about the ffmpeg-devel mailing list