[MPlayer-dev-eng] [PATCH] add 8 bit Bayer format and filter
Michael Niedermayer
michaelni at gmx.at
Fri Mar 7 05:42:43 CET 2008
On Wed, Mar 05, 2008 at 11:09:48PM -0500, Rich Felker wrote:
> On Wed, Mar 05, 2008 at 10:17:28PM -0500, Calvin Walton wrote:
> > On Thu, 2008-03-06 at 00:47 +0100, Michael Niedermayer wrote:
> > > On Mon, Mar 03, 2008 at 01:40:40PM +0100, Reimar Döffinger wrote:
> > > > On Mon, Mar 03, 2008 at 01:10:20PM +0100, Nico Sabbi wrote:
> > > > > new decoders belong to libavcodec
> > > >
> > > > If it was a decoder, though it is more a colourspace converter and as
> > > > such would be more suitable in libswscale. Either way a filter is the
> > > > worst solution possible, and both of the better solutions should be
> > > > submitted to FFmpeg...
> > >
> > > Yes, also iam not completely sure if it fits better into pixelformat or
> > > compressed stream.
> > > What it technically is, is the raw data from a color CCD. It is in that
> > > form only useable with a crop filter. Not even contrast or saturation
> > > correction could be applied to it without converting it to a normal
> > > pixel format.
> > > Also the convertion to a normal pixel format is non trivial and non
> > > linear and as such an implementation in swscale would be quite seperate from
> > > everything else.
> > > There are also dozens of different algorithms to do this convertion and
> > > they result in very different output.
> > > Converting it is pretty much identical to guessing missing samples.
> >
> > Guessing missing samples has to be done in lots of cases in swscale,
> > take a look at a common case like I420 => RGB32: not only do the colour
> > values need to be converted, but the U and V planes have to be
> > interpolated up to full picture size first.
> >
> > Swscale is (at least in part) a scaler, and scaling implies
> > interpolating missing information :)
I420/YV12/YUY2/... contains chroma planes which have been low pass filtered
and then some of the samples removed. One can thanks to sampling theory
recover the missing samples as the sampling rate is above the nyquist
frequncy. This is of course not absolutely true in practice as images are
not bandlimited but its true enough to work reasonably well. Also chroma
is quite unsensitive to resolution loss, images still look nearly the
same if one throws 3/4 of the chroma samples away.
What this thread is about is entirely different, there is no lowpass
filter at all.
>
> I agree. There's nothing nonlinear about this interpolation. All it
> requires is the right filter coefficients.
This reminds me of something mans said about you being an expert in
everything you never heard of before.
Anyway ill leave this to you to deal with, i dont have the energy for this
fight, write some linear interpolation and let the world have some
entertainment with the resulting images.
Ive seen the difference, ill post a link to some of the papers if i find
them again.
The difference from linear to non linear methods is like that of a 320x240
to a 640x480 image. (ignoring the aliassing artifacts the linear variant
inevitably has)
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080307/60effe09/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list