[FFmpeg-devel] dcp encoding + new pixel format request/sponsorship

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Jan 22 15:57:38 CET 2013

Michael Bradshaw <mjbshaw <at> gmail.com> writes:

> > Is there any reason to add a 12 bit per component format 
> > instead of using the 16 bit one and telling the encoder 
> > it should discard 4 bit?
> Out of curiosity, how would that work? Which 4 bits do you discard?

I believe when we "scale" from 16 to 8 bits, we simply discard 
the 8 least significant bit, the same can be done for the 
16 -> 12 case.

> openjpeg itself can, in theory, save 12-bit RGB, but lavc 
> would provide frames in 16-bit RGB; simply discarding bits 
> would give improper results. A proper/scaling 16-bit to 
> 12-bit conversion would need to be done, and it
> hardly seems like the encoder is the right place to put that.

It would simplify things to do it like that.

> We also wouldn't be able to decode it without a 12-bit pixel format.

The decoder would simply shift the most significant 4 bits 
into the least significant bits and set bits_per_coded_sample 
to 12.

Is "Digital Cinema" JPEG 2000?

Carl Eugen

More information about the ffmpeg-devel mailing list