[FFmpeg-devel] [PATCH] Add a gamma flag to exr loader to avoid banding

Michael Niedermayer michaelni at gmx.at
Mon May 5 04:14:48 CEST 2014


On Sun, May 04, 2014 at 11:58:42AM -0300, Gonzalo Garramuno wrote:
> On 03/05/14 23:45, Michael Niedermayer wrote:
> >one way to do that is
> >by adding a random small value to every non interger
> >computation
> >that is
> >for example replace
> >o.f *= magic.f; /* exponent adjust */
> >if (o.f >= was_infnan.f) /* make sure Inf/NaN survive */
> >by
> >
> >magic.f += random_small()
> >o.f += random_small()
> >o.f *= magic.f; /* exponent adjust */
> >o.f += random_small()
> >if (o.f + random_small() >= was_infnan.f + random_small()) /* make sure Inf/NaN survive */
> >
> I made the constants use the float value instead of the bit shifts.
> Can you give it a try?  If that does not work I'll try adding a
> random value to debug it.

--- ./tests/ref/fate/exr-slice-raw      2014-05-05 03:50:41.026086887 +0200
+++ tests/data/fate/exr-slice-raw       2014-05-05 03:54:03.790091159 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  3169800, 0x1f656d7a
+0,          0,          0,        1,  3169800, 0x6a356d0d
Test exr-slice-raw failed. Look at tests/data/fate/exr-slice-raw.err for details.
make: *** [fate-exr-slice-raw] Error 1
make: *** Waiting for unfinished jobs....
--- ./tests/ref/fate/exr-slice-rle      2014-05-05 03:50:41.034086890 +0200
+++ tests/data/fate/exr-slice-rle       2014-05-05 03:54:03.810091161 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  3169800, 0x1f656d7a
+0,          0,          0,        1,  3169800, 0x6a356d0d
Test exr-slice-rle failed. Look at tests/data/fate/exr-slice-rle.err for details.
make: *** [fate-exr-slice-rle] Error 1
--- ./tests/ref/fate/exr-slice-zip16    2014-05-05 03:50:41.038086890 +0200
+++ tests/data/fate/exr-slice-zip16     2014-05-05 03:54:03.842091161 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  3169800, 0x1f656d7a
+0,          0,          0,        1,  3169800, 0x6a356d0d
--- ./tests/ref/fate/exr-slice-zip1     2014-05-05 03:50:41.034086890 +0200
+++ tests/data/fate/exr-slice-zip1      2014-05-05 03:54:03.842091161 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  3169800, 0x1f656d7a
+0,          0,          0,        1,  3169800, 0x6a356d0d

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- 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/20140505/c8cfea37/attachment.asc>


More information about the ffmpeg-devel mailing list