[FFmpeg-devel] Adding 10-bit depth YUV

Michael Niedermayer michaelni
Thu May 10 20:40:50 CEST 2007


On Wed, May 09, 2007 at 08:03:21PM -0500, erik98 at sunflower.com wrote:
> Greetings,
> I am working on a project to make a digital (SDI-SD and SDI-HD) based DVR that works with 10-bits-per-channel YUV data,
> and I wanted to sanity check my general ideas before embarking on this project.
> For phase one, I just want to save and load the raw streams. By this, I mean to strip out the raw 10-bit data video data from the SDI-STDI (SMTP 292/305) compatible card and save it to disk.
> For phase two, assuming I still have the energy, I plan to modify the FFV1 encoder to compress/decompress the raw (10-bit) streams.
> My general strategy is as follows...
> --> To accomplish phase one, it would seem that I need to make the following source code changes...
> libavcodec/imgconvert.c:
> Add 10-bit depth variants of PIX_FMT_YUV* (ie. PIX_FMT_YUV444D10, PIX_FMT_YUV444P10, etc.).
> Note, planar forms will likely be a packed format where 5 bytes are used for every 4 pixels, padded if necessary at the end of each plane.

iam against adding 10bit anything support before 16bit is supported and
a clear advantage is demonstrated why 10bit support would be needed in
addition to 8 and 16bit support, additionally i think a more generic pix_fmt
system should be introduced before supporting bit depth between 8 and 16 bits
that is a system which specifies in a struct for each pix_fmt how it is
stored, so that a single simple generic (and slow) convertion routine can
convert any pix_fmt to any pix_fmt
this would greatly simplify things ...

> Add appropriate 10-bit planar/non-planar conversion routines
> Add appropriate 8/10-bit depth conversion routines for the new formats (basically, bit shifts. No Y crushing, etc.)

dont forget that the old imgconvert code is deprecated and convertion 
support must be added to libswscale at minimum, imgconvert is optional

> libavcodec/raw.c
> Make it aware of the new PIX_FMT_* variants
> --> To accomplish phase two, it would seem that I need to make the following source code changes...
> libavcodec/ffv1.c:
> Bump the header version from 0 to 1


> change coder_type interpretation to be coder_flags. Default is 0
> Add new flag CODER_FLAG_D10


> Add 10-bit versions of compression/decompression routines
> So, my questions to the list are these:
> 1) What would be a good mux/container file format to use for storing the raw data? AVI?

yes, avi is a simple choice, baptiste seems to think mov is a good idea too
well iam not commenting on that :)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070510/99b9cc62/attachment.pgp>

More information about the ffmpeg-devel mailing list