Commit Graph

88 Commits

Author SHA1 Message Date
Jeffy Chen
0f0d28c2ec Fix compile errors with musl
Tested on RK3588 EVB with musl-1.2.2 and gcc-10.2.

Change-Id: I10574446f46964bad5e67ab45c76060a193b8335
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2022-05-26 11:19:59 +08:00
Herman Chen
5dccad43d4 [mpi_enc_test]: Add AFBC_V2 source support
Change-Id: I089c41137edf39211f33faf234b68295256bcfc1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-24 14:34:41 +08:00
Herman Chen
0d85aab268 [utils]: Add more YUV422 YUYV format support
Change-Id: Ic8e2061c01bf6a9603c2291a17eabe0f978ef4f2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-24 14:21:28 +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
Hongjin Li
7bcf0d45dd [mpp_opt]: Modify the initialization number of opt
Change-Id: I3fef98f0feab2004b5c78dabcc4d792121bd7f1a
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-04-15 10:59:00 +08:00
Jeffy Chen
c07169d533 [misc]: Fix a few compile warnings and errors
Reported by llvm-clang.

Change-Id: I62f22fe5754d3e8d77405d213c81fda5d9f5e27d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2022-03-11 17:45:10 +08:00
Herman Chen
6b24ea59d6 [mpp_enc_roi_utils]: Fix roi generation error
Change-Id: I8e89e6826bf405573bba3190a026f7b4f6ca9b79
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-03 14:59:05 +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
Yandong Lin
0c3ddf2703 [mpi_dec_utils]: Fix ivf reader problems
Change-Id: I377a88838202080e143c44577bd4e5d01e57f392
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-12-24 14:51:14 +08:00
Herman Chen
94ab4c1e5f [utils]: Add new option module using trie
Change-Id: I9c4836d35366ff8ab2f16ac9c474b65471862bd2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-12-16 10:59:48 +08:00
Yandong Lin
f9a628752d [utils]: add MPP_FMT_YUV420SP_VU data dump
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I775ef33e760c9106a7e95fa98fd43185cfcd6195
2021-12-01 17:28:39 +08:00
sayon.chen
8c04e0d562 [mpp_enc_roi]: Add roi generation function
vepu58x roi cfg generation is depended on vepu54x roi cfg.

1. Use roi_enable to enable roi test.
2. Use roi_type to test different roi config mode.

Old region mode is set to legacy now for future roi cfg will be more and
more complicated.

Change-Id: Ib9e8976b732f05625e7589b64752d38fbd83584b
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-11-30 17:11:11 +08:00
Zhihua Wang
8d41958d4e [utils]: fix read_with_pixel_width encounter foef
Signed-off-by: Zhihua Wang <hogan.wang@rock-chips.com>
Change-Id: Ifb69440c77f538b1aa39b3c3a31b8455646b4c9b
2021-11-16 15:30:17 +08:00
Yandong Lin
d19c408ec7 [mpi_dec_utils]: Fix read ivf file err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id13ef0ac2a43c78b09d2e3df2a8c84e88061f7f3
2021-11-12 17:13:49 +08:00
Herman Chen
f0c57cde02 [mpp_lock]: Add gcc atomic macro define
Change-Id: I3e94cc7be9a51f5d674a132c0a2e6f7afba61d34
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-03 11:27:35 +08:00
Herman Chen
fd20cf4740 [test]: cleanup test code
Change-Id: I6bf234c25b2d6709aaf095ce641812d58ad0ab68
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-21 18:19:54 +08:00
Herman Chen
180dd8136a [test]: Improve decoder tests
1. All cases use reader to improve performance.
2. Rename cmd parser and create share data on cmd parsing.
3. Add reader_size function to get file size.
4. Change test log flag to -v options.
5. Fix FileBufSlot release MppBuffer issue.
6. Use index_read in multi test to improve performance.

Usage:

mpi_dec_test -i xxx.h264
Decode to the end of input stream.

mpi_dec_test -i xxx.h264 -n 10
Decode to the first 10 frame of input stream. If the xxx.h264 has only 5
frames then loop decoding from the beginning.

mpi_dec_test -i xxx.h264 -n -1 -v qf
Infinitely loop decoding xxx.h264.
It is usefull for performance test.

mpi_dec_multi_test -i xxx.h264 -n -1 -v qf -s 8
Parallelly infinitely loop run 8 decoders with same xxx.h264 input.
It is usefull for performance test.

-v q  will disable each frame output log.
-v f  will enable fps print per second.
-n -1 will enter infinite decode mode. Press <enter> will quit the loop.

Change-Id: I3d54123f0e9b9a85cb35e4fea71ebf665889750a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-21 15:17:48 +08:00
Herman Chen
d56760acd2 [test]: Improve decoder reader usage
1. Change to new reader slot interface.
2. Use reader slot in all decoder test case.
3. Do not async reset on eos to avoid eos stream issue.

Change-Id: If296f6555fd0e57f6931085f02b0378e41a5f2ce
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-20 09:38:37 +08:00
Herman Chen
7b86c1abe4 [mpi_dec_utils]: Add decoder frame rate print
Change-Id: I46006cb51205ea98204c803f4753039409e8171d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-19 14:29:34 +08:00
Herman Chen
31de64ae15 [utils]: Add fps calculation function
Change-Id: I577f168d448846addcc3be720b09aa832bb7fdd2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-19 14:05:40 +08:00
Herman Chen
ee2b8bb7c2 [dec_utils]: Improve reader performance
Use a new thread to read the whole file. Then all decoder instance can
share one single reader and read input file only once.

Change-Id: Iddc3322286bf61e449074143bbfb90fd1ff6b70a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-14 14:49:31 +08:00
Herman Chen
264aca483e [utils]: Remove extra NULL option print
Change-Id: I48871d7af4fae0fdf3e6e405793e53a5e4768801
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-30 10:06:08 +08:00
Herman Chen
6da83e59c3 [mpi_dec_utils]: Fix -f option check issue
Change-Id: I5495e37f7cebd397b1cf86408702a621c661aeba
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-23 14:05:21 +08:00
Johnson Ding
e81e72eca6 [jpegd]: Support RGB 16-bit format output
Change-Id: I0f3152bd068498fccc95569bb2950ab78ade2bf6
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-08-19 15:20:51 +08:00
Johnson Ding
f1c2d025b4 [jpegd]: Suport RGB32 format output
Change-Id: I2eed0a16895196a1270ba3d8e1ec6074be533f4f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 18:00:17 +08:00
Herman Chen
dbda66de53 [test]: Add quiet flag to decoder test log
Change-Id: I9472760ede918a913957b336665d7e0367b661c5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
841022f529 [mpi_dec_multi_test]: Add quiet flag to disable log
Change-Id: Iea28d4377212e4c18a91f30762ae8ec135702c16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Yandong Lin
025275ab26 [mpi_dec_utils]: Fix build warning under 64-bit
Note:
    warning: ignoring return value of 'fread', declared with attribute
    warn_unused_result [-Wunused-result]
         fread(ivf_data, 1, IVF_FRAME_HEADER_LENGTH, reader->fp_input);

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ic2ec8c0a46d56f584be048f933fa17532a77ce20
2021-04-30 18:43:16 +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
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
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
51d01e0069 [utils]: Fix error on RGB color fill
Change-Id: I5b7768e410135910d5c20994c84629678cd37524
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-29 16:39:10 +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
sayon.chen
12431e34d6 [utils]: Support camera as input source
Change-Id: If2a91a7436e05be4705425db40b0b1d41347f4c8
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-23 10:28:43 +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