[FFmpeg-devel] [PATCH] qtpalette: make the color_* variables unsigned again

Ganesh Ajjanagadde gajjanag at mit.edu
Tue Jan 12 05:51:01 CET 2016


On Mon, Jan 11, 2016 at 9:48 PM, Mats Peterson
<matsp888-at-yahoo.com at ffmpeg.org> wrote:
> On 01/12/2016 03:32 AM, Mats Peterson wrote:
>>
>> Valid question. Of course there's no problem using uint32_t, but in the
>> original code the variables are unsigned int... ask Andreas ;)
>
>
> Well, I'm to blame as well, since I have been using uint32_t for the a, r, g
> and b variables rather than unsigned int, since I thought they matched the
> uint32_t palette[] array better. Is that sensible enough?

Don't blame yourself; it is in fact a regression IMHO to change to
unsigned int, albeit a theoretical one. C only guarantees 16 bits for
int/unsigned int, you shift by 24 making it undefined behavior on 16
bit platforms. This is theoretical since POSIX guarantees 32 bits
here; FFmpeg does not support such 16 bit (likely embedded) platforms
anyway. But why change to something worse for no gain ;)?

>
>
> Mats
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list