hi_vpss_chn_attr

Description

Defines the static attributes of a VPSS physical channel.

Prototype

typedef struct {
    hi_bool             mirror_en;
    hi_bool             flip_en;
    hi_vpss_chn_mode    chn_mode;          /* RW; vpss channel's work mode. */
    hi_u32              width;
    hi_u32              height;
    hi_video_format     video_format;      /* RW; video format of target image. */
    hi_pixel_format     pixel_format;      /* RW; pixel format of target image. */
    hi_dynamic_range    dynamic_range;     /* RW; dynamic_range of target image. */
    hi_compress_mode    compress_mode;     /* RW; compression mode of the output. */
    hi_frame_rate_ctrl  frame_rate;        /* frame rate control info */
    hi_u32              depth;           /* RW; range: [0, 8]; user get list depth. */
    hi_aspect_ratio     aspect_ratio;      /* aspect ratio info. */
    hi_u32              reserved[10]; 
} hi_vpss_chn_attr;

Members

Member

Description

mirror_en

Reserved and not supported by the current version.

Manually set this parameter to 0 to avoid incompatibility with future versions.

flip_en

Reserved and not supported by the current version.

Manually set this parameter to 0 to avoid incompatibility with future versions.

chn_mode

Channel working mode.

width

Width of the target image.

  • The VPSS group ID is within the range of [0, 256). Both channel 0 and channel 1 support zoom-in and zoom-out.
  • The VPSS group ID is within the range of [256, 264). Different channels support different functions and have different restrictions as follows:
    • Channel 0 supports only upscaling, up to 16x upscaling. If the width of the picture before scaling is less than 4096 pixels, the output width cannot exceed 8192 pixels. If the width of the picture before scaling is greater than 4096 pixels, a maximum 2x scaling is allowed.
    • Channel 0 supports only downscaling, a maximum of 15x downscaling.

height

Height of the target image.

  • When the VPSS group ID is within the range of [0, 256), both channel 0 and channel 1 support zoom-in and zoom-out.
  • When the VPSS group ID is within the range of [256, 264). Different channels support different functions and have different restrictions as follows:
    • Channel 0 supports only upscaling, up to 16x upscaling.
    • Channel 0 supports only downscaling, a maximum of 15x downscaling.

video_format

Video format. Only HI_VIDEO_FORMAT_LINEAR is supported.

pixel_format

Pixel format of the target image

  • When the VPSS group ID is within the range of [0, 256). The following formats are supported:

    HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420 and HI_PIXEL_FORMAT_YUV_SEMIPLANAR_420

    If fisheye correction is enabled, only HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420 is supported.

  • When the VPSS group ID is within the range of [256, 264). The following formats are supported:
    • HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422, HI_PIXEL_FORMAT_YUV_SEMIPLANAR_422, HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420, HI_PIXEL_FORMAT_YUV_SEMIPLANAR_420 and HI_PIXEL_FORMAT_YUV_400.

      If fisheye correction is enabled, HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422, HI_PIXEL_FORMAT_YUV_SEMIPLANAR_422, and HI_PIXEL_FORMAT_YUV_SEMIPLANAR_420 are not supported.

    • Semi-planar 422-to-semi-planar 420 conversion is supported. UV inversion can be implemented by setting the channel output pixel format.

dynamic_range

Reserved

compress_mode

Only non-compression HI_COMPRESS_MODE_NONE is supported.

frame_rate

Frame rate control information.

  • If both the source frame rate and target frame rate are –1, the frame rate is not controlled. In auto mode, the frame rate control does not take effect.
  • The target frame rate must be lower than or equal to the source frame rate.

depth

Queue depth of channel frames obtained by users. If the queue length is 0, images cannot be obtained in HI_VPSS_CHN_MODE_USER mode.

When the fisheye correction function is enabled, one more image memory resource needs to be allocated.

Value range: [0, 8]

aspect_ratio

Aspect ratio parameter. During the processing of the aspect ratio, perform scaling before adding black borders. A larger scaling ratio will prolong processing by the Ascend AI Processor and may decrease the frame rate.

  • Filling color of the non-video areas after the aspect ratio is enabled. The value cannot be greater than 0xFFFFFF.
  • If the output image needs to be scaled, the image will be scaled to the size of the video area according to the aspect ratio. The scaling ratio cannot exceed that supported by the VPSS.
  • In ASPECT_RATIO_MANUAL mode, the coordinate values must meet the following requirements: X: greater than or equal to 0 and less than the channel image width; Y: greater than or equal to 0 and less than the channel image height; W: greater than or equal to 64 and less than or equal to the channel image width. H: The value is greater than or equal to 64 and less than or equal to the height of the channel image. The sum of X and W is less than or equal to the width of the channel image, and the sum of Y and H is less than or equal to the height of the channel image.

reserved

Reserved. To ensure compatibility in later versions, use the memset struct for resetting and initialization. Do not explicitly access the reserved field in the code.