Main Content

Chroma Resampler

Downsample or upsample chrominance component

  • Library:
  • Vision HDL Toolbox / Conversions

  • Chroma Resampler block

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.

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. The values can be uint8, uint16, or fixdt(0,N,0), where N is from 8 through 16.

double and single data types are supported for simulation, but not for HDL code generation.

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

Specify a pixelcontrol bus that 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.

double and single data types are supported for simulation, but not for HDL code generation.

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

Control signals associated with the pixel stream, returned as a pixelcontrol bus that 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.

Rounding mode applies when you select linear interpolation, or include an antialiasing filter.

Overflow can occur when you include an antialiasing filter. By default, fixed-point values wrap around on overflow.

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

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.

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

See Also

Blocks

Objects

Introduced in R2015a