Commit Graph

66 Commits

Author SHA1 Message Date
xueman.ruan
82ae30f031 [h264e_sps]: Add parameters config for encoder
Encorder parameters: constraint_set0~5

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I7f90ff97881f875ffad77cf4125ee6623d179563
2022-08-16 12:16:57 +08:00
Herman Chen
61fbfb82cd [mpp_enc_cfg]: Add hw config for block mode
NOTE: Only for vepu580

Change-Id: Ic186ad014b734b5df01ae3218ed3d7219729c1ee
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-07-05 11:45:03 +08:00
Herman Chen
8ce07dbfba [hal_vepu580]: Add slice segment info output
Change-Id: I79a036b6ed5c75b587564a91f392ac81f305e505
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2022-07-01 15:14:35 +08:00
Herman Chen
6ddafd0bfa [mpp_enc]: Add split output flag
Split output flag is for low delay packet output mode.

Change-Id: I2f743f14b89864625406ebf94687f4f838f0df15
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-10 11:19:23 +08:00
Herman Chen
f903701f44 [rk_mpi]: Add encoder query function
Change-Id: I869d30bf11b26feee02f5ba307d98f6bbdcf7058
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-13 17:34:36 +08:00
Herman Chen
f0079f49d2 [h264e_vepu580]: Add dpb hal func and more buffer
Change-Id: I1e458732b821571d25079aebe19831948bd591ee
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-26 16:04:22 +08:00
Herman Chen
2eb15d5918 [mpp_enc_cfg]: Add tuning scene mode check
Change-Id: I0d90589c6e57be6e348f6510a79d4a7ecc83ce9c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-08 10:48:25 +08:00
Herman Chen
ff40ff4325 [mpp_enc_cfg]: Add fine tuning paramter define
Change-Id: I832f6706c837aac9ef7885761a6ebbb830a08d4b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-07 18:07:28 +08:00
sayon.chen
8c04e0d562 [mpp_enc_roi]: Add roi generation function
vepu58x roi cfg generation is depended on vepu54x roi cfg.

1. Use roi_enable to enable roi test.
2. Use roi_type to test different roi config mode.

Old region mode is set to legacy now for future roi cfg will be more and
more complicated.

Change-Id: Ib9e8976b732f05625e7589b64752d38fbd83584b
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-11-30 17:11:11 +08:00
sayon.chen
1fb20bb450 [mpp_enc]: Add new roi buffer config mode
The roi structure on vepu580 is too complex.

So we provide provide a buffer tunnel for externl user to config encoder
hardware directly.

External user should generate roi data structure according to datasheet.
Then config the base_addr, qp_addr, amv_addr, pmv_addr by metadata.

Change-Id: Iae50bf3ca36c1ff789140055d4d36a79afeb2e58
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-11-20 18:34:30 +08:00
Yandong Lin
ac6f8b1384 [h264e_vepu]: add cfg to disable mb rc
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I71e72164756b23f181a67a8b8799b9867a0854fb
2021-11-09 18:26:25 +08:00
sayon.chen
09d2bca7e7 [h265e]: Add sao disable cfg
Change-Id: I446178d5d2aefa26750382f126fac582ae93e16c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-10-25 10:21:49 +08:00
sayon.chen
37397d6376 [rc_v2]: Rename stat_times to stats_time
Change-Id: I3cfd444b2d26d5bb2ce2a806efc1a74f4cce05b2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-28 16:17:50 +08:00
sayon.chen
f53dfac47c [rc_v2]: Support hierarchical QP cfg
Change-Id: I0827689ee27a7007cb157b2990089e3c34c6ad50
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-02 15:24:24 +08:00
Yandong Lin
33784aca30 [rkv_enc_cmd]: Fix check info err when enc_cfg_set
Fix issue frome github:
https://github.com/rockchip-linux/mpp/issues/201
Err message:
mpp_cfg: cfg h264:max_tid expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:max_ltr expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:prefix_mode expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:base_layer_pid expect RK_S32 input NOT RK_S32

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9dbd49a6ce04807455d1a7dc090cad96ae0f2c83
2021-05-21 15:41:11 +08:00
Yandong Lin
a0ec1ba235 [rkv_enc_cmd]: Fix check info err when mpp_enc_cfg_set
Err message:
mpp[16915]: mpp_cfg: cfg h264:poc_type expect RK_U32 input NOT RK_U32
mpp[16915]: mpp_cfg: cfg h264:log2_max_poc_lsb expect RK_U32 input NOT
RK_U32
mpp[16915]: mpp_cfg: cfg h264:log2_max_frm_num expect RK_U32 input NOT
RK_U32

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ide77867beed2ee4e94df1179882713e600d3448b
2021-05-21 11:39:00 +08:00
Herman Chen
434f15ff26 [enc_cfg]: Fix max_reenc_times size check error
Change-Id: Ieb19f47d57ea54d450cf904475732d46a5b52928
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-30 18:20:56 +08:00
Johnson Ding
e6d2ab3c60 [h264e]: Add gaps in frame_num config entry
Some of NVR product may do some thing special when decoding the first
GOP of bitstream encoded by MPP, and report "gaps in frame_num is not
allowed" although frame_num is bitstream is continuous. Setting
gaps_in_frame_num_allowed_flag to true will avoid this problem.

1. Set gaps_in_frame_num_allowed_flag true as default
2. call mpp_enc_cfg_set_u32(cfg, "h264:gaps_not_allowed", 1) if you
want gaps_in_frame_num_allowed_flag to be false.

Change-Id: I8242fb318e051a61772c02a2c8bb59e4b589ff6d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-15 16:40:48 +08:00
sayon.chen
816f1a4f7d [rc_v2]: Add debreath cfg interface
Change-Id: Id8a729dc35e1b4fd2c9d3eab95d902bd5d7d96f2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 14:55:14 +08:00
Herman Chen
f04fabc136 [mpp_enc_cfg]: Add global rc qp config
1. Add rc:qp config for user rate control config at frame level.
2. Add hw:qp config for hardware detail config.

NOTE: hardware config is only recommended for expert developer.

Change-Id: I8e28de97304577bcf77d67521f945355779ae102
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-08 16:26:53 +08:00
Herman Chen
4aa5b4a046 [mpp_enc]: Restore max_qp_step
1. Restore max_qp_step which limit the qp change between two frames.
2. Set default H.265 ip_qp_delta to 5.

Change-Id: Iacd795da7f2df46e60ab3f5c45bc8b0f30aff5a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 18:03:17 +08:00
Yandong Lin
2111a438c5 [mpp_enc]: Update osd data cfg
1. Add new structure: MppEncOSDData2
2. Different osd layer use separate buffer

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3be533eb602f23192086f56e06a1439dbb19c35c
2020-12-31 10:00:13 +08:00
Herman Chen
de8ace6622 [mpp_enc]: Separate qp change flag
Separate H.264 QP limit change flag into 3 flags

Change-Id: I658ab337569f8f715bde7633dce02b631a7d4239
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-17 14:33:17 +08:00
Herman Chen
96a7affc2b [mpp_enc_cfg]: Add low delay to MppEncCfgSet
Change-Id: I5f9e595b44cc39cc255c69a875618ea36de5e878
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-12 09:47:09 +08:00
Herman Chen
7ae2f73bca [mpp_enc_cfg]: Add super frame config
Change-Id: I0df2db8fd7c5e10412584ded557da3962b77f882
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-30 09:46:27 +08:00
sayon.chen
5012336bc2 [enc_v2]: Suppport user data set
User data set is for multiple user data with uuid.

Change-Id: Iad952961ab6242ff3a14f554410144bebd3801ba
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-11-16 09:46:53 +08:00
yandong.lin
e54234a11b [vp8e]: Fix vp8e reencode and ivf problems
1. Not do reencode in vp8 enc
2. Add api to control whether need to add ivf header
   (default: have ivf header)

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I59a3a7193abead6c73e6e1eed593a115add77888
2020-10-23 10:07:10 +08:00
timkingh.huang
0f8aeda99d [comment]: add comments in the format of Doxygen
Change-Id: I1df49ed78b5b5cf88ff253c35c59cb0b061b4ea9
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2020-10-23 09:27:53 +08:00
Herman Chen
85ada595ee [mpp_enc_cfg]: Add encoder I frame tuning config
Add max_i_prop, min_i_prop and init_ip_ration for I frame tuning config.

max_i_prop:
The max percentage of intra frame size in one gop.

min_i_prop:
The min percentage of intra frame size in one gop.

init_ip_ration:
Define the first I frame size is how many times of one P frame size.
Set to 16 mean I frame size is equal to P frame size.
Set to 160 mean I frame size is 10 times of P frame size.

These three parameters are for tuning Intra frame quality.

Change-Id: Iac1e700fe2a51fb3a6ad94753784cd54ee789176
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
Herman Chen
e3278d7655 [vepu541]: Fix OSD AYUV bit order definition error
Change-Id: I89ddd7b626873ea1d4ba22569f79d8706b216b55
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
Herman Chen
95670aa475 [mpi]: Add rk_venc_rc.h
1. Add rk_venc_rc.h for rate control definitions.
2. Add drop parameter to set_rc_cfg.

Change-Id: Iab27a1505ba187f512815f7ab00cd0ea7f863cb8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-11 16:32:38 +08:00
sayon.chen
74cc83f69e [rc_v2]: Support avbr ratecontrol
when select avbr must set target_bps max_bps min_bps,in still scene
will used min_bps for enc, in the moving scene will max_bps for enc.
and final avg bit will get close to target_bps

Change-Id: I84b2878c7e76b18a593ca2a0d99c0c8f26a2d557
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-11 11:15:55 +08:00
Herman Chen
e8a428ea04 [mpi]: Cleanup unused definition
Change-Id: Ib8490abf7241f432164f647165b1c67c618c1168
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-10 14:59:03 +08:00
yandong.lin
5ea05d986e [vp8e_v2] add vp8e v2 implement
1. add vp8e_api_v2 module
2. add hal_vp8e_vepu1_v2 and hal_vp8e_vepu2_v2 module
3. add default rc for vp8e

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I6c0e9b0a0a7654b92905ac50431ba3f4b023c2e2
2020-09-09 16:09:31 +08:00
Herman Chen
b56cfdb688 [mpp_enc_cfg]: Add frame drop paramters
Add frame drop parameters for frame drop behavior on bitrate overflow.

Change-Id: Id90fbd0c63b1a0909e426a2c9f09c8b371bec0b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-09 15:21:54 +08:00
sayon.chen
74f2f76fd7 [mpp_enc]: Support vui colour_description set
Change-Id: If84d8b04ce6ea430ed38d39c339eb9da783c6510
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-08 14:32:45 +08:00
Ding Wei
ea095cc3ae [jpege]: add rc for jpege
usage:
    q_factor - init factor
    qf_max   - max q_factor
    qf_min   - min q_factor

Change-Id: Idea1dea50f1f9c5e7e9ae41e1da228d5fb1a806b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-09-08 09:05:59 +08:00
Herman Chen
ff9283dff7 [rk_venc_cmd]: Fix enum defintion error
Change-Id: I88426dc75362ef86c0a21109d295ce8bd983de4d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-31 11:33:05 +08:00
Herman Chen
21c21209c8 [h264e]: Add qp_delta_ip
The qp_delta_ip for H.264 is 3.

Change-Id: I33c052489011e93e8b496a284a84db1450ef5981
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-05 18:13:59 +08:00
Herman Chen
e638362114 [mpp_enc]: Add max/min intra qp for H.264
NOTE: may change the behavior of get cfg

Change-Id: I1b3cd4cbbe7dc0f03e4cc38f1e831e429d4911c2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 10:26:30 +08:00
Herman Chen
df0a7f0203 [h264e]: Add poc type / poc_lsb / frm_num setup
1. Add poc type / poc_lsb / frm_num default device value.
2. Add force update path.
3. Sps will use codec cfg directly.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5f23b74f0453213c89c7238a36570484b91b48ce
2020-07-28 11:29:49 +08:00
yandong.lin
0f91ba604c [jpege:] Add q_factor and qtable
Add q_factor and qtalbe interface

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I6b59d0b2e740e4b2815e7c83ad9a3641fe700e2f
2020-07-27 17:37:38 +08:00
Herman Chen
f654f1a0ad [rk_venc_cmd]: Change h264 codec cfg
1. Remove slice mode/arg in H.264 codec cfg.
2. Add max long-term reference number / max temporal layer id / prefix
mode / base layer priority id.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If34166e4658edba65f4c6c095412a6fadd941320
2020-07-08 16:32:33 +08:00
Herman Chen
33e7e4c52a [mpi]: Remove unused H.264 mpi cfg structure
Remove sei / ref cfg in MppEncH264Cfg.

Change-Id: Iaef6a8a845b691dc21d0a6a6eca62e27bc5cf5a4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-10 17:37:49 +08:00
Herman Chen
6a6521ed13 [gop_ref]: Remove gop_ref
New reference frame config interface will be added.

Change-Id: I5766cefde12237561bbc20c905e47ed2d3e90011
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:29:40 +08:00
Herman Chen
d638ef1bb7 [rk_venc_cmd]: Restore skip_cnt for compatibility
Change-Id: Ib542ace59e199752d6316c422ae11b4e57a0990b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-20 18:12:24 +08:00
Herman Chen
d95306a63b [mpp_enc]: Add color range support
1. Change interface for adding color range to MppPrepCfg.
2. Add option in MppEncCfg.
3. Add H.264 / H.265 sps support on full / limit range.

IMPORTANT: the binary backward compatibility is broken since this commit.

Change-Id: Ib68f29bab5c6d364fe8b612bd4dff2ecd5bc59cd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
Herman Chen
0b4532c6d5 [rk_mpi_cmd]: Add max_reenc_cnt for reencode flow
When max_reenc_cnt is zero the reencode flow is disabled.

Change-Id: Iba600b37bb5ab6e4f720b652d59abfae36f9e52f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
sayon.chen
8e00c203d7 [mpp_enc_cfg]: Add h265e default cfg
Change-Id: I7f4b05be7bcfdbb93cf3b40f74941e14190ce3b4
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
sayon.chen
49f610442a [h265e_ps]: Support vui set
Change-Id: I5fa20430eb3cd8dd5f66d367db19463b0973e0df
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-05-13 15:33:29 +08:00