[FFmpeg-devel] [PATCH] WMA Voice decoder

Ronald S. Bultje rsbultje
Mon Feb 1 03:36:58 CET 2010


Hi,

2010/1/30 M?ns Rullg?rd <mans at mansr.com>:
> "Ronald S. Bultje" <rsbultje at gmail.com> writes:
>>>> + ? ?s->min_pitch_val ? ?= ((int) ((ctx->sample_rate << 8) * 0.0025) + 50)
>>>> >> 8;
>>>> + ? ?s->max_pitch_val ? ?= ((int) ((ctx->sample_rate << 8) * 0.0185) + 50)
>>>> >> 8;
>>>
>>> I think this is better done with integer math
>>
>> I could, don't really have a strong opinion here. The binary uses
>> bit-truncation math here which I refuse to use out of principle (i.e.
>> int x int -> int64, then >> 20 ?and << 1). Divisions are slow.
>> Anything else we could use here? /= 400 and whatever for .0185?
>
> Division by a simple constant may well be faster than conversion to
> float, float division, and conversion back to integer. ?It probably
> depends on the compiler.

OK, changed the. Will attach new version later.

Ronald



More information about the ffmpeg-devel mailing list