Main Content

Chroma Resampler

Downsample or upsample chrominance component

  • Chroma Resampler block

Libraries:
Vision HDL Toolbox / Conversions

Description

The Chroma Resampler block downsamples or upsamples a pixel stream.

  • Downsampling reduces bandwidth and storage requirements in a video system by combining pixel chrominance components over multiple pixels. You can specify a filter to prevent aliasing by selecting the default filter or by entering coefficients.

  • Upsampling restores a signal to its original rate. To calculate the extra sample, you can use interpolation or replication.

The block accepts luma and chrominance components. The block does not modify the luma component, and applies delay to align it with the resampled chrominance outputs. The rate of the output luma component is the same as the rate of the input.

Examples

Ports

This block uses a streaming pixel interface with a pixelcontrol bus for frame control signals. This interface enables the block to operate independently of image size and format. All Vision HDL Toolbox™ blocks use the same streaming interface. The block accepts and returns a scalar pixel value and a bus that contains five control signals. The control signals indicate the validity of each pixel and its location in the frame. To convert a frame (pixel matrix) into a serial pixel stream and control signals, use the Frame To Pixels block. For a full description of the interface, see Streaming Pixel Interface.

Input

expand all

Pixel in Y'CbCr color space, specified as a vector of three values. Integer and fixed-point data types must be between 8 and 16 bits.

The software supports double and single data types for simulation, but not for HDL code generation.

Data Types: single | double | uint8 | uint16 | fixed point

The pixelcontrol bus contains five signals. The signals describe the validity of the pixel and its location in the frame. For more information, see Pixel Control Bus.

Data Types: bus

Output

expand all

Pixel in Y'CbCr color space, returned as a vector of three values. The data type of the output pixels is the same as the data type of the input pixels.

The software supports double and single data types for simulation, but not for HDL code generation.

Data Types: single | double | uint8 | uint16 | fixed point

The pixelcontrol bus contains five signals. The signals describe the validity of the pixel and its location in the frame. For more information, see Pixel Control Bus.

Data Types: bus

Parameters

expand all

Main

If you select 4:4:4 to 4:2:2, the block performs a downsampling operation. If you select 4:2:2 to 4:4:4, the block performs an upsampling operation.

If you select Auto, the block uses a built-in lowpass filter. If you select Property, the Horizontal filter coefficients parameter appears on the dialog box. If you select None, the block does not filter the input signal.

Dependencies

This parameter is visible when you set Resampling to 4:4:4 to 4:2:2.

Coefficients for the antialiasing filter, specified as a vector.

Dependencies

This parameter is visible if you set Resampling to 4:4:4 to 4:2:2 and Antialiasing filter to Property.

If you select Linear, the block uses linear interpolation to calculate the missing values. If you select Pixel replication, the block repeats the chrominance values of the preceding pixel to create the missing pixel.

Dependencies

This parameter is visible if you set Resampling to 4:2:2 to 4:4:4.

Data Types

The parameters on this tab appear only when they are relevant. If you configure the block so that no filter coefficients are needed, or no rounding or overflow is possible, the irrelevant parameter is hidden.

Specify a rounding method for internal fixed-point calculations.

When you clear this parameter, fixed-point and integer values wrap around to zero when the value overflows what is representable with that data type. When you select this parameter, the value saturates at the maximum representable value.

This parameter applies when you set Antialiasing filter to Auto or Property.

Tips

  • When you use a block with an internal line buffer inside an Enabled Subsystem (Simulink), the enable signal pattern must maintain the timing of the pixel stream, including the minimum blanking intervals. If the enable pattern corrupts the timing of the pixel stream, you might see partial output frames, corrupted pixel stream control signals, or mismatches between Simulink® and HDL simulation results. You may need to extend the blanking intervals to accommodate for cycles when the enable is low. For more information, see Configure Blanking Intervals.

Algorithms

expand all

The default antialiasing filter is a 29-tap lowpass filter that matches the default Chroma Resampling block in Computer Vision Toolbox™. In the frequency response of this filter, the passband, [–0.25 0.25], occupies half of the total bandwidth. This filter suppresses aliasing after 4:4:4 to 4:2:2 downsampling.

Frequency response of the antialiasing filter

Whether you use the default filter or specify your own coefficients, the filter is implemented in HDL using a fully parallel architecture. To reduce the number of multipliers, HDL code generation takes advantage of symmetric, unity, or zero-value coefficients.

The block pads the edge of the image with symmetric pixel values. See Edge Padding. Also, if the frame is an odd number of pixels wide, the block symmetrically pads the line. This accommodation makes the block more resilient to video timing variation.

Extended Capabilities

Version History

Introduced in R2015a

See Also

Blocks

Objects