Chargement…
Chargement…
On each active edge while i_ce is 1, compare the absolute difference between the new pixel and the stored output with i_threshold. Below the threshold, the output follows the input directly. Otherwise, move the stored value toward the input by the fraction defined by i_k / 256. i_k is an unsigned Q0.8 coefficient and the signed calculation truncates toward zero.
Store the filtered output as an unsigned 8-bit value and drive it on o_pixel. Saturate any intermediate value outside 0 through 255. Hold the output when i_ce='0'. Synchronous active-high reset clears the stored pixel. A difference equal to the threshold uses the smoothing branch.
The testbench checks rising and falling changes, the follow branch, equality at the threshold, clock-enable hold, and reset.