Commit Graph

387 Commits

Author SHA1 Message Date
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
Zhihua Wang
ecbf315ac3 [inc]: Update rk_mpi_cmd compatible for rockit
Signed-off-by: Zhihua Wang <hogan.wang@rock-chips.com>
Change-Id: I0658e15a085217f0feee4177f7fd6731487ae7ee
2022-07-01 11:08:50 +08:00
Herman Chen
60f5fc234a [allocator]: Add dma_heap allocator
The dma_heap is introduced in kernel 5.10.

Change-Id: Id3c116d996da461467fe380a79434ba5ea875033
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-06-24 15:52:06 +08:00
sayon.chen
b05ba20d75 [mpp_frame]: Add fbc hdr stride set & get function
Change-Id: I9414f484451722228fa460dc33586851da1a0ec2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2022-06-16 09:27:47 +08:00
Herman Chen
2b35cee0ce [mpp_log]: Add more log helper function
1. Move mpp_log.h to inc for external user.
2. Add mpp_debug.h for mpp internal logging.
3. Fix some warning.
4. Add log level setup function.
5. Check env log_level value in mpp_get_log_level call.

NOTE:
1. mpp internal module should use mpp_debug.h and mpp external user
should use mpp_log.h
2. Use mpp_get_log_level to update mpp_log_level when the env changed.

Change-Id: I90a55a02a72db177533013280dfe111ca3479229
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-20 11:42:10 +08:00
Herman Chen
12858d56d1 [mpp_packet]: Add segment info and segment nb
Change-Id: I26cb5bba11393ccfb3a73b0d682b67f219034c13
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-11 16:49:30 +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
230837e41e [mpp_frame]: Add task for internal flow
1. Remove next entry in MppFrame.
2. Add MppTask in MppFrame

Change-Id: Icdf4f451e54a30977c5725848c5f4357ae54e6d8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-29 16:56:50 +08:00
Hongjin Li
4f4c73a7ae [h264d_dpb]:Fast play is disabled by default
Flip disable_fast_play to enable_fast_play,
Fast play is disabled by default.

Change-Id: I168e02a9d84590c3b2b92fe75b2b37c655c8c63e
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-04-22 09:59:18 +08:00
Herman Chen
f1324e29a2 [mpp_compat]: Add mpp compatible spec module
This module is for backward / forward compatiblity with external users.
1. Support compatible feature query.
2. Support update user program compatible feature update.

Change-Id: I7661f17c442eca0a0d0d57d2a35efdb5fd88be72
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-19 08:29:41 +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
7a5544b8ec [rc]: Fix rc issue in async mode
1. Add async rc preset function.
2. Update rc_task pointer on async_wait task.
3. Save frame type in rc task info rather than in rc ctx.

Change-Id: I956b5f14a01e5c2cdc8b4c5f9c26660274a7f0e4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-01 18:07:30 +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
72a6118b99 [mpp_meta]: Add mpp_meta_get with default value
Change-Id: I2285ace50341792b1979130d19a3ec642346e4bc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-09 11:18:23 +08:00
Hongjin Li
98ac9b259b [h264d_dpb]: Fix h264 video flicker issue
When the poc of the idr frame is 0, the subsequent frames with poc<0 are
discarded, which will cause the screen to flicker.
Add parameters in mpp as switches for immediate output of idr frames.

Change-Id: I522334dd1e81fc6aeeb60e71404f3a7071a5ecae
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-03-09 10:22:16 +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
783abcfc7a [vepu580]: Support intra frame twopass deflicker
NOTE: Only vepu580 support this feature.

Change-Id: I05768a5ca5f6d32eab3d0d9eccab0c471882cd0e
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-02-17 15:26:17 +08:00
sayon.chen
55b425c97b [av1d]: Add av1 parser api
Change-Id: Iff3c205d34cd8d8c2074de42eadc8418f5144a42
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2022-01-21 11:20:02 +08:00
Herman Chen
f94ae6d0a0 [vepu580]: Add YUV444 support for vepu580
Change-Id: I58859e59094fcecc13011b16f33b3810abbc7882
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-12-30 10:52:02 +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
Herman Chen
254a708f8e [mpp_enc]: Increase bps max limit to 200M
Single core has 100Mbps limit and rk3588 has two cores.
Increase mjpeg max_bps to 800M

Change-Id: I2a3bd830d97085bb9a875063ae9aac8df891969c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-22 17:14:51 +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
Herman Chen
5e396e03d5 [mpp_soc]: Add AVS2 type
1. Add AVS2 coding type.
2. Add AVS2 support on rk3588.

Change-Id: Ifa677830d3f8c1625a4c351a6e008c09098f5122
Signed-off-by: Herman Chen <herman.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
Herman Chen
02320fb506 [meta]: Add qpmap for encoder roi direct config
Change-Id: Ic64fa548f60f723e971c5574b6b290ddaf454809
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-20 14:55:46 +08:00
Herman Chen
0589fb5bd3 [mpp_dec_cfg]: Add external notification callback
Add callback on two events:
1. packet ready and wait for new packet input.
2. frame ready and wait for output frame poll.e

NOTE:
Add callback command param for version compatible sync between user
and mpp library.

Change-Id: Ic41d495a06cf653acb6b5100699f1b7f5f735f2e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-13 15:42:11 +08:00
Herman Chen
c5cd650fdd [mpi]: Add start / stop / pause / resume ctrl cmd
1. Move mpp_start / mpp_stop function to control command.
2. Add pause / resume control command.

Change-Id: I525668a2831eb8f23e12fbd7c1cb29c11fdcc868
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-17 11:11:43 +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
dbd2e2a77b [mpi]: Add mpp_start and mpp_stop
The purpose of mpp_start and mpp_stop is to break mpp_init_into two
stage.

Original mpp_init conbine the init and start for example mpp_dec_init
and mpp_dec_start then the global (or static) config which dominate the
fundamental working way can be only be set before mpp_init. That is
unreasonable. Another example is the encode memory prealloc flow.

The mpp_start is added to end global param receiving and do real
preparation of current operation in mpp_init.
The mpp_stop is the opposite of mpp_start.

Change-Id: I2bdcc29a9ff75777acc5c39c7e7f01477e597bb0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-20 10:24:25 +08:00
Chen Jinsen
a26e71291e [vpu_api_legacy]: support fbc fmt setup
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: If43694ce50a0f163776a260a1a919d2f9d12a4d0
2021-04-22 11:29:48 +08:00
Herman Chen
a91439bef4 [mpp_buffer]: Add mem and buffer usage function
Change-Id: I356ef9311802868fe8d234dbff178ad8463985d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-20 14:39:52 +08:00
Herman Chen
fc8fcacc49 [mpi]: Change mpi return value meaning
The 0 and positive return is success. The negative return is failure.

Change-Id: I9c4586286ce7368a52b7d9dd776fd40c6af4a1da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-08 09:08:48 +08:00
Herman Chen
85dcfcc8e6 [rk_mpi]: Add rk_vdec_cfg.h
Change-Id: If15b5eb8b0222c1a3978d3ca7c3d4a7fc83faa73
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-17 10:55:48 +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
Herman Chen
c440a5ee28 [mpp_enc]: Deprecate MPP_ENC_PRE_ALLOC_BUFF
Change-Id: I42ea6ce9897af4e5b6f1a1d1bf3beb5173a8f568
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-20 17:19:13 +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
bae7d889e7 [rc_api]: Reorganize RcMode same as MppEncRcMode
Change-Id: I04f5b7a1335aa0b6d7f9a03f98950dbedc5cd4cf
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 15:23:46 +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
sayon.chen
148a2b0b7a [rc_v2]: Add iblk4_prop info
Change-Id: I2d573a2170226472ad913e6b5068d80a18d220e5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 14:11:52 +08:00
Herman Chen
b84425e15d [mpp_meta]: Add meta key average qp for encoder
Change-Id: Iab3fde1a2a3e8e6f6150dfbeb6f5803d6e3cc240
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-14 10:01:46 +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
e0df28b509 [mpp_cfg]: Add general config function
1. Add struct config function.
2. Do not check data type when data size is matched.
3. Use type/size/offset to define data and update info.

Change-Id: Ief21107cf9a8a6b89c2b01c1a430d88e0cf827f4
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