MeanFilter
Modified by 2015.06.01
Design
MeanFilter
Version
1.0
Modified
2015-05-20
Source
IP-GUI
Function
Local filter - Mean filter, it always used for smoothing images.
It will give the first output after sum_stage + 1 cycles while the input enable.
Files
Name | Function |
---|---|
MeanFilter.v | Main module |
MeanFilter_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 wide. |
sum_stage | unsigned | Depend on width of window, log2(window_width^2) | 3 | Stage of sum. |
Ports
Name | Port | Type | Range | Default | Description |
---|---|---|---|---|---|
clk | input | unsigned | None | None | Clock. |
rst_n | input | unsigned | None | None | Reset, active low. |
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
Test for 5x5 window
PSNR
1-3 | 1-5 | 2-3 | 2-5 | Total |
---|---|---|---|---|
1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 | 1000000.00 |
Utilization
For 3x3 window.
Slice LUTs* | Slice Registers |
---|---|
38 | 17 |
Timing
For 3x3 window.
The max Data Path Delay is 2.085ns, so:
FMax = 479.61MHz
Thanks
The sources of images for simulations:
おにねこ-クロス.ホエン
月岡月穂-春爛漫