[FFmpeg-devel] [PATCH] Remove duplicated symbols from libswscale

Michael Niedermayer michaelni
Fri Feb 15 19:07:41 CET 2008


On Fri, Feb 15, 2008 at 08:20:31AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> >>> -static volatile uint64_t attribute_used __attribute__((aligned(8))) b5Dither;
> >>> -static volatile uint64_t attribute_used __attribute__((aligned(8))) g5Dither;
> >>> -static volatile uint64_t attribute_used __attribute__((aligned(8))) g6Dither;
> >>> -static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither;
> >>> +volatile DECLARE_ALIGNED(8, uint64_t attribute_used, b5Dither);
> >>> +volatile DECLARE_ALIGNED(8, uint64_t attribute_used, g5Dither);
> >>> +volatile DECLARE_ALIGNED(8, uint64_t attribute_used, g6Dither);
> >>> +volatile DECLARE_ALIGNED(8, uint64_t attribute_used, r5Dither);
> >> global symbols need either a ff_ or av_ prefix (ff_ in this case IMO)
> > 
> > I agree it should be ff_.
> 
> New patch attached.
[...]
> Index: libswscale/swscale.c
> ===================================================================
> --- libswscale/swscale.c	(Revision 25998)
> +++ libswscale/swscale.c	(Arbeitskopie)
> @@ -189,19 +189,14 @@
>  DECLARE_ASM_CONST(8, uint64_t, bm11111000)=0xFFFFFFFFFF000000LL;
>  DECLARE_ASM_CONST(8, uint64_t, bm01010101)=0x00FF00FF00FF00FFLL;
>  
> -static volatile uint64_t attribute_used __attribute__((aligned(8))) b5Dither;
> -static volatile uint64_t attribute_used __attribute__((aligned(8))) g5Dither;
> -static volatile uint64_t attribute_used __attribute__((aligned(8))) g6Dither;
> -static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither;
> +extern volatile uint64_t ff_b5Dither;
> +extern volatile uint64_t ff_g5Dither;
> +extern volatile uint64_t ff_g6Dither;
> +extern volatile uint64_t ff_r5Dither;
>  
> -DECLARE_ASM_CONST(8, uint64_t, dither4[2])={
> -        0x0103010301030103LL,
> -        0x0200020002000200LL,};
> +extern uint64_t ff_dither4[2];
> +extern uint64_t ff_dither8[2];

That stuff belongs into swscale_internal.h

[...]
> @@ -143,10 +143,10 @@
>          uint8_t *pv = src[2] + (y>>1)*srcStride[2];
>          long index= -h_size/2;
>  
> -        b5Dither= dither8[y&1];
> -        g6Dither= dither4[y&1];
> -        g5Dither= dither8[y&1];
> -        r5Dither= dither8[(y+1)&1];
> +        ff_b5Dither= ff_dither8[y&1];
> +        ff_g6Dither= ff_dither4[y&1];
> +        ff_g5Dither= ff_dither8[y&1];
> +        ff_r5Dither= ff_dither8[(y+1)&1];
>          /* this mmx assembly code deals with SINGLE scan line at a time, it convert 8
>             pixels in each iteration */
>          __asm__ __volatile__ (
> @@ -165,9 +165,9 @@
>  YUV2RGB
>  
>  #ifdef DITHER1XBPP
> -        "paddusb "MANGLE(b5Dither)", %%mm0;"
> -        "paddusb "MANGLE(g6Dither)", %%mm2;"
> -        "paddusb "MANGLE(r5Dither)", %%mm1;"
> +        "paddusb "MANGLE(ff_b5Dither)", %%mm0;"
> +        "paddusb "MANGLE(ff_g6Dither)", %%mm2;"
> +        "paddusb "MANGLE(ff_r5Dither)", %%mm1;"
>  #endif

It would be nice if you could fix the asm to use the dither variables 
in the SwsContext context, you have a register pointing to it anyway.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- 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/20080215/89508721/attachment.pgp>



More information about the ffmpeg-devel mailing list