Don't use f32::round for filter 1D#2838
Conversation
|
I'm actually not sure myself.. |
|
NaNs typically saturated to the lower bound if we assume ieee standard. However, NaNs appearing here is unlikely so I don’t think it’s important. |
|
We might put it into compatibility notes but we don't provide a method that would filter float images but convert the result into a uint image. I don't think you could provoke a NaN-conversion from the image input except by the kernel; but then it applies to the whole image which does not seem so useful. |
|
I think we've overlooked this a bit in those PRs, since I already put filter on not normal values. However, it's still possible to submit here NaN values. I don't see much point to mess with NaN inputs, if you see that different we could just return for any NaN input a default image filled with pre-defined value. |
Same as #2837. I removed
f32::roundand replaced it with+ 0.5for better perf on x86..The
self.min(u16::MAX as f32)might be unnecessary too. I left it in for now, because it maps NaN tou16::MAXinstead of 0 (by theascast). If NaN isn't a concern for filter 1D, then it can be removed too. Just let me know.