Commit Graph

3830 Commits

Author SHA1 Message Date
Yandong Lin
fa095373e1 feat[kmpp_obj]: Add kmpp_obj_get_hnd func
1. Add kmpp_obj_get_hnd for kernel ioctl.
2. Add kmpp_obj_get_hnd_size for share handle copy size.

Change-Id: I1acac5ebb4a89e97c547f1ba3f57bf3add5b4e14
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-03 07:07:05 +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
Yandong Lin
885c5f63bd fix[kmpp_obj]: Add extern C
Change-Id: I9943e1c48f74bb0fc2ec91db0faab83efb437524
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-02 18:09:02 +08:00
Herman Chen
9560f259b9 feat[kmpp_obj]: Add kmpp_objs support
1. The kernel object is provide by /dev/kmpp_objs
2. Use kobj interface name to query its info from kernel.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I638890b39a62b7a992896e8047d4bed33400f912
2024-12-31 08:54:27 +00:00
Yandong Lin
e0286d07b3 fix[h264d]: Fix extra data lost issue
The extra data(sps/pps) will be lost when the following flow occur:
push extra data -> reset -> push idr data.

Change-Id: I5f371291d5e7bcc27aad18ce6ae180b00fd76bd7
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-12-31 10:15:26 +08:00
Herman Chen
ab79656052 docs: Update 1.0.8 CHANGELOG.md
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4ed2c4985d66107ef5a2c1a06fcd0cc0b9d349d2
2024-12-30 10:18:22 +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
Johnson Ding
8f8707fbb7 fix[enc]: Fix CPB size not enough problem
In TSVC with multiple LTR frames case, there may be more than two base
layer frames between two LTR frames with different index. Replaceing
LTR frames into 1st short-term reference when calculating cpb size will
not get a correct result.

Change-Id: Ib68e8c4e733cef2192d70d03c02d29ff814cf011
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-12-26 10:14:00 +08:00
Hongjin Li
15bcad26db fix[m4v_parser]: Fix split_parse setting failure issue
Platform: Linux,General

Error case:
When decoding an MPEG4 source, it is unable to properly
configure split_parse. need_split is only initialized
during init.

Solution:
Use the split_parse parameter in the dec_cfg.

From: redmine #526753

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I89eb4dc8fcc2a1b00d73d359979770f7afefe0d3
2024-12-25 19:26:24 +08:00
Yandong Lin
07b4bca5f3 refactor[mpi]: Add ops name when assign for reading friendly
Change-Id: I563d593ea566ba3bd572a8cf5b85b7e7dce28afd
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-12-25 15:52:10 +08:00
Yandong Lin
caeb30c917 fix[mpp_trie]: Remove a redundant variables from log
Change-Id: I8989806f8ecc5e6ca015302e3641090bb47fbca0
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-12-25 14:22:44 +08:00
Yanjun Liao
0a3e8ad4eb fix[mpp_enc]: Set frm type in pkt meta
Frame type can be configured in all encoding fmt.

Change-Id: I9cd0c4417514376dcce29924f8456f36d525ef6b
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2024-12-25 14:20: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
Yandong Lin
1d40b8eb04 fix[mpp_sys_cfg]: Fix compile warning
Compile linux/aarch64 with toolchain:
gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++

Compile message:
mpp/base/mpp_sys_cfg.cpp: In constructor ‘MppSysCfgService::MppSysCfgService()’:
mpp/base/mpp_sys_cfg.cpp:88:61: warning: enum constant in boolean context [-Wint-in-bool-context]
   88 |     ENTRY(dec_buf_chk, type,        U32, MppCodingType,     MPP_SYS_DEC_BUF_CHK_CFG_CHANGE_TYPE,            dec_buf_chk, type) \
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mpp/base/mpp_sys_cfg.cpp:77:13: note: in definition of macro ‘EXPAND_AS_TRIE’
   77 |             flag ? 1 : 0, \
      |             ^~~~
mpp/base/mpp_sys_cfg.cpp:123:5: note: in expansion of macro ‘ENTRY_TABLE’
  123 |     ENTRY_TABLE(EXPAND_AS_TRIE)

Change-Id: Id60d66fdf0fd7be75d577ca8fc9b45eee3eeb2dd
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-12-24 15:53:35 +08:00
Johnson Ding
16ab9b0d4d feat[test]: Add PSNR info for video encoder
Note that the PSNR derived from SSE may not equals to PSNR from video
analyser. Because SSE returned from hardware is consist of both luma and
chroma samples. And SSE of chroma samples multiplied by some weight.
But the difference is within 1db, usually no more than 0.5db.

Change-Id: I294d473c656f39ce98dd0768cd6945ee38e89b14
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-12-23 09:28:04 +08:00
timkingh.huang
52699a26ab fix[rc_smt]: Fix the variable overflow issue
eg: fps = 30000 / 1001

Change-Id: I29b44fa4f6beeaa27d3ffd248323767ba21c34d4
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2024-12-21 14:34:32 +08:00
Yandong Lin
729dd76195 fix[h264e_sps]: fix constraint_set3_flag flag issue
When the profile idc is high profile and constraint_set3_flag=1,it must
obey some rules of high 10 intra profile, such as contain only IDR pictures.

Reference the h264 clause A.2.8 introduction.

Change-Id: I9f886925a3810bc4ad9c7e70ebdc2194354c6eb5
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-12-19 17:00:16 +08:00
Hongjin Li
87f23da2e6 feat[mpp_buf_slots]: Add coding attribute to buf slots
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I3c197e5e7ef533141e27f5728d1abcfa0fe61472
2024-12-18 16:46:14 +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
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
Hongjin Li
4db00f4c80 fix[vpu_legacy]: Fix vpu fbc configuration issue
Platform: General

Error case:
When info changing, setting the output format to fbc
causes buffer usage exceptions.

Solution:
Add the MPP_DEC_SET_FRAME_INFO command.

From: Product Department 2 czl

Change-Id: I779ca93b461bf220d64e3d4846128ce2f67ffc89
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-12-13 11:27:26 +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
51eb00cc4c fix[mpp_buffer]: Fix buffer put log
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If303b5de7e6b0b9d685b4f700d91a32e716210fb
2024-12-12 14:37:22 +08:00
Herman Chen
c7cf58b5c7 fix[mpp_mem_pool]: Record pool buffer allocator caller
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I21650f2af92e73f965a73f1748082556ae0ba516
2024-12-12 14:36:21 +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
331ee68fdd fix[mpp]: Fix input_task_count for async enc
fixes 22308f0

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Change-Id: Iaf5665e18a331021c57d6d758c44a9a169a07099
2024-12-11 19:53:57 +08:00
Hongjin Li
330cf905d9 fix[av1d]: Fix uninitialized fbc_hdr_stride issue
From: https://github.com/rockchip-linux/mpp/pull/736

Reported-by: nyanmisaka <nst799610810@gmail.com>

Change-Id: Ib2a1354b06df9524c164a3f41d58944df49ea1b3
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-12-11 17:36:18 +08:00
Herman Chen
c93e4a050a fix[cfg]: fix cfg test segment fault problem
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1de8ebf4
    r0  1de8ebf4  r1  4570704d  r2  961c9f22  r3  00000011
    r4  082204c0  r5  ffb39ed0  r6  00000001  r7  00000000
    r8  00000000  r9  00000000  r10 00000000  r11 ffb39d30
    ip  ffb39688  sp  ffb39cfc  lr  0822ac84  pc  0824b818
4 total frames
backtrace:
    #00 pc 00044818  /vendor/bin/mpp_enc_cfg_test
        (strof_cfg_type+32)
    #01 pc 00023c80  /vendor/bin/mpp_enc_cfg_test
        (mpp_enc_cfg_show+176)
    #02 pc 000194fc  /vendor/bin/mpp_enc_cfg_test
        (main+60)
    #03 pc 00043787 /apex/com.android.runtime/lib/bionic/libc.so
        (__libc_init+58)

Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5e568ce72e35a97d4b5d246d6fb13cfb2eb40ae8
2024-12-10 19:33:48 +08:00
Herman Chen
9a787f4438 chore[test]: Use put/get in mpi_dec_test for jpeg
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I967c74815450461cfdd4fca6d1ee640a83783961
2024-12-10 16:56:27 +08:00
Herman Chen
22308f01fe feat[mpp_dec]: Add jpeg put/get decode support
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2c183d6157b1bcca29cf8559dfe903c92d5ae1de
2024-12-10 16:56:27 +08:00
Herman Chen
11b68bfc3f chore[MppPacket]: Add caller log on check failure
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9b7bb0e4d66dd017734d9b97b8965b2f8193ab0d
2024-12-10 16:09:22 +08:00
Ben Hoff
18c0350721 fix[drm]: Call drop master by default
drop master by default to avoid becoming the drm master

Signed-off-by: http://benhoff.net/
Change-Id: Idf850f4ae7c5a0177e058bc2f1d2acc2df70408d
2024-12-10 09:47:45 +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
xueman.ruan
518037c606 refactor[vproc]: Refactor iep2 progress
1. solving deinterlace mode changes when video is
   progressive at detection mode. Frame output
   order will be wrong for the first 10 frames.
2. solving the issue that ff_mode judge will not
   be updated when info changes.

Change-Id: I85ef0abe7af972dbe9ee7965f2c17de78330c506
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2024-12-05 15:49:43 +08:00
Herman Chen
1cbb6a2527 fix[misc]: Fix compile on 32bit platform
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5175ed62993116a58e879d434db6b1b94747f605
2024-12-05 10:33:46 +08:00
Herman Chen
ae3ef50921 feat[mpp_obj]: Add mpp_obj for kernel object
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I7e5ec2b970cff69c37218cc03f6b759816becb93
2024-12-04 18:12:16 +08:00
Herman Chen
dfc7564693 feat[mpp_trie]: Add functions for import / export
1. Change MppTrieInfo internal structure.
2. Allow to export / import root, node_count and info_count.
3. Add trie check in import functon.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id10edbc92db14d045b5bbd15d13ef2472e695037
2024-12-04 14:49:16 +08:00
Herman Chen
f7a92432d1 feat[rk_type.h]: Add kernel driver compat define
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9a7916d9219c97a4ce121928adf929603c9c65d4
2024-12-03 17:50:11 +08:00
Ding Wei
9e2c67f02d [fix]h265d: move set hdr dynamic meta to alloc current frame
tips:
    if set this in alloc_frame, it may error and set the meta
in first missing ref frame, not in current frame.

Change-Id: I76ecadd7566e151b0795a4918efb4112881417ed
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2024-12-03 14:47:01 +08:00
xueman.ruan
047a3ff174 fix[jpegd]: replace packet size with stream length
Generally, stream length is equal to packet size,
which is set outside.

It is better to use stream length when exactly set

Change-Id: I2f5b6eaf263ce3c26b0ff12dac2f0f3f61483f3f
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2024-12-02 09:16:17 +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
Yandong Lin
7954ee2324 fix[mpp_enc_impl]: fix rc cfg for jpeg enc
Change-Id: I98d565318c9cf924f759db092f0f9725cf27dfa7
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-11-28 17:31:40 +08:00
Yandong Lin
9e1f62f965 feat[mpp_dec]: support hdr10plus dynamic metadata parse
The HDR10PLUS data parser reference link:
https://www.atsc.org/wp-content/uploads/2018/02/S34-301r2-A341-Amendment-2094-40.pdf

Change-Id: If7f8284d21aebdec5a71c4dbf6196a53ab2cebb8
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-11-28 17:03:00 +08:00
Hongjin Li
ae81989c0a fix[av1_vdpu383]: fix cdf usage issue
Platform: rk3576/vdpu383

Error case:
The idr frame (frm0) does not update the cdf, and then
frm1 uses the invalid cdf of frm0, causing core timeout

Solution:
Add a flag to determine whether the cdf is valid

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

Source: av1.rk3576.failure.obu

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I72d08877d40368976794ba3bcabf4e939d4fa047
2024-11-28 10:22:59 +08:00
Chandler Chen
0d4afaa70a fix[hal_h265d]: Avoid reg offset duplicate setting issue
set rps pps ref offset after ref_err check

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Ia04a171dc1bdbd73d769408a81efb80227a7a528
2024-11-27 17:23:52 +08:00
Johnson Ding
5f522dcaf0 fix[vepu580]: fix incorrect color range problem
For H.264 and H.265 encoder on RK3588, when input source is YUV, keep
input source. For RGB, transalting according range setting from API.

Change-Id: Icf0ffdb80d7fcc4027b8bd7b9b7fd673fc6e3b0b
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-11-25 09:58:31 +08:00
Hongjin Li
7554e1c36d fix[buf_slots]: Fix the issue of fmt conv during info change
Platform: General

Error case:
The output format is initialized to fbc, and then converted to yuv
during info change

Solution:
In the SLOTS_FRAME_INFO case, improve the copy of frame information

From: Product Department 2, android15 youtube verification

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ia78f1272c506ec1ff5e0789fd26b36e3cb1d63b1
2024-11-23 11:40:46 +08:00
Chandler Chen
c3b2ece9c2 feat[hal_avsd]: enable hw dec timeout
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I395166c22d9fc14a4c05515374f58753f83ce03d
2024-11-15 09:19:03 +08:00
Rimon Xu
e408eef415 fix[h264d]: force reset matrix coefficients when parse unknown value
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: If66ad41b25f067476f58fa32417f3a2302f5cd9e
2024-11-12 17:06:09 +08:00