Hi,

On Tue, Apr 26, 2011 at 2:07 PM, Diego Biurrun <[email protected]> wrote:
> ---
>  libswscale/ppc/yuv2rgb_altivec.c  |  152 
> -------------------------------------

Leaving for Luca.

> diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
[..]
> @@ -593,7 +593,6 @@ static inline void planar2x_c(const uint8_t *src, uint8_t 
> *dst, long srcWidth,
>     }
>
>     // last line
> -#if 1
>     dst[0]= src[0];
>
>     for (x=0; x<srcWidth-1; x++) {
> @@ -601,12 +600,6 @@ static inline void planar2x_c(const uint8_t *src, 
> uint8_t *dst, long srcWidth,
>         dst[2*x+2]= (  src[x] + 3*src[x+1])>>2;
>     }
>     dst[2*srcWidth-1]= src[srcWidth-1];
> -#else
> -    for (x=0; x<srcWidth; x++) {
> -        dst[2*x+0]=
> -        dst[2*x+1]= src[x];
> -    }
> -#endif

OK.

> @@ -160,7 +160,6 @@ DECLARE_ALIGNED(8, const uint8_t, dither_8x8_73)[8][8]={
>  { 48,  30,  43,  25,  47,  29,  42,  24, },
>  };
>
> -#if 1
>  DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220)[8][8]={
>  {117,  62, 158, 103, 113,  58, 155, 100, },
>  { 34, 199,  21, 186,  31, 196,  17, 182, },
> @@ -171,43 +170,6 @@ DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220)[8][8]={
>  {138,  83, 124,  69, 148,  93, 134,  79, },
>  {  7, 172,  48, 213,   3, 168,  45, 210, },
>  };
> -#elif 1
> -// tries to correct a gamma of 1.5
> -DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220)[8][8]={
> -{  0, 143,  18, 200,   2, 156,  25, 215, },
> -{ 78,  28, 125,  64,  89,  36, 138,  74, },
> -{ 10, 180,   3, 161,  16, 195,   8, 175, },
> -{109,  51,  93,  38, 121,  60, 105,  47, },
> -{  1, 152,  23, 210,   0, 147,  20, 205, },
> -{ 85,  33, 134,  71,  81,  30, 130,  67, },
> -{ 14, 190,   6, 171,  12, 185,   5, 166, },
> -{117,  57, 101,  44, 113,  54,  97,  41, },
> -};
> -#elif 1
> -// tries to correct a gamma of 2.0
> -DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220)[8][8]={
> -{  0, 124,   8, 193,   0, 140,  12, 213, },
> -{ 55,  14, 104,  42,  66,  19, 119,  52, },
> -{  3, 168,   1, 145,   6, 187,   3, 162, },
> -{ 86,  31,  70,  21,  99,  39,  82,  28, },
> -{  0, 134,  11, 206,   0, 129,   9, 200, },
> -{ 62,  17, 114,  48,  58,  16, 109,  45, },
> -{  5, 181,   2, 157,   4, 175,   1, 151, },
> -{ 95,  36,  78,  26,  90,  34,  74,  24, },
> -};
> -#else
> -// tries to correct a gamma of 2.5
> -DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220)[8][8]={
> -{  0, 107,   3, 187,   0, 125,   6, 212, },
> -{ 39,   7,  86,  28,  49,  11, 102,  36, },
> -{  1, 158,   0, 131,   3, 180,   1, 151, },
> -{ 68,  19,  52,  12,  81,  25,  64,  17, },
> -{  0, 119,   5, 203,   0, 113,   4, 195, },
> -{ 45,   9,  96,  33,  42,   8,  91,  30, },
> -{  2, 172,   1, 144,   2, 165,   0, 137, },
> -{ 77,  23,  60,  15,  72,  21,  56,  14, },
> -};
> -#endif

Looks potentially useful. I'd leave it in for now.

> diff --git a/libswscale/x86/rgb2rgb_template.c 
> b/libswscale/x86/rgb2rgb_template.c
[..]
> @@ -290,7 +290,6 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, 
> uint8_t *dst, long src_
>     uint16_t *d = (uint16_t *)dst;
>     end = s + src_size;
>     mm_end = end - 15;
> -#if 1 //is faster only if multiplies are reasonably fast (FIXME figure out 
> on which CPUs this is faster, on Athlon it is slightly faster)
>     __asm__ volatile(
>         "movq           %3, %%mm5   \n\t"
>         "movq           %4, %%mm6   \n\t"

This looks like something where we might actually be able to gain. See
it as a FIXME (it even says so), so leave it.

> @@ -1564,17 +1480,10 @@ static inline void RENAME(planar2x)(const uint8_t 
> *src, uint8_t *dst, long srcWi
>             "punpckhbw              %%mm3, %%mm7    \n\t"
>             "punpcklbw              %%mm2, %%mm4    \n\t"
>             "punpckhbw              %%mm2, %%mm6    \n\t"
> -#if 1
>             MOVNTQ"                 %%mm5,  (%2, %%"REG_a", 2)  \n\t"
>             MOVNTQ"                 %%mm7, 8(%2, %%"REG_a", 2)  \n\t"
>             MOVNTQ"                 %%mm4,  (%3, %%"REG_a", 2)  \n\t"
>             MOVNTQ"                 %%mm6, 8(%3, %%"REG_a", 2)  \n\t"
> -#else
> -            "movq                   %%mm5,  (%2, %%"REG_a", 2)  \n\t"
> -            "movq                   %%mm7, 8(%2, %%"REG_a", 2)  \n\t"
> -            "movq                   %%mm4,  (%3, %%"REG_a", 2)  \n\t"
> -            "movq                   %%mm6, 8(%3, %%"REG_a", 2)  \n\t"
> -#endif
>             "add                       $8, %%"REG_a"            \n\t"
>             "movq       -1(%0, %%"REG_a"), %%mm4    \n\t"
>             "movq       -1(%1, %%"REG_a"), %%mm5    \n\t"
> @@ -1605,7 +1514,6 @@ static inline void RENAME(planar2x)(const uint8_t *src, 
> uint8_t *dst, long srcWi
>     }
>
>     // last line
> -#if 1
>     dst[0]= src[0];
>
>     for (x=0; x<srcWidth-1; x++) {
> @@ -1613,12 +1521,6 @@ static inline void RENAME(planar2x)(const uint8_t 
> *src, uint8_t *dst, long srcWi
>         dst[2*x+2]= (  src[x] + 3*src[x+1])>>2;
>     }
>     dst[2*srcWidth-1]= src[srcWidth-1];
> -#else
> -    for (x=0; x<srcWidth; x++) {
> -        dst[2*x+0]=
> -        dst[2*x+1]= src[x];
> -    }
> -#endif

OK.

> diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
> index 8ea41af..2b23930 100644
> --- a/libswscale/yuv2rgb.c
> +++ b/libswscale/yuv2rgb.c
> @@ -330,28 +330,6 @@ YUV2RGBFUNC(yuv2rgb_c_16, uint16_t, 0)
>     PUTRGB(dst_1,py_1,3);
>  CLOSEYUV2RGBFUNC(8)
>
> -#if 0 // Currently unused
> -// This is exactly the same code as yuv2rgb_c_32 except for the types of
> -// r, g, b, dst_1, dst_2
> -YUV2RGBFUNC(yuv2rgb_c_8, uint8_t, 0)
> -    LOADCHROMA(0);
> -    PUTRGB(dst_1,py_1,0);
> -    PUTRGB(dst_2,py_2,0);
> -
> -    LOADCHROMA(1);
> -    PUTRGB(dst_2,py_2,1);
> -    PUTRGB(dst_1,py_1,1);
> -
> -    LOADCHROMA(2);
> -    PUTRGB(dst_1,py_1,2);
> -    PUTRGB(dst_2,py_2,2);
> -
> -    LOADCHROMA(3);
> -    PUTRGB(dst_2,py_2,3);
> -    PUTRGB(dst_1,py_1,3);
> -CLOSEYUV2RGBFUNC(8)
> -#endif
> -
>  // r, g, b, dst_1, dst_2
>  YUV2RGBFUNC(yuv2rgb_c_12_ordered_dither, uint16_t, 0)
>     const uint8_t *d16 = dither_4x4_16[y&3];
> @@ -405,36 +383,6 @@ YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0)
>     PUTRGB8(dst_1,py_1,3,6);
>  CLOSEYUV2RGBFUNC(8)
>
> -#if 0 // Currently unused
> -// This is exactly the same code as yuv2rgb_c_32 except for the types of
> -// r, g, b, dst_1, dst_2
> -YUV2RGBFUNC(yuv2rgb_c_4, uint8_t, 0)
> -    int acc;
> -#define PUTRGB4(dst,src,i)          \
> -    Y = src[2*i];                   \
> -    acc = r[Y] + g[Y] + b[Y];       \
> -    Y = src[2*i+1];                 \
> -    acc |= (r[Y] + g[Y] + b[Y])<<4; \
> -    dst[i] = acc;
> -
> -    LOADCHROMA(0);
> -    PUTRGB4(dst_1,py_1,0);
> -    PUTRGB4(dst_2,py_2,0);
> -
> -    LOADCHROMA(1);
> -    PUTRGB4(dst_2,py_2,1);
> -    PUTRGB4(dst_1,py_1,1);
> -
> -    LOADCHROMA(2);
> -    PUTRGB4(dst_1,py_1,2);
> -    PUTRGB4(dst_2,py_2,2);
> -
> -    LOADCHROMA(3);
> -    PUTRGB4(dst_2,py_2,3);
> -    PUTRGB4(dst_1,py_1,3);
> -CLOSEYUV2RGBFUNC(4)
> -#endif
> -
>  YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0)
>     const uint8_t *d64 =  dither_8x8_73[y&7];
>     const uint8_t *d128 = dither_8x8_220[y&7];
> @@ -464,28 +412,6 @@ YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0)
>     PUTRGB4D(dst_1,py_1,3,6);
>  CLOSEYUV2RGBFUNC(4)
>
> -#if 0 // Currently unused
> -// This is exactly the same code as yuv2rgb_c_32 except for the types of
> -// r, g, b, dst_1, dst_2
> -YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t, 0)
> -    LOADCHROMA(0);
> -    PUTRGB(dst_1,py_1,0);
> -    PUTRGB(dst_2,py_2,0);
> -
> -    LOADCHROMA(1);
> -    PUTRGB(dst_2,py_2,1);
> -    PUTRGB(dst_1,py_1,1);
> -
> -    LOADCHROMA(2);
> -    PUTRGB(dst_1,py_1,2);
> -    PUTRGB(dst_2,py_2,2);
> -
> -    LOADCHROMA(3);
> -    PUTRGB(dst_2,py_2,3);
> -    PUTRGB(dst_1,py_1,3);
> -CLOSEYUV2RGBFUNC(8)
> -#endif
> -
>  YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0)
>     const uint8_t *d64 =  dither_8x8_73[y&7];
>     const uint8_t *d128 = dither_8x8_220[y&7];

OK.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to