[FFmpeg-devel] [PATCH 2/5] vp56rac: Replace /256 with >>8
Ronald S. Bultje
rsbultje
Tue Jun 15 16:25:43 CEST 2010
Hi,
On Tue, Jun 15, 2010 at 10:17 AM, Rafa?l Carr? <rafael.carre at gmail.com> wrote:
> On Tue, 15 Jun 2010 09:02:15 -0400
> David Conrad <lessen42 at gmail.com> wrote:
>> - ? ?unsigned int low = 1 + (((c->high - 1) * prob) / 256);
>> + ? ?unsigned int low = 1 + (((c->high - 1) * prob) >> 8);
>
> I thought decent compilers would optimize divisons/modulos using power
> of 2, at least gcc 4.0.3 does it at -O0
Only for unsigned. If c->high or prob is signed, the intermediate is
still signed.
Ronald
More information about the ffmpeg-devel
mailing list