hi_video_frame

Description

Defines the dictionary of a source video frame.

Prototype

hi_video_frame = {"width": width,
                  "height": height,
                  "field": hi_video_field,
                  "pixel_format": hi_pixel_format,
                  "video_format": hi_video_format,
                  "compress_mode": hi_compress_mode,
                  "dynamic_range": hi_dynamic_range,
                  "color_gamut": hi_color_gamut,
                  "header_stride": [header_stride, header_stride, header_stride],
                  "width_stride": [width_stride, width_stride, width_stride],
                  "height_stride": [height_stride, height_stride, height_stride],
                  "header_phys_addr": [header_phys_addr, header_phys_addr, header_phys_addr],
                  "phys_addr": [phys_addr, phys_addr, phys_addr],
                  "header_virt_addr:[header_virt_addr_list, header_virt_addr_list, header_virt_addr_list],
                  "virt_addr": [virt_addr, virt_addr, virt_addr],
                  "time_ref": time_ref,
                  "pts": pts,
                  "user_data": [user_data],
                  "frame_flag": frame_flag, # frame_flag, can be OR operation.
                  "supplement": hi_video_supplement}

Members

Member

Description

width

Int, image width.

height

Int, image height.

field

Int, field mode, reserved.

pixel_format

Int, pixel format.

video_format

Int, video format,

compress_mode

Int, compression mode,

dynamic_range

Int, dynamic range, reserved.

color_gamut

Int, color gamut, reserved.

header_stride

List, header stride of image compression, reserved.

width_stride

List, width stride of an output image component. For a YUV image, this member indicates the stride of the Y, U, and V components. For an RGB image, this member indicates the stride of the R, G, and B components.

height_stride

List, height stride of an output image component. For a YUV image, this member indicates the stride of the Y, U, and V components. For an RGB image, this member indicates the stride of the R, G, and B components.

If VENC video encoding and JPEGE image encoding functions are involved, this parameter is reserved and is not supported.

header_phys_addr

List, physical address of the compression header, reserved.

phys_addr

List, physical address, reserved.

header_virt_addr

List, virtual address of the compression header, reserved.

virt_addr

List, start virtual address of an image in the device buffer.

For an input YUV image, virt_addr[0] is the start address of the image or Y component, virt_addr[1] is the start address of the U component, and virt_addr[2] is the start address of the V component.

For an output YUV or RGB image, virt_addr[0] is the start address of the image on the device, and virt_addr[1] and virt_addr[2] are reserved.

time_ref

Int, sequence number of an image frame.

This parameter is reserved in the decoding scenario.

This parameter is reserved in the JPEGE encoding scenario.

In the VENC encoding scenario, set this parameter to an even number in ascending order based on the frame sequence. For example, set this parameter to 2 for the first frame, 4 for the second frame, and so on.

pts

Int, image PTS.

user_data

List, private data, reserved.

frame_flag

Int.

  • In the VDEC decoding scenario, this parameter indicates whether a frame is successfully decoded. You need to release the input and output buffer in time regardless of whether the frame is successfully decoded. The system does not guarantee that the output order of frames that fail to be decoded is in the display sequence or decoding sequence. Value options of this parameter are as follows:
    • 0: The frame is decoded successfully.
    • 1: The frame fails to be decoded due to abnormal input stream or inconsistency between the configured stream format and the actual stream format.
    • 2: can be ignored. In the interlaced scenario where two fields are transmitted every frame, one of every two transmitted fields has no decoding output. This is a normal phenomenon. The decoding output of an interlaced stream is stored in the output buffers of the odd fields. In this case, you need to free the buffer in time.
    • 3: The frame fails to be decoded because the number of reference frames is incorrectly set.
    • 4: The frame fails to be decoded due to incorrect size of VDEC frame buffer.
  • In the JPEGD decoding scenario, this parameter indicates whether the frame is successfully decoded. You need to release the input and output buffers in time no matter whether the frame is successfully decoded. Value options are as follows:
    • 0: The frame is decoded successfully.
    • 1: The frame fails to be decoded due to abnormal input stream or inconsistency between the configured stream format and the actual stream format.
    • 4: The frame fails to be decoded because the size of the JPEGD decoding output buffer is insufficient. You can obtain the size of the output buffer by calling acl.himpi.vdec_get_jpegd_output_info in advance.
    • 5: The JPEGD decoding configuration parameters are incorrectly set. For example, the configured width or height exceeds the limit or the configured target decoding format is not supported. This value is used only in the JPEGD decoding scenario.
  • In the VENC encoding scenario, different bits are used to enable different functions:
    • Bit0 of this parameter indicates whether to enable the slice_temporal_mvp_enabled_flag syntax (whether to use temporal motion vector (MV) prediction for inter-frame prediction). Value options are as follows, but this parameter takes effect only when the H.265 protocol is used:
      • 0: temporal MVP enabled — slice_temporal_mvp_enabled_flag set to True.
      • 1: temporal MVP disabled — slice_temporal_mvp_enabled_flag set to False.
    • Bit1 of this parameter indicates whether to enable image edge expansion. Value options are as follows, and this parameter takes effect when the H.264 or H.265 protocol is used:
      • 0: image edge expansion enabled.
      • 1: image edge expansion disabled.
  • In the JPEGE encoding scenario, the value is 0 or 1. However, this parameter is not supported in the current version, and the parameter value is invalid.

supplement

Dictionary, supplementary image information,

Precautions

  • In general, 10-bit data is compactly stored in the buffer in non-compression mode.
  • For 10-bit YUV data, the first 8 bits and last 2 bits are stored separately in segment-based compressed mode.
  • For 10-bit tile 64x16 data, which is video decoder hardware (VDH) output, the first 8 bits and last 2 bits are stored separately in the buffer, regardless of whether the data is compressed or not.