]> git.sesse.net Git - ffmpeg/commitdiff
libavcodec/exr: fix incorrect translation of denorm mantissa
authorMark Reid <mindmark@gmail.com>
Tue, 15 Sep 2020 02:14:46 +0000 (19:14 -0700)
committerPaul B Mahol <onemda@gmail.com>
Tue, 15 Sep 2020 17:22:18 +0000 (19:22 +0200)
libavcodec/exr.c
tests/ref/fate/exr-rgba-multiscanline-half-b44
tests/ref/fate/exr-slice-raw
tests/ref/fate/exr-slice-rle
tests/ref/fate/exr-slice-zip1
tests/ref/fate/exr-slice-zip16

index 829d38143d8e5082299ddf0dd58fa605df56b670..216d216785a2812549937ba62ed83cb1f5980c63 100644 (file)
@@ -201,7 +201,7 @@ static union av_intfloat32 exr_half2float(uint16_t hf)
             mantissa <<= 1;
             exp = HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP;
             // check for leading 1 in denorm mantissa
-            while ((mantissa & (1 << 10))) {
+            while (!(mantissa & (1 << 10))) {
                 // for every leading 0, decrement single precision exponent by 1
                 // and shift half-float mantissa value to the left
                 mantissa <<= 1;
index 964bf2e65e4f6ef3742457176d6a35d0700027ca..24525b92a7d251e9e3512eea605d8fe119f70af4 100644 (file)
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 935x251
 #sar 0: 1/1
-0,          0,          0,        1,  3754960, 0x4d48a1b2
+0,          0,          0,        1,  3754960, 0x8d9af112
index c7096e4d2ad36bd0559491fd4a259323025ee067..1e7d3825eaf0113687d6ece1aa694583d74a8834 100644 (file)
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 587x675
 #sar 0: 1/1
-0,          0,          0,        1,  6339600, 0x4f2b496b
+0,          0,          0,        1,  6339600, 0xda3e31df
index c7096e4d2ad36bd0559491fd4a259323025ee067..1e7d3825eaf0113687d6ece1aa694583d74a8834 100644 (file)
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 587x675
 #sar 0: 1/1
-0,          0,          0,        1,  6339600, 0x4f2b496b
+0,          0,          0,        1,  6339600, 0xda3e31df
index c7096e4d2ad36bd0559491fd4a259323025ee067..1e7d3825eaf0113687d6ece1aa694583d74a8834 100644 (file)
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 587x675
 #sar 0: 1/1
-0,          0,          0,        1,  6339600, 0x4f2b496b
+0,          0,          0,        1,  6339600, 0xda3e31df
index c7096e4d2ad36bd0559491fd4a259323025ee067..1e7d3825eaf0113687d6ece1aa694583d74a8834 100644 (file)
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 587x675
 #sar 0: 1/1
-0,          0,          0,        1,  6339600, 0x4f2b496b
+0,          0,          0,        1,  6339600, 0xda3e31df