v_vcresampler
Vitis Drivers API Documentation
Overview

Functions

int XV_VcrsmplInitialize (XV_Vcresampler_l2 *InstancePtr, u16 DeviceId)
 This function initializes the core instance. More...
 
void XV_VCrsmplStart (XV_Vcresampler_l2 *InstancePtr)
 This function starts the Chroma resampler core. More...
 
void XV_VCrsmplStop (XV_Vcresampler_l2 *InstancePtr)
 This function stops the Chroma resampler core. More...
 
void XV_VCrsmplLoadDefaultCoeff (XV_Vcresampler_l2 *InstancePtr)
 This function loads default filter coefficients in the chroma resampler coefficient storage based on the selected TAP configuration. More...
 
void XV_VCrsmplrLoadExtCoeff (XV_Vcresampler_l2 *InstancePtr, u16 num_taps, const short *Coeff)
 This function loads user defined filter coefficients in the horiz. More...
 
void XV_VCrsmplSetActiveSize (XV_Vcresampler_l2 *InstancePtr, u32 width, u32 height)
 This function configures the Chroma resampler active resolution. More...
 
void XV_VCrsmplSetFormat (XV_Vcresampler_l2 *InstancePtr, XVidC_ColorFormat formatIn, XVidC_ColorFormat formatOut)
 This function configures the Chroma resampler for the required format conversion. More...
 
void XV_VCrsmplDbgReportStatus (XV_Vcresampler_l2 *InstancePtr)
 This function prints Chroma Resampler status on the console. More...
 

Variables

const short XV_vcrsmplrcoeff_taps4 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_4]
 Coefficient table for 4-tap vertical chroma resampling conversions. More...
 
const short XV_vcrsmplrcoeff_taps6 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_6]
 Coefficient table for vertical chroma resampler with 6 taps. More...
 
const short XV_vcrsmplrcoeff_taps8 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_8]
 Coefficient table for vertical chroma resampling with 8 taps. More...
 
const short XV_vcrsmplrcoeff_taps10 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_10]
 Coefficient table for vertical chroma resampler with 10 taps. More...
 
const short XV_vcrsmplrcoeff_taps4 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_4]
 Coefficient table for 4-tap vertical chroma resampling conversions. More...
 
const short XV_vcrsmplrcoeff_taps6 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_6]
 Coefficient table for vertical chroma resampler with 6 taps. More...
 
const short XV_vcrsmplrcoeff_taps8 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_8]
 Coefficient table for vertical chroma resampling with 8 taps. More...
 
const short XV_vcrsmplrcoeff_taps10 [XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_10]
 Coefficient table for vertical chroma resampler with 10 taps. More...
 

Function Documentation

int XV_VcrsmplInitialize ( XV_Vcresampler_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_vcresampler_Initialize().

void XV_VCrsmplLoadDefaultCoeff ( XV_Vcresampler_l2 InstancePtr)

This function loads default filter coefficients in the chroma resampler coefficient storage based on the selected TAP configuration.

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

References XV_vcresampler::Config, XV_vcresampler_Config::NumTaps, XV_vcrsmplrcoeff_taps10, XV_vcrsmplrcoeff_taps4, XV_vcrsmplrcoeff_taps6, XV_vcrsmplrcoeff_taps8, and XV_VCrsmplrLoadExtCoeff().

void XV_VCrsmplrLoadExtCoeff ( XV_Vcresampler_l2 InstancePtr,
u16  num_taps,
const short *  Coeff 
)

This function loads user defined filter coefficients in the horiz.

chroma resampler coefficient storage

Parameters
InstancePtris a pointer to the core instance to be worked on.
num_tapsis the number of taps
Coeffis a pointer to user defined filter coefficients table
Returns
None

References XV_vcresampler::Config, and XV_vcresampler_Config::NumTaps.

Referenced by XV_VCrsmplLoadDefaultCoeff().

void XV_VCrsmplSetActiveSize ( XV_Vcresampler_l2 InstancePtr,
u32  width,
u32  height 
)

This function configures the Chroma resampler active resolution.

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

References XV_vcresampler_Set_HwReg_height(), and XV_vcresampler_Set_HwReg_width().

void XV_VCrsmplSetFormat ( XV_Vcresampler_l2 InstancePtr,
XVidC_ColorFormat  formatIn,
XVidC_ColorFormat  formatOut 
)

This function configures the Chroma resampler for the required format conversion.

Parameters
InstancePtris a pointer to the core instance to be worked on.
formatInis the input chroma format
formatOutis required chroma format
Returns
None

References XV_vcresampler::Config, XV_vcresampler_Config::ResamplingType, XV_vcresampler_Set_HwReg_input_video_format(), and XV_vcresampler_Set_HwReg_output_video_format().

void XV_VCrsmplStart ( XV_Vcresampler_l2 InstancePtr)

This function starts the Chroma resampler core.

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

References XV_vcresampler_EnableAutoRestart(), and XV_vcresampler_Start().

void XV_VCrsmplStop ( XV_Vcresampler_l2 InstancePtr)

This function stops the Chroma resampler core.

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

References XV_vcresampler_DisableAutoRestart().

Variable Documentation

const short XV_vcrsmplrcoeff_taps10[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_10]

Coefficient table for vertical chroma resampler with 10 taps.

This 3D array contains precomputed filter coefficients for chroma resampling conversions between 4:2:2 and 4:2:0 formats. The coefficients are organized as:

  • First dimension: Conversion type (e.g., 422->420, 420->422)
  • Second dimension: Filter phase
  • Third dimension: Tap index (10 taps per filter)

The coefficients are used by the vertical chroma resampler hardware or software to perform high-quality chroma sub-sampling or up-sampling.

See Also
XV_VCRSMPLR_NUM_CONVERSIONS
XV_VCRSMPLR_MAX_PHASES
XV_VCRSMPLR_TAPS_10

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps10[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_10]
Initial value:
=
{
{{ 0, 0, -988, 0, 1703, 2666, 1703, 0, -988, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},
{{ 305, -638, -586, 705, 2262, 2262, 705, -586, -638, 305},
{ 0, 0, 0, 0, 4096, 0, 0, 0, 0, 0}
}
}

Coefficient table for vertical chroma resampler with 10 taps.

This 3D array contains precomputed filter coefficients for chroma resampling conversions between 4:2:2 and 4:2:0 formats. The coefficients are organized as:

  • First dimension: Conversion type (e.g., 422->420, 420->422)
  • Second dimension: Filter phase
  • Third dimension: Tap index (10 taps per filter)

The coefficients are used by the vertical chroma resampler hardware or software to perform high-quality chroma sub-sampling or up-sampling.

See Also
XV_VCRSMPLR_NUM_CONVERSIONS
XV_VCRSMPLR_MAX_PHASES
XV_VCRSMPLR_TAPS_10

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps4[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_4]

Coefficient table for 4-tap vertical chroma resampling conversions.

This 3D array contains the filter coefficients used for vertical chroma resampling between different chroma subsampling formats (e.g., 4:2:2 to 4:2:0 and vice versa).

Dimensions:

  • [XV_VCRSMPLR_NUM_CONVERSIONS]: Number of conversion types (e.g., 422->420, 420->422).
  • [XV_VCRSMPLR_MAX_PHASES]: Number of filter phases per conversion.
  • [XV_VCRSMPLR_TAPS_4]: Number of taps (coefficients) per phase (4-tap filter).

Each entry contains the coefficients for a specific conversion and phase.

Example usage: XV_vcrsmplrcoeff_taps4[conversion][phase][tap]

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps4[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_4]
Initial value:
=
{
{{ 0, 1024, 2048, 1024},
{ 0, 0, 0, 0}
},
{{ 506, 1542, 1542, 506},
{ 0, 4096, 0, 0}
}
}

Coefficient table for 4-tap vertical chroma resampling conversions.

This 3D array contains the filter coefficients used for vertical chroma resampling between different chroma subsampling formats (e.g., 4:2:2 to 4:2:0 and vice versa).

Dimensions:

  • [XV_VCRSMPLR_NUM_CONVERSIONS]: Number of conversion types (e.g., 422->420, 420->422).
  • [XV_VCRSMPLR_MAX_PHASES]: Number of filter phases per conversion.
  • [XV_VCRSMPLR_TAPS_4]: Number of taps (coefficients) per phase (4-tap filter).

Each entry contains the coefficients for a specific conversion and phase.

Example usage: XV_vcrsmplrcoeff_taps4[conversion][phase][tap]

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps6[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_6]

Coefficient table for vertical chroma resampler with 6 taps.

This 3D array contains precomputed filter coefficients used by the vertical chroma resampler for different conversion modes and phases. The coefficients are organized as follows:

  • First dimension: Conversion type (e.g., 422->420, 420->422)
  • Second dimension: Phase of the resampling process
  • Third dimension: Tap coefficients for the filter (6 taps per phase)

The coefficients are used to perform chroma resampling between different chroma subsampling formats.

See Also
XV_VCRSMPLR_NUM_CONVERSIONS
XV_VCRSMPLR_MAX_PHASES
XV_VCRSMPLR_TAPS_6

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps6[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_6]
Initial value:
=
{
{{ 0, 0, 1298, 1500, 1298, 0},
{ 0, 0, 0, 0, 0, 0}
},
{{-327, 792, 1583, 1583, 792, -327},
{ 0, 0, 4096, 0, 0, 0}
}
}

Coefficient table for vertical chroma resampler with 6 taps.

This 3D array contains precomputed filter coefficients used by the vertical chroma resampler for different conversion modes and phases. The coefficients are organized as follows:

  • First dimension: Conversion type (e.g., 422->420, 420->422)
  • Second dimension: Phase of the resampling process
  • Third dimension: Tap coefficients for the filter (6 taps per phase)

The coefficients are used to perform chroma resampling between different chroma subsampling formats.

See Also
XV_VCRSMPLR_NUM_CONVERSIONS
XV_VCRSMPLR_MAX_PHASES
XV_VCRSMPLR_TAPS_6

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps8[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_8]

Coefficient table for vertical chroma resampling with 8 taps.

This 3D array contains precomputed filter coefficients used for vertical chroma resampling between different chroma subsampling formats (e.g., 4:2:2 to 4:2:0 and vice versa).

Dimensions:

  • [XV_VCRSMPLR_NUM_CONVERSIONS]: Number of conversion types (e.g., 422->420, 420->422).
  • [XV_VCRSMPLR_MAX_PHASES]: Number of filter phases.
  • [XV_VCRSMPLR_TAPS_8]: Number of taps per filter (8 taps).

Each entry contains the coefficients for a specific conversion and phase.

Example conversions:

  • 422->420: Downsampling from 4:2:2 to 4:2:0 chroma format.
  • 420->422: Upsampling from 4:2:0 to 4:2:2 chroma format.

Referenced by XV_VCrsmplLoadDefaultCoeff().

const short XV_vcrsmplrcoeff_taps8[XV_VCRSMPLR_NUM_CONVERSIONS][XV_VCRSMPLR_MAX_PHASES][XV_VCRSMPLR_TAPS_8]
Initial value:
=
{
{{ 0, -988, 0, 1703, 2666, 1703, 0, -988},
{ 0, 0, 0, 0, 0, 0, 0, 0}
},
{{-423, -903, 977, 2397, 2397, 977, -903, -423},
{ 0, 0, 0, 4096, 0, 0, 0, 0}
}
}

Coefficient table for vertical chroma resampling with 8 taps.

This 3D array contains precomputed filter coefficients used for vertical chroma resampling between different chroma subsampling formats (e.g., 4:2:2 to 4:2:0 and vice versa).

Dimensions:

  • [XV_VCRSMPLR_NUM_CONVERSIONS]: Number of conversion types (e.g., 422->420, 420->422).
  • [XV_VCRSMPLR_MAX_PHASES]: Number of filter phases.
  • [XV_VCRSMPLR_TAPS_8]: Number of taps per filter (8 taps).

Each entry contains the coefficients for a specific conversion and phase.

Example conversions:

  • 422->420: Downsampling from 4:2:2 to 4:2:0 chroma format.
  • 420->422: Upsampling from 4:2:0 to 4:2:2 chroma format.

Referenced by XV_VCrsmplLoadDefaultCoeff().