Commit Graph

2084 Commits

Author SHA1 Message Date
sayon.chen
60de6443f7 [hevc_dec_hal]: Support hevc_v345 dec
Change-Id: Iab26ea11c3eadfbe423b9ddfd8c674b38dd68e21
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-27 11:44:53 +08:00
sayon.chen
cdda734346 [mpp_device]: Add interface for get hw_id
NOTE: hardware id is for hal detection.

Change-Id: Id58d04b7f1c022d8dccc44c294be02f03b22bf42
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-27 11:15:56 +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
Herman Chen
a561a987c1 [vepu541]: Set osd_plt_cks on configure osd_plt
The osd_plt_cks need to be clear when configuring OSD palette and should
be set true when encoding.

Change-Id: I2601a06116b984b532bfd0c8ae4cba779bf316d8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-26 14:22:07 +08:00
Johnson Ding
38a310ae14 [test]: return 0 function main has no error
Change-Id: I11c332f11ba0310fa2f57dc1cba725c24493073d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-26 10:32:20 +08:00
sayon.chen
ad4fd32b21 [mpp_enc]: When enc_v2 init fail use v0 by default
Try enc_v2 on HEVC and AVC case. When it failed just fallback to normal
case.

Change-Id: Iaed522d79b87bef63a8dea3585bb926f8cedb4f8
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-24 14:24:12 +08:00
Johnson Ding
e9c5eae5fa [rc]: abort on debug mode if GOP is negative
Change-Id: I54221a8ff26bd7d63a9f4eb6024d81f417721d3d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-23 14:26:58 +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
6a76bfc3f5 [mpp_buffer]: Add offset property
1. Add offset set / get function to MppBuffer
2. Add U32 register address converstion function.

Change-Id: Id297b7a05e47d4e249f5e33c1924a0539729c808
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-20 17:41:32 +08:00
Johnson Ding
ad0d2179a9 [h264d]: fix fast mode error
1. When fast_mode is enabled, send_reg process and wait_reg process in
different thread asynchronously. If a wait_reg process hasn't finished
and another send_reg process is processing at the same time, these two
thread may access the same stack which stores content of a ioctl
request. In this case, MPP_HW_POLL_HW_FINISH cmd will be sent twice.
This leads to hardware decoder timeout in waiting and reset.

2. In fast_mode enbaled case, the three element of reg struct in array
should be accessed in FIFO order.

Change-Id: I8c9b028a3a4569c07b17cdc3916be36e89e9374c
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-20 16:45:28 +08:00
Herman Chen
a225238d0c [osal]: Add syslog on linux
Change-Id: I484ed12194e2e772326018e7cb1503ab761b2e71
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-19 17:32:01 +08:00
Herman Chen
6d52e80b27 [encoder]: Change rate control work flow
1. Add mpp_rc_api and mpp_rc_defs for open rc module to external users.
2. Add RcImplApi registration and setup function.
3. Separate RC module from the encoder implement.
4. Use EncFrmStatus and EncRcTaskInfo to control work flow.
5. proc_rc and update_rc function in enc_impl are removed.
6. Use rc_frm_start and rc_hal_start to process rate control.
7. Add more RcCfg setup in mpp_enc_v2.cpp.
8. Use rc_task to replace all the frame status and rc config transmit.
   EncFrmStatus is for encoder flow control.
   EncRcTaskInfo is for communication between rc / hal / hardware

Change-Id: Ia72b0e0804bfca13963c2b2a5887983fd9b5bcbf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-19 14:43:02 +08:00
Herman Chen
74d050c4df [h264e]: Output SPS/PPS without GET_EXTRA_INFO
When user does not use GET_EXTRA_INFO to get encoded header stream the
encoder should add the header stream before the hardware output stream.

NOTE: Only vepu2 is fixed.

Change-Id: Idf5c07127ef68bb6553f9fb6550f993f3a29ea63
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-18 20:10:41 +08:00
Herman Chen
61d8063b36 [mpi]: Add command for RC api configure
User can define its own rate control stategy function and can use them
in MPP encoder flow.

Change-Id: I9573ab8cb5a63c543e17faf07e89f64f5d7013ef
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-18 19:37:07 +08:00
sayon.chen
e894f739ff [h265e_v541]: Rename h265e_rkv to h265e_vepu541
Change-Id: I3bfd760360be4fe6f9bc7b77c592419fa1b02bda
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-18 17:48:07 +08:00
Herman Chen
6e6d43a9ce [hal_task]: Separate hal_task to different ones
hal_task will be separated to dec / enc / vproc hal_tasks.

Change-Id: I67c45772ca998a25ec116d6f08f0584f62408ad1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-17 14:25:07 +08:00
Johnson Ding
856aef46a2 [m4vd]: fix compiler warning
Change-Id: If9e73a27ea92ad8536d9c9396575ac5d8897a282
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-13 17:37:02 +08:00
Chen Jinsen
55cf9aa935 [vpu]: update to match new ioctl for kernel-4.19
Currently, this patch only works well on jpege.

Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: I77026c1975f4937b5bc042e490a2230708b3e715
2020-03-13 17:26:05 +08:00
Johnson Ding
9cb0efa777 [h264e]: fix h264 enc
Change-Id: I0cfe387bfaf1ed575b327c9c2270ec4a8313baf0
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-13 17:25:54 +08:00
Johnson Ding
08344548db [jpege]: fix jpeg enc error
Change-Id: I4b92f45e833316b137d297a6f58ab77508227c2f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-13 17:25:47 +08:00
Johnson Ding
9cc13095a8 [dec]: fix dec error
Change-Id: Ibbf76ae3590e083591784ef30616acebe8e52ad2
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-13 17:25:34 +08:00
Johnson Ding
c490f4ce71 [vp8e]: fix error when deinit vp8e
Change-Id: I9e4aece6e106afad4cd3b0398e4ed5a557859484
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-13 17:24:33 +08:00
Johnson Ding
6b3acc8085 [hal]: fix fault reg count on printing regs
Change-Id: I36d74ac7bfc98c5d0b3da141b6e5a3775fad474a
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-13 16:22:10 +08:00
Herman Chen
7aacf22419 [rc]: Support fraction frame rate
Change-Id: I0b7d972bbc514d3868221428e6168c62c452cf56
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-13 10:53:41 +08:00
Herman Chen
dcb9642114 [mpp_enc_v2]: Add control process function
Move all control process code to a new function.

Change-Id: I7b536cc52fcc695ecdfbccd925b881db28acb4cf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-12 19:56:08 +08:00
Herman Chen
22aef2ccd3 [mpp_common]: Add container_of macro
Include <stddef.h> and add container_of macro.

Change-Id: Ie439b7683e026be9336e618c605b3b934e4fde38
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-12 15:53:18 +08:00
Herman Chen
512de40ff0 [h264e]: Add scaling list mode configuration
Change-Id: Icb4435060c76bc03472d22d6a13909ad4c60e88b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-11 17:27:46 +08:00
Herman Chen
fd6aef3a02 [mpp_meta]: Clear value on get_env failed
NOTE: s32 and s64 value can not be cleared to zero for it may have
initialized invalid value.

Change-Id: Iea9f36600b051584de34d8ac1782a897c64dcd2f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-11 17:06:49 +08:00
Herman Chen
45e2b89d5d [vepu541]: Add more log for debug
Change-Id: I91c1f9520bf11d9d87d0b09cbc6447ac57f02d47
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-10 14:27:44 +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
Herman Chen
73ec7df421 [vepu541]: Add 4K support using RegExtraInfo
Change-Id: I48919fa746e72ef2efbf5d4d30c8d4b589a3ce3a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-06 17:53:27 +08:00
Herman Chen
ce5e257e87 [hal_h264e_vepu541]: Add H.264E ROI and OSD
1. When ROI is enabled the qp_area_en should be always true to avoid
bug.
2. Use meta data to transmit ROI and OSD infomation to HAL.
3. Fix crash when roi is not set.

Change-Id: Ia40c139fcec5b334634c871cf12d7bb250d93b56
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-06 17:36:09 +08:00
Herman Chen
54b047e396 [cmake]: Add history log
1. Remove SVN version record.
2. CMakeLists will record max 10 git version.
3. Use mpp_show_history to control the history display.
4. Use strings libmpp.so | grep author to get history log from binary.

Change-Id: I5231ced4031d868fe1329488c914730dc91a3531
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-04 11:05:50 +08:00
Johnson Ding
14cae9c4ca [mpp_platform]: fix wrong device getting problem
For vepu2 on kernel-4.4, the device name should be "/dev/vepu" not
"/dev/vpu_service". This happens on RK3328.

Ref issue:
1. https://github.com/rockchip-linux/mpp/issues/125
2. https://github.com/HermanChen/mpp/issues/11

Change-Id: I830f6c5d4d45effb6faeeb3bbf4c2b5589b92d46
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-02 10:34:43 +08:00
Herman Chen
8b18624b88 [vepu541]: Add osd and osd_plt common config
1. OSD plt config will be sent to device directly.
2. OSD data config will be set by registers.

Change-Id: Ia38bc79ee1fa4d9f6bfafe65d9b2a8c8ff6d6c8c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 17:45:24 +08:00
Herman Chen
ce0d686e54 [misc]: Remove some rc log
Change-Id: I6c9f7f987795b5ee8d37df12e64b472b8b5d2596
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 17:44:19 +08:00
Herman Chen
52c93a4955 [utils]: Update iniparser
Change-Id: Id29dc65a732aa62f4614f1d602545c04e7de054b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 17:25:17 +08:00
sayon.chen
001b637afa [rc_v2]: Reorganize rc calc codec
1. Used mppclip instead of if else case
2. Cbr case increase fluc_l level to get more precise bps
3. Fix error on max_i_bit_prop is not set

Change-Id: I81ada0c7f66bac45f1093b3e0d8bec6ebf738231
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 16:47:40 +08:00
Herman Chen
3426222b95 [mpp]: Fix warning on buildroot
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I15b6cc0b04ad025d1def8a4836117eb2656a34d7
2020-02-27 15:37:42 +08:00
Herman Chen
95db60b3ad [cmake]: change build script for x86_64
Change-Id: I181d09afdd10eadbf78ba1e016990b606205e6eb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 15:37:42 +08:00
Herman Chen
9fd56bdd20 [vpue541]: Enable vepu541 H.264 encoder
Change-Id: Ica01cd69a75112c8a6aba62083d5ed55b9826e4b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 15:37:42 +08:00
Herman Chen
53f12e2ac9 [hal_vepu541_h264e]: Add vepu541 H.264 encoder
1. Set input format to non-AFBC mode.
2. Fix QP mode.
3. Add stride setup for YUV420P
4. Change ME setting to match C model.
5. Fix L2 AQ parameter error.
6. Set constraint_set0 to zero.
7. Align recn/refr fbc body to 8K.

Change-Id: If91ca22123420661be0941428b8bf145b7babef8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-02-27 15:37:42 +08:00
sayon.chen
9353b94f3b [h265e_syntax]: Fix slice tmvp flag no set
Change-Id: Id0402323eec15bbc6b52d220a8f48c232f51879c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-02-27 15:37:42 +08:00
Herman Chen
288bf1e5aa [mpp_dec]: Fix error on last empty eos frame
When last stream packet is send with eos flag but without valid task or
not output is set just output an empty eos frame.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I18a4ea004479820d4dcfe30aa75d935b15a188cf
2020-02-27 15:37:42 +08:00
sayon.chen
88b7bfd913 [hal_h265e]: Fix rkvenc config issue
1. fbc body must 4k align so set header len align 8k
2. fix tmvp me_cnst colmv load & store cfg
3. fix pp reg stride set err && add rgb2yuv param cfg
4. slice split in mbnum must minus 1
5. fix sao flag syntax no set

Change-Id: Ic2f73b5c18c2d41de50984df11334110724ecf5a
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-02-27 15:37:42 +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
sayon.chen
9b1242436c [hal_h265e]: Used vepu541 common interface
Change-Id: I7b1634a253215a5a419c4bdd1131850b5f22c5c2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-02-25 10:28:54 +08:00
sayon.chen
a813a3ca04 [rkv_h265e]: Move dpb buf alloc to hal
Change-Id: Id467803c5ceb280476b64efe0f18132a87049976
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-02-25 10:20:42 +08:00
sayon.chen
66870125f4 [h265e_ps]: Fix sps set error
pic_with & pic_height no 8 align set error

Change-Id: Ibf041c0a6ed20eea35a379eac8fb0998b7a3670d
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-02-25 10:20:42 +08:00
Ding Wei
d5a653112f [mpp_device]: change mpp_ioctl cmd
merge xx_SET_REG_xx  to XX_SET_REG_WRITE
change MPP_CMD_GET_REG to MPP_CMD_SET_REG_READ

NOTE: extra info is different on new ioctl case.

1. Move all extra info process into mpp_device_patch function.
2. Old ioctl should send regs with max size of vepu and vdpu. But new
ioctl need only the correct size of register file.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I8164fc8d4c85f493c52cc7cd12d8717ca5d35637
2020-02-25 10:20:33 +08:00