Commit graph

3202 commits

Author SHA1 Message Date
Hongjin Li
cc3194d336 fix[h265d]: Fix log issue
Reported-by: https://github.com/rockchip-linux/mpp/issues/874

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ic2b60decee850f15db9e5145b62dbc5a05f4c03a
2025-07-23 01:45:08 +00:00
xiaoxu.chen
2f5e6399c3 feat[base]: Add toml function
1. add cfg to toml
2. add toml to cfg

Change-Id: Iab5cb8f498f8bb769a0bc90a5beca85365bc960f
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-07-23 01:32:05 +00: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
xiaoxu.chen
be7fc93fc2 fix[vepu511]: Add tune stat update
Change-Id: I813fbf37735673660bde2266a25939690d15e98d
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-07-14 17:51:16 +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
timkingh.huang
db6deeef62 chore[rc_smt]: Adjust code style for rc_smt
Change-Id: I819c76652270104b32775b44e8f6658bf95b4437
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2025-07-12 09:13:02 +00: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
nyanmisaka
e0e59e5ce2 fix[vproc]: Fix unit tests cannot be disabled
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Change-Id: Icfd755d6bfee95bc3803a90e89ab790e8eb0e889
2025-07-07 09:59:49 +08:00
xiaoxu.chen
1ea951afe5 fix[base]: Fix enc cfg size
Sync with kmpp-develop commit:
refactor[vcodec]: Optimize enc cfg struct

Change-Id: If3b4a724831d30adb24ad3a8cd4702118a56f464
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-07-01 06:40:51 +00:00
Hongjin Li
6d8d29bbac fix[mpp_sys_cfg]: fix RK3399 hor stride calc issue
Platform: RK3399
Spec: All

RK3399 does not need to force 256 odd multiple alignment

Source:
1920x1080_taipei.mpg

Reported-by: Zulin Chen <casey.chen@rock-chips.com>

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ie0c22aaf8c78d76a083db54098a5250bbf07c1db
2025-06-30 11:42:12 +08:00
Yandong Lin
e08da1bd61 fix[av1d_parser]: Fix parse obu units error.
Because the loop uses repeated i, the parsing obu units
falling into an infinite loop.

Change-Id: Idc972cc05bb6c1bee94ad0e4c3d46c07da88a73d
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-06-25 07:45:19 +00:00
timkingh.huang
07580ac761 fix[hal_h265e]: Fix crash on zero gop
Change-Id: I733c8ab6d313b525a6d84f6f1b24c96c78abf7b5
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2025-06-25 07:00:37 +00: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
Herman Chen
fb6f170362 fix[base]: Fix packet and frame pool init issue
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id2243d8184e65520a9eee7dbc89e4b1d04a1abf7
2025-06-24 11:16:43 +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
ccee46d061 fix[cmake]: Fix compile error on linux with asan
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I90a815835048e7931d773f3dc5ed42cb39640ab6
2025-06-24 02:28:11 +00:00
xiaoxu.chen
2506f5df61 fix[hal_h264e]: Fix h264 poc_type reg configure
Change-Id: Ife9fd9bc96037406cfbea16c3c4fef45d4a5a3dd
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-06-23 10:01:34 +00:00
Hongjin Li
6624f5cfa2 fix[av1d_parse]: Fix mem leak issue
Platform: General
Spec: av1

Reported-by: redmine #513080
Change-Id: I228ab74182359f746e744c78cc9259524d9e9aba
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-06-23 17:30:50 +08:00
xiaoxu.chen
97f620f832 fix[h265d]: Fix yuv400 decode error
Platform: RV1126B
Spec: h265

Error case:
The H.265 slice header syntax lacks adaptation for the case where ChromaArrayType=0.

Reported-by: redmine #559194
Source: y400-ok.265

NOTE: The decoders before RV1126B do not support YUV400.

Change-Id: I5362bc7f3894f1ec3938708563d81bf867815d9a
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-06-19 12:08:54 +00:00
Johnson Ding
57695b2f59 fix[h265d]: Fix GDR stream decoding
1. GDR stream started with Non-IDR frame is supported and no need to
disable error.
2. Intra refreshed frames will be mark as discard if started with
Non-IDR frame.

Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Change-Id: Ide470d377f13e0512ceda4eb7219650aeffb0148
2025-06-19 17:39:51 +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
0b3ee6af1a refactor[base]: Refactor C++ mpp_frame 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: Ide35c19442f6917d338599ebf200b8b710b0a601
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
e31839cc74 refactor[mpp_mem_pool]: Add exit leak pool print
1. Refactor caller parameter on pool functions.
2. Add name on pool init.
3. Add exit leak pool print.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I39a8a966db895340a9e01ddff3a7894f1ca4b825
2025-06-17 11:09:54 +08:00
canming huang
014bca460e fix[cmake]: Fix static build issue
Add merge_static_lib.sh to cmake command.

Signed-off-by: canming huang <huangcmzzk@gmail.com>
Change-Id: I1574818090f22c5612ddcb9aa12653428273f5c5
2025-06-13 11:17:36 +08:00
Hongjin Li
aa6ae2c5f6 refactor[osal]: Refactor more module from C++ to C
Refactor thread, list, queue and time module.

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: I96c07e1549868085867502c8bb974ffd3875ea9d
2025-06-12 18:32:09 +08:00
Herman Chen
794fce9e7d fix[vp8e]: Remove unused vp8e_rc file
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2cedfa23f39643e22f005687d04a96c484f6f90d
2025-06-12 14:50:51 +08:00
Yandong Lin
380ef67c24 fix[h265d_rkv]: Fix dec err after cut streams
Need to sync cache after cut slice segment header extension datas.

Change-Id: Id89ef895ac6df47ff593407a18e0246138dffb9f
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-06-10 15:01:09 +08:00
Herman Chen
63e1e88b0b fix[mpp_dec]: Fix compile warning
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Iaa879b19731a534cde16a57699d54f588dc93753
2025-06-06 06:14:20 +00:00
Herman Chen
301d85254f refacotr[base]: Refactor mpp_dec_cfg from C++ to C
1. Change mpp_dec_cfg entry_table define
2. Use new update function to update MppDecCfgSet

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ibaf98d69664c107f79ea51e6cd83419dc1bf450a
2025-06-05 11:36:24 +08:00
Yandong Lin
90df438d20 fix[h265d_parser]: Fix slice header parse
Change-Id: Ib27e3dcefcdb4b1a4116bf71c3bbb778d718e22d
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-06-04 17:18:40 +08:00
Hongjin Li
4ebce81d20 fix[mpp_sys_cfg]: afbc calc support yuv444sp_10bit
Platform: General
Spec: All

Reported-by: Jinsen Chen <kevin.chen@rock-chips.com>

Change-Id: Iaf5eaadedc718682e9876ec8cb64fdd82ea1ac86
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-05-29 09:20:50 +00:00
Herman Chen
ebb4987988 fix[kmpp_obj]: Update helper macro
1. Fix ELEM_FLAG handle error.
2. Move some macro to kmpp_obj_macro.h

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0e177e1aeb8e21327f7c84ace28ca890955b135f
2025-05-29 02:13:00 +00:00
Johnson Ding
1986fe4d5d fix[h263d]: Fix missing initializer for field problem
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Change-Id: I1afa8524eab41cebf4cb743c6bde812212983fd0
2025-05-28 15:31:43 +08:00
Herman Chen
f662bfc1c1 feat[kmpp_obj]: Refactor kmpp_obj helper
1. Integrate simple element and struct element to one macro.
2. Resolve different update flag mode.
3. Support hierarchy definition for future config file registration.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I691a99aafec3f4e9d4e883e172d2b82ace44e379
2025-05-26 18:16:17 +08:00
Johnson Ding
79806e6314 fix[avsd_plus]: Fix page fault when filtering field data
If hardware failed at decoding the first field of frame, stream consumed
length will not be update to vlc_stream_base register. To avoid reading
stream base address as stream length after irq, just abort decoding when
hardware reporting error.

Change-Id: I7ca80aefebb0700612a20d7e35c49dc736a31b6f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2025-05-22 09:30:17 +00:00
Hongjin Li
cb0027ee64 fix[h265d_vdpu384a]: Fix CABAC error detection issue.
Platform: RV1126B
Spec: h265

Error case:
When decoding a video sequence, the interrupt reports
a bitstream error.

The value of num_negative_pics shall be in the range of
0 to sps_max_dec_pic_buffering_minus1[ sps_max_sub_layers_minus1 ]

For frame5 (starting from 0)
sps_max_dec_pic_buffering_minus1[ sps_max_sub_layers_minus1 ] = 4
num_negative_pics = 5

Solution:
Mask out undefined bits in cabac error detection, this error is
allowed to be ignored.

Source: H265-019-Movie_Trailer_复仇者联盟.720P预告片.h265.mp4

Reported-by: Caesar Wang <caesar.wang@rock-chips.com>


Change-Id: I22915d3e6b04cf270bd2075e1606e5d35142f2cd
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-05-20 01:58:08 +00:00
casey.chen
867f449cf1 [vpu_api] Apk Dynamically set the max and min limit of QP
Change-Id: I60b852e5bade3b5ee6be92c9609542724a03d934
Signed-off-by: casey.chen <casey.chen@rock-chips.com>
2025-05-19 08:26:45 +00:00
Hongjin Li
3507338fa6 fix[mpp_sys_cfg]: Fix stride issue on resolution change
Platform: General
Spec: vp8/vp9/mpeg2

Error case:
Stride information persists incorrectly across
resolution changes, leading to errors.

Solution:
When the stride is not set externally, it needs to
be set to 0 to avoid the stride not being updated
in time when the resolution of the same source
changes. For example, the source:
VP9_crowd_run_2048X1088_60fps_bd8_frm_resize_l41.webm
contains two resolutions: 2048x1088 and 1365x725

Source:
VP9_crowd_run_2048X1088_60fps_bd8_frm_resize_l41.webm

Reported-by: redmine #552464
Change-Id: I0e8f7c77736dbba31ccd98e559e3d7eeac240d97
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-05-19 07:47:48 +00:00
Yanjun Liao
6fc495af49 fix[vepu_540c]: Reduce print hw_status when irq ret
Change-Id: I2a0f48bb21fd31513e7e9a1f390dde1d0ec5f720
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-05-16 17:34:23 +08:00
Hongjin Li
161345e67f fix[mpp_sys_cfg]: Fix ver_stride calc issue
Platform: General
Spec: vp8/vp9/mpeg2

Error case:
Ver_stride is set externally, causing sys_cfg
to use the external ver_stride directly

Solution:
If it is not necessary, do not set ver/hor_stride
externally. To minimize the impact, currently only
modify the specs that encounters problems

Source:
vp9 3840x2026 in rk3576
vp8 1920x1080 in rk3588
m2v 1920x1080 in rk3588

Reported-by: redmine #550255

Change-Id: Ie1e73e17fa2db1740d36821a5bb26fb1487e81cb
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-05-15 15:55:57 +08:00
Hongjin Li
39e40c3aa8 fix[sys_cfg]: Fix ver stride calculation issue.
Platform: General
Spec: all

Reported-by: Jinsen Chen <kevin.chen@rock-chips.com> redmine #539176

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I0458c4814f04b73cd5955e79ceea39fde21b8fe9
2025-05-15 15:55:44 +08:00
Yanjun Liao
6d3cc5ea5d fix[vepu541]: Add warning for unsupport nv21/nv42
VEPU_541 unsupport uv_swap in nv12/nv24.

Change-Id: I768b9a5fc5657a8d8eb58feeb0f09756a6197c3e
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-05-13 10:03:45 +08:00
Herman Chen
1483344ec3 refactor[base]: Remove MppDecCfgImpl
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ieddb794750f5810275047cbe94dceda75c35ea3c
2025-05-09 08:08:17 +00:00
Johnson Ding
aef67cc0ce fix[avs2d]: fix vertical stride config
Platform: Chips designed before RK3576
Spec: avs2

Error case:
For RK3588 FBC, vertical pixels equals to height of image aligned with
CTU size and then plus 16.

Issue reported at redmine #550260, caused by this commit:
adf21e18ba
"Align to CTU64 to avoid info change"

Change-Id: I52ab1ff4437431666b1e6fc1e458b6981f53c821
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2025-05-09 15:24:56 +08:00
Yandong Lin
be7f3bb870 fix: Revert "fix[mpp_enc_impl]: fix rc cfg for jpeg enc"
This reverts commit 7954ee2324.

Change-Id: Iad0f11a415bd234a261723a72f764fbdc2fa6d69
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-05-08 07:31:54 +00:00