---
title: hi_venc_intra_refresh
description: "P帧刷Islice控制参数。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_1541.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_1541.html
indexId: 8d228d5cf96a304d573e17dba0fc62c5248dbc0d1504b97af3511b56768aa830105
---
# hi_venc_intra_refresh

#### 说明

P帧刷Islice控制参数。


#### 定义

```
typedef struct {
hi_bool
refresh_enable;
hi_venc_intra_refresh_mode
intra_refresh_mode;
hi_u32
refresh_num;
hi_u32
req_i_qp;
} hi_venc_intra_refresh;
```


#### 成员

| 成员名称 | 描述 |
| --- | --- |
| 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值。 hi\_mpi\_venc\_set\_intra\_refresh接口与hi\_mpi\_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 | 行：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 |
