[FFmpeg-devel] [PATCH] G722 decoder

Michael Niedermayer michaelni
Thu Mar 26 01:20:01 CET 2009


On Wed, Mar 25, 2009 at 03:20:18PM -0700, Kenan Gillet wrote:
>
> On Mar 25, 2009, at 2:39 PM, Michael Niedermayer wrote:
[...]
>> [...]
>>>>
>>>>
>>>> [...]
>>>>> +static int inline scale(const int log_factor, int shift) {
>>>>> +    const int wd1 = ilb[(log_factor >> 6) & 31];
>>>>> +    shift -= log_factor >> 11;
>>>>> +    return shift < 0 ? wd1 << (2-shift) : (wd1 >> shift) << 2;
>>>>
>>>> wd1 << (2-shift) : wd1 >> (shift-2)
>>>
>>> shift - 2 can be negative
>>
>> but can shift - 2  and 2-shift be both negative?
>>
>> (excluding INT_MIN)
>
> yes but i need the 2 lower bits cleared so for instance in the case where 
> shift =1
> only 1 lower bit would be cleared.

ahh ok then pick what you prefer

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090326/2cb71ecc/attachment.pgp>



More information about the ffmpeg-devel mailing list