Functions
VXLIB_colorConvert_YUVXtoRGB_i8u_o8u

Functions

VXLIB_STATUS VXLIB_colorConvert_YUVXtoRGB_i8u_o8u (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint8_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, uint8_t x_value, uint8_t src_space)
 
VXLIB_STATUS VXLIB_colorConvert_YUVXtoRGB_i8u_o8u_checkParams (const uint8_t src[], const VXLIB_bufParams2D_t *src_addr, const uint8_t dst[], const VXLIB_bufParams2D_t *dst_addr, uint8_t x_value, uint8_t src_space)
 

Detailed Description

Function Documentation

◆ VXLIB_colorConvert_YUVXtoRGB_i8u_o8u()

VXLIB_STATUS VXLIB_colorConvert_YUVXtoRGB_i8u_o8u ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
uint8_t  dst[restrict],
const VXLIB_bufParams2D_t *  dst_addr,
uint8_t  x_value,
uint8_t  src_space 
)
Description:
Performs a color conversion operation from YUYV or UYVY to RGB.
Method:
Uses Q14 fixed point approximation of BT.709 and BT.601 coefficients
 BT.709
 R'= Y' + 0.0000*U + 1.5748*V
 G'= Y' - 0.1873*U - 0.4681*V
 B'= Y' + 1.8556*U + 0.0000*V

 BT.601
 R'= Y' + 0.000*U + 1.403*V
 G'= Y' - 0.344*U - 0.714*V
 B'= Y' + 1.773*U + 0.000*V
Parameters
[in]src[]Pointer to array containing input YUVX image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output RGB image (UQ8.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]x_valueParameter indicating whether to convert from YUYV (x_value = 0) or UYVY (x_value = 1)
[in]src_spaceParameter indicating the color space of src
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • YUVX Input (1 plane): src_addr
    • 'dim_x' refers to the number of luma pixel units per line
    • 'dim_y' refers to the number of lines in the image
    • 'stride_y' should be at least ('dim_x' * 2 * 1) bytes
  • RGB (1 plane): dst_addr
    • 'dim_x' refers to the number of RGB pixel units per line
    • 'dim_y' refers to the number of lines in the image
    • 'stride_y' should be at least ('dim_x' * 3 * 1) bytes
  • 'src_space' valid values:
    • VXLIB_COLOR_SPACE_NONE
    • VXLIB_COLOR_SPACE_BT601_525
    • VXLIB_COLOR_SPACE_BT601_625
    • VXLIB_COLOR_SPACE_BT709
    • VXLIB_COLOR_SPACE_DEFAULT
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Set widths equal to strides
    • Align all pointers to 8 byte boundaries
    • Set all stride and width values to a multiple of 8

◆ VXLIB_colorConvert_YUVXtoRGB_i8u_o8u_checkParams()

VXLIB_STATUS VXLIB_colorConvert_YUVXtoRGB_i8u_o8u_checkParams ( const uint8_t  src[],
const VXLIB_bufParams2D_t *  src_addr,
const uint8_t  dst[],
const VXLIB_bufParams2D_t *  dst_addr,
uint8_t  x_value,
uint8_t  src_space 
)
Description:
Checks the parameters for programming errors for the VXLIB_colorConvert_YUVXtoRGB_i8u_o8u function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • Both images shall have the same x and y dimensions
  • The stride_y of the src image shall be equal to or greater than dim_x * 2
  • The stride_y of the dst image shall be equal to or greater than dim_x * 3
  • x_value shall be not greater than 1
  • src_space shall be not greater than 3
Parameters
[in]src[]Pointer to array containing input YUVX image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output RGB image (UQ8.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]x_valueParameter indicating whether to convert from YUYV (x_value = 0) or UYVY (x_value = 1)
[in]src_spaceParameter indicating the color space of src

Copyright 2023, Texas Instruments Incorporated