venc_set_cu_pred
Applicability
Product |
Supported (√/x) |
|---|---|
x |
|
x |
|
x |
|
√ |
|
√ |
Function Usage
Adjusts the tendency of selecting the CU/MB mode of a channel and supports the tendency adjustment of the inter/intra-frame prediction and encoding block size.
In the encoding protocol, pixel blocks are used as basic processing units, such as the coding units (CUs) in H.265 and macroblocks (MBs) in H.264. The CU mode in this API refers to the selection of pixel blocks of different sizes in inter/intra-frame prediction mode.
Prototype
- C Prototype
1hi_s32 hi_mpi_venc_set_cu_pred(hi_venc_chn chn, const hi_venc_cu_prediction *cu_pred)
- Python Function
1ret = acl.himpi.venc_set_cu_pred(chn, cu_pred)
Parameter Description
Parameter |
Description |
|---|---|
chn |
Int, encoding channel ID.
|
cu_pred |
Dict, dictionary of the tendency to use the CU mode. For details, see hi_venc_cu_prediction. The dictionary contains the following parameters:
|
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, error code.
|
Restrictions
- Only H.264/H.265 encoding channels support this API.
- It is recommended that this API be called after a channel is created and before encoding is started, to reduce the number of the API calls during encoding. If this API is called during encoding, the configuration takes effect when the next frame is encoded.
- Before calling this API, you are advised to call acl.himpi.venc_get_cu_pred to obtain the tendency configuration of the CU mode.
- Note that specific modes are disabled in some scenarios. For example, when the maximum MB size is 16 x 16 in H.264, inter16_cost is included in the baseline and main profile, or inter8_cost is included in the high profile, they do not take effect, even if you have set the tendency parameter.