[FFmpeg-devel] FFV1 high bit depth RGB

Michael Niedermayer michaelni at gmx.at
Wed Jul 4 16:08:46 CEST 2012


Hi

On Wed, Jul 04, 2012 at 12:19:22PM +0200, Georg Lippitsch wrote:
> Hi,
> 
> I'm trying to add high bit depth RGB encoding to FFV1.
> Unfortunately, 16Bit doesn't seem to be as trivial as I hoped, since
> the JPEG200-RCT needs an additional bit of precision.
> 

> So as a first step, I added 10 bit support by adding a new 10 bit
> packed RGB colorspace, and rewriting encode_rgb() / decode_rgb() in
> ffv1 to support it. That works well, and encoding is proven to be
> lossless with 10 bit RGB input.
> Patches attached, any comments appreciated!

why dont you use the existing PIX_FMT_GBRP10 ?


> 
> Especially, does any one have any ideas if there is a (more or less)
> simple solution for adding 16 bit RGB to FFV1?
> If that is too hard to implement, do you think adding 10 and 12 bit
> colorspaces is feasible? Any other suggestions on how to support
> more than 8bit properly?

the code has to be changed to use larger data types. This needs to be
benchmarked
if its slower some preprocessor templating will be needed to build
it for both <16bit and >=16bit so the existing code isnt slowed down

[...]

> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 820cd3f..5101129 100644
> --- a/libavutil/pixfmt.h
> +++ b/libavutil/pixfmt.h
> @@ -107,6 +107,8 @@ enum PixelFormat {
>      PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
>      PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
>      PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
> +    PIX_FMT_RGB30BE,   ///< packed RGB 10:10:10, 48bpp, 10R, 10G, 10B, the 2-byte value for each R/G/B component is stored as big-endian 10 bit
> +    PIX_FMT_RGB30LE,   ///< packed RGB 10:10:10, 48bpp, 10R, 10G, 10B, the 2-byte value for each R/G/B component is stored as little-endian 10 bit
>      PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
>      PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian

breaks ABI, you cannot add anything in the middle


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20120704/3a022660/attachment.asc>


More information about the ffmpeg-devel mailing list