On Tue, Mar 25, 2008 at 01:30:23PM +0100, Carl Eugen Hoyos
wrote:
> Hi!
>
> Attached is a patch that tries to get rid of b5Dither,
g5Dither, g6Dither
> and r5Dither from libswscale.
[...]
> Index: libswscale/swscale_internal.h
>
============================================================
=======
> --- libswscale/swscale_internal.h (Revision 26271)
> +++ libswscale/swscale_internal.h (Arbeitskopie)
>  -111,6 +111,7 
>
> #define RED_DITHER "0*8"
> #define GREEN_DITHER "1*8"
> +#define GREEN6_DITHER
"11*8+4*4*25*2+40"
> #define BLUE_DITHER "2*8"
The number does not seem correct
[...]
> Index: libswscale/yuv2rgb_template.c
>
============================================================
=======
> --- libswscale/yuv2rgb_template.c (Revision 26271)
> +++ libswscale/yuv2rgb_template.c (Arbeitskopie)
[...]
>  -143,10 +143,10 
> uint8_t *pv = src[2] +
(y>>1)*srcStride[2];
> long index= -h_size/2;
>
> - b5Dither= ff_dither8[y&1];
> - g6Dither= ff_dither4[y&1];
> - g5Dither= ff_dither8[y&1];
> - r5Dither= ff_dither8[(y+1)&1];
> + c->blueDither = ff_dither8[y&1];
> + c->green6Dither = ff_dither4[y&1];
> + c->greenDither = ff_dither8[y&1];
> + c->redDither = 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__ (
[...]
>  -238,10 +238,10 
> uint8_t *pv = src[2] +
(y>>1)*srcStride[2];
> long index= -h_size/2;
>
> - b5Dither= ff_dither8[y&1];
> - g6Dither= ff_dither4[y&1];
> - g5Dither= ff_dither8[y&1];
> - r5Dither= ff_dither8[(y+1)&1];
> + c->blueDither = ff_dither8[y&1];
> + c->green6Dither = ff_dither4[y&1];
> + c->greenDither = ff_dither8[y&1];
> + c->redDither = 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__ (
>  -254,9 +254,9 
As only 3 of the 4 are used there is no need to init all 3.
Which also means this code does not need 2 green dither vars
in the context
[...]
> #ifdef HAVE_MMX
> - b5Dither= ff_dither8[dstY&1];
> - g6Dither= ff_dither4[dstY&1];
> - g5Dither= ff_dither8[dstY&1];
> - r5Dither= ff_dither8[(dstY+1)&1];
> + c->blueDither = ff_dither8[dstY&1];
> + c->green6Dither = ff_dither4[dstY&1];
> + c->greenDither = ff_dither8[dstY&1];
> + c->redDither =
ff_dither8[(dstY+1)&1];
> #endif
A simple if(RGB16) could be used to avoid the introduction
of green6Dither
i think.
[...]
--
Michael GnuPG fingerprint:
9FF2128B147EF6730BADF133611EC787040B0FAB
Many that live deserve death. And some that die deserve
life. Can you give
it to them? Then do not be too eager to deal out death in
judgement. For
even the very wise cannot see all ends. -- Gandalf
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
|