[FFmpeg-devel] [PATCH] WMA Voice decoder
Thu Jan 21 19:52:13 CET 2010
On Thu, Jan 21, 2010 at 01:01:16PM -0500, Ronald S. Bultje wrote:
> >> + ? ?int y = (x % 9) * 5 + 6;
> > you can probably multiply x by some constant and >> (see FAST_DIV also)
> > to find x/9 and x - x/9*9 = x%9
> Using FASTDIV appears to give identical output, so changed also. Or
> did you mean you always want me to use the multiply/shift, even
> without CONFIG_FASTDIV?
I suspect that he means that FAST_DIV should be overkill for this
> ? (I use 16 and not 32 because otherwise tbl itself would need to be
> 64 bit also, which is silly.) should I use MULL()? Is there a faster
> way to multiply 2 32 bit ints and have them become 64?
MULH (includes a right-shift by 32 bits).
> Note that with this implementation, stddev changes by 0.01-0.07
> depending on which sample I test with, so it's not ideal... The weird
> thing is that that happens even when I use 32 instead of 16 (64-bit
> table) and then directly using ((uint64)x * tbl[..]) >> 32, so maybe
> my code is buggy?
Well, if you copy-pasted correctly, yes
FAST_DIV(x, 9) / 9
FAST_DIV(x, 9) * 9
More information about the ffmpeg-devel