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

Cédric Schieli cschieli
Fri Feb 27 18:28:38 CET 2009


Hi all,


Here is my complete patch set to bring alpha channel support in swscale.


#1 : sws_yuv2rgb_factorize.patch
Pre-factorize part of yuv420_rgb32 in yuv2rgb_template.c to prepare
for a yuva420_rgb32 function

#2 : avpicture_layout_yuva420p.patch
Fix avpicture_layout to not chroma shift the alpha plane when
outputting yuva420p (to be able to output with -f rawvideo -pix_fmt
yuva420p)

#3 : sws_treat_yuva420p_as_yuv420p.patch
Use (srcFormat==yuv420p) codepath for the (srcFormat=yuva420p) case in
various places where it is appropriate

#4 : sws_default_alpha_value.patch
When converting from a non alpha format to an alpha format, defaults
to all ones rather than all zeroes
This patch introduces some (small) differences in swscale-exemple
output for RGB32_1 and BGR32_1 (see swscale-example.log.diff) that I
can't reproduce manually

#5 : sws_configure_alpha.patch
Adds --enable-swscale-alpha configure option and a isALPHA macro

#6 : sws_yuva2rgb.patch
Unscaled yuva420p to rgb32 C/MMX converters

#7 : sws_scale_alpha.patch
Scale the alpha channel

#8 : sws_output_yuva420p.patch
Now that yuva420p can be scaled, it can be added to output supported format

#9 : swscale-example_use_alpha.patch
Also compute alpha channel differences in swscale-example


One remaining issue is a strange difference on x86_64 for some cases
(see swscale-example.x86_64.log.diff). After some debugging, it seems
it comes from #9. I'll invetigate more on this one.


Regards,
C?dric Schieli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_yuv2rgb_factorize.patch
Type: text/x-patch
Size: 4815 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avpicture_layout_yuva420p.patch
Type: text/x-patch
Size: 1003 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_treat_yuva420p_as_yuv420p.patch
Type: text/x-patch
Size: 1964 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_default_alpha_value.patch
Type: text/x-patch
Size: 15659 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_configure_alpha.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_yuva2rgb.patch
Type: text/x-patch
Size: 10527 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_scale_alpha.patch
Type: text/x-patch
Size: 53888 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws_output_yuva420p.patch
Type: text/x-patch
Size: 1989 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale-example_use_alpha.patch
Type: text/x-patch
Size: 5058 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale-example.log.diff
Type: text/x-patch
Size: 21772 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale-example.x86_64.log.diff.gz
Type: application/x-gzip
Size: 26954 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090227/f549bd49/attachment-0010.bin>



More information about the ffmpeg-devel mailing list