[Ffmpeg-devel] Removing img_format dependency from swscale

Luca Abeni lucabe72
Wed Aug 30 16:38:48 CEST 2006


Hi all,

On Tue, 2006-08-29 at 15:17 +0200, Luca Abeni wrote:
[...]
> 1) since libswscale is now using ffmpeg's PIX_FMT_* instead of mplayer's
> IMGFMT_*, swscale.c::sws_orderYUV() cannot use the pixel format to
> decide if the pointers must be swapped or not.
Ok, I actually had a look at mplayer's code, and... It seems to me that
sws_orderYUV() is never called!

I might be wrong, but here is what I found:
- Most of the swscale users (libmpcodecs/vf_screenshot.c,
libmpcodecs/vf_scale.c, libvo/vo_vesa.c, libvo/vo_aa.c, and
libvo/vo_x11.c) call sws_scale_ordered(), which assume that src[] and
dst[] are already ordered, and does not call sws_orderYUV()
- The remaining users (libmpcodecs/vf_sab.c, libmpcodecs/vf_smartblur.c,
and spudec.c) use the IMGFMT_Y8 (aka PIX_FMT_GRAY8) format, which does
not need to swap pointers.


So, it seems to me that I was thinking about a non-issue... :)

I attach a preliminary version of the patch, for testing. I just tried
./mplayer -vo x11 <testfile>
and
./mplayer -vo x11 -vf scale=<w>:<h> <testfile>
and it seems to work ok...

But I do not know how to test the patch in a more accurate way;
suggestions are welcome. Maybe someone interested can forward the patch
to the mplayer list, asking for more testing?


			Thanks,
				Luca
-- 
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert-swscale-alternative.diff
Type: text/x-patch
Size: 56117 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060830/c9e14288/attachment.bin>



More information about the ffmpeg-devel mailing list