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

Michael Niedermayer michaelni at gmx.at
Sat May 3 00:54:08 CEST 2014


On Fri, May 02, 2014 at 11:22:49AM -0300, Gonzalo Garramuno wrote:
> On 01/05/14 23:06, Michael Niedermayer wrote:
> >float computations can differ in result between platforms, rounding
> >can differ, compiler optimizations can differ
> >i dont know if its either of these though thats causing the issue
> >
> >
> >[...]
> Find attached a patch that isolates the powf function to only work
> when gamma is different than 1.  And all negative values are clamped
> to 0.
> The checksums don't need to be changed from 0x1f656d7a.
> If it still does not work for you Michael, can you upload a png to
> with the image you get at http://www.datafilehost.com/ ?
> 

>  exr.c |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 70 insertions(+), 7 deletions(-)
> 391fc9a2030b5c271e89316a055cc6f4a29e1a86  exr_patch11.diff
> diff --git a/libavcodec/exr.c b/libavcodec/exr.c
> index 084025a..5ff4df4 100644

still fails
both on x86_64 as well as arm32, it also fails differently on both
gamma_table differs between the 2
first difference is at index 256, where one is 0 and the other 1
last difference is at index 1023

previous patches failed only on x86_64, but worked on arm32

on arm32:
--- /home/michael/ffmpeg-git/ffmpeg/tests/ref/fate/exr-slice-raw        2014-05-02 05:37:07.676760799 +0200
+++ tests/data/fate/exr-slice-raw       2014-05-03 00:37:24.306202155 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  3169800, 0x6a356d0d
+0,          0,          0,        1,  3169800, 0x1f656d7a

on x86_64:
--- ./tests/ref/fate/exr-slice-raw      2014-05-02 05:37:07.676760799 +0200
+++ tests/data/fate/exr-slice-raw       2014-05-03 00:38:36.906203684 +0200
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  3169800, 0x6a356d0d
+0,          0,          0,        1,  3169800, 0x9a9b6cde

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- 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/20140503/c836c883/attachment.asc>


More information about the ffmpeg-devel mailing list