[FFmpeg-cvslog] r29011 - in trunk/libswscale: swscale.c swscale_internal.h swscale_template.c

Reimar Döffinger Reimar.Doeffinger
Fri Mar 20 17:24:15 CET 2009


On Fri, Mar 20, 2009 at 03:15:14PM +0100, sdrik wrote:
> Author: sdrik
> Date: Fri Mar 20 15:15:14 2009
> New Revision: 29011
> 
> Log:
> Add alpha channel scaling

Breaking all Altivec and all x86 PIC builds in one commit is not something to aspire
to...

> @@ -1161,7 +1212,7 @@ static inline void RENAME(yuv2packedX)(S
>  #if HAVE_ALTIVEC
>      /* The following list of supported dstFormat values should
>         match what's found in the body of ff_yuv2packedX_altivec() */
> -    if (!(c->flags & SWS_BITEXACT) &&
> +    if (!(c->flags & SWS_BITEXACT) && !c->alpPixBuf
>         (c->dstFormat==PIX_FMT_ABGR  || c->dstFormat==PIX_FMT_BGRA  ||
>          c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 ||
>          c->dstFormat==PIX_FMT_RGBA  || c->dstFormat==PIX_FMT_ARGB))

Fixed.

> @@ -1191,6 +1242,49 @@ static inline void RENAME(yuv2packed2)(S
>          {
>              //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
>              case PIX_FMT_RGB32:
> +                if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
> +#if ARCH_X86_64
> +                    __asm__ volatile(
> +                    "mov        %4, %%"REG_b"               \n\t"
> +                    YSCALEYUV2RGB(%%REGBP, %5)
> +                    YSCALEYUV2RGB_YA(%%REGBP, %5, %6, %7)
> +                    "psraw                  $3, %%mm1       \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
> +                    "psraw                  $3, %%mm7       \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
> +                    "packuswb            %%mm7, %%mm1       \n\t"
> +                    WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
> +
> +                    :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
> +                    "a" (&c->redDither)
> +                    ,"r" (abuf0), "r" (abuf1)
> +                    : "%"REG_b, "%"REG_BP
> +                    );

When you write a special x86_64 version where you have 16 registers
available, what in the seven hells makes you use rbx, which is almost
guaranteed to have issues?
Fixed it, though I did not test it particularly thoroughly.




More information about the ffmpeg-cvslog mailing list