[Ffmpeg-devel] [PATCH] PNG 16-bit grayscale support

Michael Niedermayer michaelni
Thu Oct 19 11:11:29 CEST 2006


Hi

On Thu, Oct 19, 2006 at 08:15:01AM +0300, Kostya wrote:
> On Wed, Oct 18, 2006 at 10:34:09AM +0200, Michael Niedermayer wrote:
> > Hi
> > 
> > On Wed, Oct 18, 2006 at 08:07:29AM +0300, Kostya wrote:
> > > On Sun, Oct 15, 2006 at 05:18:20PM +0200, Michael Niedermayer wrote:
> > > > Hi
> > > > 
> > > [...]
> > > > >  
> > > > > +    PIX_FMT_GRAY16,     ///<        Y        , 16bpp big-endian
> > > > 
> > > > GRAY16 should be native endian, no realistic code besides memcpy and similar
> > > > will be able to handle non native 16bit efficiently
> > > > 
> > > > if a PIX_FMT_GRAY16BE and PIX_FMT_GRAY16LE is usefull or not is something iam
> > > > unsure about, id say we could always add them later if needed, but if you want
> > > > to add them then iam fine with that too
> > > 
> > > A serach for documentation showed that formats that are known to support
> > > 16-bit depth explicitly define it to be in "Network format order" (PNG spec)
> > > or "MSB first" (PGM spec). But renaming format PIX_FMT_GRAY16BE seems logical.
> > 
> > ive no objections to adding PIX_FMT_GRAY16BE but theres one aspect you seem to
> > forget and that is that this isnt only about raw or raw+generic compressor
> > formats, normal codecs be it dct or wavelet based will always output native
> > endian 16bit also filters will almost always use native endian 16bit as 
> > its a matter or a+b vs. be2me(be2me(a)+be2me(b))
> 
> GRAY16 native endian needed for processing
> GRAY16BE may needed for output (for PGM)
> but as PNG explicitly defines GRAY16BE and may need to filter it, it will
> take endian conversion in PNG decoding.

if a codec needs to internally use native 16bit format then it should also
output native 16bit
also the convert to/from rgba32 in png.c should be removed and PIX_FMT_RGBA
should be used


> 
> Maybe I'll add some more examples of 16-bit gray use (like PGM and JPEG LS)
> It won't hurt FFmpeg to have full 16-bit (and 12-bit) grayscale support

great

[...]

-- 
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