Commit graph

3703 commits

Author SHA1 Message Date
timkingh.huang
4a71a39dc7 fix[smt_rc]: Fix first frame QP error
Change-Id: Icc7c30e2f2153643c2b06482e21b1082d0e3e618
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2024-09-25 16:45:11 +08:00
xiaoxu.chen
a4bd0d2a69 refactor[h265]: unify calculation tile width
Change-Id: Ib5200e332cc5be47f79561570c0342e7690e4587
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2024-09-25 14:14:03 +08:00
Yandong Lin
c16dfcea7d fix[h264d]: fix no output for mvc stream
By default, the frame of view 0 is decoded and output.

Change-Id: I26287147548620f733712d4ab044df7c830dbd7f
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-09-24 17:43:41 +08:00
timkingh.huang
61d34ba1d1 fix[vepu580]: Fix motion level assignment error
Change-Id: I3de290596126c26ac3711c4b6d83c83f01a717f0
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2024-09-24 14:33:12 +08:00
Hongjin Li
48962a107a fix[avsd]: Fix attach dev error issue
Error log:
mpp_dev_ioctl found NULL input ctx

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Id3ae1eec032d0d7ec943417bd8caf814eb8f80e9
2024-09-19 14:35:11 +08:00
Rimon Xu
5acf49c633 fix[h265d]: Fix conformance window offsets for chroma formats
- Correctly apply conformance window offsets based on chroma_format_idc
- For YUV 4:0:0 (chroma_format_idc == 0), no offset scaling is needed
  as there is no chroma component
- For YUV 4:2:0 (chroma_format_idc == 1), apply * 2 to both horizontal
  and vertical offsets
- For YUV 4:2:2 (chroma_format_idc == 2), apply * 2 only to horizontal
  offsets
- For YUV 4:4:4 (chroma_format_idc == 3), no offset scaling is needed
- Ensured the output window accurately reflects the cropping adjustments
  for different chroma subsampling formats

Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: I90c7e61487a1638d5ba296f1d95de4792fcb2104
2024-09-18 19:53:44 +08:00
Tingjin Huang
fdb674ab01 fix[test]: Fix mdinfo size according to soc type
Change-Id: I25801cefe329f4aea943379a7fd99db57b733ed1
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-09-13 14:52:19 +08:00
Tingjin Huang
c48a88c2fa feat[vepu510]: Add scaling list regs setup
H.264: intra8x8 and inter8x8 for luma only
H.265: intra/inter 8x8/16x16 for luma and chroma,
       intra/inter 32x32 for luma

Change-Id: I6ca3d5985af7d3d7e7c1bc99db820cd166be0624
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-09-13 14:51:44 +08:00
Yandong Lin
05b809393c fix[h265d_vdpu383]: fix dec err when ps_update_flag=0
The ps_update_flag=0 case is not handled properly here,
and follow commit exposes this problem.
233940: fix[h265d]: fix infochange loss when two sps continuous

Change-Id: I54dcea6c31483257b4b771a8bd4994cc75ed41f5
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-09-11 15:40:04 +08:00
Tingjin Huang
ba450dd834 fix[vepu510]: Sync code from enc_tune branch
1. Fix AQ setup error for smart H.264
2. Fix initial value error of qp_min
3. Adjust H.264 regs setup for CVR scene

Change-Id: I38b09edb95532a3c1e9a544584c6d258f05fc43b
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-09-10 17:42:41 +08:00
Herman Chen
c4e9cc504d fix[mpp_cfg]: Fix compile warning
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I90693ea5af424b46fa1b307f4181e68b078e973d
2024-09-06 16:41:25 +08:00
Yandong Lin
e9d95ce4a5 fix[h265d]: fix output err causeby refs cleard
fix issue cause by the following commit:
233940: fix[h265d]: fix infochange loss when two sps continuous

Change-Id: Ie0047cbb7f02ef78e46f6980acfb20532af12dee
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-09-06 15:25:54 +08:00
Yandong Lin
f358f6c24e fix[h264d]: remove error check for B frame has only one ref
When a B frame is behind an IDR frame, there is only one reference.

Change-Id: I1bc7f1901aa128490d14dc6702dce6a32612ff48
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-09-05 09:17:50 +08:00
Johnson Ding
6f0f337f71 fix[test]: Fix test demo stuck issue
When reading file from start over, buffer got from list should be put
back. Otherwise buffer list will have no more buffer available after
rewinding BUF_COUNT (which is 4 currently) times.

Change-Id: If346e1824bd876cf2d6c226c97c1dec17dc9b56f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-09-04 18:26:09 +08:00
Herman Chen
85208c99b0 docs: Update 1.0.7 CHANGELOG.md
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ie7ade7ae53b3dc6a53da3fd38a3f3834280892d8
2024-09-04 14:43:53 +08:00
Yandong Lin
44a9afe384 fix[h265d]: fix infochange loss when two sps continuous
The sps buf is managed by mpp_mem_pool. When two sps appear
consecutively, the second ptr of sps is the same as the old sps.
So when updating the sps to pps,it is not enough to judge the ptr sps.

Change-Id: Ieb7cf1c374dd72abae6f0c899bc9f2ee9849072e
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-09-04 11:12:49 +08:00
xueman.ruan
be5247fe75 fix[hal_h264e]: Fix CAVLC encode smartP stream err
Change-Id: I759210b5e7557cc4bcc3a117d7d11adeaddd9153
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2024-09-02 18:12:55 +08:00
Herman Chen
e9abaab950 refactor[mpp_cfg]: Refactor MppTrie and string cfg
1. Reduce MppTrie memory usage.
2. Add info context and string temp storage.
3. Refactor memory layout on mpp_trie last info.
4. Use ENTRY_TABLE to setup mpp_enc/dec_cfg trie info.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I3e554ca6ef97bf77406ced00a116c5783570baba
2024-08-30 17:22:31 +08:00
Herman Chen
295aa22639 chore[mpp_mem]: Add mpp_realloc_size
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I896b4132e0fded153ee4d932b9c011bf3ba41c16
2024-08-29 17:53:01 +08:00
Tingjin Huang
2988a0c499 fix[mpi_enc_test]: Remove redundant code about smart encoding
Change-Id: I3a0876bd9476590b0e25d1c18f76a793fd4c86ab
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-29 11:26:17 +08:00
Yandong Lin
8f1b70dd79 fix[h264e_sps]: fix the default value of max mv length
The value of log2_max_mv_length_horizontal/vertical has been changed to
15 since the 2016 standard.

Change-Id: I12ab104cd3277e4d926c7a721bfaccab721d5997
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-08-29 10:39:52 +08:00
Tingjin Huang
1984930917 feat[rc_smt]: Add rc container for smart mode
Change-Id: I4e6b2317c8fe71236b3e6c14ffb9ead7af4530ec
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-29 10:04:03 +08:00
Tingjin Huang
01dee1b7d4 feat[vepu580]: Optimization to improve VMAF
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
Change-Id: Idaecf9a402aa9b87802d76911abb816e0dc557ec
2024-08-29 10:04:03 +08:00
Tingjin Huang
df0b9e3a0d feat[vepu580]: Optimize hal processing for smart encoding
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
Change-Id: I27ec19fcfa6c71bb1d084fea7d40853fed3e4603
2024-08-29 10:04:03 +08:00
Tingjin Huang
e03714e193 feat[vepu580]: Add qpmap and rc container interface
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
Change-Id: I9fb0683008880a2e025664052a64d290730e6b49
2024-08-29 10:04:03 +08:00
Herman Chen
a1a9422c26 chore[mpp_cfg]: Remove some unused code
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9b0efcba54328fae66ad06f66038bb314a66f6bc
2024-08-28 17:34:46 +08:00
Tingjin Huang
e0e70e96d2 feat[vepu510]: Add anti-smear regs setup for H.264
Change-Id: I46ce011c215a632c871ea8816563a2eb598146e0
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-27 10:24:49 +08:00
Tingjin Huang
16e700e41e feat[vepu510]: Add H.264 tuning setup
1. Add AQ regs setup. There is no aq clip operation which is
different from vepu500.
2. Update anti-stripe regs setup. Option "-atl 1/0" to enable/disable.
3. Add anti-ringing regs setup
4. Add anti-flicker regs setup

Change-Id: Ia36073d26ab5587f3478f7f8b4cdfe8a1ffed8f4
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-27 10:24:39 +08:00
liming.lou
1bb6ff8993 feat[vepu510]: Sync code from enc_tune branch
1. Design 8 mode for smear
2. Adjust atf_e and atr_e switch
3. Adjust aq thd and aq qp delta
4. Modify appropriate parameters for smear
5. Add sao atr atl configure interface

Change-Id: I0afb7e3d920dddfd33ea8d81fcbda5dd0d6801d3
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-27 10:23:33 +08:00
toby.zhang
03696728e1 feat[vepu510]: Sync code from enc_tune branch
1. Add anti-line tuning
2. Adjust AQ assignment
3. Add smart encoding
4. Add deblur/qpmap routine
5. Add atf & four level intensity control atf
6. Add atr anti_blur function
7. Add real time bitrate output
8. Add smear buffer for vepu510

Change-Id: Iae661686f6adacd0b5ec57c102c184e2537dfc7d
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-27 10:23:23 +08:00
toby.zhang
02095f66d3 feat[vepu510]: Sync code from enc_tune branch
1. Add cu_qp_delta_depth cfg
2. Configure AQ regs for H.265
3. Configure regs according to scene mode
4. Support fixed frame level QP
5. Add RDO lambda table index
6. Update stat info for HEVC
7. Add tuning code for H.264 encoder

Change-Id: Id7dae4ed55e1b94622aee72cfce8f24c833d00e1
Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
2024-08-27 10:08:49 +08:00
Yanjun Liao
12cf338dff fix[enc_roi]: Fix cu_map init in vepu_54x_roi
Change-Id: Icdc9c44778ce3ecbf9234ffe4294aff8ffd4165d
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2024-08-23 15:56:29 +08:00
Hongjin Li
2a30bc68c2 fix[hal_vp9]: Optimize prob memory usage
Change-Id: Ice9fe69b1427777cd054788b967be5adaabe7bb6
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-08-21 14:51:10 +08:00
Johnson Ding
79b24a631b fix[hal_h265d]: Allow reference missing for GDR
1. Keep decoding when the reference frame is not valid.
2. For RK3588, improve decoding speed and result when decoding a
   non-IDR picture of a GDR stream.

Change-Id: Iae3ac63b05349e4ba923d6df03f89c2958ad72a1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-08-19 09:32:32 +08:00
Herman Chen
c367dd1609 feat[mpp_trie]: Add trie context filling feature
1. Add context space reserving on trie shrink.
2. Remove MppTrieNode on trie interface.
3. Fix MppTrie usage on tests.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ie2f568785a78499b394d298c3833dd04c6f9a9bd
2024-08-16 15:24:36 +08:00
Herman Chen
8bfa0916e2 feat[mpp_trie]: Add trie tag and shrink feature
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1edd0fb510393b73ec4962825183623cf1007482
2024-08-16 14:52:25 +08:00
Herman Chen
8108bf58ea fix[osal]: Fix mpp_mem single instance issue
When another C++ static global object init before the mpp_mem service
the MppService service will be inited twice. Then on object destroy will
deinit service twice and cause mutex double delete issue.

On init

E mpp_mem : MppMemService start 0 0x7c536619e8
I mpp_mem : MppMemService mpp_mem_debug enabled 3 max node 1024
E mpp_mem : MppMemService start 1 0x5e8d724230
I mpp_mem : MppMemService mpp_mem_debug enabled 3 max node 1024

On destory

05-17 09:58:04.743  2576  2576 E mpp_mem : ~MppMemService enter 0 0x5e8d724230
05-17 09:58:04.743  2576  2576 E mpp_mem : ~MppMemService enter 1 0x7c536619e8
05-17 09:58:04.743  2576  2576 E mpp_mem : mpp_osal_free

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'rockchip/rk3576_t/rk3576_t:13/TQ3C.230805.001.B2/eng.kenjc.20240510.161710:userdebug/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2024-05-17 09:58:04.800905936+0000
Process uptime: 1s
Cmdline: mpp_trie_test
pid: 2576, tid: 2576, name: mpp_trie_test  >>> mpp_trie_test <<<
uid: 0
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x5e8d724230)'
    x0  0000000000000000  x1  0000000000000a10  x2  0000000000000006  x3  0000007fd26f05d0
    x4  0000000000008080  x5  0000000000008080  x6  0000000000008080  x7  8080000000000000
    x8  00000000000000f0  x9  0000007c50d22a00  x10 0000000000000001  x11 0000007c50d60de4
    x12 0101010101010101  x13 000000007fffffff  x14 000000000001ffea  x15 0000000000000078
    x16 0000007c50dc5d58  x17 0000007c50da2c70  x18 0000007c55b38000  x19 0000000000000a10
    x20 0000000000000a10  x21 00000000ffffffff  x22 0000000000001000  x23 0000005e8d724230
    x24 0000007c5489e010  x25 0000005e8d70c060  x26 0000000000000002  x27 0000007c513226e8
    x28 0000000000000000  x29 0000007fd26f0650
    lr  0000007c50d52968  sp  0000007fd26f05b0  pc  0000007c50d52994  pst 0000000000000000
backtrace:
      #00 pc 0000000000051994  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #01 pc 000000000005363c  /apex/com.android.runtime/lib64/bionic/libc.so (__fortify_fatal(char const*, ...)+124) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #02 pc 00000000000b74cc  /apex/com.android.runtime/lib64/bionic/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+60) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #03 pc 00000000000b735c  /apex/com.android.runtime/lib64/bionic/libc.so (pthread_mutex_lock+240) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #04 pc 0000000000048290  /system/bin/mpp_trie_test (mpp_osal_free+108) (BuildId: 55dca41ecc701b3ad16f0ef02270a45ce40533ff)
      #05 pc 0000000000041080  /system/bin/mpp_trie_test (MppMemPoolService::~MppMemPoolService()+32) (BuildId: 55dca41ecc701b3ad16f0ef02270a45ce40533ff)
      #06 pc 00000000000b9ca4  /apex/com.android.runtime/lib64/bionic/libc.so (__cxa_finalize+280) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #07 pc 00000000000ac944  /apex/com.android.runtime/lib64/bionic/libc.so (exit+24) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #08 pc 000000000004a1f8  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+100) (BuildId: 4e07915368c859b1910c68c84a8de75f)

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I81ead0f796ba6e26b520a87ae69cc8f7f6e816f4
2024-08-16 09:53:55 +08:00
Hongjin Li
083b76960e fix[hal_vp9d_com]: Fixed memory leak issue
Platform: RK3576

Error case: Decode vp9 source

Change-Id: If2a444cd70d850a190a26e2eabc3cdde9d997dd3
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-08-15 09:58:09 +08:00
Johnson Ding
ad898220a6 fix[hal_h265d]: Avoid risk of segment fault
Change-Id: I5af80d2de068cb6cb5ded11c110a86c35626bffb
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-08-09 18:06:11 +08:00
Johnson Ding
c2689ac98a fix[hal_h265d]: fix error slot index marking
At fast mode, 3 error_index is need. Otherwise it will be covered and
leads to ref_err marked as 1.

Change-Id: I846b6f814a88eb45d54d7e2f533c950464d1bd8e
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-08-09 18:05:51 +08:00
Johnson Ding
918723041b fix[h265d]: Adjust condition of scan type judgement
Refer to commit 3198035973.

When decoding interlaced H.265 stream, SPS will be changed after parsing
SPS NALU. This leads to comparing the new SPS and old SPS via memcpy
reporting that they are different. And references list will unreference
frames. Finally, some frame that should be kept in dpb will be removed.
And the following picture to be decoded will not find these removed
frame for reference.

Note that comparing two SPS buffer with memcpy to find if reference list
should be update is too rough. It should be fixed in the future.

Change-Id: If20ab30973df12635976d4b9d759b36b560ddea2
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-08-09 17:09:21 +08:00
Hongjin Li
2df4bed689 fix[mpp_hdr]: Fix buffer overflow issue
For vdpu383, 8K video needs to be scaled to 4K,
but buf_size still needs to be processed as 8K.
When filling HDR data, it needs to be filled
according to the 4K buffer offset.

Change-Id: I610adcf848acc1eee903b5ef7e438875b55e4628
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-08-05 09:45:45 +08:00
Hongjin Li
44f56822f7 fix[mpp_buffer]: Synchronous log addition point
Inc/dec logs are added after ref_count changes

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I6c358d077c5437d47305c5e211ae9999ca7a8b8f
2024-08-05 08:53:56 +08:00
Yandong Lin
a412466af8 fix[hal_vepu]: fix split regs assignment
Change-Id: Idba725a871dbac7ce070e0bb66701f1584e06bb4
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-08-03 11:05:44 +08:00
Yandong Lin
b71f7be716 fix[vepu580]: poll max set to 1 on split out lowdelay mode
Change-Id: I76e80cda83db4cc63998906d62f98181e282a91e
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-08-02 17:22:47 +08:00
Yandong Lin
d96a88673c feat[h264d]: support hdr meta parse
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id17781edfe480c859a2e89909e517030ea07c43b
2024-08-02 14:26:51 +08:00
Yandong Lin
b9a9ba00d5 chore: fix compile warning
warning: variable 'xxx' set but not used

Change-Id: I0dc5d434b7f08e776f98e08885d4b25eaab199c1
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-08-01 11:12:51 +08:00
Yandong Lin
b739b13594 fix[mpp_common]: fix compile err on F_DUPFD_CLOEXEC not defined
Change-Id: I5e258a13be331af7a4d11d6ab2e4a8afb12418dd
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-07-31 18:18:32 +08:00
Rimon Xu
045016af53 fix[h265d]: return error on sps/pps read failure
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: I19ebfcd2e3d301b15cd85a11706cfb3061bdef81
2024-07-31 17:13:00 +08:00
Hongjin Li
2ec23d0371 fix[build]: The first toolchains is selected by default
Change-Id: I4e449d4361f017c4e9eaa5947d7d79ac0e6a3e91
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2024-07-31 09:56:46 +08:00