[FFmpeg-devel] [PATCH] fix libswscale+altivec+-std=gnu99 compile

Guillaume POIRIER poirierg
Thu Jul 17 08:18:13 CEST 2008


Hello,

On Thu, Jul 17, 2008 at 1:05 AM, Alexander Strange
<astrange at ithinksw.com> wrote:

[..]

> It looks like having uncasted AVV() with 3.3 is problematic. And, even
> worse, it will compile altivec constants with the {} syntax, but if you
> leave out the cast it'll drop all but the first four members and write
> zeroes instead. It also breaks if you do:
> vector signed short a = (vector unsigned short)...
> which makes writing short macros harder.
>
> I can compile on ppc+gnu99 with apple gcc 3.3 and 4.2 with this patch. Does
> anyone else have problems with it?

+#define AVVBYTE(x...)  (const vector unsigned char)(x)
+#define AVVSHORT(x...) (const vector short)(x)
+#define AVVFLOAT(x...) (const vector float)(x)

For consistency reasons you need to have the sign part of the naming
scheme. I'd like to suggest 2 solutions:

either this:
+#define AVVUBYTE(x...)  (const vector unsigned char)(x)
+#define AVVSHORT(x...) (const vector short)(x)
+#define AVVFLOAT(x...) (const vector float)(x)

or:
+#define AVVU8(x...)  (const vector unsigned char)(x)
+#define AVVS16(x...) (const vector short)(x)
+#define AVVFLOAT(x...) (const vector float)(x)

I don't care which one is applied as long as it's consistent.

Guillaume
-- 
George Carlin  - "Electricity is really just organized lightning."




More information about the ffmpeg-devel mailing list