Video and Image Processing Suite User Guide

ID 683416
Date 2/12/2021
Public

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

Document Table of Contents

24.8. Warp Lite IP API

The API simplifies programming the control registers.

The recommended sequence at startup is:

set_off_screen_R(<unsigned int> value); 
set_off_screen_G(<unsigned int> value); 
set_off_screen_B(<unsigned int> value); 
gen_coefficients(<float> distortion, <bool> top_correction, <bool> h_flip, <int> width, <int> height) 
apply_coefficients() 
start() 

The start() function (and its stop() counterpart) are inherited from the VipCore class.

The sequence to change coefficients in use is simply

gen_coefficients(<float> distortion, <bool> top_correction, <bool> h_flip, <int> width, <int> height)
apply_coefficients()
Table 81.  Warp IP API Functions
Name Description
gen_coefficients Generates a valid set of coefficients for the control registers from the input arguments. Write the arguments to the control registers using the apply_coefficients() function. If the input arguments generate an invalid coefficient set, the coefficient set is left unmodified and a terminal message is displayed. If you call the apply_coefficients() function, the IP applies the last valid set and you see no change in IP behavior.
apply_coefficients Produces a coefficient set generated by the gen_coefficients() function to the control registers. If you never call the gen_coefficients() function, the IP produces the default passthrough coefficients. If you calll the gen_coefficients() function but it fails, the IP produces the previous valid values. If you set no such values, the IP produces the default passthrough coefficients.
set_offscreen_R Sets the value of the RGB[R]/YCbCr[Y] component for the IP to use for offscreen pixels.
set_offscreen_G Sets the value of the RGB[G]/YCbCr[Cb] component for the IP to use for offscreen pixels.
set_offscreen_B Sets the value of the RGB[B]/YCbCr[Cr] component for the IP to use for offscreen pixels.
Start Sets the GO bit of the control register.
Stop Clears the GO bit of the control register.

gen_coefficients Function

Arguments
float distortion_ratio: Amount of distortion to apply from 0 to 0.3
bool top_correction: Select edge to which vertical keystone applies. Top(true) or bottom (false).
bool h_flip: Select whether to apply horizontal flip (true) or not (false)
int width: Width of image to warp. int height: Height of image to warp.
Return Value
Void
Example
gen_coefficients(0.15, true, false, 1920,1080); Specify a top edge keystone correction of 15% to HD frames
gen_coefficients(0,false,true,720,576);Apply a horizontal flip without keystone to SD frames.
gen_coefficients(0.3,false,true,1280,720); Apply a bottom edge keystone of 30% with horizontal flip to 1280x720 frames.

apply_coefficients Function

Arguments
Void
Return Value
Void
Example
apply_coefficients();

set_offscreen_R Function

Arguments
Int: Value
Return Value
Void
Example
Set_offscreen_R(255); Set the RGB R component to full red for 8 bit color planes.

set_offscreen_G Function

Arguments
Int: Value
Return Value
Void
Example
Set_offscreen_G(255); Set the RGB G component to full green for 8 bit color planes.

set_offscreen_B Function

Arguments
Int: Value
Return Value
Void
Example
Set_offscreen_B(255); Set the RGB B component to full blue for 8 bit color planes.

Start Function

Arguments
Void
Return Value
Void
Example
stop();

Start Function

Arguments
Void
Return Value
Void
Example
stop();