git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f16180f
)
libavcodec/exr : fix float to uint16 conversion for negative float value
author
Martin Vignali
<martin.vignali@gmail.com>
Tue, 25 Apr 2017 20:52:50 +0000
(22:52 +0200)
committer
Michael Niedermayer
<michael@niedermayer.cc>
Thu, 27 Apr 2017 02:25:31 +0000
(
04:25
+0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/exr.c
patch
|
blob
|
history
diff --git
a/libavcodec/exr.c
b/libavcodec/exr.c
index
7194640
..
c32eea1
100644
(file)
--- a/
libavcodec/exr.c
+++ b/
libavcodec/exr.c
@@
-220,9
+220,9
@@
static union av_intfloat32 exr_half2float(uint16_t hf)
*
* @return normalized 16-bit unsigned int
*/
-static inline uint16_t exr_flt2uint(
u
int32_t v)
+static inline uint16_t exr_flt2uint(int32_t v)
{
-
unsigned in
t exp = v >> 23;
+
int32_
t exp = v >> 23;
// "HACK": negative values result in exp< 0, so clipping them to 0
// is also handled by this condition, avoids explicit check for sign bit.
if (exp <= 127 + 7 - 24) // we would shift out all bits anyway