Commit Graph

51 Commits

Author SHA1 Message Date
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
Johnson Ding
3f737ef5c3 fix[utils]: fix read and write some YUV format
Change-Id: I96d2b49539b7547df6786b3495fcbc375d4f4fc3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-03-01 15:11:48 +08:00
Yanjun Liao
303a26ddad fix[mpp_dump]: add YUV420SP_10BIT format dump
Change-Id: I1e89dbfefb394b4e8b2fbaf4fb0516be3528dd24
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2024-01-29 09:35:28 +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
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
xueman.ruan
7017dbd1b6 fix[utils]: fix hor_stride 24 aligned error
Change-Id: Ife950bd3ae5fac5faffffa4275222fcc7fb9bbe0
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-09-28 16:24:22 +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
ef67776801 [mpp_dec]: fix hdr stream dump yuv error.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: Ibf13d81dfec194bb607a1fe881227951bb1509e0
2023-03-29 15:17:31 +08:00
Zhihua Wang
2de930d33c [utils]: read_image support YUV444SP, YUV444P
Signed-off-by: Zhihua Wang <hogan.wang@rock-chips.com>
Change-Id: I20f9b200134dac343c7e3e5da894689937afe2ca
2022-11-11 14:19:35 +08:00
sayon.chen
d1111e74ba [utils]: Support yuv420sp_tight_10bit to 16bit dump
Change-Id: Ic1143a7fe022d38ba8f6300b7e9e017a44bf802c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2022-09-16 15:38:40 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
439fce52b0 [test]: Add infinite loop mode for mpi_enc_test
Change-Id: Ibf459034f89682ec2accf5c79cf437bc34804808
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-29 17:19:22 +08:00
Herman Chen
708f7d4b28 [utils]: Update RGB generation code
Change-Id: I016c92f80391392f3b7f0ebbf8c44d6fa2304c27
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-04-27 16:01:22 +08:00
Herman Chen
370777bd14 [utils]: Improve extension detection function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id21a26efd4e3bdb82a5ef3d338d012c69dcac8e2
2020-04-14 10:43:01 +08:00
Herman Chen
50a9655531 [test]: update sample for fbc support
The FBC data should be in this form:

    +---------------------+
    | header (4K aligned) |
    +---------------------+
    |                     |
    |    payload data     |
    |                     |
    +---------------------+

The payload data size is equal to the orignal format size.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2855c89db43c3e2cc302ac40e96e36ef6147f041
2020-04-10 17:42:17 +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
Ding Wei
f7ddf931c2 [utils]: Add more format support
Change-Id: I93f380f157806b8885559834b94b348bba87ff12
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-02-20 11:33:25 +08:00
Herman Chen
459eace205 [mpp_frame]: Add color format print
1. Add color format print for all supported format.
2. Add RGB color fill function.

Change-Id: I79fb3f40402b6fb6e36883c99945e709723aee7d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-31 10:53:33 +08:00
Johnson Ding
d2459e4fac [jpegd]: Add YUV400 support
Change-Id: I110f0f2a16977f985d32204704ca4c2effcd8b90
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-06-12 10:55:58 +08:00
Herman Chen
f367af4a37 [utils]: Add YUV420P dump frame support
Change-Id: I0a63b03ab1bb5fb5fdcf52eadc2bde52319d155b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-15 15:33:51 +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
a0f76729d5 [utils]: Optimize YUV422SP frame write function
When decoding 422 source the YUV422 frame is default in YUV422SP mode.
But software like vooya does not support this format. So we change it to
YUV422P format for better user experience.

Change-Id: I103445470db5e6dd46ff1dc2cb705ae7e47bd8bc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-11-20 11:43:06 +08:00
Herman Chen
ae93472665 [utils]: Add YUV444 frame writing support
VDPU hardware only support semi-planar format for YUV444 which is
hard to display on other software. So utils will change it to YUV444P
and write to file.

Change-Id: Ie81149d7638c2e1d36fc3bc06fe1353ca95c6c01
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-12 15:56:46 +08:00
Herman Chen
15e357ffd0 [utils]: Add YUV422SP frame write support
Add YUV422SP format support to function dump_mpp_frame_to_file for 422
format jpeg file.

Change-Id: I721551f526c2c981f023f638f4efd20bf695f5e9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-09-06 09:10:04 +08:00
Ding Wei
6b6c1ae033 [utils]: for avoiding c++ keywrod, rename xor to vor
Change-Id: I6d2f604b33373932ba4df9affa253764e99bae13
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:32 +08:00
Herman Chen
4e030fa170 [test]: Move some function to utils
Move yuv read function and yuv create function to utils.

Change-Id: I79a861ce869c182a27ed51a976eeb08f1f230d6e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-27 17:20:24 +08:00
Ding Wei
4b2c91ed78 [utils]: fix bug: has error when calc last 4 byte
Change-Id: I240518ff7fcf429f42e50f87b56bf78738f2bb6d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-24 09:31:18 +08:00
Ding Wei
53a02bf26f [checksum]: use sum and xor for data/frame check
Change-Id: Ie3bd2f2819d8387a5b2486cf0a096d271220d819
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-19 15:01:38 +08:00
Herman Chen
ef3d9158eb [utils]: Fix warning on Linux
Change-Id: I5b7319381f55fd089d512b9a3274dd9273b7279c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-03 09:01:33 +08:00
Herman Chen
f96141033d [util]: Add frame checksum calculation function
Add checksum calculation function and file access function for debug.
NOTE: checksum for YUV image and for luma only so far.

Change-Id: I54509bebd64f5e5143e14824733d9c25af9db204
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-13 09:42:57 +08:00
ChenHengming
dfe367b0ff [utils]: add mpp_frame write file function to utils
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@921 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-16 07:22:48 +00:00
ChenHengming
c0866a76f9 [comment]: fix company name hand writing error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@906 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-13 09:42:31 +00:00
ChenHengming
bed52a856e [utils]: add show_options to utils
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@316 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-09-28 22:31:52 +00:00