RankFilter
Modified by 2015.06.01
Design
RankFilter
Version
1.0
Modified
2015-05-21
Source
IP-GUI
Function
Local filter - Rank filter, it always used for denoising with preserving edge.
It will give the first output after sum_stage + 2 cycles while the input enable.
Files
Name | Function |
---|---|
RankFilter.v | Main module |
RankFilter_TB.sv | Test bench |
Parameters
Name | Type | Range | Default | Description |
---|---|---|---|---|
work_mode | unsigned | 0 for Pipeline, 1 for Req-ack | 0 | This module's working mode. |
window_width | unsigned | 2 - 15 | 3 | The width(and height) of window. |
color_width | unsigned | 1 - 12 | 8 | Color's bit width. |
sum_stage | unsigned | Depend on width of window, int(log8(window_width^2)) + 1 | 2 | Stage of sum. |
full_win_bits | unsigned | Depend on width of window | 4 | Width bits of full size of window. |
Ports
Name | Port | Type | Range | Default | Description |
---|---|---|---|---|---|
clk | input | unsigned | None | None | Clock. |
rst_n | input | unsigned | None | None | Reset, active low. |
rank | input | unsigned | full_win_bits - 1 : 0 | None | Filter's rank, if half of full size of window, this module working as median filter, etc. |
in_enable | input | unsigned | None | None | Input data enable, in pipeline mode, it works as another rst_n, in req-ack mode, only it is high will in_data can be really changes. |
in_data | input | unsigned | color_width * window_width * window_width - 1 : 0 | None | Input data, it must be synchronous with in_enable. |
out_ready | output | unsigned | None | None | Output data ready, in both two mode, it will be high while the out_data can be read. |
out_data | output | unsigned | color_width - 1 : 0 | None | Output data, it will be synchronous with out_ready. |
Simulations
Simulations for this module just support Gray-scale images !
Waves
Pipeline mode
ReqAck mode
Original
Results
HDL functional simulation for pipeline mode is on the left, for req-ack mode is on the middle, and which on the right is the soft simulation
Test for 3x3 window, Middle
Test for 5x5 window, Middle
Test for 3x3 window, Max
PSNR
1-3-4 | 1-3-8 | 1-5-12 | 1-5-24 | 2-3-4 | 2-3-8 | 2-5-12 | 2-5-24 | Total |
---|---|---|---|---|---|---|---|---|
1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 |
Utilization
For 3x3 window.
Slice LUTs* | Slice Registers |
---|---|
377 | 228 |
Timing
For 3x3 window.
The max Data Path Delay is 3.705ns, so:
FMax = 269.90MHz