[FFmpeg-devel] [PATCH] OpenEXR decoder rev-17

Jimmy Christensen jimmy
Sun Sep 13 17:58:48 CEST 2009


On 2009-09-08 19:57, Reimar D?ffinger wrote:
> On Tue, Sep 08, 2009 at 03:30:26PM +0200, Jimmy Christensen wrote:
>> +static inline uint16_t exr_flt2uint(uint32_t v)
>> +{
>> +    int exp = v>>  23;
>> +    if (v&  0x80000000)
>> +        return 0;
>> +    if (exp<= 127+7-24) // we would shift out all bits anyway
>> +        return 0;
>> +    if (exp>= 127)
>> +        return 0xffff;
>> +    v&= 0x007fffff;
>> +        return (v+(1<<23))>>  (127+7-exp);
>
> Indentation is off.

Thanks. Fixed in rev17.

> Also, if you use int32_t as type for v,
> you can remove the (v&  0x80000000) case, since exp will then be<  0
> for negative numbers (should be documented with a comment of course).

I would love to remove the line, but I have no idea on how to document 
this since you are alot more in to this. Perhaps you could write what I 
should put in? Or perhaps send in a patch after it's been approved?

Anyway here's the new patch

Again, thanks for the review.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenEXR-rev17.diff
Type: text/x-patch
Size: 20181 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090913/9c8c6966/attachment.bin>



More information about the ffmpeg-devel mailing list