On Tue, Sep 04, 2012 at 08:06:18AM -0400, Derek Buitenhuis wrote:
> On 03/09/2012 12:26 PM, Alberto Delmás wrote:
> > Subject: [PATCH 2/2] mss12 and mss2: Avoid unnecessary division and loop
> 
> If you can confirm the output to be bit-exact, then I suppose it is OK.
> 
> However, I still am not really clear on what exactly is going on in
> this patch... perhaps you can add it to the commit message.

First thing looks equally WTFy to me. One can easily replace
    int bit   = (((c->value - c->low) << 1) + 1) / range;

with

    int bit   = (((c->value - c->low) << 1) + 1) >= range;

But further simplifying that way is not obvious.

The second part is obvious

sum_{k=0}^{N} 2^k = 2^{k+1} - 1

That's simple geometric progression after all.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to