v_csc
Vitis Drivers API Documentation
Overview

Data Structures

struct  XV_Csc_l2
 Csc driver Layer 2 data. More...
 

Macros

#define XV_CscSetColorDepth(InstancePtr, val)   ((InstancePtr)->ColorDepth = val)
 This macro sets color depth for CSC core. More...
 
#define XV_CscGetBrightness(InstancePtr)   (((InstancePtr)->Brightness-20)/2)
 This macro returns current brightness setting by reading layer 2 fw register map. More...
 
#define XV_CscGetContrast(InstancePtr)   (((InstancePtr)->Contrast+200)/4)
 This macro returns current contrast setting by reading layer 2 fw register map. More...
 
#define XV_CscGetSaturation(InstancePtr)   (((InstancePtr)->Saturation/2))
 This macro returns current saturation setting by reading layer 2 fw register map. More...
 
#define XV_CscGetRedGain(InstancePtr)   (((InstancePtr)->RedGain-20)/2)
 This macro returns current red gain setting by reading layer 2 fw register map. More...
 
#define XV_CscGetGreenGain(InstancePtr)   (((InstancePtr)->GreenGain-20)/2)
 This macro returns current green gain setting by reading layer 2 fw register map. More...
 
#define XV_CscGetBlueGain(InstancePtr)   (((InstancePtr)->BlueGain-20)/2)
 This macro returns current blue gain setting by reading layer 2 fw register map. More...
 
#define XV_CscGetColorFormatIn(InstancePtr)   ((InstancePtr)->ColorFormatIn)
 This macro returns current set input color format by reading layer 2 fw register map. More...
 
#define XV_CscGetColorFormatOut(InstancePtr)   ((InstancePtr)->ColorFormatOut)
 This macro returns current set output color format by reading layer 2 fw register map. More...
 
#define XV_CscGetColorStdIn(InstancePtr)   ((InstancePtr)->StandardIn)
 This macro returns current set input color standard by reading layer 2 fw register map. More...
 
#define XV_CscGetColorStdOut(InstancePtr)   ((InstancePtr)->StandardOut)
 This macro returns current set output color standard by reading layer 2 fw register map. More...
 
#define XV_CscGetOutputRange(InstancePtr)   ((InstancePtr)->OutputRange)
 This macro returns current set output range by reading layer 2 fw register map. More...
 
#define XV_CscIs422Enabled(InstancePtr)   ((InstancePtr)->Csc.Config.Is422Enabled)
 This macro checks if Csc instance is enabled for 4:2:2 processing. More...
 
#define XV_CscIs420Enabled(InstancePtr)   ((InstancePtr)->Csc.Config.Is420Enabled)
 This macro checks if Csc instance is enabled for 4:2:0 processing. More...
 
#define XV_CscIsDemoWindowEnabled(InstancePtr)   ((InstancePtr)->Csc.Config.IsDemoWindowEnabled)
 This macro checks if Csc instance is enabled for the Demo Window. More...
 

Enumerations

enum  XV_CSC_REG_UPDT_WIN
 This typedef enumerates the window within which the csc core will have an impact. More...
 
enum  XV_CSC_FW_REG_MMAP
 CSC Layer 2 Register Map. More...
 

Functions

int XV_CscInitialize (XV_Csc_l2 *InstancePtr, u16 DeviceId)
 This function initializes the core instance. More...
 
void XV_CscSetPowerOnDefaultState (XV_Csc_l2 *CscPtr)
 This function sets the CSC IP layer 2 fw registers to power on default state. More...
 
void XV_CscStart (XV_Csc_l2 *InstancePtr)
 This function starts the Color space converter core. More...
 
void XV_CscStop (XV_Csc_l2 *InstancePtr)
 This function stops the Color space converter. More...
 
void XV_CscSetActiveSize (XV_Csc_l2 *InstancePtr, u32 width, u32 height)
 This function set the frame resolution for the Color space converter This also will reset the demo window to full frame. More...
 
int XV_CscSetDemoWindow (XV_Csc_l2 *InstancePtr, XVidC_VideoWindow *DemoWindow)
 This function sets the demo window for the Color space converter. More...
 
int XV_CscSetColorspace (XV_Csc_l2 *InstancePtr, XVidC_ColorFormat cfmtIn, XVidC_ColorFormat cfmtOut, XVidC_ColorStd cstdIn, XVidC_ColorStd cstdOut, XVidC_ColorRange cRangeOut)
 This function configures the Color space converter to user specified settings. More...
 
void XV_CscSetBrightness (XV_Csc_l2 *InstancePtr, s32 val)
 This function set brightness to specified value. More...
 
void XV_CscSetContrast (XV_Csc_l2 *InstancePtr, s32 val)
 This function set contrast to specified value. More...
 
void XV_CscSetSaturation (XV_Csc_l2 *InstancePtr, s32 val)
 This function set saturation to specified value. More...
 
void XV_CscSetRedGain (XV_Csc_l2 *InstancePtr, s32 val)
 This function set red gain to specified value. More...
 
void XV_CscSetGreenGain (XV_Csc_l2 *InstancePtr, s32 val)
 This function set green gain to specified value. More...
 
void XV_CscSetBlueGain (XV_Csc_l2 *InstancePtr, s32 val)
 This function set blue gain to specified value. More...
 
void XV_CscDbgReportStatus (XV_Csc_l2 *InstancePtr)
 This function prints CSC IP status on console. More...
 

Macro Definition Documentation

#define XV_CscGetBlueGain (   InstancePtr)    (((InstancePtr)->BlueGain-20)/2)

This macro returns current blue gain setting by reading layer 2 fw register map.

It also translates between hw register value and user view

Parameters
InstancePtris pointer to csc core layer 2
Returns
current user view value (0-100)
#define XV_CscGetBrightness (   InstancePtr)    (((InstancePtr)->Brightness-20)/2)

This macro returns current brightness setting by reading layer 2 fw register map.

It also translates between hw register value and user view

Parameters
InstancePtris pointer to csc core layer 2
Returns
current user view value (0-100)
#define XV_CscGetColorFormatIn (   InstancePtr)    ((InstancePtr)->ColorFormatIn)

This macro returns current set input color format by reading layer 2 fw register map.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Current set input color format
  • XVIDC_CSF_RGB
  • XVIDC_CSF_YCRCB_444
  • XVIDC_CSF_YCRCB_422
  • XVIDC_CSF_YCRCB_420
#define XV_CscGetColorFormatOut (   InstancePtr)    ((InstancePtr)->ColorFormatOut)

This macro returns current set output color format by reading layer 2 fw register map.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Current set output color format
  • XVIDC_CSF_RGB
  • XVIDC_CSF_YCRCB_444
  • XVIDC_CSF_YCRCB_422
  • XVIDC_CSF_YCRCB_420
#define XV_CscGetColorStdIn (   InstancePtr)    ((InstancePtr)->StandardIn)

This macro returns current set input color standard by reading layer 2 fw register map.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Current set input color standard
  • XVIDC_BT_2020
  • XVIDC_BT_709
  • XVIDC_BT_601
#define XV_CscGetColorStdOut (   InstancePtr)    ((InstancePtr)->StandardOut)

This macro returns current set output color standard by reading layer 2 fw register map.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Current set output color standard
  • XVIDC_BT_2020
  • XVIDC_BT_709
  • XVIDC_BT_601
#define XV_CscGetContrast (   InstancePtr)    (((InstancePtr)->Contrast+200)/4)

This macro returns current contrast setting by reading layer 2 fw register map.

It also translates between hw register value and user view

Parameters
InstancePtris pointer to csc core layer 2
Returns
current user view value (0-100)
#define XV_CscGetGreenGain (   InstancePtr)    (((InstancePtr)->GreenGain-20)/2)

This macro returns current green gain setting by reading layer 2 fw register map.

It also translates between hw register value and user view

Parameters
InstancePtris pointer to csc core layer 2
Returns
current user view value (0-100)
#define XV_CscGetOutputRange (   InstancePtr)    ((InstancePtr)->OutputRange)

This macro returns current set output range by reading layer 2 fw register map.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Current set output range
  • XVIDC_CR_16_235
  • XVIDC_CR_16_240
  • XVIDC_CR_0_255
#define XV_CscGetRedGain (   InstancePtr)    (((InstancePtr)->RedGain-20)/2)

This macro returns current red gain setting by reading layer 2 fw register map.

It also translates between hw register value and user view

Parameters
InstancePtris pointer to csc core layer 2
Returns
current user view value (0-100)
#define XV_CscGetSaturation (   InstancePtr)    (((InstancePtr)->Saturation/2))

This macro returns current saturation setting by reading layer 2 fw register map.

It also translates between hw register value and user view

Parameters
InstancePtris pointer to csc core layer 2
Returns
current user view value (0-100)
#define XV_CscIs420Enabled (   InstancePtr)    ((InstancePtr)->Csc.Config.Is420Enabled)

This macro checks if Csc instance is enabled for 4:2:0 processing.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Returns 1 if condition is TRUE or 0 if FALSE

Referenced by XV_CscDbgReportStatus(), and XV_CscSetColorspace().

#define XV_CscIs422Enabled (   InstancePtr)    ((InstancePtr)->Csc.Config.Is422Enabled)

This macro checks if Csc instance is enabled for 4:2:2 processing.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Returns 1 if condition is TRUE or 0 if FALSE

Referenced by XV_CscDbgReportStatus(), and XV_CscSetColorspace().

#define XV_CscIsDemoWindowEnabled (   InstancePtr)    ((InstancePtr)->Csc.Config.IsDemoWindowEnabled)

This macro checks if Csc instance is enabled for the Demo Window.

Parameters
InstancePtris pointer to csc core layer 2
Returns
Returns 1 if condition is TRUE or 0 if FALSE

Referenced by XV_CscDbgReportStatus(), XV_CscSetActiveSize(), and XV_CscSetDemoWindow().

#define XV_CscSetColorDepth (   InstancePtr,
  val 
)    ((InstancePtr)->ColorDepth = val)

This macro sets color depth for CSC core.

Parameters
InstancePtris a pointer to csc layer 2 fw register map
valis the requested color depth
Returns
None

Enumeration Type Documentation

CSC Layer 2 Register Map.

Each instance of the csc core will have it's own register map

This typedef enumerates the window within which the csc core will have an impact.

Coordinates outside the window will be passed as-is to output

Function Documentation

void XV_CscDbgReportStatus ( XV_Csc_l2 InstancePtr)

This function prints CSC IP status on console.

Parameters
InstancePtris the instance pointer to the CSC IP instance to be worked on
Returns
None

References XV_csc_Config::BaseAddress, XV_csc::Config, XV_CscIs420Enabled, XV_CscIs422Enabled, and XV_CscIsDemoWindowEnabled.

int XV_CscInitialize ( XV_Csc_l2 InstancePtr,
u16  DeviceId 
)

This function initializes the core instance.

Parameters
InstancePtris a pointer to core instance to be worked upon
DeviceIdis instance id of the core
Returns
XST_SUCCESS if device is found and initialized XST_DEVICE_NOT_FOUND if device is not found

References XV_CscSetPowerOnDefaultState().

void XV_CscSetActiveSize ( XV_Csc_l2 InstancePtr,
u32  width,
u32  height 
)

This function set the frame resolution for the Color space converter This also will reset the demo window to full frame.

Parameters
InstancePtris a pointer to the core instance to be worked on.
widthis the input stream width
heightis the input stream height
Returns
None

References XV_CscIsDemoWindowEnabled.

void XV_CscSetBlueGain ( XV_Csc_l2 InstancePtr,
s32  val 
)

This function set blue gain to specified value.

It also translates user setting of 0-100 to hw register range

Parameters
InstancePtris pointer to csc core instance
valis new gain value
Returns
None
void XV_CscSetBrightness ( XV_Csc_l2 InstancePtr,
s32  val 
)

This function set brightness to specified value.

It also translates user setting of 0-100 to hw register range

Parameters
InstancePtris pointer to csc core instance
valis new brightness value
Returns
None
int XV_CscSetColorspace ( XV_Csc_l2 InstancePtr,
XVidC_ColorFormat  cfmtIn,
XVidC_ColorFormat  cfmtOut,
XVidC_ColorStd  cstdIn,
XVidC_ColorStd  cstdOut,
XVidC_ColorRange  cRangeOut 
)

This function configures the Color space converter to user specified settings.

Before any feature specific calls in layer-2 driver is made the csc core should have been configured via this call.

Parameters
InstancePtris a pointer to the core instance to be worked on.
cfmtInis input color space
cfmtOutis output color space
cstdInis input color standard
cstdOutis output color standard
cRangeOutis the selected output range
Returns
XST_SUCCESS if the requested color format is allowed XST_FAILURE if YUV422/420 color format is requested but not allowed

References XV_CscIs420Enabled, and XV_CscIs422Enabled.

void XV_CscSetContrast ( XV_Csc_l2 InstancePtr,
s32  val 
)

This function set contrast to specified value.

It also translates user setting of 0-100 to hw register range

Parameters
InstancePtris pointer to csc core instance
valis new contrast value
Returns
None
int XV_CscSetDemoWindow ( XV_Csc_l2 InstancePtr,
XVidC_VideoWindow *  DemoWindow 
)

This function sets the demo window for the Color space converter.

Any pixel outside the demo window will not be impacted and will be passed to output as-is

Parameters
InstancePtris a pointer to the core instance to be worked on.
DemoWindowis structure that contains window coordinates and size
Returns
XST_SUCCESS if this core instance has the demo window enabled XST_FAILURE if this instance does not have the demo window enabled

References XV_CscIsDemoWindowEnabled.

void XV_CscSetGreenGain ( XV_Csc_l2 InstancePtr,
s32  val 
)

This function set green gain to specified value.

It also translates user setting of 0-100 to hw register range

Parameters
InstancePtris pointer to csc core instance
valis new gain value
Returns
None
void XV_CscSetPowerOnDefaultState ( XV_Csc_l2 CscPtr)

This function sets the CSC IP layer 2 fw registers to power on default state.

Parameters
CscPtris a pointer to the layer 2
Returns
None

Referenced by XV_CscInitialize().

void XV_CscSetRedGain ( XV_Csc_l2 InstancePtr,
s32  val 
)

This function set red gain to specified value.

It also translates user setting of 0-100 to hw register range

Parameters
InstancePtris pointer to csc core instance
valis new gain value
Returns
None
void XV_CscSetSaturation ( XV_Csc_l2 InstancePtr,
s32  val 
)

This function set saturation to specified value.

It also translates user setting of 0-100 to hw register range

Parameters
InstancePtris pointer to csc core instance
valis new saturation value
Returns
None
void XV_CscStart ( XV_Csc_l2 InstancePtr)

This function starts the Color space converter core.

Parameters
InstancePtris a pointer to the core instance to be worked on.
Returns
None
void XV_CscStop ( XV_Csc_l2 InstancePtr)

This function stops the Color space converter.

Parameters
InstancePtris a pointer to the core instance to be worked on.
Returns
None