Commit Graph

1911 Commits

Author SHA1 Message Date
sayon.chen
71ff5475cb [hevc_v345_dec]: Support hevc_v345 hw_rps
1. must define HW_RPS for support
2. defalut open hw_rps

Change-Id: Ic699fa2fba24217a082ee4ef62538e3f92d11e1c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-04-02 10:28:50 +08:00
Herman Chen
77e2e5a70b [rc]: Change default rc parameter
1. Change statistic time to 3 seconds.
2. Change H.264 min qp from 16 to 8.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib0d20f2dcb8affb58bc5fdeea6d506fe28be68b1
2020-04-02 08:45:36 +08:00
sayon.chen
e26a59a676 [mpp_enc_v2]: Fix reenc path task_length asssert
Change-Id: Ia22601c815c47b4ef3ecfee741a09bc7476a7531
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-04-01 13:54:08 +08:00
Herman Chen
8191f70f91 [h264e]: Fix error of missing cropping info
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I773027fee1d0b0b0f16efa118a0447cf08c7835a
2020-04-01 08:48:13 +08:00
Herman Chen
2548db477e [mpp]: Enable new encoder path for H.264 and H.265
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ida9674118f338a70b9f61420fbf117ae465050f8
2020-03-31 18:27:41 +08:00
Herman Chen
f5549b6e7e [hal_h264e_vepu1]: Add vepu1 new api support
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0226888b8e0d4aff36bdcb4e6a415a5e67ed4e6e
2020-03-31 18:27:16 +08:00
Herman Chen
a22c2e109b [h264e]: Update length after insert sei packet
1. Add length return when writing sps/pps/sei
2. After writing to packet update both packet length and task length.
3. Update rule of updating length and packet length.
4. Rate control use only hardware length to calculate.
5. Move update hal to the end of flow to reserve for adding extra data.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9077747a34dc47079d6a1f90db7913c92aa448f5
2020-03-31 16:49:40 +08:00
Herman Chen
a56bc3baf1 [mpp_packet]: Add MppPacket append function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0788997fffe2e55ac55d515c33280badf6e97eb8
2020-03-31 16:49:40 +08:00
Herman Chen
6df1c1ec62 [mpp_enc]: Use metadata to send intra flag.
Use MppMeta in MppPacket to carry flags and data instead of MppTask.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I274cf4163914938f22e983eca35c7fee8a9435dc
2020-03-31 16:49:30 +08:00
Herman Chen
3e03d9c074 [rc]: Fix error div zero on reencoding
Change-Id: I8ecbcbf3d5af822e6f0332bcb42d98a2881a8b5a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-30 20:24:30 +08:00
Herman Chen
4c8d9ea2d5 [h264e_vepu541]: Fix clerical error
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9e1f9366e0a1a1a7602ae4e49b7e5822fee7db31
2020-03-30 20:15:49 +08:00
Herman Chen
0a2d4e341c [mpp_enc_v2]: Add encoder header output mode
1. Default output mode is output header only on config changed.
2. Add new mode to output header on each intra frame.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Iea8dd1e6bb377318b88300d6a013f2c736b15afc
2020-03-30 17:16:11 +08:00
Herman Chen
6aac71a463 [mpp_packet]: Add copy function
NOTE: copy will overwrite valid data from pos and update new length.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ied41cc3f13d24da3704335bbfed2c6b20664c8d1
2020-03-30 15:23:52 +08:00
Herman Chen
04787b8f4e [hal_h264e_vepu541]: Add MB layer rc
1. Fix error of return bit_real.
2. Add MB rc functions.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1555b717bf28b776781b58f092ed1d2dd4dc82e6
2020-03-28 18:11:16 +08:00
Herman Chen
0ccc49408c [h264e]: Fix user data insert error
1. Fix clerical error.
2. Add UUID on writing sei packet.
3. Fix payload size error.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ie06e017814175005ac9f131a17b2452b5705d527
2020-03-28 17:13:21 +08:00
sayon.chen
4965578e36 [h265e_api_v2]: Fix sei packet write issue
Change-Id: I677b824d189d377543c67ba9adfa86ef608ad4ac
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-28 17:04:19 +08:00
sayon.chen
b4c5269174 [h265e_api_v2]: Supprot slice split cmd
Change-Id: Ied371e75ded717a7f7c2044d7f0f527f327272eb
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-28 17:04:19 +08:00
Herman Chen
75431ca4ae [mpp_enc_v2]: Fix reencode path dead loop
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9adc1accfd10361e4901aaeb5abde9e09bb2a7bd
2020-03-28 15:19:19 +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
sayon.chen
93526561ff [h265e_api_v2]: Reencoder case proc_dpb no process
1.fix reencoder case dpb update case stream error
2.reorganize rc check reencoder function

Change-Id: Ibb51f9ee183fcfa6c2d04255c6815a25c7a61b5c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-28 10:09:26 +08:00
Herman Chen
b60ef09e08 [h264e_vepu541]: Fix extra_info setup error
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I421e132a2349dbdc65cc4228f732d12300a5893b
2020-03-27 18:54:30 +08:00
Herman Chen
633d1a251b [vepu541]: Fix error on output header with stream
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If44279e3e1bea215f0d69a2fe926f778f5a4a97e
2020-03-27 16:57:48 +08:00
Herman Chen
04b26d02df [h264e_api_v2]: Add user data before encoding.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I54cc186a889d5703d86f42eafff5244e10b24ad2
2020-03-27 16:57:48 +08:00
Herman Chen
ca09525fcc [h264e]: Add sei writer function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia960cd919f6e2f99f258196b4bc076caea26ae70
2020-03-27 16:57:48 +08:00
sayon.chen
170d2d08f0 [hal_h265e_541]: Fix rc realbit return error
Change-Id: If830bc17a85e084e4fa935520e1b21cd6697fac4
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-27 16:37:30 +08:00
sayon.chen
e200d403c1 [h265e]: support extra data append
Change-Id: Ib21a6555080c7a7fa0a4e2742ebaa8e2982b4ea6
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-27 15:09:57 +08:00
sayon.chen
ba75c1ed08 [h265e]: Support smart gop ref
Change-Id: I50c80c82d3dcbedb728507503bc56e5b09fb138d
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-03-27 14:52:35 +08:00
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