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

Cédric Schieli cschieli
Thu Mar 5 09:25:51 CET 2009


2009/3/2 Michael Niedermayer <michaelni at gmx.at>:
> On Fri, Feb 27, 2009 at 11:30:25PM +0100, C?dric Schieli wrote:
> [...]
>
>> @@ -608,9 +635,15 @@
>> ? ? ? ? ?Y >>=10;\
>> ? ? ? ? ?U >>=10;\
>> ? ? ? ? ?V >>=10;\
>> + ? ? ? ?if (alpha){\
>> + ? ? ? ? ? ?A = 0;\
>> + ? ? ? ? ? ?for (j=0; j<lumFilterSize; j++)\
>> + ? ? ? ? ? ? ? ?A += alpSrc[j][i ? ? ] * lumFilter[j];\
>> + ? ? ? ? ? ?A >>=10;\
>> + ? ? ? ?}\
>>
>
> this does not look like its rounding to nearest

Why not ? This is the exact same code as for the luma plane. Or am I
missing something ?

[...]

>> @@ -1095,11 +1147,28 @@
>> ? ? ? ? ? ? ?switch(c->dstFormat)
>> ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ?case PIX_FMT_RGB32:
>> + ? ? ? ? ? ? ? ?if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
>> + ? ? ? ? ? ? ? ? ? ?YSCALEYUV2PACKEDX
>> + ? ? ? ? ? ? ? ? ? ?YSCALEYUV2RGBX
>> + ? ? ? ? ? ? ? ? ? ?"movq ? ? ? ? ? ? ? ? ? ? ?%%mm2, "U_TEMP"(%0) ?\n\t"
>> + ? ? ? ? ? ? ? ? ? ?"movq ? ? ? ? ? ? ? ? ? ? ?%%mm4, "V_TEMP"(%0) ?\n\t"
>> + ? ? ? ? ? ? ? ? ? ?"movq ? ? ? ? ? ? ? ? ? ? ?%%mm5, "Y_TEMP"(%0) ?\n\t"
>> + ? ? ? ? ? ? ? ? ? ?YSCALEYUV2PACKEDX_YA(ALP_MMX_FILTER_OFFSET)
>> + ? ? ? ? ? ? ? ? ? ?"psraw ? ? ? ? ? ? ? ? ? ? ? ?$3, %%mm1 ? ? ? ? \n\t"
>> + ? ? ? ? ? ? ? ? ? ?"psraw ? ? ? ? ? ? ? ? ? ? ? ?$3, %%mm7 ? ? ? ? \n\t"
>> + ? ? ? ? ? ? ? ? ? ?"packuswb ? ? ? ? ? ? ? ? ?%%mm7, %%mm1 ? ? ? ? \n\t"
>> + ? ? ? ? ? ? ? ? ? ?"movq ? ? ? ? ? ? ? "U_TEMP"(%0), %%mm2 ? ? ? ? \n\t"
>> + ? ? ? ? ? ? ? ? ? ?"movq ? ? ? ? ? ? ? "V_TEMP"(%0), %%mm4 ? ? ? ? \n\t"
>> + ? ? ? ? ? ? ? ? ? ?"movq ? ? ? ? ? ? ? "Y_TEMP"(%0), %%mm5 ? ? ? ? \n\t"
>
> it seems that YSCALEYUV2PACKEDX_YA could be changed to take teh registers as
> parameters to avoid the movq TEMP stuff ?
> also same applies to all other cases where its possible

Patch attached


Regards,
C?dric Schieli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_parametrized_yscaleyuv2packed.patch
Type: text/x-patch
Size: 2436 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090305/7017359e/attachment.bin>



More information about the ffmpeg-devel mailing list