H264_ENC
H264_ENC API Status
API |
BK7258_AP |
|---|---|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
H264_ENC Marco defined and config
Marco name |
illustrate |
|---|---|
CONFIG_H264 |
enable H264_ENC module or not |
Note
CONFIG_H264 depends on CONFIG_YUV_BUF, H264 module can not work alone. Those api only for reference, user can not use them directly. Please referecnce doorbell project.
H264_ENC API Reference
Header File
Functions
-
bk_err_t bk_h264_driver_init(void)
init h264 driver
This API use to init h264 driver register and register system isr
- Returns
BK_OK: succeed
others: other errors.
-
bk_err_t bk_h264_driver_deinit(void)
deinit h264 driver
This API use to deinit h264 driver register and deregister system isr
- Returns
BK_OK: succeed
others: other errors.
-
bk_err_t bk_h264_init(uint16_t width, uint16_t height)
Init the h264 encoder.
This API init the h264 encoder
vote cpu to 480MHz
vote video power on
set h264 clk enable
enable h264 system isr
according image resolution, config release register
- Parameters
width – input image width
height – input image height
- Returns
BK_OK: succeed
others: other errors.
-
bk_err_t bk_h264_deinit(void)
Deinitialize the H264 module.
This API deinitialize the H264 module
vote cpu to default
vote video power off
disable h264 clk
disable h264 system isr
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_set_base_config(h264_compress_ratio_t *config)
config h264 encode ratio
This API modify h264 register to config encode ratio, you can call anytime
- Parameters
config – compress ratio config
profile_idc: profile idc
p_frame_cnt: p frame count
qp: qp
num_imb_bits: num imb bits
num_pmb_bits: num pmb bits
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_get_h264_base_config(h264_base_config_t *config)
get h264 encode base config
This API get h264 encode base config, you can call anytime
- Parameters
config – h264 base config
profile_idc: profile idc
p_frame_cnt: p frame count
qp: qp
num_imb_bits: num imb bits
num_pmb_bits: num pmb bits
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_set_pframe_num(uint32_t pframe_number)
set h264 encode p frame count
This API can set h264 encode p frame count
- Attention
if you use h264 pipeline, suggest modify it by CONFIG_H264_P_FRAME_CNT
- Parameters
pframe_number – p frame number
- Returns
BK_OK: Success
others: Other errors
-
uint32_t bk_h264_get_pframe_num(void)
get h264 encode p frame count
This API get h264 encode p frame count
- Returns
p frame number
-
bk_err_t bk_h264_set_qp(h264_qp_t *qp)
set h264 encode qp
This API can set h264 encode qp
- Parameters
qp – qp config
qp: qp
num_imb_bits: num imb bits
num_pmb_bits: num pmb bits
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_set_quality(uint32_t imb_bits, uint32_t pmb_bits)
set h264 encode qp
This API can set h264 encode qp
- Parameters
imb_bits – imb bits
pmb_bits – pmb bits
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_encode_enable(void)
enable h264 encode
This API enable h264 encode
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_encode_disable(void)
disable h264 encode
This API disable h264 encode
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_soft_reset(void)
soft reset h264
This API soft reset h264, you can call this to reset encode logical, can regenrate idr frame
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_config_reset(void)
config reset h264 driver
This API config reset h264 driver, reset all register to init status
- Attention
this api will reconfig h264 all register
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_get_fifo_addr(uint32_t *fifo_addr)
get h264 encode fifo addr
This API get h264 encode fifo addr
- Parameters
fifo_addr – h264 encode fifo addr
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_register_isr(h264_isr_type_t type_id, h264_isr_t isr, void *param)
register h264 isr
This API register h264 isr
- Parameters
type_id – isr type
isr – isr callback function
param – isr param
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_unregister_isr(h264_isr_type_t type_id)
unregister h264 isr
This API unregister h264 isr
- Parameters
type_id – isr type
- Returns
BK_OK: Success
others: Other errors
-
uint32_t bk_h264_get_encode_count(void)
get h264 encode count
This API get h264 encode count
- Attention
output unit is word(4 bytes)
- Returns
encode count
-
bk_err_t bk_h264_enc_lcd_dma_cpy(void *out, const void *in, uint32_t len, dma_id_t cpy_chnl)
h264 encode lcd dma copy
This API h264 encode lcd dma copy
- Parameters
out – output addr
in – input addr
len – copy len
cpy_chnl – dma channel
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_updata_encode_fps(uint32_t fps)
h264 updata encode fps
This API h264 updata encode fps, this fps will release h264 decode fps
- Parameters
fps – fps
- Returns
BK_OK: Success
others: Other errors
-
bk_err_t bk_h264_global_soft_reset(uint8_t enable)
h264 module global softreset
This API will use for resetting h264 module
@attenation this api must be called twice to complete the reset: first enable(1), then disable(0)
- Parameters
enable – 0:disable, 1:enable
- Returns
BK_OK: Success
others: Other errors.
H264_ENC API Typedefs
Header File
Structures
-
struct h264_base_config_t
-
struct h264_compress_ratio_t
Macros
-
BK_ERR_H264_DRIVER_NOT_INIT
-
BK_ERR_H264_ISR_INVALID_ID
-
BK_ERR_H264_INVALID_RESOLUTION_TYPE
-
BK_ERR_H264_INVALID_PFRAME_NUMBER
-
BK_ERR_H264_INVALID_QP
-
BK_ERR_H264_INVALID_IMB_BITS
-
BK_ERR_H264_INVALID_PMB_BITS
-
BK_ERR_H264_INVALID_CONFIG_PARAM
-
BK_ERR_H264_INVALID_PIXEL_HEIGHT
-
INT_SKIP_FRAME
-
INT_FINAL_OUT
-
INT_LINE_DONE
-
H264_CLK_SEL_480M
-
H264_AHB_CLK_DIV
-
H264_AHB_CLK_SEL
-
H264_INT_ENABLE
-
H264_INT_DISABLE
-
MAX_QP
-
MIN_QP
-
MAX_PFRAME
-
MIN_PFRAME
-
MAX_IFRAME_BITS
-
MAX_PFRAME_BITS
-
MIN_FRAME_BITS
-
DEFAULT_SKIP_MODE
-
H264_GOP_FRAME_CNT
-
H265_GOP_FRAME_CNT
-
H264_COMPRESS_RATIO_DEFAULT_CONFIG()
H264 compress ratio default config.
This is the default configuration for the H264 compress ratio. The init_qp/i_min_qp/i_max_qp/p_min_qp/p_max_qp range is [15, 51]. The imb_bits/pmb_bits range is [50, 4095].
- Returns
Enumerations
-
enum h264_isr_type_t
Values:
-
enumerator H264_SKIP_FRAME
-
enumerator H264_FINAL_OUT
-
enumerator H264_LINE_DONE
-
enumerator H264_ISR_MAX
-
enumerator H264_SKIP_FRAME
-
enum h264_type_t
Values:
-
enumerator H264_NAL_UNSPECIFIED
-
enumerator H264_NAL_SLICE
-
enumerator H264_NAL_DPA
-
enumerator H264_NAL_DPB
-
enumerator H264_NAL_DPC
-
enumerator H264_NAL_IDR_SLICE
-
enumerator H264_NAL_SEI
-
enumerator H264_NAL_SPS
-
enumerator H264_NAL_PPS
-
enumerator H264_NAL_AUD
-
enumerator H264_NAL_END_SEQUENCE
-
enumerator H264_NAL_END_STREAM
-
enumerator H264_NAL_FILLER_DATA
-
enumerator H264_NAL_SPS_EXT
-
enumerator H264_NAL_PREFIX
-
enumerator H264_NAL_SUB_SPS
-
enumerator H264_NAL_DPS
-
enumerator H264_NAL_RESERVED17
-
enumerator H264_NAL_RESERVED18
-
enumerator H264_NAL_AUXILIARY_SLICE
-
enumerator H264_NAL_EXTEN_SLICE
-
enumerator H264_NAL_DEPTH_EXTEN_SLICE
-
enumerator H264_NAL_B_FRAME
-
enumerator H264_NAL_P_FRAME
-
enumerator H264_NAL_I_FRAME
-
enumerator H264_NAL_UNSPECIFIED25
-
enumerator H264_NAL_UNSPECIFIED26
-
enumerator H264_NAL_UNSPECIFIED27
-
enumerator H264_NAL_UNSPECIFIED28
-
enumerator H264_NAL_UNSPECIFIED29
-
enumerator H264_NAL_UNSPECIFIED30
-
enumerator H264_NAL_UNSPECIFIED31
-
enumerator H264_NAL_UNSPECIFIED
Header File
Structures
-
struct h264_config_t
-
struct h264_qp_t
-
struct h264_dma_config_t
Macros
-
PBITS_FACT1
-
PBITS_FACT2
-
PBITS_FACT3
-
PBITS_FACT4
-
PBITS_FACT5
Type Definitions
-
typedef uint8_t h264_unit_t
-
typedef void (*h264_isr_t)(h264_unit_t id, void *param)