User guide
Table Of Contents
- Contents
- 1. About This MegaCore Function Suite
- Release Information
- Device Family Support
- Features
- Design Example
- Performance and Resource Utilization
- 2D FIR Filter
- 2D Median Filter
- Alpha Blending Mixer
- Avalon-ST Video Monitor
- Chroma Resampler
- Clipper
- Clocked Video Input
- Clocked Video Output
- Color Plane Sequencer
- Color Space Converter
- Control Synchronizer
- Deinterlacer
- Deinterlacer II
- Frame Buffer
- Gamma Corrector
- Interlacer
- Scaler
- Scaler II
- Switch
- Test Pattern Generator
- Trace System
- 2. Getting Started with Altera IP Cores
- 3. Interfaces
- Interface Types
- Avalon-ST Video Protocol
- Avalon-MM Slave Interfaces
- Avalon-MM Master Interfaces
- Buffering of Non-Image Data Packets in Memory
- 4. 2D FIR Filter MegaCore Function
- 5. 2D Median Filter MegaCore Function
- 6. Alpha Blending MegaCore Function
- 7. Avalon-ST Video Monitor MegaCore Function
- 8. Chroma Resampler MegaCore Function
- 9. Clipper MegaCore Function
- 10. Clocked Video Input MegaCore Function
- 11. Clocked Video Output MegaCore Function
- 12. Color Plane Sequencer MegaCore Function
- 13. Color Space Converter MegaCore Function
- 14. Control Synchronizer MegaCore Function
- 15. Deinterlacer MegaCore Function
- Core Overview
- Functional Description
- Parameter Settings
- Signals
- Control Register Maps
- 16. Deinterlacer II MegaCore Function
- 17. Frame Reader MegaCore Function
- 18. Frame Buffer MegaCore Function
- 19. Gamma Corrector MegaCore Function
- 20. Interlacer MegaCore Function
- 21. Scaler MegaCore Function
- 22. Scaler II MegaCore Function
- 23. Switch MegaCore Function
- 24. Test Pattern Generator MegaCore Function
- 25. Trace System MegaCore Function
- A. Avalon-ST Video Verification IP Suite
- B. Choosing the Correct Deinterlacer
- Additional Information

January 2013 Altera Corporation Video and Image Processing Suite
User Guide
5. 2D Median Filter MegaCore Function
Core Overview
The 2D Median Filter MegaCore function applies 3×3 or 5×5 pixel median filters to
video images. Median filtering removes speckle noise and salt-and-pepper noise
while preserving the sharpness of edges in video images.
Functional Description
The 2D Median Filter MegaCore function provides a means to perform 2D median
filtering operations using matrices of 3×3 or 5×5 kernels.
Each output pixel is the median of the input pixels found in a 3x3, 5x5, or 7×7 kernel
centered on the corresponding input pixel. Where this kernel runs over the edge of the
input image, zeros are filled in.
Larger kernel sizes require many more comparisons to perform the median filtering
function and therefore require correspondingly large increases in the number of logic
elements. Larger sizes have a stronger effect, removing more noise but also potentially
removing more detail.
1 All input data samples must be in unsigned format. If the number of bits per pixel per
color plane is N, this means that each sample consists of N bits of data which are
interpreted as an unsigned binary number in the range [0, 2
N
– 1]. All output data
samples produced by the 2D Median Filter MegaCore function are also in the same
unsigned format.
Avalon-ST Video Protocol Parameters
The 2D Median Filter MegaCore function can process streams of pixel data of the
types listed in Table 5–1.
Stall Behavior and Error Recovery
The 2D Median Filter MegaCore function has a delay of a little more than N–1 lines
between data input and output in the case of a N×N 2D Median Filter. This is due to
line buffering internal to the MegaCore function.
Table 5–1. 2D Median Filter Avalon-ST Video Protocol Parameters
Parameter Value
Frame Width As selected in the parameter editor.
Frame Height As selected in the parameter editor.
Interlaced / Progressive Progressive.
Bits per Color Sample Number of bits per color sample selected in the parameter editor.
Color Pattern
One, two or three channels in sequence. For example, if three channels in
sequence is selected where , and can be any color plane:
γβα