Commit graph

4092 commits

Author SHA1 Message Date
Hongjin Li
4692f8bd6b refactor[mpp_mem]: Refactor C++ mpp_mem 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: I927346dfdb0edea486b8dda61f379f96059b01ba
2025-06-11 18:33:42 +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
xiaoxu.chen
1c867b3cac refactor[kmpp]: Replace venc_packet with KmppPacket
The kmpp.ko should update to after commit:

    commit 5502cf37894311092ca591904753ba429a6ab4ee
    Author: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
    Date:   Wed May 21 10:00:44 2025 +0800

        feat[kmpp_packet]: Add kmpp_packet interface

        Change-Id: I4a5bd37e6e34e084b2b6b4616bac770f58a2d15e
        Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>

Change-Id: Id77297068709422c1465093fa8104949a117a662
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-06-09 12:12:52 +00:00
Hongjin Li
1705827021 refactor[osal/linux/os_log]: Use C constructor.
Change-Id: I178b570db0131965deecbcf536ab8f680a35c46f
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-06-06 16:25:38 +08:00
Hongjin Li
dee9bced95 fix[mpp_singleton]: fix init order issue
Platform: General
Spec: all

Error case:
Constructors may be added after 65535(mpp_singleton_init)
ex: mpp_platform added after 65535 when mpp_soc is
    refactored to c

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
Change-Id: If736904beb0cd64a3e4ae3b20fd72e1198646ac7
2025-06-06 16:25:38 +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
xiaoxu.chen
08bbde04bd feat[kmpp_packet]: Add kmpp_packet interface
Change-Id: If913e5deb0077b8fe59f2a6a5eebfcd76fcabf7b
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-06-05 20:14:47 +08:00
Herman Chen
fddfc9db2e chore[kmpp_obj]: Add from objs device macro
Combine kernel objdef and userspace objdef process.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Change-Id: Icf1ad03af8df3d1450138d3a9161b2dd20bb59f5
2025-06-05 17:54:04 +08: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
Herman Chen
47ba2a350e chore[kmpp_obj]: Add more obj function
1. Add update flag copy function.
2. Add entry copy function.
3. Fix register log.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4059c63cd3bbcab86144eaad38c0fc30c9ee52a8
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
Herman Chen
22febcaca8 chore[kmpp_obj]: Update flag calculation macro
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib8071bce985e6f5dc09580ca8d944118e5b05c63
2025-06-01 13:18:52 +00: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
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
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
2c5895fe93 fix[enc_utils]: Remove duplicate option
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia71d4896bb3d693bfdb9e5f0a7a63168ba39fe49
2025-05-27 09:58:55 +08:00
Herman Chen
c384c5e8fd fix[kmpp_obj]: Remove extra print in helper
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5fb1db340ee85e83927ebe84ee6cc6da4dc8fbbb
2025-05-27 09:58:55 +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
Herman Chen
21095a1bb9 feat[kmpp_obj]: Add more kmpp_obj property
1. Add disable_mismatch_log flag.
2. Disable meta mismatch log to reduce log.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I8f897929ee5dc5a895f2b7bafd69bfa7053aac36
2025-05-26 17:50:37 +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
Herman Chen
fa92e755c7 feat[kmpp_obj]: Add object update function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1d3cb9e14a28dda11374b9cde0aea72bf4d582dc
2025-05-21 08:52:53 +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
Herman Chen
67adfd36cc chore[utils]: Add fbc frame data dump
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic98bf866c3b905d240e199ce6ec949f5061da076
2025-05-14 03:57:22 +00: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
Herman Chen
359b5c075c chore: A fix for company release requirement
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id24b2448a0fe1cbda19c1d1421f8ddb7c21c40dd
2025-05-08 03:31:54 +00:00
Herman Chen
38ee436830 feat[kmpp_obj]: Add userspace objdef functions
1. Add mpp_internal.h for simplifing mpp_trie, mpp_cfg, mpp_cfg_io,
kmpp_obj relationship.
2. Add objdef userspace interface: register / unregister, add init,
deinit, dump function registration.
3. Fix vdpp/CMakeLists.txt lack of kmpp_base issue.
4. Adjust utils order to fix compile error.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I50304a84c4baf5b49ee2658713ac171c91983209
2025-05-07 16:56:48 +08:00
Herman Chen
3c5080bb1f refactor[base]: Refactor mpp_trie from C++ to C
Sync to kmpp_trie version.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5846fe3c22e50f49ae3c3fa50f56fb053451b70f
2025-05-07 11:18:17 +08:00
Herman Chen
c4732853fa refactor[mpp_cfg_io]: Change cfg to trie interface
1. Change the trie setup function name.
2. Fix trie leak issue.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I417973c1d9c15639ec044cf0e95a07f8593a1762
2025-05-07 11:01:17 +08:00
Hongjin Li
095fdce624 feat[osal]: Add mpp_singleton 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: Idfff4d03e1c98e4ad1ddf1553133ba4b0194f7b8
2025-05-06 18:07:33 +08:00
Herman Chen
f2eb2a2b59 feat[mpp_cfg_io]: Add mpp cfg io module
1. Add mpp_cfg output to log.
2. Add mpp_cfg input from json.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I21fa491a9531918c1b05083ec2f1853ae69f3005
2025-04-29 09:49:01 +00:00
Hongjin Li
6275e90171 test[resolution]: Add resolution test tool
usaeg:
<exe> <-s|--spec> <|h264|h265|avs2|vp9|av1|jpeg|all> [-q]
    -h|--help:  help info
    -s|--spec:  spec, |h264|h265|avs2|vp9|av1|jpeg|all
    -sv|--save: save test file
    -l|--log:   exec mpp demo with log
    -d|--debug: dump debug info

Change-Id: I5c69570d0a2834c0114c75ed3f64c734e238d4b6
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-04-29 06:26:57 +00:00
Hongjin Li
26252d3872 fix[h265d_ps]: Suppress YUV444 unsupported warning logs
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: If8026b502f04b334e5858f640c58e8e515232cef
2025-04-27 17:22:23 +08:00
Herman Chen
817a5434da fix[mpp_cfg]: Fix function define on C++ field
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id66c928e5e7393fe289457326ca83490255db152
2025-04-27 07:20:39 +00:00
Yanjun Liao
54d72a64c5 fix[h264e_dpb]: fix walk_len when refs_dryrun
Platform:All
Spec:encoder

Error case:
h264e_dpb: find_cpb_frame can not find match frm 0.

Solution:
Since info->st_gop = st_cfg_cnt - 1 cannot accurately represent
the number of st_cfg, st_cfg_cnt is used to replace info->st_gop.

Change-Id: I3a2f494de5dcec0182d0431fb2c1b653cbe3bf84
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-04-25 06:52:10 +00:00
Hongjin Li
81c4696937 fix[av1d_vdpu383]: fix segid page fault issue
Platform: RK3576
Spec: av1

Error case:
When the resolution is switched and the width and height
are enlarged, the segid space is insufficient

Solution:
Determine whether the cdf/segid space is sufficient and
recalculate if insufficient

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

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I8df6773337e093f0767d18d552895b3ec7601efa
2025-04-18 17:25:05 +08:00
Herman Chen
ecbbb721aa fix[allocator]: Fix misc buffer group flag issue
The default misc buffer group do not have the flag. We need to seperate
the default misc group with different flag.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I14941eedfe9c06ec978a12061ba33e12495aa038
2025-04-18 01:54:32 +00:00
Chandler Chen
e69e2f88c7 fix[h265d_parser]: fix startcode finder for 00 00 00 xx case
Platform: All
Spec: h265

Error case:
nalu payloads with byte sequence 00 00 00 xx data used to be incorrectly detected as start code.

Solution:
Modify the start code detection logic by replacing
condition src[i+2] < 2 with src[i+2] == 1

Reported by: redmine #545594

Source: kiloview-p3.hevc

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I7e544e127f324df42418765adc5a7a51e082736e
2025-04-17 01:24:28 +00:00
Yandong Lin
4999c7762f fix[kmpp]: Fix eos frame with NULL buffer issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9e05767b1750733c2c972bc78467bb4f8a2da255
2025-04-16 03:51:09 +00:00
xueman.ruan
a034b888c2 [mpi_enc_utils]: Add step config for slt test.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I95720c7ec22f952b318e6997a63a383b2542a018
2025-04-15 16:14:45 +08:00
Xiaobo Liu
e168077ff5 fix[utils]: Remove duplicate assignments
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Change-Id: Ie3ecc53dee73b694af345796d9b5462674582ee9
2025-04-15 11:03:40 +08:00
xueman.ruan
e386d8a16b fix[mpi_enc_test]: Sync mdc config of RV1126B
Change-Id: I53a11f03a3bc050d37df6ff32e4f1b33b6f60e3a
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2025-04-14 10:31:48 +00:00