Video and Vision Processing Suite Intel® FPGA IP User Guide

ID 683329
Date 6/26/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents
1. About the Video and Vision Processing Suite 2. Getting Started with the Video and Vision Processing IPs 3. Video and Vision Processing IPs Functional Description 4. Video and Vision Processing IP Interfaces 5. Video and Vision Processing IP Registers 6. Video and Vision Processing IPs Software Programming Model 7. Protocol Converter Intel® FPGA IP 8. 3D LUT Intel® FPGA IP 9. AXI-Stream Broadcaster Intel® FPGA IP 10. Bits per Color Sample Adapter Intel FPGA IP 11. Chroma Key Intel® FPGA IP 12. Chroma Resampler Intel® FPGA IP 13. Clipper Intel® FPGA IP 14. Clocked Video Input Intel® FPGA IP 15. Clocked Video to Full-Raster Converter Intel® FPGA IP 16. Clocked Video Output Intel® FPGA IP 17. Color Space Converter Intel® FPGA IP 18. Deinterlacer Intel® FPGA IP 19. FIR Filter Intel® FPGA IP 20. Frame Cleaner Intel® FPGA IP 21. Full-Raster to Clocked Video Converter Intel® FPGA IP 22. Full-Raster to Streaming Converter Intel® FPGA IP 23. Genlock Controller Intel® FPGA IP 24. Generic Crosspoint Intel® FPGA IP 25. Genlock Signal Router Intel® FPGA IP 26. Guard Bands Intel® FPGA IP 27. Interlacer Intel® FPGA IP 28. Mixer Intel® FPGA IP 29. Pixels in Parallel Converter Intel® FPGA IP 30. Scaler Intel® FPGA IP 31. Stream Cleaner Intel® FPGA IP 32. Switch Intel® FPGA IP 33. Tone Mapping Operator Intel® FPGA IP 34. Test Pattern Generator Intel® FPGA IP 35. Video and Vision Monitor Intel FPGA IP 36. Video Frame Buffer Intel® FPGA IP 37. Video Frame Reader Intel FPGA IP 38. Video Frame Writer Intel FPGA IP 39. Video Streaming FIFO Intel® FPGA IP 40. Video Timing Generator Intel® FPGA IP 41. Warp Intel® FPGA IP 42. Design Security 43. Document Revision History for Video and Vision Processing Suite User Guide

6. Video and Vision Processing IPs Software Programming Model

Most video and vision processing IPs are configurable at run-time. Memory-mapped run-time control interfaces expose a set of control registers to change the processing behavior and status registers to query the states of the processing functions. The set of available registers and the width in binary bits of each register varies with each control interface. You must assume that writable control registers and readable registers power up in an undefined state.

HAL Device Drivers for Nios II SBT

For software control and run-time reconfiguration, the Intel video and vision processing IPs have an associated software driver. The video IPs do not fit any of the generic device models provided by the Nios II HAL. Consequently, the bare-metal drivers only provide partial HAL support with a few dedicated accessor functions to the control and status registers. The video functions cannot be accessed indirectly through the generic HAL API or the ANSI C standard library.

Using these drivers in your application is optional. If you do not use drivers, Intel recommends you use the definitions provided by the register header files to control the IP components (*_regs.h) and avoid using unnamed constants and addresses to access the run-time register map from your application.

Refer to the Nios® II Software Developer's Handbook to get started with the Nios® II development tools.

Common Software API

Many Intel video and vision processing IPs expose a register map with common registers located at the same location (refer to the Video and Vision Processing Registers. To limit code footprint, many video and vision processing device structures (C struct) include a common device structure as their first member. This shared base allows the definition of a set of common functions to query the VID_PID and VERSION registers, respectively at addresses 0x0000 and 0x0004, and the set of IMG_INFO registers in the range 0x0120-0x013C.

Common API reference

Register definition header file: intel_vvp_core_regs.h

Include file: intel_vvp_core.h

Table 9.  Common API reference
Name Description
intel_vvp_core_init Initialize the instance.
intel_vvp_core_get_vendor_id Returns the vendor ID.
intel_vvp_core_get_product_id Returns the product ID.
intel_vvp_core_get_qpds_major Returns the version major number.
intel_vvp_core_get_qpds_update Returns the version update number.
intel_vvp_core_get_qpds_patch Returns the version patch number.
intel_vvp_core_get_register_map_version Returns the version number of the register map.
intel_vvp_core_get_img_info_width Returns the width read from the IMG_INFO_WIDTH register.
intel_vvp_core_get_img_info_height Returns the height read from the IMG_INFO_HEIGHT register.
intel_vvp_core_get_img_info_interlace Returns the interlace nibble read from the IMG_INFO_INTERLACE register.
intel_vvp_core_get_img_info_colorspace Returns the colorspace code read from the IMG_INFO_COLORSPACE register.
intel_vvp_core_get_img_info_subsampling Returns the subsampling code read from the IMG_INFO_SUBSAMPLING register.
intel_vvp_core_get_img_info_cositing Returns the cositing code read from the IMG_INFO_COSITING register.
intel_vvp_core_get_img_info_field_count Returns the field count code read from the IMG_INFO_FIELD_COUNT register.
intel_vvp_core_set_img_info_width Writes a width to the IMG_INFO_WIDTH register.
intel_vvp_core_set_img_info_height Writes a height to the IMG_INFO_HEIGHT register.
intel_vvp_core_set_img_info_interlace Writes an interlace nibble to the IMG_INFO_INTERLACE register.
intel_vvp_core_set_img_info_colorspace Writes a colorspace code to the IMG_INFO_COLORSPACE register.
intel_vvp_core_set_img_info_subsampling Writes a subsampling code to the IMG_INFO_SUBSAMPLING register.
intel_vvp_core_set_img_info_cositing Writes a cositing code to the IMG_INFO_COSITING register.

intel_vvp_core_init

Prototype
 eIntelVvpCoreErrors intel_vvp_core_init(intel_vvp_core_instance *instance, intel_vvp_core_base base, uint16_t expected_product_id);
Description

Initializes the common members intel_vvp_core_instance. The initialization stops early if the vendor ID or product ID read at the base address are not a match. Otherwise, the function proceeds to read and store the version numbers in the second register

Arguments

instance – pointer to the intel_vvp_core software driver instance structure

base – base address of the register map

expected_product_id – the expected product id

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

kIntelVvpCoreVidErr if the vendor id of the core is not the IntelFPGA vendor ID (0x6AF7).

kIntelVvpCorePidErr if the product_id does not match with the expectation

kIntelVvpCoreInstanceErr if the instance is a null pointer

intel_vvp_core_get_vendor_id

Prototype
uint16_t intel_vvp_core_get_vendor_id(void *instance);
Description

Query the vendor_id of an initialized instance

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the vendor_id field in the intel_vvp_core_instance instance

intel_vvp_core_get_product_id

Prototype
uint16_t intel_vvp_core_get_product_id(void *instance);
Description

Query the product _id of an initialized instance

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the product_id field in the intel_vvp_core_instance instance

intel_vvp_core_get_qpds_major

Prototype
uint8_t intel_vvp_core_get_qpds_major(void *instance);
Description

Query the major version number of an instance. The instance must have been initialized successfully.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the major version number field in the intel_vvp_core_instance instance

intel_vvp_core_get_qpds_update

Prototype
uint8_t intel_vvp_core_get_qpds_ update(void *instance);
Description

Query the minor version number of an instance. The instance must have been initialized successfully.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the update (minor) version number field in the intel_vvp_core_instance instance

intel_vvp_core_get_qpds_patch

Prototype
uint8_t intel_vvp_core_get_qpds_patch(void *instance);
Description

Query the patch version number of an instance. The instance must have been initialized successfully.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the patch (build) version number field in the intel_vvp_core_instance instance

intel_vvp_core_get_register_map_version

Prototype
uint8_t intel_vvp_core_get_register_map_version(void *instance);
Description

Query the register map version number of an instance. The instance must have been initialized successfully.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the register map version number field in the intel_vvp_core_instance instance

intel_vvp_core_get_img_info_width

Prototype
uint32_t intel_vvp_core_get_img_info_width(void *instance);
Description

Read the IMG_INFO_WIDTH register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info width register

intel_vvp_core_get_img_info_height

Prototype
uint32_t intel_vvp_core_get_img_info_height(void *instance);
Description

Read the IMG_INFO_HEIGHT register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info height register

intel_vvp_core_get_img_info_interlace

Prototype
uint8_t intel_vvp_core_get_img_info_interlace(void *instance);
Description

Read the IMG_INFO_INTERLACE register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info interlace register

intel_vvp_core_get_img_info_colorspace

Prototype
uint8_t intel_vvp_core_get_img_info_colorspace(void *instance);
Description

Read the IMG_INFO_COLORSPACE register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info colorspace register

intel_vvp_core_get_img_info_subsampling

Prototype
uint8_t intel_vvp_core_get_img_info_subsampling(void *instance);
Description

Read the IMG_INFO_SUBSAMPLING register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info subsampling register

intel_vvp_core_get_img_info_cositing

Prototype
uint8_t intel_vvp_core_get_img_info_cositing(void *instance);
Description

Read the IMG_INFO_COSITING register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info cositing register

intel_vvp_core_get_img_info_field_count

Prototype
uint16_t intel_vvp_core_get_img_info_field_count(void *instance);
Description

Read the IMG_INFO_FIELD_COUNT register of an instance. The instance must have been initialized successfully and the register readable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

Returns

the value returned from a read to the image info field count register

intel_vvp_core_set_img_info_width

Prototype
eIntelVvpCoreErrors intel_vvp_core_set_img_info_width(void *instance, uint32_t width);
Description

Write a new width to the IMG_INFO_WIDTH register of an instance. The instance must have been initialized successfully and the register writable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

width – new width

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

intel_vvp_core_set_img_info_height

Prototype
eIntelVvpCoreErrors intel_vvp_core_set_img_info_height(void *instance, uint32_t height);
Description

Write a new height to the IMG_INFO_HEIGHT register of an instance. The instance must have been initialized successfully and the register writable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

height – new height

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

intel_vvp_core_set_img_info_interlace

Prototype
eIntelVvpCoreErrors intel_vvp_core_set_img_info_interlace(void *instance, uint8_t height);
Description

Write a new interlace to the IMG_INFO_INTERLACE register of an instance. The instance must have been initialized successfully and the register writable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

height – new height

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

intel_vvp_core_set_img_info_colorspace

Prototype
eIntelVvpCoreErrors intel_vvp_core_set_img_info_colorpsace (void *instance, uint8_t colorspace);
Description

Write a new colorspace to the IMG_INFO_COLORSPACE register of an instance. The instance must have been initialized successfully and the register writable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

colorspace – new colorspace

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

intel_vvp_core_set_img_info_subsampling

Prototype
eIntelVvpCoreErrors intel_vvp_core_set_img_info_subsampling(void *instance, uint8_t subsampling);
Description

Write a new subsampling to the IMG_INFO_SUBSAMPLING register of an instance. The instance must have been initialized successfully and the register writable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

subsampling – new subsampling

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

intel_vvp_core_set_img_info_cositing

Prototype
eIntelVvpCoreErrors intel_vvp_core_set_img_info_cositing (void *instance, uint8_t cositing);
Description

Write a new cositing to the IMG_INFO_COSITING register of an instance. The instance must have been initialized successfully and the register writable.

Arguments

instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it

cositing – new cositing

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error