[FFmpeg-devel] [RFC] Bayer colorspaces: CODEC_ID, PIX_FMT or both?

Peter Ross pross at xvid.org
Thu Mar 17 12:02:50 CET 2011

On Sun, Jan 30, 2011 at 02:20:59AM +0100, Michael Niedermayer wrote:
> On Sun, Jan 30, 2011 at 11:45:51AM +1100, Peter Ross wrote:
> [...]
> > 3. BOTH (CODEC_ID and PIX_FMT)
> > 
> > Some bayer implementations pack the samples. e.g. 12-bit RGGB, means
> > each sample consumes 12 bits in memory. Other bayer implementations
> > pad each samples out to 16-bits.

There are also formats using this approach with ordinary RGB. e.g. 16-bits
consumed per R/G/B component, but the dynamic range is 14-bits.

> > A hybrid implementation would have PIX_FMTs defined for 8-bit and
> > 16-bit sample sizes, and make a BAYER codec available to unpack the
> > samples into PIX_FMT_BAYER_xxxx16{LE|BE}
> > 
> > Comments?
> this is best

Okay. If the demuxer uses AVCodecContext.bits_per_coded_sample to indicate the number
of bits-per-sample, should it describe 'per component sample' or 'per pixel sample'.

Enclosed is a patch for scaling up these formats within rawdec. Not sure if rawdec
is the best place for this; keen to hear opinions.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-rawdec-scale-RGB-and-BAYER-formats-up-to-16-bits-if-.patch
Type: text/x-diff
Size: 2407 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110317/5bab4fc5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110317/5bab4fc5/attachment.asc>

More information about the ffmpeg-devel mailing list