Commit Graph

52 Commits

Author SHA1 Message Date
Yanjun Liao
ce39aff31f feat[dec_test]: Add buffer mode option
Add an option in dec_test to demo zero-copy external buffers mode.

use -bufmode to config the buffer mode option
hl - half internal mode
i  - pure internal mode
e  - pure external mode

Change-Id: Ib92c30acd8c370843becb286c935de056b09bcbd
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2023-11-29 09:54:36 +08:00
Herman Chen
5d89c2cc32 chore[mpp_dec]: Decoder changes to cacheable buffer
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I839cd04d14a38f4553785c44667758df69aa9929
2023-11-29 09:54:36 +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
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
9d9aeba533 [mpi_enc_test][mpi_dec_test]: close slt verify file
Change-Id: Id303202846e9e415b0837e73115ce3c93503e608
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-04-25 16:12:49 +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
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
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
db487e5d7f [mpp_dec]: Add MPP_DEC_GET_CFG cmd implement
Add MPP_DEC_GET_CFG call before setup decoder config in mpi_dec_test.

Change-Id: I1ed8c2be44be9de0e4b1364a1401a81a9ecfd6e1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-17 11:11:43 +08:00
Johnson Ding
0faeb9413f [hal_jpegd]: Check output format before decoding
Change-Id: I035297695a4ff027814507e829adba1a767f61e8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-08-23 14:30:31 +08:00
Herman Chen
4dbc29e380 [mpi_dec_test]: Allow loop jpeg decoding test
Change-Id: I2074554b9106213671c976705a195b0e9f740eb7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-01 16:51:08 +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
a4ed23117b [mpi_dec_test]: Add MppDecCfg to setup decoder
Add MppDecCfg and string control to add more extra control.

Change-Id: Iead4bd938691af3eac76368421c04c3ebd1f6272
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-17 11:42:04 +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
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
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
Herman Chen
3c55b55e46 [mpp_dec]: Add query interface for debug
1. Add query interface.
2. Add query result in mpi_dec_test.

Change-Id: Ie0026f155331c0b0f8e1b5409aeb7d41b6a3ecc6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-23 14:17:34 +08:00
Jeffy Chen
2de0509cbb [test]: Fix stringop-truncation warnings
Fix this warning when building with newer GCC:
warning: '__builtin_strncpy' specified bound 256 equals destination size [-Wstringop-truncation]
|   106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
|       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In function 'strncpy',

Change-Id: I6341fa4e507f644b143a8e266f3df267fbd9c566
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2020-09-08 09:05:59 +08:00
Herman Chen
41dd3ea054 [test]: Format mpi_dec_test output log
1. Add temporal layer id print and error/discard value print.
2. Add mpp instance print to separate different instances.

Change-Id: I4d85e4ec80e957316a6aab82e3661e27389bebc8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 16:21:45 +08:00
Herman Chen
3166d88321 [test]: Add coding type detection to mpi_dec_test
Change-Id: Ie6353184dab453e479c4f61137f208276386367c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-27 10:34:52 +08:00
Herman Chen
37602b5bb9 [test]: Skip error opt on parsing parameter
Change-Id: Ia5935b55bf0a09158b4ebd40656de6e813e880c4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-10-10 16:29:43 +08:00
Herman Chen
4553fac11e [test]: Add read packet config function
When mpp output packet binary file with size config file test case
should be enable to parser the corresponding config file.
This patch implement the config file option with "-c" prefix.

Command line sample:
mpi_dec_test -t 7 -i /sdcard/in.bin -i /sdcard/ops.bin
Then the test case will read in.bin file with size division specified
in ops.bin.

Change-Id: I8b18a6475d77f0303f12614a063888dcd9505f16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-11-21 09:57:32 +08:00
Herman Chen
203ff537c3 [test]: Fix not enough buffer on YUV444 jpeg decode
When decoding YUV444 jpeg image the buffer size should be larger.
Also we add user specified output format support for jpeg decoding.

Change-Id: If8defbc23162dac111aafee6d96d2726c366b7da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-12 16:03:08 +08:00
Herman Chen
3f22788c07 [test]: Add infinite loop decoding mode
When max frame count is set to negtive value mpi_dec_test will always
loop input file.
This is usefull for longterm pressure test.

Change-Id: I64336d5ec6411ee3712b951ef0b0c02bd5f453cf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-10 10:52:31 +08:00
Herman Chen
0a78fb7102 [mpp]: Combine block control and timeout control
Use MppPollType as block control MPP_SET_INPUT_TIMEOUT and
MPP_SET_OUTPUT_TIMEOUT 's parameter.
Deprecate old block/block_timeout control.

Next step is to change MppPollType to RK_S64 for compatible in different
platform.

Change-Id: I02974f0b8eeb23ff43687448d6c3271ea7dd0a2c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 11:56:56 +08:00
Herman Chen
741cf4a920 [test]: Improve mjpeg decode file output
Change-Id: Ib0f58417acfa9daa2de1e5db9bdc11d16e7ef693
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-28 16:29:31 +08:00
Herman Chen
89a1fd39ba [test]: Fix NULL buffer group input for usage
When decoder frame buffer group does not exist do not call usage
function.

Change-Id: I677d9bf1cd116886b94959c90161a4500795eacc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-07 17:31:13 +08:00
Herman Chen
b403830430 [test]: Update decoder test function
1. Add buffer group clear when buffer group exists.
2. Add buf_size and limit to buffer group
3. Add max memory usage calc to mpi_dec_test
4. Set mpi_dec_multi_test default thread count to 1

Change-Id: Ia165c9a213b0aed9bc634121dd70776fd6c4801f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:51:22 +08:00
Herman Chen
e38a5ad357 [test]: Add frame count limit to mpi_dec_test
Add max frame number parameter with "-n" option to mpi_dec_test.

Change-Id: I21c00baee4d94cab69a95060ac5a694cd9f28945
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-23 10:49:49 +08:00
sliver.chen
3f6fc99b81 [test]: modify sleep time to improve the decoding effciency
it is obvious.

Change-Id: I9ce91996ff6cebad01297281a6a0f3e5632680e5
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-12-12 20:46:48 +08:00
sliver.chen
b625ced0af [test]: add err info check when decode
mpp will output error yuv data when process error input stream.
We should check it and discard those error frame to avoid display error.

Change-Id: I04423b5fad13e727594b06c217f491227e465fce
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-11-08 11:22:01 +08:00
ayaka
e710c126ad [test]: add timeout poll type sample code
You could enable the output timeout with a new opinion
"-x" the unit is the millisecond.

Change-Id: Ibfc85729d867a08d1984c8e7b2d63b197159a42b
Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-08-03 17:43:43 +08:00
Randy Li
04e3ffb69c [test]: fix the align problem in decode_advanced()
The old Video IP like VDPU1 only supports align with 16 bytes,
it would causing a numbers of memory problem without that.

Change-Id: I7570808824ab2e32602c8cae7f97c9b6b2947db9
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-24 15:54:59 +08:00
Herman Chen
d8ed1f4eb1 [mpi]: Add poll interface to mpi
1. Add poll with timeout. Support three mode: block/non-block/timeout.
2. Change control MPP_SET_INPUT_BLOCK and MPP_SET_OUTPUT_BLOCK.
3. Remove msleep in most mpp interface.

Change-Id: I39d9a261b6f1da66c6cb944abd71d1e7f4928d2d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-01-04 15:15:37 +08:00
Herman Chen
12a7c735e5 [test]: Add more comment to mpi_dec_test
1. Use half internal mode for demo
2. Add decoder memory mode description

Change-Id: I5b72063e55c2228050af7bafe743e0b9ad834721
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-09 16:46:28 +08:00
Herman Chen
bbe38e38a7 [test]: Add return value for test
Change-Id: I4f64b3ffebda6b966cd898ba317d088be967d5d6
2016-12-01 14:17:30 +08:00
Herman Chen
5e5f667d68 [dec]: fix mpp_packet error usage in test
1. mpp_packet length is the valid data size, fix this in copy_init function
2. in mpp_dec_test setup pos and length only do not touch data and size

Change-Id: Ic1bb15126fa09e7da0869ea79ec85ad2869c3955
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-11-29 10:10:31 +08:00
Herman Chen
102453612b [test]: Set decode test packet size to 2K
Due to current decoder does not support multi-frame data in one packet we have
to limit packet size to a small size. So that one packet will not contain
multiple frame.
This is a modification for internal auto-test environment.

Change-Id: I3bb14c62874ed693b7b9125f21ca342abe54c732
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-11-28 15:00:15 +08:00
Herman Chen
e9520d5cb0 [mpi_dec_test]: cleanup test case
separate simple and advanced process

Change-Id: Ie278357e69bb0748e9958952e3a7f5560c75d024
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-10-10 20:08:32 +08:00
Herman Chen
04b6a23ce2 [test]: modify mpi_dec_test for mjpeg decoding
1. clear input packet length when packet is copied
2. modify mjpeg advanced decoding path in mpi_dec_test
3. add numerator and denominator set prop function
4. remove extra log on first info change
5. fix eos process and buffer size check in advanced decoding flow
6. fix jpegd stream length config error

Change-Id: Id6c26ebda090eb4076f27deaad4d61b4221f2653
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-10-10 11:03:59 +08:00
timkingh.huang
44852d9696 [mpi_dec_test]:add advanced decoding path
(1) when decoding mjpeg, switch to mpi_dec_test_decode_advanced
(2) add advanced decoding interface for mjpeg in vpu_api_legacy.cpp

Change-Id: Ib1848d1686c76826385f76405dda81dd0405cb62
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2016-10-08 08:57:41 +08:00
Lin Kesheng
60373a6973 [all]: format code
use fromdos to change file type, remove ^M in code.

Change-Id: I000202dc51fcff57cc0771455baebea595115b1d
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-08 15:21:02 +08:00
ChenHengming
0e9872c5ac [mpi_dec_test]: update decoder test case
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1171 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-07 09:39:36 +00:00
ChenHengming
4db17e27c6 [mpi_dec_test]: fix compiling error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1051 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-20 07:56:39 +00:00
ChenHengming
f7341152cb [mpi_dec_test]: get_frame until return MppFrame is NULL
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@931 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-16 11:51:56 +00:00
ChenHengming
c31e7ada4a [mpp]: change mpi_get_frame return value meaning:
return MPP_NOK means flow error
return MPP_OK does not mean there is available frame, need to check the MppFrame pointer
[mpp_dec_test]: reduce buffer size on reading to avoid one packet multiple frame input.

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@930 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-16 11:34:13 +00:00
ChenHengming
4c06405e3d [mpi/mpp]: add format check function and modify mpp_dec_test for format check
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@925 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-16 09:12:30 +00:00