Currently the demosaicers behave differently regarding clipping the output
Bayer demosaicers:
border_interpolate: does not clip but does not produce negative values
amaze: does not clip and produces negative values
rcd: clips into [0;65535]
dcb: does not clip and produces negative values
lmmse: does not clip and produces negative values
igv: clips into [0;65535]
ahd: does not clip but does not produce negative values
eahd: does not clip and produces negative values
hphd: does not clip and produces negative values
vng4: does not clip and produces negative values
fast: does not clip and produces negative values
xtrans demosaicers:
border_interpolate: does not clip but does not produce negative values
3-pass: does not clip and produces negative values
1-pass: does not clip and produces negative values
fast: does not clip but does not produce negative values
In my opionion we should make the behaviour consistent in the way that we clip negative values to zero but do not clip the highlights to 65535.
Opinions?
Definitely clip negative to zero, not sure about >65536.0. I'm the one who pointed out the behavior to Ingo; for me the egregious positive behavior is in AMAZE, where I see some highlight pixels pushed out an order of magnitude, which seems extreme for the semantics of the operation. Specifically, I'm seeing values around 0.4 ending up 4.5 after AMAZE application. My stats collector in rawproc has a few issues I'm fixing; will post some stats after they're fixed.
Most helpful comment
Definitely clip negative to zero, not sure about >65536.0. I'm the one who pointed out the behavior to Ingo; for me the egregious positive behavior is in AMAZE, where I see some highlight pixels pushed out an order of magnitude, which seems extreme for the semantics of the operation. Specifically, I'm seeing values around 0.4 ending up 4.5 after AMAZE application. My stats collector in rawproc has a few issues I'm fixing; will post some stats after they're fixed.