[FFmpeg-devel] [PATCH 1/2] avcodec/ffv1: flip half of float16 and Compactify floats

2025-01-18 Thread Michael Niedermayer
float16 (and more so float32) have many odd values half the values are negative, many are larger than "1.0" and many values are very close to 0. Storing the 16bits as is, looses compression because of the mixture of dense and sparse regions and also many completely unused ones. This simply remaps

[FFmpeg-devel] [PATCH 1/2] avcodec/ffv1: flip half of float16

2025-01-18 Thread Michael Niedermayer
float16 is a sign bit followed by "positive is larger" exponent and mantisse that way the up direction changes between negative and positive numbers flipping the exponent and mantisse for positive numbers gives a compression gain of 0.5% for both RCT and noRCT modes using the ACES_OT_VWG_SampleFram