[Ffmpeg-devel] more libswscale questions....

Michael Niedermayer michaelni
Thu Nov 16 15:55:04 CET 2006


Hi

On Thu, Nov 16, 2006 at 09:51:26PM +1100, Steven Johnson wrote:
> Hi,
> 
> The more i muck with libswscale, the more questions I have.
> 
> Q1,
[...]
> But it seems if I want to convert from X to Y using libswscale, then
> there needs to be a converter for every possible permutation.  Is that
> correct?

no


> 
> Because by my count there are 37 pixel formats, and having converters
> for each to each is 37 * 37 = 1369 convert functions.  That can't be
> right, can it?  What formats does one need to support/implement
> conversions to/from in order to cover all of the cases?  And relating

for input either
X -> 8bit planar YUV
or
X -> horizontal scaling -> internal YUV  (which is more then 8bit per sample,
i forgot how much thugh, maybe 12 or 15 bits), internal YUV also has a
silly limitation that chroma must be subsampled by 2 relative to luma
if you can fix this it would be very welcome, some half finished mmx
code to do full hoizontal chroma is there under #if 0, flags to turn
full chroma on are also there, and the c code might even work with
it, or maybe not i dunno ...

for output you need a internal YUV -> vertical scaling -> X

the scaling code is already there in macros so you just need to add the
conversation into it ...

all IIRC, i probably forgot some minor details ...



[...]
> Q2,
> When it comes to scaling, how does the image end up in the format the
> scaling code uses, and how does it go from there to the dest format.  I
> tried tracking the code, but I can;t work out the path.
> 
> Eg, I want to go from RGB24 to BGR32 and scale the image from 1024x768
> down to 320x200.  How does libswscale convert from RGB24 -> YV12 ->
> Scaled YV12 -> BGR32?  It seems for the src I need to add the format to
> hcscale an hyscale? Is that correct?  But it seems the dest is always
> YV12?  That can't be correct, so I am missing something, obviously.  In

yes the code was broken, should be less broken now :)

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list