avcodec/exr: preserve half-float NaN bits and add fate test
Handles NaNs more like the official implementation handles them, preserving the original bits.
This commit is contained in:
parent
7777e5119a
commit
8d19b3c4a5
@ -193,8 +193,7 @@ static union av_intfloat32 exr_half2float(uint16_t hf)
|
||||
// half-float NaNs will be converted to a single precision NaN
|
||||
// half-float Infs will be converted to a single precision Inf
|
||||
exp = FLOAT_MAX_BIASED_EXP;
|
||||
if (mantissa)
|
||||
mantissa = (1 << 23) - 1; // set all bits to indicate a NaN
|
||||
mantissa <<= 13; // preserve half-float NaN bits if set
|
||||
} else if (exp == 0x0) {
|
||||
// convert half-float zero/denorm to single precision value
|
||||
if (mantissa) {
|
||||
|
@ -317,6 +317,8 @@ fate-exr-rgb-scanline-half-zip-dw-outside: CMD = framecrc -i $(TARGET_SAMPLES)/e
|
||||
FATE_EXR += fate-exr-rgb-tile-half-zip-dw-outside
|
||||
fate-exr-rgb-tile-half-zip-dw-outside: CMD = framecrc -i $(TARGET_SAMPLES)/exr/rgb_tile_half_zip_dw_outside.exr -pix_fmt gbrpf32le
|
||||
|
||||
FATE_EXR += fate-exr-rgb-scanline-zip-half-0x0-0xFFFF
|
||||
fate-exr-rgb-scanline-zip-half-0x0-0xFFFF: CMD = framecrc -i $(TARGET_SAMPLES)/exr/rgb_scanline_zip_half_float_0x0_to_0xFFFF.exr -pix_fmt gbrpf32le
|
||||
|
||||
FATE_EXR-$(call DEMDEC, IMAGE2, EXR) += $(FATE_EXR)
|
||||
|
||||
|
6
tests/ref/fate/exr-rgb-scanline-zip-half-0x0-0xFFFF
Normal file
6
tests/ref/fate/exr-rgb-scanline-zip-half-0x0-0xFFFF
Normal file
@ -0,0 +1,6 @@
|
||||
#tb 0: 1/25
|
||||
#media_type 0: video
|
||||
#codec_id 0: rawvideo
|
||||
#dimensions 0: 256x256
|
||||
#sar 0: 1/1
|
||||
0, 0, 0, 1, 786432, 0x1445e411
|
Loading…
x
Reference in New Issue
Block a user