跳到主要内容

hi_vpc_pic_info

hi_venc_cu_prediction

说明

定义CU模式选择的倾向性配置结构体。

定义

hi_venc_cu_prediction = {"pred_mode": hi_op_mode,
"intra32_cost": intra32_cost,
"intra16_cost": intra16_cost,
"intra8_cost": intra8_cost,
"intra4_cost": intra4_cost,
"inter64_cost": inter64_cost,
"inter32_cost": inter32_cost,
"inter16_cost": inter16_cost,
"inter8_cost": inter8_cost}

成员

成员名称描述
pred_mode整型,倾向性选择模式,支持自动模式、手动模式两种。
intra32_cost整型,Intra32倾向性调节,对应帧内预测32*32像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。 H.264该值无效。
intra16_cost整型,Intra16倾向性调节,对应帧内预测16*16像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。
intra8_cost整型,Intra8倾向性调节,对应帧内预测8*8像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。
intra4_cost整型,Intra4倾向性调节,对应帧内预测4*4像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。
inter64_cost整型,Inter64倾向性调节,对应帧间预测64*64像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。 H.264该值无效。
inter32_cost整型,Inter32倾向性调节,对应帧间预测32*32像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。 H.264该值无效。
inter16_cost整型,Inter16倾向性调节,对应帧间预测16*16像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。
inter8_cost整型,Inter8倾向性调节,对应帧间预测8*8像素块尺寸模式,该值增大表示选择该模式的倾向性越小。 取值范围:[0, 15]。 默认值:8。

父主题: 视频/图像编码

hi_venc_intra_refresh

说明

P帧刷Islice控制参数。

定义

hi_venc_intra_refresh = {"refresh_enable": refresh_enable,
"intra_refresh_mode": hi_venc_intra_refresh_mode,
"refresh_num": refresh_num,
"req_i_qp": req_i_qp}

成员

成员名称描述
refresh_enable整型,是否使能刷Islice功能。
- 0:不使能,默认值;
- 1:使能 。
intra_refresh_mode整型,I宏块刷新模式,分为按行刷新和按列刷新。默认按行刷新。
refresh_num每次I宏块刷新行数或者列数,可以通过这个变量控制刷新的速度及码流的平稳程度。刷新行数或者列数越多,刷新的速度越快,但是码流平稳度越差;刷新的行数或者列数越少,刷新的速度越慢,但是码流平稳度越好。 需保证设置的refresh_num可以在一个GOP内完成Islice刷新,注意高级跳帧参考时只会在base层中的P帧(可被base层中其他帧的参考)进行刷新。refresh_num需满足表1中的计算公式。
req_i_qp整型,I帧QP值。 acl.himpi.venc_set_intra_refresh接口与acl.himpi.venc_request_idr接口配合使用时,该值用于控制插入的IDR帧的质量,该值越小,质量越好,插入的IDR帧大小越大。 取值范围:[0, 51] ,默认值51。

参考信息

表1 refresh_num参数值计算公式

默认值

计算公式

备注

H.264,refresh_num默认值为:

(pic_height +lcu_size-1)>>6

  • 行:refresh_num*(max_refresh_frame_in_gop - 1) >= (pic_height + lcu_size - 1) /lcu_size
  • 列:refresh_num*(max_refresh_frame_in_gop - 1) >= (pic_width + lcu_size - 1) /lcu_size

计算公式中的/表示向下取整。

  • GOP内P帧刷Islice最大帧数max_refresh_frame_in_gop参数值取值说明:
    • 无高级跳帧参考时:max_refresh_frame_in_gop = gop;
    • 有高级跳帧参考时:max_refresh_frame_in_gop = (gop + (base*(enhance+1) -1))/(base*(enhance+1))。
  • 编码单元尺寸lcu_size参数值取值说明:
    • H.264时,该参数值固定为16;
    • H265时:
      • Atlas 200/500 A2推理产品,该参数值固定为32

H.265,refresh_num默认值为: ((pic_height + lcu_size - 1)/lcu_size) >> 2

父主题: 视频/图像编码

hi_venc_intra_refresh_mode

说明

P帧刷Islice模式定义。

定义

INTRA_REFRESH_ROW = 0 # 按行刷新
INTRA_REFRESH_COLUMN = 1 # 按列刷新
INTRA_REFRESH_BUTT = 2

父主题: 视频/图像编码

hi_vpc_pic_info

说明

图像信息字典,用来描述VPC功能输入和输出图片信息。

定义

hi_vpc_pic_info = {"picture_address": picture_address,
"picture_buffer_size": picture_buffer_size,
"picture_width": picture_width,
"picture_height": picture_height,
"picture_width_stride": picture_width_stride,
"picture_height_stride": picture_height_stride,
"picture_format": hi_pixel_format}

成员

成员名称描述
picture_address整型,存放图片数据的Device地址。
picture_buffer_size整型,存放图片数据的缓冲区大小。
picture_width整型,图片真实宽。
picture_height整型,图片真实高。
picture_width_stride整型,图片宽Stride。
picture_height_stride整型,图片高Stride。
picture_format整型,目标图片的格式。

父主题: 图像处理

hi_vpc_crop_region

说明

VPC抠图功能需要的参数。

定义

hi_vpc_crop_region = {"top_offset": top_offset,
"left_offset": left_offset,
"crop_width": crop_width,
"crop_height": crop_height}

成员

成员名称描述
top_offset整型,上偏移。
left_offset整型,左偏移。
crop_width整型,抠图区域宽。
crop_height整型,抠图区域高。

父主题: 图像处理

hi_vpc_resize_info

说明

VPC缩放功能需要的参数。

定义

hi_vpc_resize_info = {"resize_width": resize_width,
"resize_height": resize_height,
"interpolation": interpolation}

成员

成员名称描述
resize_width整型,缩放之后的宽。
resize_height整型,缩放之后的高。
interpolation整型,缩放算法。 Atlas 200/500 A2推理产品,支持如下缩放算法:
- 0:业界通用的Bilinear算法(与OpenCV-3.4.2版本算法的计算结果相同)
- 1:业界通用的Nearest neighbor 算法(与OpenCV-3.4.2版本算法的计算结果相同)

父主题: 图像处理

hi_vpc_crop_region_info

说明

VPC抠图功能需要的参数。

定义

hi_vpc_crop_region_info = {"dest_pic_info": hi_vpc_pic_info,
"crop_region": hi_vpc_crop_region}

成员

成员名称描述
dest_pic_info字典,抠图目标图片信息。
crop_region字典,抠图区域信息。

父主题: 图像处理

在线提单