Commit Graph

3625 Commits

Author SHA1 Message Date
Rimon Xu
62922f3cc1 [m2vd_parser] change frame period to 27MHZ
The system clock frequency specified by MPEG2 is 27MHz, so the
values calculated using this frequency are the most accurate.
Therefore, all frame periods should be changed to be based on
the 27MHz calculation.

Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: Id878ce83a453e5a332912cac0bb393c436bfa5de
2023-07-10 16:42:36 +08:00
Rimon Xu
53846ffaa4 [dec_no_thread] Fix invail mpp_pkt_in after reset
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: I3cf3e8e5342a5bd88c8b079d5ee7ca43ab0cdf25
2023-06-30 16:31:08 +08:00
Herman Chen
ae444a6cb5 Revert "[m2v_parser]: fix pts calculate error"
This reverts commit b5f6decb49.

Change-Id: Iedffa5079e39bf9fec043d4248f41d5cd1b02116
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2023-06-29 18:29:21 +08:00
Christina Brien
58d1164b43 MPEG-2: correct PTS calculations OS-15301
b5f6decb49 is a commit which changed PTS
calculation, in an attempt to fix dimension mismatch.

PTS is measured according to the 90kHz MPEG clock (derived from the 27MHz system
clock). The frame_period value in m2vd_parser.c comes from the
frame_period_Table indexed by frame_rate_code from the sequence_header; this is
a fixed-point q8 value of milliseconds - i.e. according to a 256kHz clock.  The
90kHz and 256kHz timestamps are not dimensionally compatible. Treating them as
such is wrong.

This change cprrects the PTS calculation by providing appropriate conversions
between 90kHz and 256kHz clocks.

Change-Id: I21fe84bd79b0b5762f641b886b491f4e548a2629
2023-06-29 08:56:27 +08:00
Herman Chen
78a6ca648e [cmake]: Adapt to Android 14 requirement
1. Android 14 required to use libc++ instead of libstdc++
2. Add ndk search path and options for ndk switch.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I07595fc0290daaaf6518eca18d7b318be89fc6ae
2023-06-25 10:08:43 +08:00
Johnson Ding
56e006e046 [hal_jpege_vepu2]: fix wrong rstm assigning issue
For multi-core case, the first restart marker for each core should be
correct. Otherwise JPEG decoder may fail to decode the following ECS.

Change-Id: Ic5e1c4c175cc88a7946bd0c07c09709ad066a4d8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-06-21 16:58:06 +08:00
Johnson Ding
9b06c3e92f [enc]: remove recovery point SEI when needed
If SEI NALU is disabled, recovery point should not be generated.

Change-Id: I8359385a8c048a635661016f50a6bf1b5da38946
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-06-21 16:57:55 +08:00
Yandong Lin
93e6aa1631 [vepu_580]: fix the handling for enc failed
Check enc status and force idr when enc failed.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I23a2dabc1e56ca7904b541f834fee5535cfd4f53
2023-06-21 09:11:16 +08:00
Yandong Lin
3ba3f59baa [h264e_dpb]: fix dpb info print alignment
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I2fec62a1558dfed3ad7c2ad702ca85aeccf1d7ea
2023-06-20 17:19:19 +08:00
xueman.ruan
8a54ab8d7d [h264d]: fix the derivation of mbaff.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I3a119e2d9eb90158d837bd35b03d0d436425764e
2023-06-16 11:21:14 +08:00
Yandong Lin
f1734a1737 [mpp_service]: remove get disable_rcb_info env runtime
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3886482cd10ac8cc02d35d7b89c8cc8f88c1a600
2023-06-08 18:27:13 +08:00
Yandong Lin
8335e44c25 [vdpu_com]: remove get rcb_mode env runtime
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I8bc4d06339d1e663b8a4cea9ad3c167dd861779e
2023-06-08 18:24:47 +08:00
Herman Chen
feab136f1a [allocator_dma_heap]: Add error log
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I06af727713e1c096eada8a40795f42668fdaff6d
2023-06-06 15:48:43 +08:00
Yandong Lin
a76ad475db [hal_h265d]: modify reg_cxt to reg_ctx
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ic182b046054e84f88695136b40c9b6c9243cc434
2023-06-02 15:05:43 +08:00
Yandong Lin
e4554e2b84 [mpp_frame]: fix MPP_FRAME_XXX bit mask conflict
fix MPP_FRAME_HDR bit mask conflicts with MPP_FRAME_FMT_LE_MASK

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3a0df734f8cbc36da625d4b1a70658069809774f
2023-06-02 15:05:17 +08:00
xueman.ruan
b36f6854c3 [h264e]: fix mlvec test error.
Issue is introduced by commit as follows.
Change-Id: I7aedef0096d606ff91e1ed30d7e228a75359931d

Change-Id: I2162791bcc4d19d8fd3f110f252d74503cc6415b
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-05-31 17:17:03 +08:00
xueman.ruan
f91f152a1a [hal_h264e]: fix log2_max_frm_num config error.
Issue is introduced when user configs log2_max_frm_num.

1. use MppEncH264HwCfg instead of hw_poc_type.
2. slice_write can only use corresponding hardware config.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: Id5f3622512075eedc1e9dc99636c3f0dff43d6f1
2023-05-30 14:04:31 +08:00
xueman.ruan
fbe861d86b [jpege]: set default rc_mode to fix_qp.
Change-Id: Icd0e0148865b96ddb78657296479a965eed5de9b
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-05-26 11:44:11 +08:00
Johnson Ding
e025b079a2 [hal_jpege1]: Fix spliting ECS not work problem
Change-Id: I1d1674ef9f8b27ff92db3c9cc8f1af9135f1c637
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-05-18 14:14:14 +08:00
Johnson Ding
e214fe36dd [hal_jpege2]: Add multi-core encoding for spliting
If Picture is splited by MCU numbers that configured by user, add
multi-core encoding support for RK3588.

Change-Id: I11984aba1bc99eda8642bb7acec6e2354a5dfac5
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-05-18 14:13:36 +08:00
Zhihua Wang
acd257349c [vepu541]: Support h265e slice split
Signed-off-by: Zhihua Wang <hogan.wang@rock-chips.com>
Change-Id: Icddbda95b818aa9ce779d38b62cda59f8a1273f7
2023-05-13 11:48:08 +08:00
Yandong Lin
376a4e25a2 [mpp_buf_slot]: fix impl->slots maybe invalid issue
After realloc, the source pointer maybe invalid,
need assign the new pointer.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I324f379540cab2d6463a829470f11ff2d57b0b42
2023-05-11 10:42:37 +08:00
Yandong Lin
287ce67137 [h264d_vdpu382]: hack for err ref check
The hw ref used may not correct, cause mark frame err info incorrectly.
So if is err frame, set fd = 0, err for trigger pagefault if the cur frame
use the err ref. This makes it possible to correctly identify whether an
err ref frame is being used.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I4e7f042731f22e3ab8f4c90e51120fb8d841142a
2023-05-10 18:26:23 +08:00
Yandong Lin
193309a852 [driver]: add MPP_CMD_SET_ERR_REF_HACK api
support hack for err ref check for decoder

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib61336b50dde626d85f9f6bb25950ea70149ea49
2023-05-10 18:24:13 +08:00
Chandler Chen
a7f94086ff [vepu540c] modify h264/h265 encode reg config
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I9f6ec8b1d801a1159cd0bd2e43e3a57b34d91238
2023-05-10 17:58:30 +08:00
Yandong Lin
d86f0fc707 [mpp_service]: fix query_cfg name issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib594f7e892fdd8831fd49fa8fa4aeb8ac0dd533e
2023-05-09 18:12:49 +08:00
Johnson Ding
669bf366ec [avs2d]: Fix PTS out of order problem
It is wrong to using PTS of the next packet as PTS of current paring
frame.

Change-Id: I858d4bd2831e63eefc8815be3cabe460444528bd
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-05-09 15:20:15 +08:00
Yandong Lin
b04033f8c2 [mpi_enc_test]: fix some cmd config issue
1. Fix qc param config issue.
2. Fix some param help description issue.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I47b88c6f1c0c2db67139cae55957019572b5cd20
2023-05-08 17:12:47 +08:00
Xingwen Fang
a8102ad4c7 [mpp_frame]: fix mpp meta memory leak
Change-Id: I263f0cc3da523b5d5304937e926d4a9c03114242
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
2023-05-08 14:49:37 +08:00
Yandong Lin
5209fe4dd2 [vp9d_parser]: fix ref frame early release issue
The commit that cause the issue:
commit eaa250d1fc
Author: Yandong Lin <yandong.lin@rock-chips.com>
Date:   Thu Apr 13 10:57:35 2023 +0800

    [vp9d_parser]: fix frame mark errinfo issue

    Key Frame or intra only frame do not reference other frame,
    so need not check errinfo of ref frame.

    Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
    Change-Id: I4fbfca7ba7dedfef6d6a721528ba536dba50a8f3

err log:
mpp_buf_slot: Assertion slot->status.has_frame failed at mpp_buf_slot_get_prop:1085
hal_vp9d_vdpu34x: ref buff address is no valid used out as base slot index 0x2

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie280d732a48ae326f1c9bb6470ca452dc974d296
2023-05-04 11:53:21 +08:00
xueman.ruan
c794d353c5 [allocator_dma_heap]: add file permission check.
Change-Id: Icfffaf3594f029b87e3a87f17de408a681c49dfb
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-05-04 08:57:02 +08:00
Yandong Lin
13794992d9 [mpp_mem_pool]: fix MppMemPoolNode double put issue
When a object is double put by mpp_mem_pool_put,
it will destroy the info of MppMemPoolImpl.

So set node->check = NULL when mpp_mem_pool_put, and it will check
failed adn return when double mpp_mem_pool_put.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I54be2eae3a1d7e81579f89d3e80304abface3049
2023-04-27 17:45:28 +08:00
xueman.ruan
8c1f82c939 [mpp_cfg]: fix set ptr err.
The same poiner address may have different value in memory.
So we need to update pointer config at each time.

Issue is introduced by commit as followed.
Change-Id: Ia15a0128d03b1a2624410b6f2a13effe3a03c47c

Change-Id: Ia10fe1f3faff257d5276473cb7829ac1cb0f1795
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-04-26 10:13:14 +08:00
Yandong Lin
eaa250d1fc [vp9d_parser]: fix frame mark errinfo issue
Key Frame or intra only frame do not reference other frame,
so need not check errinfo of ref frame.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I4fbfca7ba7dedfef6d6a721528ba536dba50a8f3
2023-04-25 09:13:22 +08:00
Chandler Chen
d2a3eda478 [m2vd_parser] mark resetFlag when frame alloc failed
frame alloc failed cause by stream error, such as:
receive top field while top_field_first = 0,
or bottom filed while top_field_first = 1;
mark resetFlag to wait for another I frame

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I0bf6152db84459b06141ab0fa5232c0fffd51f92
2023-04-24 16:56:52 +08:00
Johnson Ding
e32018de55 [h265d]: Skip decoding special encoder stream
Change-Id: I1c7aebce531452349fd5bbf20221906a81a163a7
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-23 17:42:50 +08:00
Johnson Ding
b45d8b16cb [h264d]: Skip decoding special encoder stream
Change-Id: I9bdd32bc3b00b9a038d9429295b045a8b6bd97ef
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-23 17:41:31 +08:00
Johnson Ding
1a8161c845 [dec]: Add common code for AVC and HEVC
Change-Id: I48f0bddbbb6762a653dca0eec3dc8b6acba03673
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-23 17:10:11 +08:00
Johnson Ding
66e2f65ff2 [h265d]: Fix SEI parsing
Change-Id: If7a504882385a9d41d9ab22b319c30b6b67f3b1c
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-23 11:44:36 +08:00
Johnson Ding
8d7e66474b [h264d]: Fix paring SEI_BUFFERING_PERIOD
SEI payload parsing should be aligned with bytes. So bits remaining at
tail should be skipped. In case of bits remained is more than 32,
skipping the whole payload directly from the beginning of the current
payload being parsed.

Change-Id: I003a51b8347011ad310b55452192b07ae63e7df3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-23 11:44:36 +08:00
Johnson Ding
ef4d266eb7 [jpegd]: Fix multi DHT parsing
Change-Id: I101654fcb87921ef4e9bbc35a2b4ff7ede974071
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-23 10:22:18 +08:00
xueman.ruan
7d6c39741d [mpp_dec]: add info when decode mpeg2/4 beyond cap.
Change-Id: I0aaf6b9f411557462cd2bf810b86cc7f04884ad9
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-04-20 09:55:30 +08:00
Johnson Ding
0de995aa8b [misc]: Fix Clang warning
Change-Id: I0e6241c6ecd3d77bf111d7ce7184b458b05fe1f9
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-18 11:52:54 +08:00
Johnson Ding
b92d30ee7c [avs2d]: Fix stuck on eos problem
Change-Id: I9d60dff526b8330afb2eee9c85563f56d6043736
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-14 17:44:24 +08:00
Johnson Ding
9f540430f5 [avs2d]: fix SEGV when realloc
For larger NALU header, eg: userdata or extradata, header buffer
initialized at first will not be enough. But previous data pointers that
point to header buffers are not valid after doing reallocation. So a
better way to recording buffer entry is to record offset.

Change-Id: I13f59e142af6d1a932279cb8eb43c28e72141af9
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-04-14 17:42:22 +08:00
Yandong Lin
0380ab2453 [hal_h265d_rkv]: fix cut slice header extension data issue
In 64-bit env, memcpy in the same buffer may cause err stream.
Use memmove replace memcpy to resolve the issue.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I55326e03c1af04ec617bd213c7dcd84d5d92406d
2023-04-11 14:17:59 +08:00
Yandong Lin
2d6ba2a3c6 [h264d]: modify prop rkv_h264d_parse_debug -> h264d_debug
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I0a2c3a980182049da71badd025138f5d896e1cc4
2023-04-10 15:57:40 +08:00
xueman.ruan
f387c6dac2 [mpp_allocator]: disable std allocator.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I27441d49c2072176b848b5d80d408ebcb50926df
2023-04-07 09:06:37 +08:00
Xinhuang Li
55c5f0cb5b [rc_v2] fixed avbr min_still_percent initialization err
- Fixed min_still_percent overflow
- Fixed incorrect initialization value after dynamic
change of bit rate

Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
Change-Id: I8a0cf501f5995731d1ad8173c3d8880b33c63f73
2023-04-06 16:15:21 +08:00
xueman.ruan
a3689ee547 [hal_avsd_plus]: fix avs+ decode error.
issue occurs in 64 bit env.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: Iceab22b7ded40189de1aa81451227ca5a25ed778
2023-04-06 11:18:44 +08:00