Commit Graph

108 Commits

Author SHA1 Message Date
Herman Chen
0b4532c6d5 [rk_mpi_cmd]: Add max_reenc_cnt for reencode flow
When max_reenc_cnt is zero the reencode flow is disabled.

Change-Id: Iba600b37bb5ab6e4f720b652d59abfae36f9e52f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
Herman Chen
85f9662150 [mpi_enc_test]: Use MppEncCfg to setup encoder
Change-Id: Ie3506a3555751344f54264d85804ee509a976659
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
Herman Chen
02c7073f35 [vepu541]: Fix roi error
1. Fix h.264 encoder roi buffer leak error.
2. Set all qparea to [1, 51] range.

Change-Id: I8434fc5fc60071ec533aba68fc2fe3be5a087bcd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-04-29 19:26:00 +08:00
Herman Chen
32689b3708 [test]: Add user data option in mpi_enc_test
Change-Id: Ib84980defdcbae5f92ad841a107757392f37db2d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-04-29 08:50:43 +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
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
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
sayon.chen
28bc434e72 [mpi_enc_test]: update mpi_enc test case
1. Support video stride and bitrate config
2. Support mpp_enc_v2 h265 codec config
3. Support roi & osd config used meta path
4. Support tsvc config set
5. Support file format check according to file extension

Change-Id: Ib0cedf83867e3cda67159dc7ae5717a67495575c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-28 15:00:42 +08:00
Herman Chen
f941d184be [test]: Add header extraction for H.265 encoder
Change-Id: Idc6760c5fe95c90adeddf42afb3948e35c839af6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-26 14:52:13 +08:00
Francis Fan
d4cae78524 [mpp]: cancel release mpp_frame in put_frame api
NOTE: This change may effect some existed program.
MPP caller should always follow the rule that the resouce creator must
be the resource destoryer. So caller of encode_put_frame should release
the input MppFrame structure and MPP should not release the input frame.

Change-Id: I36897dbbf1697002ae64868f2385961472eeb7c5
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-20 17:43:39 +08:00
Herman Chen
6cee8bb11a [h264e]: Add slice split function
Slice split has two modes: split by byte and split by CTU number.

Change-Id: Id5a07f8a8cae612b6b913e9cb747dacec5b8e5a2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-07 15:32:29 +08:00
sayon.chen
caee16c968 [h265e]: Add fixqp flow
Move fixqp mode from VBR+CQP to rc_mode FIXQP.

Change-Id: Ia29471ecd81bb1a4759f6e6f1d7e37515341eb8c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 15:37:42 +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
Herman Chen
7b47085c19 [test]: Add output block for mpi_enc_test
Set encoder output to block mode in mpi_enc_test.

In some case the demo will get NULL return packet. Use block mode to
avoid this error.

Change-Id: I8e7438b07f024a30f62bbb92382e210b06e47a61
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-11-21 10:19:09 +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
Johnson Ding
90b2a3838c [vpu]: Fix encoder's improper operation with eos
When encoder receives an empty frame with eos flag set, encoder will
encode an unreasonable extra frame.

Change-Id: I3bd1a2c84780f1b6212171117b67319b2f613b9f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-12 09:52:02 +08:00
Ding Wei
3e5ad4fed3 [h265e]: add h265 encoder code
Change-Id: I08350dc76d3040bc1a16a3d8234f836f5fbf69d0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-21 09:59:31 +08:00
Herman Chen
866b6bd170 [test]: Simplify mpi_enc_test
Remove motion detection / ROI / OSD setup from mpi_enc_test. These
complicated funciton will be move to a new test case later.

Change-Id: I8b212a191f4e1ba6a4ec21a23fd2f4cc51dc4c5d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-10 08:34:21 +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
Herman Chen
87da5bef82 [test]: Add yuyv422 and uyvy422 test case
Add yuyv422 and uyvy422 support to encoder test case: mpi_enc_test.
Note: on these two case the hor_stride should be twice of width.
With this modification test case can output correct stream now.

Change-Id: I463d3c158369d831e4558199c917023773300ac1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-29 12:01:55 +08:00
sliver.chen
bf702db051 [test]: add argb fmt support for unit test
modify read yuv image method and buffer size.

Change-Id: I5a5dd63fd98831a744801d5504f4ac6d2e0fcebc
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-02-23 11:38:49 +08:00
sliver.chen
1c7586932c [test]: remove roi control cfg except avc type
ROI cmd just avaiable in rkvenc,but also we need to 
ignore it in vpu. or will leads to warning about
unknow vpu cmd.

Change-Id: I9a630171df5698ae5d39bb2e5c38f06b2f988893
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-01-23 08:36:25 +08:00
timkingh.huang
1acefd6207 [h264e]: add configuration of ROI
Change-Id: Ieba60baedc8fabd248112636f5ea59a107775403
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2018-01-15 18:34:28 +08:00
sliver.chen
033694705b [test]: modify to avoid encode dead loop
modify ret val of read_yuv_img to avoid test_mpp_run
dead loop in mpi->poll.

Change-Id: If1b907584d0a79f9a5def168eec9358440e38aee
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-09-08 16:21:14 +08:00
Lin Kesheng
cad4b4b886 [h264e]: add rotation configuration
Change-Id: I148814a644264b341d6db1d7af767dd485942829
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-03-28 14:08:41 +08:00
Lin Kesheng
a9840b7dfb [h264e]: implement SEI writting
Change-Id: I7e4960983fd20e924752b143dc368af4ebc44eb5
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-03-22 15:45:53 +08:00
Lin Kesheng
c1665998c3 [h264e]: transform_8x8_mode is not limitted for smaller resolution
Change-Id: I5ba70b325580c0936d72bc553a95f1c208533271
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-28 14:51:33 +08:00
Lin Kesheng
422ecbc204 [mpi]: change rc mode and quality definition
Change-Id: I87008d7294acaa89d9206e5b1cd1ce74c40d4af4
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-14 15:50:06 +08:00
Lin Kesheng
73f2ee87a7 [h264e]: add SEI writing
1. write prep/codec/rc cfg to SEI
2. mpi_enc_test add SEI writting test
3. write SEI one sequence once defaultly

Change-Id: I7dd00a20afe101d7ddf17c875f0704d91a8fea2b
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-06 14:23:09 +08:00
Herman Chen
b1a5c18ef9 [mpi/mpp]: Remove MppEncConfig interface
Change-Id: Ie85b780076b22342bfc1837beef00036f5f40a04
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-01-06 18:00:36 +08:00
Herman Chen
4c1ae218e6 [mpi/mpp/enc]: New encoder framework
1. Interface change:
Separate normal config into three basic config and several runtime config:
Three basic config -
a. rate control config
b. preprocess config
c. video codec protocol config
More flexible rate control interfaces are provided.
More codec configure interfaces are provided.
Change flag with bitmap is provided for further optimization.

2. Remove old codec config from controller and left rate control module only
Encoder controller only handle user rate control requirement and bit allocation.
Hal hardware encoder only handle qp calculation according given target bit.
Remove all old codec code.

3. Move codec process to hal
Different hardware will share same codec process function in common protocol
directory. And different hardware api will register to same api set. Codec
header generation is moved to separate hal directory.

4. Encoder will return length by task
Encoder will NOT get stream information feedback from controller. All
information required by encoder will be all stored in Task.

5. Add mpp_rc for rate control
Move some common rate control utils to mpp_base.

6. Update mpi_enc_test and mpi_rc_test with new interface

Change-Id: Iebb5e276a48f547167e1bed4673f21cc2f0c8ad5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-05 10:58:27 +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
bbe38e38a7 [test]: Add return value for test
Change-Id: I4f64b3ffebda6b966cd898ba317d088be967d5d6
2016-12-01 14:17:30 +08:00
Lin Kesheng
723ffae18e [mpi_enc_test]: fix mpi_enc_test read src frame bug
1. read src frame with real width and height of picture,
   rather than virtual ones.
2. configure correct hor_stride & ver_stride for hardware
3. support yuv420/420sp for mpi_enc_test demo and video
   app, and is compatible for old interface

Change-Id: I1fc23dc2954577b28e25b80a4dcdd1536d45d622
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-11-24 17:52:44 +08:00
Lin Kesheng
1a9d6af7b9 [h264e_controller]: add set idr frame interface
Change-Id: I3fdaccd95b6570b2994d7a8ddb1db5d4cc066600
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-11-15 14:29:00 +08:00
Herman Chen
163ef0ecd9 [test]: add help for max frame number in enc test
1. add help log print for max frame number
2. change flag from -F to -n

Change-Id: Ie45681d2b0a6bdd90733b6a6e1c455325eca89b9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-11-07 20:25:08 +08:00
Lin Kesheng
4d2fa9ae4c [mpi_enc_test]: add option num_frame
1. add option num_frame
2. reduce osd region size

Change-Id: I560686178c902755b49422b9c7c89889338216bd
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-11-03 14:15:49 +08:00
Lin Kesheng
fad35922fc [h264e_rkv]: pack cfg into SEI and write to stream
1. add SEI writting interface
2. write extra_info_cfg and rc_cfg to SEI
3. stream_get_pos use s->buf_plus8 rather than s->p_start

Change-Id: I71de4d6f5dc31f21c0a32dc5ded275ced260d861
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-25 20:54:06 +08:00
Lin Kesheng
089660baa8 [hal_h264e_rkv]: support osd configuration
1. add osd control interface
2. remove h264e_hal_rkv_coveragetest_cfg.osd
3. add h264e_hal_test & mpi_enc_test for osd
4. use tool to format code

Change-Id: Iadb3453d8e6976e5f718253f762d144864419e94
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-08 11:19:11 +08:00
Herman Chen
c58df3f3f9 [mpp_enc]: Implement new encoder framework
1. Separate encoder configure to four parts
2. Add Preprocess / OSD / Extra configs
3. Implement mv_info interface

Change-Id: I2350a25c9f40b199cee8ef6c75ac6ca099f143c4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-27 11:08:08 +08:00
Lin Kesheng
3300d13c3c [HAL_H264E_RKV]: complete buffers allocation
1. add HalEncTask.flags.err to decribe errors
2. support alloc error treatment
3. support frame rate configuration
4. user tool to format file mpi_enc_test.c
5. allocate buffer according to color space

Change-Id: I17a89039504390bf1f2ff664a0aa4075b04d33ee
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-20 16:52:20 +08:00
Herman Chen
5f7053520e [test]: fix mpi_enc_test help info
Change-Id: I8eb8b8593e41dab607fe14619504904ba9c01b1b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-09-13 11:00:39 +08:00
herman.chen
a0c0639205 [meta]: modify metadata type and key definition
This is prepare for adding metadata key tree.

Change-Id: Ibd8f4a2c820cdeb5c59ade9a0f80d29e803143da
Signed-off-by: herman.chen <herman.chen@rock-chips.com>
2016-09-08 16:56:45 +08:00
Herman Chen
a0c8a331ad [mpi_enc_test]: add default test without input
Change-Id: Ia8e57e4d9e36b5bedac206bef5ab2abb47ea0b0f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-09-08 16:41:56 +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
Herman Chen
43bfdc6bdf [format]: format coding style
Change-Id: I3d0e081f6636ca8162df4bda68618ec0ba37e7ae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-08-23 09:16:22 +08:00
ChenHengming
4f7f69c1ae [mpp]: fix compile error on windows
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1191 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-11 10:16:44 +00:00
ChenHengming
b15604090a [test]: add format option to mpi_enc_test
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1165 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-07 02:47:14 +00:00