Commit graph

1311 commits

Author SHA1 Message Date
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
17a370d2d0 chore[astyle]: Format code by new astyle config
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Iafdb694219ad9d0407e622ba13fd729b935a2dad
2025-10-23 07:57:46 +00:00
Yanjun Liao
9a079f8c6f refactor[mpp]: Rename file type from C++ to C
Change-Id: I657ec099b95ee745a6963c0768dc97308c2c6735
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-10-11 09:10:42 +00:00
Hongjin Li
eed8ec347f fix[hal_av1d_vdpu383]: Fix Roku player crash after seeking.
Platform: RK3576(vdpu383)
Spec: av1

Error case:
When using the Roku player, it crashes after seeking.
Because dxva->frame_refs[mapped_idx].Index == -1, cdf_buf
becomes NULL, which leads to a crash.
The deeper cause is that after seeking, playback doesn’t
start from an I-frame, so the reference frame info isn’t
ready.

Err log:
Null pointer crash stack.

Solution:
Check frame_refs index validity to avoid crashes.

Source:
test_av1_1920x1080.mp4 (Likely reproducible with other AV1 sources.)

Reported-by: Liming Xu <rimon.xu@rock-chips.com>

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Id55c2b00aa4c42eec2ccd780974e933a052864de
2025-09-30 15:06:42 +08:00
Yandong Lin
c1f1c12dcf fix[h265d]: Fix rps data update issue
1. Add rps_update_flag to indicate whether to update rps.
2. Fix global cfg data len for vdpu384a.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I1c664c99f34f6dea940368496175273042b48b18
2025-09-30 15:05:34 +08:00
Hongjin Li
8202197857 fix[hal_av1d]: Fix AV1 background frame decoding failure.
Platform: RK3588
Spec: av1

Error case:
Decode the AV1 bitstream from Bilibili that includes
background frames.

Err log:
Correct: mpp_av1dec: irq_status: 00001100
Error:   mpp_av1dec: irq_status: 00040100 // hw timeout

Solution:
The swreg8.sw_idr_pic_e shall be set to 1 when current frame
is an intra frame.

Source: Bilibili AV1 videos
ex: https://www.bilibili.com/video/BV11ibPzLEhe

Reported-by: redmine #575039

Change-Id: I9f83fe7025f2c7ed70c8121798f9db0bfc4b0a24
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-09-11 01:29:27 +00: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
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
xiaoxu.chen
317fce0bee chore[hal]: Organize the relevant processes for vepu fmt
1. Move Vepu fmt from vepu541_common to vepu5xx_common
2. Create vepu580_common
3. Add vepu ARGB4444, ARGB1555, AYUV1BPP, AYUV2BPP

Change-Id: I372e35d9ccf93ecf082d4a279c03841bef3bc581
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-08-12 03:40:29 +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
Yanjun Liao
05f59be432 fix[hal_h265e]: Fix nal type in tsvc mode
Platform: vepu_580/540/510
Spec: h265e

In tsvc mode, top p-frames not used as reference frames.

Change-Id: I0b285e5ed753e73321fd728389195f0e5b118874
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-07-25 11:02:42 +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
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
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
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
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
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
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
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
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
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
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
Hongjin Li
6dbce1daf3 fix[h265d_vdpu383]: Fix CABAC error detection issue.
Platform: RK3576
Spec: h265

Error case:
When decoding a video sequence, the interrupt reports
a bitstream error, but the video sequence is actually
normal.

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

Reported-by: redmine #540704

Source: H.265 HEVC_1280x720_Movie Trailer_复仇者联盟.预告片.h265.mp4.mp4

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I9f0b6c744bbc56ad721d45461a18f8124956ffc7
2025-04-11 03:39:17 +00:00
Hongjin Li
257ee8ab51 fix[h264_vdpu384a]: Fix error proc issue
Platform: RV1126B
Spec: h265/h264/avs2/vp9/av1

Change-Id: If82b2595160a739a3c9275382e754d7931ace45b
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-04-11 01:29:32 +00:00
Yandong Lin
ea8b5af151 fix[mpp]: Fix compile warning with ipc sdk toolchain
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I206b473b904e69d10644897e47ba1933ada8204d
2025-04-03 14:43:14 +08:00
Hongjin Li
f23096522b fix[sys_cfg]: Fix HAL layer buffer alignment issue
Platform:
RK3399, vp9/h265
RK3562/RK3576/RK3588, vp9

Error case:
The stride result calculated by sys_cfg is not
synchronized with the HAL layer.

Change-Id: I98f4e18fcb9af19850ca7dbd201bded8137e7861
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-04-03 02:10:07 +00:00
Yanjun Liao
2dcc5f6c12 fix[hal_jpege_api]: Fix jpege api path judgment
Avoid incorrect hal jpege api return.

Change-Id: I19f7f7cf9336115243db2d091d3f0eeeb6929863
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-04-02 06:44:59 +00:00
Yanjun Liao
ae4d4378e8 fix[vepu_511]: Speed grade configuration of 0.67
Modified default speed preset configuration to 0.67 PPC,
delivering ~40 FPS for 4K resolution at 500MHz

Change-Id: If4b11f1d45871a377403afb8dd98f727124ce499
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-03-28 14:05:56 +08:00
Yanjun Liao
43a191ede7 feat[vepu_511]: Add rv1126b 265e/264e/jpge support
Change-Id: Ie6baf5a0820ecfe9adbb49dd4d267fc2c51d5c2a
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-03-26 03:52:57 +00:00
Hongjin Li
d57658ff6d fix[jpegd_rkv]: New JPEG IP supports tile 4x4 output by default.
Platform: RV1126B
Spec: jpegd

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I0c7c570d504808081ea894b62e04ae7bc562348a
2025-03-26 11:40:46 +08:00
Hongjin Li
648dd1befb fix[jpeg_rkv]: New JPEG IP defaults to no RGB support.
Platform: RV1126B
Spec: jpeg

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I9ac03fd51bdb0bc5c25e85e9743fd585a1cae50c
2025-03-26 11:13:02 +08:00
Hongjin Li
4ca7bace36 fix[hal_rcb]: Fix rcb buf size calc issue
Platform: RV1126B/RK3576
Spec: h265/h264/avs2/vp9/av1

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I29e673dc40813e13fe8028b0191aa29d704eb6d8
2025-03-26 02:09:46 +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
Johnson Ding
83f4b5abd6 fix[avsd]: Skip redundant zeros between fields inside one picture
Hardware decoder may failed at decoding the last field of one picture
when there are too many zeros between first and the second field. So
we should tell hardware to read from the exact place of field stream.

Change-Id: Ia78f5d0a97136861ceb3ab198419fe51905c3b2f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2025-03-24 01:58:24 +00:00
Yanjun Liao
1b0aef1de8 fix[hal_h265e_vepu580]: Fix overflow status check
Encoder should continue when indicates stream overflow hw_status.

Change-Id: I5a04ca6016bb0c0050ae291832b467e3b7e53cc5
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-03-11 18:10:06 +08:00
Hongjin Li
ad26e20d69 feat[vdpu384a]: Support RV1126B new features
Platform: 1126B, Support h265/h264

1. H264/H265 CABAC Table Hardware Implementation
2. update h265/h264 global Parameters
3. h265/h264 update rcb buffer size
4. update fbc/pp/sal chn control

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ia22d30272f7c20c6ab33850881b6a0135a4264b2
2025-03-04 14:13:18 +08:00
Rimon Xu
beb2bd2793 fix[vepu510]: Mark frame first part when split slice out
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: I5c481ca5738e1ad1ae466e8e91749f4bf1c8a209
2025-02-18 17:29:36 +08:00
Johnson Ding
75e9008ea9 fix[jpege_vpu720]: Correct encoded size config
Encoded width and height should align with MCU size.

Change-Id: If62629f9ca7275bafaa156b55af001b10b0e836b
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2025-02-11 08:14:10 +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
Chandler Chen
a524df5361 feat[h265d]: Add vdpu383 hevc yuv444_10bit support
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I14d7a8fac9f14283ecc364142ea93d80eda43fcd
2025-01-20 06:56:35 +00:00
Hongjin Li
686d5a60d9 fix[]: Fix abnormal FBC info issue in Info Change
Platform: RK3576

From: Product Department 2 czl

Change-Id: I058e36b426b2d4b894086547d5cf240e2f8f2cca
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-01-15 15:14:18 +08:00
Hongjin Li
8763144523 refactor[hal]: Update the reg offset setting method.
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: If63cbfdae4150280b4d24698543990a454ed5f6f
2024-12-27 11:54:55 +08:00
Hongjin Li
277bc5b9d5 refactor[av1d_vdpu383]: Regs definition sync with other protocols.
Platform: RK3576

Change-Id: I766b00d2463cab3f786c26f5cf793a504ff5fcba
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-12-13 15:59:58 +08:00
Herman Chen
a426f4078e feat[dec_nt_test]: Support jpeg decoding on decode
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I36196906fe5a5cf4f0a1ebd1aa1fa69dd94f88bc
2024-12-12 14:38:34 +08:00
Herman Chen
fea856cd27 chore[hal_jpegd]: Remove reset / flush functions
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If595e10f59ca6791d9c59b7b655c8379c7f151a3
2024-12-12 14:35:18 +08:00
nyanmisaka
f929cdeb63 fix[vepu580]: fix is_yuv/is_fbc typo
MPP_FRAME_FMT_IS_YUV() should be used.

fixes 5f522dc

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Change-Id: If279598df7c078aa69f6eb8d71ecc59d6af960c8
2024-12-09 09:22:59 +08:00
Rimon Xu
5a8e1fa682 feat[mpp_dec]: add control for select codec device
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: I55cbbf1e2a2b4693325a27af83ae76020d6f4ac2
2024-11-29 15:08:06 +08:00
Hongjin Li
45b28c7a32 fix[av1_vdpu383]: Fix the CDF issue between GOPs
Platform: rk3575/vdpu383

Error case:
The idr frame (frm0) does not update the cdf, and then frm1,
when using the cdf, mistakenly uses the cdf of the previous
gop instead of the default cdf

Solution:
At the beginning of GOP, reset all validity flags

Reported-by: Detlev Casanova <detlev.casanova@collabora.com>

Source: av1.video.es

Change-Id: I72152664d1c4275cb39f657c94ed4ba89a076465
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-11-29 14:06:16 +08:00