Commit Graph

45 Commits

Author SHA1 Message Date
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
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
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
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
Yanjun Liao
01a86a21ca fix[enc_utils]: Support read odd resolution image
Change-Id: Ib6b9d9ebc9d552ee0fda0f3a14c77b2ae37881d8
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2024-04-26 16:44:23 +08:00
Yanjun Liao
ed77dd7988 feat[mpi_enc_test]: add YUV400 fmt support
Change-Id: I05d149d176e1e692e9706dac07e6d843446309f9
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2024-01-11 18:02:23 +08:00
Herman Chen
eb14ae5032 [enc_utils]: Remove extra option log
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic9c54399bee41eab69c8a109e7d03eb6ee04d1a0
2023-12-19 18:16:39 +08:00
xueman.ruan
22100022d7 fix[utils]: adjust format range constraint
Change-Id: I12d57955d6ad84e063784e46893b1deec90785b6
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-10-26 10:29:34 +08:00
hdl
68177e2268 feat[vepu580]: Add frm min/max qp and scene_mode cmd param
Signed-off-by: hdl <hdl@rock-chips.com>
Change-Id: I27c3f3cfb599b8d05e58aceb1967bec4230d386e
2023-09-25 17:46:32 +08:00
Johnson Ding
65eea468b0 fix: fix redundant prefix NALU amended problem
1. For normal Smart-P mode, if TSVC is not enabled, temporal_id can be
   zero, and no need to add prefix NAL.
2. For RK3588 H.264 dual core encoders working concurrently, redundant
   prefix_nal should also be removed, if prefix NALU is empty.

Change-Id: I89aca4f0cf418afb48e39a141107c5f4491a1ce1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-08-17 15:41:26 +08:00
xueman.ruan
c83da7de68 fix[utils]: fix convert format error
Change-Id: I9994ab4671dbf9c0f7b0b0476c9fd2710294805d
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-08-16 16:02:11 +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
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
Herman Chen
2b35cee0ce [mpp_log]: Add more log helper function
1. Move mpp_log.h to inc for external user.
2. Add mpp_debug.h for mpp internal logging.
3. Fix some warning.
4. Add log level setup function.
5. Check env log_level value in mpp_get_log_level call.

NOTE:
1. mpp internal module should use mpp_debug.h and mpp external user
should use mpp_log.h
2. Use mpp_get_log_level to update mpp_log_level when the env changed.

Change-Id: I90a55a02a72db177533013280dfe111ca3479229
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-20 11:42:10 +08:00
Herman Chen
22400055e1 [mpi_enc_utils]: Fix opt node count error
Change-Id: Ic41d86f9bc63ae1c62b2cc7a8637c652a3ad99fa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-02-24 16:16:22 +08:00
Herman Chen
6e316ddc10 [hal_h265e_vepu580]: Fix tile osd offset error
Use new multi register offset config function to setup all offset for
vepu580 and vepu541.

Change-Id: I78e77ddd818b7875c028b660aa06a16b527a8409
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-02-16 10:28:28 +08:00
toby.zhang
407fce1272 [mpi_enc_test]: Add fix qp encoder mode
Change-Id: Ia749c9eb5d2a25b87e64215aa184301baf9fa6b5
Signed-off-by: toby.zhang <toby.zhang@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-02-15 16:35:37 +08:00
Hongjin Li
f7954e9545 [mpi_enc_test]: optimize slt code
1. Optimize help log about slt
2. Optimize slt file opening

Change-Id: Ib315e46d7fbb5f3ffa576c24f5e47c42a19cb09d
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-01-28 08:47:54 +08:00
Hongjin Li
8c13cd93b0 [mpi_enc_test]: add slt testcase
slt verify file:
mpi_enc_test -w 4096 -h 2304 -t 7  -slt enc_xxx.verify -n 5
mpi_dec_test -i <inputfile>  -t 7  -slt dec_xxx.verify -n 5

Change-Id: I528fcd8d1adf8821c1555790cd8482108f219fdc
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-01-26 17:29:02 +08:00
Hongjin Li
33269e39e7 [mpp_dec]: Fix the problem of read data error
For data with sizes of 5120x7160 and 8000x8000, the required buffer size
was calculated incorrectly during the encoding process, which caused the
requested buffer to be too large, resulting in drm exceptions.
Therefore, the method of calculating data has been modified.

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I519a76687118d568cf57e7d3d54a150e9019285c
2022-01-17 20:41:06 +08:00
sayon.chen
33d6284f13 [test]: update rc2 testcase
rc2 test is a decode -> encode -> decode test case which can be used to
test the whole system codec capability.

1. Use new option module.
2. Add type for input file source stream.
3. Use decoder file reader to read input file.

Change-Id: Ia2334cd423e77a76c564478cc70c07a58954dd04
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2022-01-12 11:50:20 +08:00
Herman Chen
96d1664cd1 [test]: Use new option module
1. Use new option module in dec/enc test
2. Delete mpi_enc_multi_test and mpi_rc_test

Change-Id: Ib00020247386ee06cca2f560ae41aee8e88f47cc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-01-11 08:37:41 +08:00
Herman Chen
f94ae6d0a0 [vepu580]: Add YUV444 support for vepu580
Change-Id: I58859e59094fcecc13011b16f33b3810abbc7882
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-12-30 10:52:02 +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
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
662d0c19a6 [mpi_enc_test]: Update osd test case
1. Update osd test in mpi_enc_test.
2. Remove osd test in mpi_multi_test.
3. Fix log info in vepu541.

Change-Id: I8056edf263df5571448782b3b8074f54956672ee
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-16 09:46:53 +08:00
Herman Chen
16ba8b5820 [hal_h264e_vepu]: Fix stride parameter compatible
Fix stride definition to compatible to both pixel stride and byte
stride.

In MPI the stride is defined to byte stride. But vepu requires 8 pixel
aligned pixel stride.

So we add more code to adapt to both case and check 8 pixel alignment.

From opengles definition:

Stride means bytes in a row of pixels including padding. So an image
could be 510 pixels in width and rounded up to 512 pixels. The stride
would be 512 * bit depth of the image's format. You could also have
stride in pixels in which case the stride would be 512 pixels

Pitch is a little more vague, but typically could be interchangeable
with stride. Considering your reference is specifying in bytes, it's
likely safe to assume they're not measuring in pixels. So the reference
likely means the number of bytes in a row + padding, the only
alternative would be number of bytes without padding e.g. image width *
bit depth.

Change-Id: I20acf71e2a6bea2eb08b41fe7df531154ebef897
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-28 09:25:06 +08:00
Herman Chen
a2c289bbce [mpp_enc_ref]: Add st_cfg repeat value check
1. When repeat in st_cfg is negative set it to zero.
2. Do not insert non-reference frame when smart oop vi_len less than 2.

Change-Id: Icdf2be21fbbe0a919f7c3006d9c1dde5dfc5ffcb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-11 15:29:39 +08:00
sayon.chen
c0fef41211 [hal_vepu_v2]: Fix vepu hor_stride setup
vepu h264 input stride must be aligned to 8 for vepu limitation.
If it is not 8 aligned some buffer conversion preprocess should be done
before the buffer is sent encoder.

1. The hor_stride in vepu hardware is in pixel unit not byte unit.
2. The hor_stride in vepu must be 8 pixels aligned.
3. The YUV420P should be 16 pixels aligned for chroma.
4. Fix log print when hor_stride != width 8align

Change-Id: If30136a4673399c3be40a41a055e832db4c321d5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-08 09:04:55 +08:00
sayon.chen
71f9142c50 [mpp_enc_utils]: Add more cmd params set
1. -b bps_target:bps_min:bps_max:rc_mode
2. -g gop_mode:gop_len:vi_len
3. -x read ini cfg

Change-Id: I937d2200da9427d7079eeb437e379db11c7e29d7
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-05 18:13:59 +08:00
Johnson Ding
cba637c3f1 [jpege/h264e]: fix RGB encode config
Change-Id: Iec9d928ad6fb1a31cbf6f224b264ebb6797294a3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-08-05 10:52:05 +08:00
Herman Chen
c31fd4dc27 [enc_utils]: Add tsvc demo (control by gop_mode)
Change-Id: I034d631b3d6c473b82d12e3434860c7f8e9f9318
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 14:11:22 +08:00
Herman Chen
0b5a25d903 [utils]: Fix encoder width / stride mismatch
Fix the default width stride value in RGB format.

Change-Id: I330bc81bfc5057484a46815d62eccd3fd212a49d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 11:36:38 +08:00
Herman Chen
bba530c27d [mpi_enc_utils]: Add hex format input support
Change-Id: I49ff9a916c51a0f9f3719cfb01e85e5a9e5f0a61
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 11:28:30 +08:00
Herman Chen
50bf7b7bf0 [utils]: Add encoder reference config sample
Add MppEncRefCfg configure sample to mpi_enc_utils.

Change-Id: I56d87dc6b267a8029c4d539526c368f2f44cec11
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:42:17 +08:00
Herman Chen
6a6521ed13 [gop_ref]: Remove gop_ref
New reference frame config interface will be added.

Change-Id: I5766cefde12237561bbc20c905e47ed2d3e90011
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:29:40 +08:00
Shunqian Zheng
9464af395b [misc]: Terminate soc_name to fix out of bounds
1. Terminate soc_name string to fix memory out of bounds
2. Fix all snprintf/strnlen warning

Change-Id: I4525c6e289a00d1509bc30ee69545d92f2f4b9cb
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2020-04-29 16:06:47 +08:00
Herman Chen
4f5e7d3773 [mpi_enc_utils]: Fix tsvc4 definition
Change-Id: I1c995af21ae14b1dc0d14ad0cbd9c6a02d6d03c4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-04-27 10:41:43 +08:00
Herman Chen
e8cb0d49f2 [enc_utils]: Format source code
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I92f133f89920b125d3f2d44ee718ed394acd7aab
2020-04-20 09:53:55 +08:00
Xinhuang Li
c2d9a16c24 [test]: modify the frame rate to support decimals
use "-r numerator:denominator:flex"
for set the input to the same fps as the output, such as 50:1:1
or "-r numerator:denominator/flex-numerator:denominator:flex"
for set input and output separately, such as 40:1:1/30:1:0.
the default parameter is 30:1:0.

Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
Change-Id: Ief2935354b82aba9c192b4af92636519d3e75423
2020-04-17 10:51:56 +08:00
Herman Chen
f79c854314 [utils]: Add gop ref config util function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9b82e4a2a6e8451c9e63599329c3d3ddc74ff59c
2020-04-09 14:29:37 +08:00
Herman Chen
681599f97f [test]: Update utils for encoder test
1. Move command parsing to util files.
2. Support frame format and coding type detection.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id1df67ba61943bb7aa1f02ccccaa932fb5ae9842
2020-04-07 15:25:56 +08:00
Herman Chen
fe4b86b025 [mpp_enc]: Update OSD API
1. Update OSD palette config API. User must specify palette is default
or user defined.
2. OSD palette config will go through control and OSD data (region)
config will go through meta data in each frame.
3. Remove unused code.
4. Add mpi_enc_utils for mpi_enc_test cases

Change-Id: Ib4aeb60789a3e999446212841508e604533efb3c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-04-02 18:21:20 +08:00