aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Reid <mindmark@gmail.com>2020-09-14 19:14:46 -0700
committerPaul B Mahol <onemda@gmail.com>2020-09-15 19:22:18 +0200
commit8ddcbebc3f869def7819697d7f4f85b94308c570 (patch)
treec4ac1bde012f15d0f10020e260d46de2e84a4e37
parent2524e64dbe4b39644b14bfa943461fd011fafb56 (diff)
downloadffmpeg-8ddcbebc3f869def7819697d7f4f85b94308c570.tar.gz
libavcodec/exr: fix incorrect translation of denorm mantissa
-rw-r--r--libavcodec/exr.c2
-rw-r--r--tests/ref/fate/exr-rgba-multiscanline-half-b442
-rw-r--r--tests/ref/fate/exr-slice-raw2
-rw-r--r--tests/ref/fate/exr-slice-rle2
-rw-r--r--tests/ref/fate/exr-slice-zip12
-rw-r--r--tests/ref/fate/exr-slice-zip162
6 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 829d38143d..216d216785 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -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;
diff --git a/tests/ref/fate/exr-rgba-multiscanline-half-b44 b/tests/ref/fate/exr-rgba-multiscanline-half-b44
index 964bf2e65e..24525b92a7 100644
--- a/tests/ref/fate/exr-rgba-multiscanline-half-b44
+++ b/tests/ref/fate/exr-rgba-multiscanline-half-b44
@@ -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
diff --git a/tests/ref/fate/exr-slice-raw b/tests/ref/fate/exr-slice-raw
index c7096e4d2a..1e7d3825ea 100644
--- a/tests/ref/fate/exr-slice-raw
+++ b/tests/ref/fate/exr-slice-raw
@@ -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
diff --git a/tests/ref/fate/exr-slice-rle b/tests/ref/fate/exr-slice-rle
index c7096e4d2a..1e7d3825ea 100644
--- a/tests/ref/fate/exr-slice-rle
+++ b/tests/ref/fate/exr-slice-rle
@@ -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
diff --git a/tests/ref/fate/exr-slice-zip1 b/tests/ref/fate/exr-slice-zip1
index c7096e4d2a..1e7d3825ea 100644
--- a/tests/ref/fate/exr-slice-zip1
+++ b/tests/ref/fate/exr-slice-zip1
@@ -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
diff --git a/tests/ref/fate/exr-slice-zip16 b/tests/ref/fate/exr-slice-zip16
index c7096e4d2a..1e7d3825ea 100644
--- a/tests/ref/fate/exr-slice-zip16
+++ b/tests/ref/fate/exr-slice-zip16
@@ -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