Chroma Resampler Up Conversion Design Example
This design example illustrates how to implement chroma up resampling using Altera's Chroma Resampler MegaCore® function in DSP Builder. The Chroma Resampler MegaCore function can implement both subsampling and up conversion. In this example, the Chroma Resampler MegaCore function converts a 4:2:2 input video steam to a 4:4:4 stream through linear interpolation. The output video data is written into a binary data file using MATLAB Simulink Video Sink. A video conversion utility avi-is-avi (provided in the package) converts the binary output for display in RGB format. A binary-to-AVI conversion block is included in the design to implement the output conversion automatically.
To evaluate the performance of the Chroma Resampler MegaCore function, the same video input is processed by the MATLAB SIMULINK Chroma Resampling blockset, converted to RGB color space by the SIMULINK Color Space Conversion blockset, and displayed via the SIMULINK Video Display block.
Download the files used in this example:
Files in the zip download include:
- ChromaUpConversion.mdl—DSP Builder design file
- chroma_resampler.vhd—wrapper file to generate the Chroma Resampler intellectual property (IP) MegaCore function
- avi-is-avi.exe—DOS executable to convert an avi file to and from a binary file
- car.avi—sample input video, 640W by 480H pixels
- carYcc422176x144.bin—binary video stream subsampled from car.avi, 176W by 144H pixels, in YCbCr format and subsampled to 4:2:2
- caroutput.avi—pre-simulated output AVI file using the provided input video clip carYcc422176x144.bin
Figure 1. Top-Level Diagram of the Chroma Resampler Up Conversion Design Example in DSP Builder

View Full Size
Implementation
In this example, the Chroma Resampler IP MegaCore function uses the parameters shown in Table 1.
| Table 1. Parameter Description |
| Parameters |
Value |
| Image Resolution |
176 x 144 |
| Bits Per Pixel Per Color Plane |
8 |
| Conversion Format |
4:2:2 to 4:4:4 |
| Horizontal Interpolation |
Linear |
Table 2 describes the ports.
| Table 2. Chroma Resampler Signals |
| Signal |
Type |
Description |
reset |
Input |
MegaCore function asynchronous reset. Active high. |
din_data |
Input |
Data input bus. |
din_valid |
Input |
Input data valid signal. |
dout_ready |
Input |
Output data ready signal indicating whether output sink is ready to take output data. |
din_ready |
Output |
Data input ready signal indicating whether MegaCore function is ready to take input data. |
dout_data |
Output |
Data output bus. |
dout_valid |
Output |
Data valid signal indicating validity of output data signals. |
Reference
1. C. Poynton, "Digital video and HDTV: algorithms and interfaces," Morgan Kaufmann Publishers, 2003.
Related Links
|