Commit graph

451 commits

Author SHA1 Message Date
Herman Chen
2771f34e76 feat[mpp_meta]: Add frame / meta dup function
Add dup function for mpp_frame and mpp_meta.
NOTE: The buffer in MppFrame is not dup.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4965bc6016c8ffca4b72bbd49e2653eab06c7591
2025-11-06 16:32:37 +08:00
xiaoxu.chen
425552cb3d feat[mpp]: Use macro to create mpp_cfg
1. Create mpp_cfg when define KMPP_OBJ_HIERARCHY_ENABLE
2. Add kmpp_objdef_get_cfg_root function
3. Fix mpp_cfg update flag judgment logic
4. Add mpp_enc_cfg extract and apply interface from configure file

Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
Change-Id: I3a02e7bbddd20a78c3284589fc9513a1c49cac18
2025-11-03 15:35:53 +08:00
xiaoxu.chen
47f66b60a3 fix[inc]: Reserve split variable for compatibility
Change-Id: I15684e92ea4fe2e2addc206504613272bb787943
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-11-03 15:26:43 +08:00
Herman Chen
b40657a3c7 feat[kmpp_vdec]: Add kmpp_vdec module
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9467fa122fa0c5f3d755714ea63e089a4d86eca9
2025-10-24 17:34:33 +08:00
Herman Chen
067de5647a feat[mpp_enc_cfg]: Change to object implement
Modification Point:
1. Use enc configure object macro.
2. Use kmpp_obj_update to sync user cfg setup.
3. Distinguish between user mode and kernel mode for enc obj.
4. EncImpl only check codec related SET_CFG result.
5. Refactor SET_CFG flow.
6. Adapter jpeg q_mode feature.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
Change-Id: I2856acdf863189fdaa29121ad8bc007fe90b5ab5
2025-10-24 11:18:37 +08:00
Herman Chen
29521e7f4a chore[kmpp_obj]: Change kmpp_shm get / put input
1. Use KmppShm to replace KmppShmPtr as input.
2. Add kmpp_shm_to_entry to get valid access address.
3. Add more test case.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id554e4e60f8e11e08578c91a9c30c7b173f10ab9
2025-09-30 15:06:14 +08:00
Herman Chen
f507421f8b chore[mpp_enc_cfg]: Remove MppEncCodecCfg
1. Revert codec cfg to separate h264/h265/jpeg/vp8 cfg.
2. Update enc/dec/sys cfg_test print.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ida5da8a6b738fbf710e1ab590bc6b6f3438319c4
2025-09-10 17:39:55 +08:00
Herman Chen
5d9da6f29e feat[mpp_enc_cfg]: Separate init function
Add mpp_enc_cfg_init_k for kernel encoder config init.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4ebdc179b27115d72a2efa213405cbb4dca564d0
2025-09-10 16:57:08 +08:00
Herman Chen
ca061993ef refactor[osal]: Refactor C++ osal file to C
1. Refactor osal cpp files to c.
2. Update osal license to Apache-2.0 OR MIT.
3. Remove windows support.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic5545d861676880f7a6247515404d585cd4fcef5
2025-09-02 17:49:14 +08:00
timkingh.huang
6588b71f2b fix[mpp_meta]: Add KEY_NPU_UOBJ_FLAG and KEY_NPU_SOBJ_FLAG
UOBJ: deliver userspace buffer for rk3588 and rk3576
SOBJ: deliver shared memory buffer for rv1126b

Sync to kmpp-develop patch with the same log:
If596371639eaedb01d6900c737d1f7fec49bf8d4

Change-Id: I8927f6341b5d3f94bf52af32c02b75cd24ad0681
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2025-09-01 17:35:25 +08:00
xiaoxu.chen
54bdc5ddbc refactor[enc]: Use KmppShmPtr to represent osd buffer
Change-Id: I2211b806d4b4a065faf1f0fa5a240e104bbb30ab
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-08-13 14:55:14 +08:00
Herman Chen
a91e70bd23 chore: Rename Dolby for sdk release requirement
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia5293f7963937ce57c123590abc32d208d181602
2025-08-11 07:01:16 +00:00
xiaoxu.chen
8808b16d7a feat[mpp]: Add jpeg roi function for RV1126B
Change-Id: I41bb66fbe1abf4adfa32162630e00d4050adb516
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-08-06 14:39:34 +08:00
xiaoxu.chen
7043132d0c feat[kmpp]: Add jpeg roi function for kmpp
Sync with kmpp-develop commit:
feat[kmpp]: Add jpeg roi function for RV1126B

Change-Id: Ifeb5ce7b75af6fc3fc0e66fbe727dfd30a325a0e
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-08-06 14:39:22 +08:00
Herman Chen
b851fdc379 chore[mpp_enc_cfg]: Add base:smart_en option
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If3799589a8a65a2181b117d70014af87957afe72
2025-07-25 14:44:46 +08:00
Herman Chen
fef2e2af06 feat[mpp_meta]: Add more frame buffer key to meta
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I8873dff77c85ddcacf0845ca81f6c0f3dd30e88e
2025-07-25 11:24:54 +08:00
Herman Chen
9aef0ff7a7 feat[base]: Use enc cfg obj
Sync with kmpp-develop commit:
feat[kmpp]: Use enc cfg obj

Add MppEncCfgImpl to compatible with MppEncCfgSet and kmpp_obj path.

Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id4e262d1053c03cd93d620828405f060f0f8517c
2025-07-18 15:48:19 +08:00
timkingh.huang
72492494ee feat[smart_v3]: Add new frame qp interface
min_bg_fqp: min frame qp for background region
max_bg_fqp: max frame qp for background region
min_fg_fqp: min frame qp for foreground region
max_fg_fqp: max frame qp for foreground region

Change-Id: Idc10767d545dd83e4157f839a621e4801c98201e
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2025-07-12 17:21:09 +08:00
Herman Chen
981a15d9c6 fix[mpp_cfg_io]: Add more mpp_cfg_io function
1. Move MppCfgStrFmt to rk_mpp_cfg.h
2. Add mpp_cfg_find and mpp_cfg_set_cond
3. Fix memory leak in mpp_cfg_test
4. Add log->cfg function
5. Add cfg->json function
6. Add to / from log / json check to mpp_cfg_test

Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I02e80cd21da664019bf0b767b073c14dbbfe0776
2025-07-09 23:27:17 +08:00
Herman Chen
4f102251f3 feat[kmpp]: Add KmppMeta module
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Change-Id: If4cc861cd1598e0b66842f8f21256a1a0000b4a6
2025-07-09 14:20:19 +08:00
timkingh.huang
92ca648b53 feat[smt_v3]: Add parameters cfg interface
Change-Id: If7f54c829e7d79843800a0a15fee126d152af2a8
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2025-06-24 16:53:41 +08:00
timkingh.huang
560ac10baf feat[vepu510]: Add smart v3 interface
Change-Id: Ib2dea60f794f1ef404cf91b75053d8cf2639fd6b
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2025-06-24 16:22:18 +08:00
yichen.wang
a056703411 feat[mpp_enc_cfg]: Add H.264/H.265 vui enable cfg
Support user setting for vui_parameters_present_flag.

1. Default vui enable flag is true if not setting.
2. Call mpp_enc_cfg_set_s32(cfg, "h264:vui_en", vui_en) or
        mpp_enc_cfg_set_s32(cfg, "h265:vui_en", vui_en) to
        enable or disable the vui enable flag.

Platform: all
Spec: all

Reported-by: #556121 at redmine

Change-Id: Ie4a23c2879c3209377a5800d8e63c4081c34e0f7
Signed-off-by: wyc <yichen.wang@rock-chips.com>
2025-06-24 11:10:39 +08:00
Herman Chen
3d530016fb feat[mpp_buffer]: Add mpp_buffer discard function
Mark a single buffer to discard status.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I86e9501ace8c2b11c60360905e9f6c9466e38eea
2025-06-19 17:39:19 +08:00
Herman Chen
eba256b154 refactor[base]: Refactor C++ mpp_enc_cfg to C
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ie60f680329ac6a861c7f7124955a35968fb82823
2025-06-19 17:39:00 +08:00
Hongjin Li
db6ce4fb76 refactor[base]: Refactor C++ mpp_meta to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ice500e67c4d2a4faa75873f73e537fd9659fffe8
2025-06-17 17:13:56 +08:00
Hongjin Li
ec65df0fe1 refactor[base]: Refactor C++ mpp_packet to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4d8544d78f0b879233b481b37f0feb675f2d8eb9
2025-06-17 14:35:43 +08:00
Hongjin Li
147aec8a1b refactor[base]: Refactor C++ mpp_buffer to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I7e478416160ab1188686252ebea9ef5f71e19852
2025-06-17 11:18:25 +08:00
Herman Chen
8435799824 feat[mpp_log]: Add external callback support
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ice375b1c9522442f403cf6eb1d1d2306e64b9b30
2025-05-28 17:15:41 +08:00
Xiaobo Liu
ff3ae5c010 fix[mpi]: Fix typo
Reported by cppcoffee@gmail.com
https://github.com/rockchip-linux/mpp/pull/824

Change-Id: I9df340bf14296cc70275c248494d1cc3249942d3
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2025-04-11 09:44:47 +08:00
toby.zhang
dceef49597 fix[mpp_enc]: Add encoder speed mode setup
The encoder speed mode is in range of 0 ~ 3.
0 - normal mode with all mode decision path enabled.
1 - fast mode
2 - faster mode
3 - fastest mode

Signed-off-by: toby.zhang <toby.zhang@rock-chips.com>
Change-Id: I0c607adbc1e4cea4025fa8a3816dc3a1ec1f13a1
Signed-off-by: toby.zhang <toby.zhang@rock-chips.com>
2025-04-08 11:06:26 +08:00
toby.zhang
154b3e2853 fix[mpp]: add qpmap_en and enc_spd
Signed-off-by: toby.zhang <toby.zhang@rock-chips.com>
Change-Id: Iac272bd2a134fd132ac7321717f19fb51389560c
2025-04-04 09:30:39 +00:00
Herman Chen
6b51725df4 feat[kmpp]: Add kmpp_frame_test
1. Add kmpp frame / buffer / packet / meta define in rk_type.h
2. Move KmppObj, KmppObjDef and KmppShmPtr to rk_type.h
3. Add kmpp_frame_test
4. Add kmpp_objdef_get_offset function in kmpp_obj.c

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib4aecfc26f60521288b6e33b8c4e0af5afd3213b
2025-04-03 17:18:34 +08:00
Herman Chen
a091f3ae02 fix[mpp_venc_kcfg]: Revert to mpp interface
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I546667e2647e5d5cdb0adb14e448577b1d0b7a0b
2025-04-01 18:22:41 +08:00
Herman Chen
84c7d337bf refactor:[kmpp]: Move kmpp to seperate directory
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I85eb166a3ebb1ae64a44c7127808fc469c6415a8
2025-04-01 14:51:32 +08:00
Yanjun Liao
27ab1e4abd fix[mpp_frame]: Add rk_fbc fmt for 1126b
Change-Id: I357efd122b1bdf3345ca887130d837ebf7cb5afa
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-03-26 03:52:12 +00:00
Yanjun Liao
2e74006879 feat[mpp_meta]: Add osd_data3 fmt for 1103b/1126b
Change-Id: I8ca02440c2239a4952900f22e5617d4b9ea8048c
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-03-26 03:52:12 +00:00
Hongjin Li
3ac819df3b feat[err_proc]: Add a new command: DIS_ERR_CLR_MARK
Platform: General
Spec: h264/h265/avs2/avs2d/m2vd

MPP_DEC_SET_DISABLE_ERROR:
Comes with an error mark by default.

MPP_DEC_SET_DIS_ERR_CLR_MARK:
Takes effect when MPP_DEC_SET_DISABLE_ERROR is enabled and
is used to clear the error mark.

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I82b00c737bb72bdc420267d36c28752a5e3ee9a6
2025-03-24 15:06:27 +08:00
Hongjin Li
70b572a2c0 fix[mpp_sys_cfg]: Fix abnormal stride calculation.
Platform: General

Error case:
If the specification specifies a stride, it should be
configured according to the specification's stride rather
than calculated based on width and height, especially
in scenarios involving H.264 field-based sources.
For the case of FBC, hor_stride needs to be processed
based on pixels and is unrelated to bit depth.

Reported-by: Johnson Ding <johnson.ding@rock-chips.com>

Source: rk_32.h264

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I02058432f2baeeea4c5a87c6845b24de8a78b276
2025-02-13 00:20:12 +00:00
Yanjun Liao
3ea5eb5a51 fix[mpp_enc]: Fix some exceptions when force pskip
1. Add rc model in when force skip frm
2. Fix ref frm error when force pskip
3. Disable pskip when cfg force idr
4. Support pskip frm as ref frm
5. Support force skip frm as is_ref or non_ref

Change-Id: Ib138ab75a9df2c4521cb376e3a3d7fd30565ecd9
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-01-23 18:04:48 +08:00
Yandong Lin
fad0868986 feat[rk_mpi_cmd]: Merge cmds from mpp_interface
Change-Id: I6550486d6efbac43d6f30cdb6dfefa75a93a437d
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-16 15:04:18 +08:00
Yandong Lin
fc2a997a58 fix[mpp_enc_cfg]: Remove a redundant atr_str
Change-Id: I7553fcf8a7014ce3c2a13b1fd923ac91d78fb9d3
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-16 06:19:31 +00:00
Herman Chen
f0ff240b87 feat[mpp_meta]: Use trie to index the meta key
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I634d447223e6e9d268642798a4fb0d11ad32cfb0
2025-01-13 17:41:51 +08:00
Yandong Lin
7939be1246 refactor[mpp_enc_cfg]: Adjust cu_qp_delta_depth
sync from mpp_interface

Change-Id: I2dfabef3acf01566df289396678a433ac84f3a15
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-09 06:17:45 +00:00
Yandong Lin
2cb69a2860 fix[mpp_enc_cfg]: Add sao_bit_ratio from mpp_interface
Change-Id: Iba92fdd0052e661b74d747f921dfe25d5a408cd1
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-09 03:32:10 +00:00
Yandong Lin
e447e0763e feat[mpp_enc_cfg]: Merge enc cfgs from mpp_interface
Change-Id: Ie08d9a26129096634b61fe60a10517efe0807180
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-07 17:04:12 +08:00
Hongjin Li
07bef12867 feat[mpp_sys_cfg_st]: Provide packaging for use on products
Change-Id: I41bbd28f4aabce5ba3735a47e65ccb71997262a2
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-01-03 08:42:22 +00:00
Yandong Lin
47fbbe7436 feat[mpp_venc_kcfg]: Add mpp_venc_kcfg module
Change-Id: I67acff6efbfa9ec1c35c3bdc8252b4047e5c9f75
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-03 14:08:00 +08:00
Johnson Ding
b4efbdf9b7 feat[enc]: Add switch for disable IDR encoding when FPS changed.
1. No need to encode IDR when fps_in is changed. So remove it from
`check_resend_hdr`
2. If application do not want any IDR encoded when only fps is changed,
    call `mpp_enc_cfg_s32(cfg, "rc:fps_chg_no_idr", 0);` when
    initializing.
3. Keeping CPB when only SPS, PPS are updated without IDR encoded for
H.264 encoder.

Change-Id: I034dd789a3f24318004d942624eb10240f7db2e9
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-12-25 09:41:11 +08:00
Herman Chen
78ad332e7e feat[mpp_sys_cfg]: Add mpp_sys_cfg function
MppSysCfg is used to config and query mpp gloabl parameters.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I132746e07b55040b582878adaef209ce73147da1
2024-12-18 15:54:03 +08:00