Commit Graph

2797 Commits

Author SHA1 Message Date
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
Herman Chen
17e3a2fefd [mpp_enc]: Use qp config in rc to setup encoder
1. Unify H.264/H.265/vp8 qp config
2. H.264/H.265 encoder setup default rc qp config.
3. Move rc_cfg process all to mpp_enc module.
4. Fix some encoder config in encoder test.

Change-Id: I2a31c6abf904f1c16c2acd937c8d467d48db531d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-11 16:26:49 +08:00
Herman Chen
f04fabc136 [mpp_enc_cfg]: Add global rc qp config
1. Add rc:qp config for user rate control config at frame level.
2. Add hw:qp config for hardware detail config.

NOTE: hardware config is only recommended for expert developer.

Change-Id: I8e28de97304577bcf77d67521f945355779ae102
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-08 16:26:53 +08:00
Herman Chen
e0df28b509 [mpp_cfg]: Add general config function
1. Add struct config function.
2. Do not check data type when data size is matched.
3. Use type/size/offset to define data and update info.

Change-Id: Ief21107cf9a8a6b89c2b01c1a430d88e0cf827f4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-08 16:26:53 +08:00
Johnson Ding
2e5ea77cb2 [jpegd]: Optimize marker searching
Change-Id: I25accfc85fc2978a0cb44572cea9b33c833c13df
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-05 18:50:10 +08:00
Johnson Ding
597ca81624 [jpegd]: Add table entries counter
Change-Id: Iae98752d7977af5f03612cb7bfbd53e77f39a8bd
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-05 18:45:14 +08:00
Johnson Ding
fd7db64eed [jpegd]: Call RKV jpegd prior to old jpegd
Change-Id: I4af49a28a6ce23289c690b5ff185a863e99f8926
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-05 18:44:54 +08:00
Johnson Ding
149bb3d090 [jpegd]: Add RKV jpegd implementation
Change-Id: I10497fea20a0a4bbd5bd32a4d3a3e398f6e1aa95
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-05 18:44:45 +08:00
Johnson Ding
533ccf5546 [jpegd]: Add rkv jpegd register definition
Change-Id: Id157c79459b19c9c6dec9b57af065d29bfac3998
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-05 18:44:38 +08:00
Herman Chen
35947058ed [h265e]: Enable luma and chroma SAO by default
Change-Id: I652617c6235d8503ba96dca98e5bf6c003c12c51
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-04 14:53:37 +08:00
Herman Chen
e0a0de0914 [h265e]: Fix sps color info error
Change-Id: Ibf85735c83e72e0001d369e96bfce117759c3cbb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 18:10:14 +08:00
Herman Chen
4aa5b4a046 [mpp_enc]: Restore max_qp_step
1. Restore max_qp_step which limit the qp change between two frames.
2. Set default H.265 ip_qp_delta to 5.

Change-Id: Iacd795da7f2df46e60ab3f5c45bc8b0f30aff5a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 18:03:17 +08:00
Herman Chen
fb13523e51 [hal_h265e_vepu541]: Optimize quantization param
1. Set rounding bias to 0 to reduce noise crawling.
2. Reduce complex context qp delta.

Change-Id: I35b15631b964fb0a59cfd4986ed1aedf9ba0e851
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 11:31:55 +08:00
Herman Chen
1292f6a99c [hal_h265e_vepu541]: Optimize tuning parameters
1. Enable chroma klut function.
2. Reduce qp_range in Intra frame to get better result.

Change-Id: Ieeae73c6efa06f86bd6fe1b8687c5fcb3bd15da0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 11:09:36 +08:00
Herman Chen
d69900c75d [h265e]: Use 16x16 qp for H.265 encoding
Change-Id: Idabc956b6bf8934df7ba3b3b0281c317bd50e7e2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 11:02:45 +08:00
Yandong Lin
eaf1e8f76b [mpi_dec_test]: Organize the common func of each dec test
1. Set these func into mpi_dec_utils
2. Note: num of threads: -n -> -s

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: If733fb0fdd7110313d2e140d3c50aad37260b6d2
2020-12-31 10:59:43 +08:00
Yandong Lin
2111a438c5 [mpp_enc]: Update osd data cfg
1. Add new structure: MppEncOSDData2
2. Different osd layer use separate buffer

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3be533eb602f23192086f56e06a1439dbb19c35c
2020-12-31 10:00:13 +08:00
sayon.chen
fdc4af2c04 [hevc_vepu541]: Add prepare implement
The prepare implement is to pre-alloc buffer and reduce the delay
of the first frame.

Change-Id: I063888e93539b44cd6d102fb864b729580858e23
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-31 08:42:09 +08:00
sayon.chen
1790d9585e [vepu541_hevc]: Modify title buf alloc flow
Change-Id: I23f237711d49083bfebe7ce5b32dedb43ff39c7c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-31 08:33:50 +08:00
sayon.chen
fe25c5da3e [hevc_vepu541]: Modify Roi buf alloc flow
Change-Id: I6e38a8881f7baa16552ced1eb82df6827b512a58
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-31 08:32:51 +08:00
sayon.chen
640bc83793 [hevc_vepu541]: Close vepu540 title debug log
Change-Id: I3c84dde0265fb37f3f6757931435af9629dbe39d
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-31 08:29:25 +08:00
sayon.chen
41c9c809b0 [mpp2str]: Add rc_gop_mode 2 str
Change-Id: I3fd4334cf108d62726e3caae5eda9801922d8ef9
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-24 17:21:33 +08:00
sayon.chen
476e6adfa5 [mpp_frame]: Add hor_stride_pixel interface
Change-Id: Ia6065b7c3832511c5d01263e6f07713028e8abd6
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-24 16:04:21 +08:00
sayon.chen
f2fd3a4d35 [buf_slot]: Fbc case hor_stride defalut 64 align
Change-Id: I56666c128c4178b6aea876012aa477ca49f98261
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-24 16:02:39 +08:00
sayon.chen
c6c7498e0a [vproc]: Fix prevfrm free issue
Change-Id: I2305f80a519e06c526cbcfb343ff7558f0fe4a9b
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-24 16:01:30 +08:00
Herman Chen
9614080a74 [hal_h264e_vepu541] Add prepare implement
The prepare implement is to pre-alloc buffer and reduce the delay of
the first frame.

Change-Id: I44bc0a016dc8820440c09c3c43a6d78cdb82a137
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-24 15:54:35 +08:00
Herman Chen
0be1763725 [mpp_enc]: Add hal prepare function
Add prepare function to hal interface.

NOTE: The hal prepare function is the hal hook on user control.
When user config is changed hal can process some cfg before enc_impl
updated the config through syntax in task.

Also when encoder is in low delay mode the user control should not be
processed if the current frame is not finished.

Change-Id: Ie287e05daff0d139cf04d93d97246fa176d14d53
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-24 14:59:37 +08:00
Herman Chen
841775003d [mpp]: Add encoder timing record for each frame
Change-Id: I3e4689bd473b9de272000664ece7fe39c8d3d0d7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-24 14:26:15 +08:00
Herman Chen
ff56c151e2 [mpp_frame]: Add stopwatch to MppFrame for timing
Usage:

1. Enable timing trace
   mpp_frame_set_stopwatch_enable(frame, 1);

2. Get stopwatch and record on each step
   stopwatch = mpp_frame_get_stopwatch(frame);
   mpp_stopwatch_record(stopwatch, "step 0");
   mpp_stopwatch_record(stopwatch, "step 1");
   mpp_stopwatch_record(stopwatch, "step 2");

3. Get timing log on stopwatch disable or MppFrame destroy
   mpp_frame_set_stopwatch_enable(frame, 0);
   or
   mpp_frame_deinit(&frame);

Change-Id: I47c235e95c9f2f39d970ef1f2948b72dcc254146
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-24 11:27:25 +08:00
Herman Chen
7b415f98be [mpp_time]: Add more info log on check error
Change-Id: I68e1bb05c87a43ae37754947d8fd83cd3ed4de5d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-24 10:40:08 +08:00
Herman Chen
502e688aa4 [mpi]: Add more 32bit rgb color info
Change-Id: Ife89f6968f9e9f9ce48a437ca4f9c7e0c4ca7c16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-23 15:12:46 +08:00
Herman Chen
7db289c307 [mpi_enc_util]: Add uv swap stride support
Change-Id: I6650d737e61beb91ad31f8979c5fdafe52156102
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-23 15:10:44 +08:00
Yandong Lin
eabbc375c0 [mpi_dec_test]: Support jpeg loop decoding
usage: -n -1

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ic184142f771b1e9c68344b3162e491f18d4d33fc
2020-12-23 14:39:02 +08:00
Yandong Lin
80ed6fc527 [hal_vp9d_vdpu34x]: Fix vp9 fast mode err
In case of fast mode, also need prob_loop_base
and prob_default_base.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie78eeb78d9230263d9a0736c468c4cc35a539885
2020-12-23 11:35:21 +08:00
Johnson Ding
873f509da9 [osal]: Fix encoder not working problem at vepu2
For vepu2, kernel 4.4 and previous version, '/dev/vepu' should be used
rather than '/dev/vpu_service'.

Change-Id: I2efd4a219bbd7dd3cebf226c8ebcede9bcff9823
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-12-23 10:10:11 +08:00
Herman Chen
b1963d2087 [vepu541]: Fix rgb color error
1. RGB565 need endian swap to help
2. Rework rgb format support to be the same with vepu1/2.

Change-Id: I1cc16b208dbc8968fe313009e06dac380df6df56
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-12-22 16:51:20 +08:00
Herman Chen
a36d46c44e [utils]: Add more fill image format support
1. Add more yuv fill image functions.
2. Add 24bit rgb fill image functions.

Change-Id: Ief8e3147fad924234156b7005943c5899df2abed
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-22 14:51:57 +08:00
Herman Chen
6884534e85 [hal_h264e_vepu541]: Fix crash on invalid color
Change-Id: Idf901ee648c01bbfdce1074877137f1eb0ac58e8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-22 10:35:11 +08:00
Herman Chen
1fb4758a42 [h264d]: Support level 6.0, 6.1 and 6.2
Change-Id: I6061bfe9ecfcb8bd527035a97c5f40c20dc1abdb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-22 10:24:45 +08:00
Herman Chen
cca0ad8fa6 [vdpu34x]: Add statistic register definition
Change-Id: I60e02667cbc1d36d0e760c84f3f73a4343f2e9fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-22 10:14:07 +08:00
Yandong Lin
a40ce32e4e [hal_vp9d_vdpu34x]: Fix vp9d fbc err
The y/uv hor virstride of the ref frame should be
configured width, just like cur frame, when fbc enable

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I49f48164d1921bfd7ccede3eac353f26431939a4
2020-12-21 11:05:48 +08:00
Chen Jinsen
f9ef9976e9 [mpp_dec]: Fix stuck issue on decoder control
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: I563a899fdfa428f6204934248e0f9b60cc61a186
2020-12-18 16:29:16 +08:00
Herman Chen
11aa95e52f [mpp_log]: Update mpp_log macro
Change-Id: I0e46e93a9a8fa0a7cb7a0e86cec1748503bddcfb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-17 16:07:28 +08:00
Herman Chen
3cf778d714 [vepu541]: Update vepu541 aq mode parameter
Change-Id: Ifeaa2cfc60fcc954625fa07e232a3f623bc2c759
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-17 14:33:29 +08:00
sayon.chen
efd6e8e8d7 [vdpu34x]: Support error mode process
Change-Id: Iaac11b645261a8cb69f135963c3b8b8ff7b9284c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-17 14:33:29 +08:00
Yandong Lin
ad8d8a669a [vp9d_vdpu34x]: Vp9d support hw prob
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I6b4eadad2ea4e08eef8816f76bbabe3ec3f7494c
2020-12-17 14:33:29 +08:00
Herman Chen
de8ace6622 [mpp_enc]: Separate qp change flag
Separate H.264 QP limit change flag into 3 flags

Change-Id: I658ab337569f8f715bde7633dce02b631a7d4239
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-17 14:33:17 +08:00
sayon.chen
711459b3c5 [mpp_dec]: Default enable vproc for deinterlace
Change-Id: I724b54de0f4affc7fed8a4841f06aeb6326754d3
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-15 16:43:56 +08:00
sayon.chen
e0210723e7 [iep2]: Fix prev_frm0 no free cause mem leak
Change-Id: I14925aa491902f023e026c2ac808d8434aa26a8c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-15 15:31:40 +08:00
sayon.chen
660a378f1a [iep2]: Fix iep2 2 in 1 out case cfg issue
Change-Id: I23a7c86c6e54c01b61f9499dedf963a089fc65f6
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-15 15:30:14 +08:00