[FFmpeg-devel] [PATCH] Fix 4XM decoding on big-endian and unaligned reads

Vitor Sessak vitor1001
Thu Nov 11 21:55:27 CET 2010


On 11/11/2010 09:37 PM, Reimar D?ffinger wrote:
> On Thu, Nov 11, 2010 at 09:31:51PM +0100, Vitor Sessak wrote:
>> +#define LE_CENTRIC_MUL(dst, src, scale, dc) \
>> +    { \
>> +        *((uint32_t *) (dst)) = AV_RL32(src) * (scale) + (dc); \
>> +    }
>
> Regardless of my other comment, using AV_WN32A would avoid any potential aliasing
> issues.

Thanks for the tip, I didn't know of AN_RN32A.

> Also if you already add {} to the macro you could go for the proper
> do { .. } while (0) (or remove the {}, I don't really care).

Is there any advantage for one or other way? I find it more readable 
without the do ... while(0).

-Vitor



More information about the ffmpeg-devel mailing list