Commit graph

3248 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Ding Wei
8608ff2c60 fix[h264d]: Parse hdr parameters on enable_hdr_meta enabled
Change-Id: Ice5c2150af5b7f80f9ec6c73dc1a9e04bb71fe87
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2024-11-07 18:20:17 +08:00
Hongjin Li
1f8aafea1c fix[h264d_parser]: Fix pps parsing issue
Platform: General

Error case:
The source don't have the second_chroma_qp_index_offset

Solution:
The base line profile, Main profile, and Extended profile do not
support transform_8x8_mode_flag, pic_scaling_matrix_present_flag,
and second_chroma_qp_index_offset, so it is not parsed in these
cases.

From: redmine #516724

Source: bigbitrate.264

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Iab48d47b3031a478d1821a164274366e1249a73c
2024-11-04 15:43:40 +08:00
Chandler Chen
aaa4c8e9a8 fix[hal_vdpu383]: fix fbc hor_stride mismatch issue
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I32ba0ace912179d875f2e474a0ef673b9bd74b65
2024-10-29 16:45:56 +08:00
Yandong Lin
4a2bd2aea6 fix[hal_vepu580]: re-get roi buf when resolution switch
Change-Id: Iba09d1daffaed9391b93c124d203487a396ffb6a
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-10-29 09:59:55 +08:00
Yandong Lin
a0fbdd3c21 fix[hal_vepu541]: re-get roi buf when resolution switch
Change-Id: I2ebc2c731abb8cd45d1d9df98f3eb420a7091de1
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-10-29 09:59:55 +08:00
Herman Chen
a49f851c65 fix[iep2]: Remove unnessary log on init failed
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I19a979246ccf7ceeed8e8598ad17420b6d7cb952
2024-10-29 09:44:46 +08:00
Hongjin Li
a14f1327aa fix[h264_dpb]: Add env variables to force fast play mode
env var: force_fast_play_mode

Change-Id: I678452de25e62ffcd0415fc21bbe4a7da4c792a7
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-10-24 17:01:45 +08:00
xiaoxu.chen
611a9a04b6 fix[h265e_slice]: fix compilation warning
Change-Id: Ic21ffe6c438ef8e77aa3d8b9173af482a0689d36
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2024-10-21 09:58:13 +08:00