Commit Graph

3026 Commits

Author SHA1 Message Date
Herman Chen
eee95d181d [hal_h264e_vepu541]: Reduce intra block in P frame
Increase intra block cost in inter frame.

Change-Id: Ie913467bf2ceec37a00a63e89d6a08765ce4008b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-15 14:10:35 +08:00
Siyong Chen
66efd29e8b [hal_h264e_541]:Fine tuning L2 paramet cfg
Change-Id: Ie568cb5dae40b65a7960b106dc8cb23b5acf9a23
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-03-15 14:08:24 +08:00
Siyong Chen
dbc46a11ec [h264e]: Rkvenc set chroma_qp_index default -6
Change-Id: Ia62983b7721fbcb2450e9481c85346d90769990e
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-03-15 14:03:03 +08:00
Siyong Chen
b2414627c3 [rc_v2] Modify cbr reenc ratio calc
Change-Id: Id857a03d128e912e68093dcd9a2cede0fdcfd190
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-03-15 13:58:29 +08:00
Herman Chen
c6f2c43afa [mpp_dec]: Add more detail debug log
Change-Id: Ic5516a5e6746f563cfeb77f415d0f98d2fd6f453
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-13 16:44:08 +08:00
Yandong Lin
f2231d1473 [mpp/vcodec service]: Check whether the offset is configured repeatedly
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I217a138b62a7a17f7f371d76a591a02852950a10
2021-03-12 11:39:27 +08:00
Yandong Lin
095be71345 [hal_h265e_vepu541]: Fix h265 enc err when multi tile
In the first tile, the offset of some regs be configured twice,
when multi tiles.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I6a4f6851cd635b4ea8a52f056bcf5f097636ece3
2021-03-12 11:37:44 +08:00
Herman Chen
bb5e42b781 [h264e]: Fix separate chroma qp offset issue
Only set different chroma qp offset on High profile.

Change-Id: Iabcbc3d256cdbf521369262f011ac77db998f54f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-10 14:16:04 +08:00
Yandong Lin
5be47f31f0 [hal_vdpu]: Support fd and offset to be set separately
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I38214c5d692fce76b60fe71536fab9863605e64e
2021-03-05 14:22:35 +08:00
Herman Chen
7dd312a457 [test]: Use different function name in dec tests
Change-Id: I672abbcc654f084b52d337c61d55218d7f342f7b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-05 14:11:06 +08:00
Herman Chen
b45e1f5352 [hal_h264d_vdpu34x]: Reduce buffer fd usage
Change-Id: Ifc1c7fe28fcb04e0e6d3b0f03c827d4abb1bfce9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:31:56 +08:00
Yandong Lin
5fae84dcfb [h265d_vdpu34x]: Fix invalid fd issue
fd and offset should be set separately

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I87a041c549ec9c5a713aeb37b23c1c4d0efde744
2021-03-03 15:18:37 +08:00
Herman Chen
6b5ee5a122 [mpp_dec]: Implement put_packet by dequeue/enqueue
1. Use dequeue/enqueue to implement decoder put_packet interface.
2. Change task check on deinit. Only check the metadata size in task.
   If MppTask is destroyed with valid metadata just should warning.
3. Reserve one task at input queue for eos packet.

Change-Id: Ib445b148bb5a10c588104ee1fd96bad6f52f1388
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
914d28a9e1 [mpp]: Rename I/O port
Change-Id: Ieb154da4802873d5f534aba6fd38a90e2ffaa9fc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
d3ed1d9e6e [mpp_task]: Add positive return for port poll
When poll the port task and there is task for dequeue just return
positive valid task count value to caller.

Change-Id: I6c078cee69e34ba9b6cc5ffa77c704b8c59683b4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Ding Wei
27a8f219d3 [mpp_service]: add msg flag for offset alone
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Ifba9f4da888e2229e3c36b7f6de0d35be4179e95
2021-03-03 13:46:27 +08:00
Herman Chen
8b5ad54522 [mpi]: Prepare to change internal poll return
The external mpi poll interface only return zero and non-zero value.
Zero return for success and non-zero return for failure.

But later we will use both zero and positive value to indicate success
return. Now for backward compatibility set all positive return to zero.

Change-Id: Id2969a2fb3f5a61137ffc40d108d29090ba1a998
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 10:11:39 +08:00
Herman Chen
9ec098a981 [rc]: Fix pre_i_qp update error
1. The pre_i_qp should use scale_qp to update rather then the start_qp
which has substracted by ip_qp_delta.
2. Reduce default ip_qp_delta to 2 for H.264 and 4 for H.265.

Change-Id: Ie43ba15c8bd524bd10aac6053306f72e8759370c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-01 16:12:31 +08:00
Herman Chen
da2745f829 [iep2]: Fix compile error when asan check enabled
Change-Id: Id85aab6f1d4d6cdf4559d6da5d0d46c93871c8be
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-01 16:12:31 +08:00
Yandong Lin
e4dd718e24 [hal_vdpu34x]: Fix refine rcb size err
When refine rcb size, width and height need to be aligned with ctu size
first.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iaf3d51c6ff049792aeddb2452e1b1a75699eae59
2021-03-01 16:12:31 +08:00
sayon.chen
943690e384 [vepu540_hevc]: Fix refbuf body_offset cfg issue
Change-Id: I18be1281e1ec76beaa947d8e695d90f5973b1118
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-03-01 16:12:31 +08:00
Herman Chen
70ea32f3df [mpp_dec]: Do not release input packet with buffer
NOTE: on advanced mode the input packet should not be released when the
thread is finished.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I66656f6f2e484aabd28f74469c29d4bd44a7dcc2
2021-02-25 17:09:04 +08:00
Herman Chen
b21305dc02 [mpp_enc]: Fix task queue metadata release issue
When encoder dequeue the completed task the input frame should be get
from metadata.

Change-Id: I134f89974e3655b8c40e358071a32ae4a0c28bc0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-25 14:00:14 +08:00
Herman Chen
22e73ba651 [mpp_dec]: Add decoder hal_info (with 403 kmsg)
NOTE: When MppDev is not output to mpp_dec the codec info update is
disabled.

This patch may cause kernel show the following log on old kernel:
mpp_process_request:1078: unknown mpp ioctl cmd 403

This log has no harm at all and new kernel will disable this log.

Change-Id: I26c8d78e279b5809bb2d1e51baf2c48e7f6e5a33
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-25 08:42:46 +08:00
Herman Chen
7906945016 [mpp_packet]: Add get_status function
Change-Id: Idd7314d33345854f4577d8a68b37d4ab274cf462
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-25 08:42:46 +08:00
Ding Wei
0a4817c8e6 [hal_info]: Add decoder hal info
Change-Id: Ie57bf1403fb3ba7009bba4bb406b91238301918b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-23 11:09:46 +08:00
Ding Wei
945168e91b [mpp_hal]: Add MppDev to MppHalCfg
Get MppDev on hal module init.

Change-Id: Ie0c6f7aa04b23f09ee154239ccda3d77c1bb2895
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-02-22 20:28:58 +08:00
Yandong Lin
7ae6041138 [jpege_vepu]: Support rotation for jpeg enc
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id230d61801e7dfb4d3fa8ae6c81955ae8255fad3
2021-02-21 11:33:33 +08:00
Herman Chen
7009324f0f [vp8d_vdpu2]: Fix 10bit fd limit
Use 32bit fd and 32bit offset to replace 10bit fd and 22bit offset.

Change-Id: Ic89ed79c3b00e9c8530455f61513588acd121999
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-21 08:58:32 +08:00
Yandong Lin
4e240f0bcd [m2vd_parser]: Fix the frame be output repeatly issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I720d2934982084be105ca70cd4ed104d34b8fb0a
2021-02-17 15:32:45 +08:00
Herman Chen
3fd6381af7 [mpp_enc]: Fix crash on low frame rate case
The crash error was introduced by commit:
[mpp_enc]: Refactor encoder thread flow
6aa528227f

This patch fixed this error:
Assertion status->enc_start failed at mpp_enc_thread:1994

Change-Id: I083a46bf3aa932f8999a78415136e1e806892b09
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-17 15:32:45 +08:00
Ding Wei
1dbcadd0fb [mpp_service]: Fix error when cap hw info
Tips: User should close fd before changing the client_type. Otherwise
the kernel will leak one info structure.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I2f99e4840d1e9a3805306be50e4afa3653f43c0c
2021-02-17 15:32:45 +08:00
sayon.chen
b3cfffdabc [hevc541]: Use REG_OFFSET to setup outbuf
Change-Id: I894419616fdf57f123ce6cecb1d0eef0adb6ed91
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-02-05 15:21:15 +08:00
Herman Chen
9e2c0e532b [vdpu34x]: Fix 10bit fd limit error
Change-Id: I26d7dc20b67eb4163589d27d9b68815d11aa1cbf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-05 14:21:44 +08:00
sayon.chen
219e97f63c [hevc54x]: Modfiy Ref & rcon bodybuf offset set
fd maybe > 1024 fb|offset may overflow used MPP_DEV_REG_OFFSET
way to avoid this case

Change-Id: I142f8c9915f18da822d3edbf3ff8fe9b081d8918
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-02-05 09:32:49 +08:00
Herman Chen
d0ff90bec8 [hal_h264e_vepu541: Use REG_OFFSET to setup addr
Change-Id: I6365f5e3213c9bfe27340b163ac39669585156cc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-05 09:18:18 +08:00
sayon.chen
dd94fee936 [rc]: Update intra qp and qscale calculation
Change-Id: Ic5ddfbb7f034e4cd2abe65cb55192c3386baf3e3
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-04 10:25:27 +08:00
Herman Chen
81f14330f4 [mpp_enc]: Fix qp_init check error
When qp_init is -1 or 0 it is not inited and it is a valid case.

Change-Id: Ic964cdcda129278cbd78ccc855e16c148fb53ab4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-04 08:41:49 +08:00
Herman Chen
3c0e38b80f [vepu541_h264e]: Fix intra block statistic error
Change-Id: I62c034d87c9c92de8f6f65eb2ad600b4717fcb95
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-03 21:12:30 +08:00
Johnson Ding
a77ab8b283 [jpegd]: fix decoding one DQT case
If there is only one DQT, qtable_selection should be configure to 2 so
that hardware will find the right DQT for chrominance.

Change-Id: I3abc68d6328e0ff0a757c3b249c7a4f5738ff9d5
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-02-03 09:27:59 +08:00
Johnson Ding
8a01c12e4a [jpegd]: Add env entry for switching jpegd
Change-Id: Ib1965a17df6f8e77c35a46b272267a5cdd0940c4
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-02-03 09:26:39 +08:00
Herman Chen
4ecb7de25c [mpp_platform]: Add kernel version detection
Change-Id: Id2110213daeaca606bafe288a6d4cd970c112d4f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-02 20:21:29 +08:00
Herman Chen
7936ba3efe [mpp_enc]: Update i qp when it is not set
Change-Id: I01e9b6ae3ffc63229b9c906641271dd1129f12e6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-02 10:10:44 +08:00
Herman Chen
d7b26bb3af [rc]: Parameter tuning
1. Fix ip_qp_delta calc error.
2. Reduce ip_init_ratio from 480 to 160 to reduce first I frame size.

Change-Id: I40125b4e527be0fc9705a7670988b04ac13f7dc1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-02 09:57:51 +08:00
Herman Chen
a5cafbabdf [vepu541_rc]: Reduce P frame qp range
Reduce P frame qp range from 2 to 1 to get more stable video quality.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I58f13e2ad2dc6ff04dd010e990f012a26b88d157
2021-02-02 08:50:06 +08:00
Yandong Lin
774f1ffbc5 [vp9d_paser]: Fix pts err
When syntax indicates to show existing frame,
should output current pts of pkt.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I7f9e5e7b76ef289407be42a0cc84fb9f62577cdf
2021-02-01 16:07:46 +08:00
Ding Wei
dde2800edc [vdpu34x]: Fix rcb refine err
1. when fast_mode=1, regs will upadte, use the ctx->reg_buf[i].regs
   instead of ctx->regs.
   for fix this, it should add regs for paramter in rcb_info_update.
2. per rcb buf size need plus tile_row_num*64 Bytes for align

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I1bf6c6c6167497b58b3aa95c0252b37b3fe1b075
2021-02-01 15:22:58 +08:00
Herman Chen
434f15ff26 [enc_cfg]: Fix max_reenc_times size check error
Change-Id: Ieb19f47d57ea54d450cf904475732d46a5b52928
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-30 18:20:56 +08:00
Herman Chen
6aa528227f [mpp_enc]: Refactor encoder thread flow
Change-Id: Id0e007c1e76882195fa1d43257d745f93a0005ed
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-30 15:03:23 +08:00
Herman Chen
91eb74129c [h264e_vepu541]: Update tuning parameter
Change-Id: Ibf9848673caf8d148243b41b9fffb5c00cd72a65
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-30 15:01:54 +08:00