hi_mpi_venc_set_ref_param
The
The
Description
Sets the advanced frame skipping reference parameters of an H.264/H.265 encoding channel to change the inter-frame reference relationship. For details about the advanced frame skipping mode, see Advanced Frame Skipping Modes.
Restrictions
- When an H.264/H.265 encoding channel is created, the 1x frame skipping reference mode is used by default. To change the reference mode, you are advised to call this API after creating an encoding channel but before starting encoding. This reduces the number of the API calls during encoding.
- If this API is called during encoding, the configuration takes effect only after the next I-frame is encoded.
- To set the 1x frame skipping reference mode, set pred_en = HI_TRUE, enhance = 0, and base = 1. To set the 2x frame skipping reference mode, set pred_en = HI_TRUE, enhance = 1, and base = 1. To set the 4x frame skipping reference mode, set pred_en = HI_TRUE, enhance = 1, and base = 2.
- If the GOP mode of the channel is set to HI_VENC_GOP_MODE_DUAL_P, the value of sp_interval must be set to (enhance + 1) x base. If sp_interval is not 0, pred_en must be set to HI_TRUE.
- If the GOP mode of the channel is set to HI_VENC_GOP_MODE_SMART_P, the pred_en parameter must be set to HI_TRUE.
- If the GOP mode of the channel is set to HI_VENC_GOP_MODE_BIPREDB, the value of enhance must be equal to that of b_frame_num.
Prototype
hi_s32 hi_mpi_venc_set_ref_param(hi_venc_chn chn, const hi_venc_ref_param *ref_param)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
chn |
Input |
Encoding channel ID. |
|
ref_param |
Input |
Pointer to the advanced frame skipping reference parameters for an H.264/H.265 encoding channel. |
Returns
- 0: success
- Other values: failure. For details, see VENC/JPEGE Return Codes.
Advanced Frame Skipping Modes
The advanced frame skipping reference modes involve three parameters: base, enhance, and pred_en. For details about their meanings, see hi_venc_ref_param. The following figures show the advanced frame skipping reference modes.
- To configure the advanced frame skipping reference in dual_p mode when sp_interval is not 0, the following condition must be met: base x (enhance + 1) = sp_interval. Using the 4x advanced frame skipping reference (base = 2 and enhance = 1) as an example, sp_interval of the dual_p mode = 2 x (1 + 1) = 4.
- Schematic diagram of advanced frame skipping reference in normal_p mode




