Commit Graph

2996 Commits

Author SHA1 Message Date
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
Yandong Lin
4cb7a32226 [jpege_api_v2]: Init fixqp as default rc mode for jpege
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5d16f3225133386360f83f0853e1e13e4569ebd0
2021-01-29 16:35:48 +08:00
Herman Chen
1b822d1fdd [rc]: Fix invalid init qp error
Change-Id: I15cdbab2fda156bd2fdc3ef6daf535c584bea4d1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-29 15:12:56 +08:00
Herman Chen
8dd7e8f37f [mpp_soc]: rk356x has jpeg decoder with pp
Change-Id: I5e9225299b842796e6e57f481b25ed5af26f6edf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-27 15:28:47 +08:00
Herman Chen
86a1849bd5 [mpp_enc_cfg]: Fix node length mismatch
Change-Id: If5d5e93981a32a19e36d4601190ca250b22272b9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-27 15:00:31 +08:00
Herman Chen
fb714ced4c [mpp_enc]: Add qp check on rc config
Change-Id: I7f8978db79821bb19e8af5391653ae5e1e01cacc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-22 18:06:17 +08:00
Yandong Lin
6cecbf071b [hal_vdpu34x]: Refine rcb size
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I63c4badc6659862509d638d00a5db1e8da200071
2021-01-22 16:43:08 +08:00
Johnson Ding
a2caeb423a [mpp_soc]: Fix vdpu jpeg with pp failed issue
Change-Id: I0d8418d187a3a44773342dccd1f8730cd6b54168
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-20 18:26:34 +08:00
Johnson Ding
a1070cced0 [jpegd]: Support NV21 format for rkv jpegd
Change-Id: If3b5006d0abd17ddd525c88b7922bf6eb796b61f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-20 18:17:58 +08:00
Johnson Ding
abac9c3abe [jpegd]: reset table counter before parsing
In mjpeg decoding without re-init case, qtable counter and htable
counter will keep growing. And generating regs will fail.

Change-Id: Ic48f919d80e5fc73f3e0d0380625da7aa254cdb8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-20 18:17:47 +08:00
Herman Chen
c440a5ee28 [mpp_enc]: Deprecate MPP_ENC_PRE_ALLOC_BUFF
Change-Id: I42ea6ce9897af4e5b6f1a1d1bf3beb5173a8f568
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-20 17:19:13 +08:00
Herman Chen
0ce3ed3048 [mpp_list]: Use class inheritance
Change-Id: I3ef33ca9bdcfea80a6c05a8c69db2d4938a5d0eb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-19 17:06:16 +08:00
sayon.chen
3f5b640345 [mpp_enc_v2]: Modify idr set flow
Move idr request to mpp_enc_proc_cfg

Change-Id: Ic93af13297971b9fd2766bc18b7c6fd71ce18d09
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-19 08:35:23 +08:00
Herman Chen
55440c0d56 [rc]: On intra reenc do not add ration to scale_qp
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I995ce9e5867374fafa701061fbb5866afb7b76d4
2021-01-15 17:00:43 +08:00
Johnson Ding
e6d2ab3c60 [h264e]: Add gaps in frame_num config entry
Some of NVR product may do some thing special when decoding the first
GOP of bitstream encoded by MPP, and report "gaps in frame_num is not
allowed" although frame_num is bitstream is continuous. Setting
gaps_in_frame_num_allowed_flag to true will avoid this problem.

1. Set gaps_in_frame_num_allowed_flag true as default
2. call mpp_enc_cfg_set_u32(cfg, "h264:gaps_not_allowed", 1) if you
want gaps_in_frame_num_allowed_flag to be false.

Change-Id: I8242fb318e051a61772c02a2c8bb59e4b589ff6d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-15 16:40:48 +08:00
sayon.chen
6f16b401d7 [rc_v2]: Add I frame debreath process
Change-Id: I17a5fb8515b51170e3a1066b69870045775bca82
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 16:37:48 +08:00
sayon.chen
bae7d889e7 [rc_api]: Reorganize RcMode same as MppEncRcMode
Change-Id: I04f5b7a1335aa0b6d7f9a03f98950dbedc5cd4cf
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 15:23:46 +08:00
sayon.chen
816f1a4f7d [rc_v2]: Add debreath cfg interface
Change-Id: Id8a729dc35e1b4fd2c9d3eab95d902bd5d7d96f2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 14:55:14 +08:00
sayon.chen
148a2b0b7a [rc_v2]: Add iblk4_prop info
Change-Id: I2d573a2170226472ad913e6b5068d80a18d220e5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 14:11:52 +08:00
Herman Chen
ac65d47d55 [rc]: Change vepu541 tuning parameter
1. Set H.265 initial ip_qp_delta to 6.
2. When ip_qp_delta is enabled the minimum value is limited to 4.
3. Increase vepu541 H.264 encoder I frame bias to get better detail.

Change-Id: I6b000f2afe27fbeaffe966d88256cc3589ddef99
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-14 15:45:36 +08:00
Herman Chen
5569c2c68d [rc]: Set statistic time to minimum 2s
NOTE: Gop is better to be integer multiples of output fps.

Change-Id: Id42e2e0c076d6c0a3f67756dc73dca7451b95ff6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-14 15:21:36 +08:00
Ding Wei
b64d32cac8 [hal_h264d]: refine rcb_size for rcb_info
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I0cfc9d38f92a4ffe842786baaba22285c80a4966
2021-01-14 15:00:12 +08:00
Ding Wei
b3ce4085f7 [vdpu34x]: add rcb_info for rkvdec
tips:
    according to rcb_size descending, and sent rcb_info to the kernel.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I85e951d9cc1c15962e702ab9781df35e6739bb6a
2021-01-14 14:53:37 +08:00
Herman Chen
b84425e15d [mpp_meta]: Add meta key average qp for encoder
Change-Id: Iab3fde1a2a3e8e6f6150dfbeb6f5803d6e3cc240
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-14 10:01:46 +08:00
Yandong Lin
4d82e3e9ab [dec_test]: Optimizing mt/multi test
1. Add FileReader
2. Implement frame_num(-n) param setting

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I15c169e6d8a8ce74f838402d4360436ecd0a1829
2021-01-14 08:51:41 +08:00
Ding Wei
82691156fd [vdpu34x_com]: add regs info for rcb_buf
Change-Id: I1268b905e87020a9097443cdf09b7cdc3669f083
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-01-13 18:28:52 +08:00
Ding Wei
0d6a0e28d5 [mpp_device]: add MPP_DEV_RCB_INFO for rkvdec34x
Change-Id: I0fe59f27f74fdd6a5eafd91b91870fdbf1253e33
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-01-13 18:25:28 +08:00
Herman Chen
4df6a06807 [rc]: Fix ip_qp_delta on reenc
1. Fix error of removing ip_qp_delta on reenc.
2. Set H.264 qp_row_i to 0.

Change-Id: Ib8810bd5baebc7d6ed0188b078e708c1c3d0b5c2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-13 16:30:38 +08:00
Johnson Ding
643d2116f8 [build]: support NDK-17 and above
Change-Id: I59bb0a1ad06a3e6d2a2b51610c528ade61e9c5d3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-13 11:23:55 +08:00
Yandong Lin
5f748ee931 [mpi_dec_test]: Add FileReader for mpi_dec_utils
Support different format files as input:
1. Normal file, e.g. h264/h265 raw stream
2. Ivf file , e.g vp8/vp9 stream with ivf header

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I034693ae3e23bdde57c90ded7dd7248c50728122
2021-01-11 16:26:49 +08:00
Herman Chen
4b4335581e [vepu541]: Add rc_qp_range and aq config
Change-Id: I011c1b88aa1ed8d210015f60a94c42cd7fde44d1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-11 16:26:49 +08:00