[FFmpeg-devel] [PATCH] swscale alpha channel support

Cédric Schieli cschieli
Sun Mar 1 23:14:06 CET 2009


2009/2/28 Michael Niedermayer <michaelni at gmx.at>:
> On Fri, Feb 27, 2009 at 11:30:25PM +0100, C?dric Schieli wrote:
>> 2009/2/27 Michael Niedermayer <michaelni at gmx.at>:
>> > On Fri, Feb 27, 2009 at 06:28:38PM +0100, C?dric Schieli wrote:
>> >> Hi all,
[...]
>> @@ -1213,6 +1213,7 @@
>> ? ? ?end = s + src_size/2;
>> ?#if HAVE_MMX
>> ? ? ?__asm__ volatile(PREFETCH" ? ?%0"::"m"(*s):"memory");
>> + ? ?__asm__ volatile("movq ?%0,%%mm6"::"m"(mask32a):"memory");
>> ? ? ?__asm__ volatile("pxor ? ?%%mm7,%%mm7 ? ?\n\t":::"memory");
>> ? ? ?mm_end = end - 3;
>> ? ? ?while (s < mm_end)
>> @@ -1245,6 +1246,8 @@
>> ? ? ? ? ?"psllq ? ? ? ?$16, %%mm5 ? ?\n\t"
>> ? ? ? ? ?"por ? ? ? ?%%mm4, %%mm3 ? ?\n\t"
>> ? ? ? ? ?"por ? ? ? ?%%mm5, %%mm3 ? ?\n\t"
>> + ? ? ? ?"por ? ? ? ?%%mm6, %%mm0 ? ?\n\t"
>> + ? ? ? ?"por ? ? ? ?%%mm6, %%mm3 ? ?\n\t"
>> ? ? ? ? ?MOVNTQ" ? ? %%mm0, ?%0 ? ? ?\n\t"
>> ? ? ? ? ?MOVNTQ" ? ? %%mm3, 8%0 ? ? ?\n\t"
>> ? ? ? ? ?:"=m"(*d)
>
> the code can be implemented with
> significantly fewer instructions (as shows in my previous review)
> and at the same time supporting alpha = 0xFF

Attached patch is a rewrite of rgb15to32 and rgb16to32 using fewer
instructions and setting alpha to 0xFF
Output of swscale-example remains the same

Regards,
C?dric Schieli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_rgb1516to32_rewrite.patch
Type: text/x-patch
Size: 4269 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090301/3f3df97d/attachment.bin>



More information about the ffmpeg-devel mailing list