Commit Graph

1911 Commits

Author SHA1 Message Date
sayon.chen
5de565c84e [h265e_rkv_hal]: Support format cfg
Change-Id: I18dfa559c6ee35cfae672a8bfac04a3ab12edf68
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-01-03 15:49:32 +08:00
sayon.chen
b792ef7114 [h265e]: Support colmv buffer set
Change-Id: Ic672ba58257af389895a3cc42a3aa9a43da7c968
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-01-03 15:28:26 +08:00
sayon.chen
72606f13fa [h265e]: rename fivm_max_mrg_cnd to max_mrg_cnd
Change-Id: I7e1b4fb37a8af9812c393e095006f4af9f625bea
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-01-03 15:24:48 +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
sayon.chen
6748990389 [h265e_v2]: Support user data set
Change-Id: If1cdbcbec10c0d6182560055e2816bc0e5a05a4b
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-30 09:02:32 +08:00
sayon.chen
fd862c2884 [mpp_enc]: enc supprot user data set
1. add user data struct define
    2. meta supprot user data set

Change-Id: I1ac4bf179ce15fce61b3ad326de9fb0f8c821cad
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-30 08:49:29 +08:00
Rimon Xu
7a57f7d5c8 [m2vd]: all time value must be defined as 64bit.
Change-Id: I8c881907f1761c24e8100c27691a075130ea73e0
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-12-28 16:23:04 +08:00
Rimon Xu
53edbab5f4 [h264d]: Fix illegal sps_id value from SEI parser.
Change-Id: Id7367ab3d02ced4d285621d5eddc6b774a5b5c48
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-12-26 18:03:36 +08:00
sayon.chen
6cc5a4ca17 [h265e_api_v2]: fix h265e codec_cfg change flag issue
Change-Id: I9596f72dc89052975856e03f7f618e4a6ac8c069
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-26 17:10:20 +08:00
sayon.chen
24a3258e38 [mpp_enc_v2]: fix enc_v2 hal init cfg error
Change-Id: I35bf4e16bb19d1f6b55172dac333210576b06dcc
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-26 17:09:36 +08:00
Johnson Ding
e3c7e72d69 [build]: Fix cmake version comparison
Change-Id: I42a752f5fac642784688bb4f47156948d438f06f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-12-24 15:24:05 +08:00
sayon.chen
a8ef9864c1 [mpp_enc]: Register h265e api function
Change-Id: I820abce8043d2e8f5906bc086475332103d318e8
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-23 16:45:33 +08:00
sayon.chen
828effef09 [hal_h265e]: Add hal_api_v2 && rkv h265e regs cfg
Change-Id: I3ac15269023be5ac2e4b09fd0545d1e55f08fb5e
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-23 16:43:50 +08:00
sayon.chen
00834d7cbd [h265e_api_v2]: add h265e_api_v2 for rk1109 driver
Change-Id: Ic38d2ae51b750efc0035f03729d2e90ccadbd442
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-23 16:31:12 +08:00
sayon.chen
5af2b04898 [rc_api]: add more hal feedback params
Change-Id: I3914b1f801fb7d0cc5c9d23ac67d69df5878e666
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-23 14:43:34 +08:00
Rimon Xu
e36da64e9b [vproc]: set iep deinterlace mode to frame.
Change-Id: I5acd7b202bdbb60afa952f1f1486ae791e0e8cda
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-12-23 14:37:41 +08:00
Xingwen Fang
61c938948b [mpg4d]: No need to split frame for extradata packet
In some MP4 video sources, extra data of sps/pps is only
placed at the beginning of the file. If you perform a
flush operation while processing extra data and waiting
for a complete frame, the extra data will be lost.

Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
Change-Id: I2c088914b50a2ef39c2ecc45381a4891c45bec50
2019-12-23 14:32:10 +08:00
Xingwen Fang
736f6199b5 [mpp]: use mpp_list to store timestamps
MppQueue does not support concurrent access, and there
are defect in the design, which need to be improved in
the future.

Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
Change-Id: I50db4bcf520bbf4115c6f40d7a759652087965ec
2019-12-23 14:28:43 +08:00
Herman Chen
069826890f [mpp_enc_v2]: Optimize encoder main flow
1. Add skip flow for frame rate conversion frame drop.
2. Add reencode path for reencoding.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ibca23e03d2e82f280bb7db7cf522fb1648f840bf
2019-12-23 14:21:36 +08:00
Herman Chen
8aeb153052 [h264e_api_v2]: Clean up old mpp_rc from h264e v2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I08a312c72085c84d860151a08606c35195305805
2019-12-23 14:20:12 +08:00
sayon.chen
05999b8189 [h265e_api]: set h265e_api as static function
Change-Id: Idf0ff836a22e030e8ce37ad68355219ade6a0b07
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-23 11:45:18 +08:00
sayon.chen
552701a010 [mpp_device]: add mpp_service ioctl
Change-Id: I144bac98f90dc80a4fabb427dc9e07a35713c132
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-23 11:37:24 +08:00
sayon.chen
abb3607c15 [mpp_meta]: Add osd & roi metadata keyid
Change-Id: Ibf2b2f87cd75655c68d6a697bc81d89f699abfac
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-20 17:48:03 +08:00
sayon.chen
d5a97b5c2f [h265e]: Add h265e codec config definition
Change-Id: I6b8816ce94830df2d2a8e4139a7aa8ef6242225d
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2019-12-20 17:45:36 +08:00
Herman Chen
50645d3175 [enc_impl]: Add task to encoder start function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Idd87b13ab45c6899293ad76e2c81e1c7f0169919
2019-12-20 15:44:16 +08:00
Herman Chen
46e189b876 [mpp]: Enable new encoder path by env value
Use enc_version to switch to new encoder path.
Use task_count value to separate different encoder api set.

Change-Id: I4e8ff2b0935ec2cb6178ded742f33ab48187c878
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Herman Chen
f8ff61f57e [h264e]: Add new encoder path implement
1. Add new h.264 encoder api implement to mpp_enc.
2. Rate control is still empty

Change-Id: If4375cfdc07430e03565050a9a846e55a2ac24a0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Herman Chen
6533d422a2 [rc]: Add rate control module
1. Move mpp_rc_api.h to rc_api.h
2. Add rc base module from mpp_rc.
3. Add rc api and empty rc model.

RC module design:
Rate control is a highly user defined module. So we perfer to open the
interface and let users add their frame-level rate control model.

In order to limit the user behavior the API input and output is
restricted. User can use the provide rc base components to define their
own model.

Change-Id: I72c251e7807f675e973bc80ea55683cd57070b00
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Herman Chen
ec1673276c [rc]: Add rate control debug header rc_debug.h
Change-Id: Ib66f0f1f4dcf30eeac72db2ff84f4b8a1febccd6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Herman Chen
a686811240 [hal_h264e]: Add new hal_h264e_api to mpp_enc_hal
1. Add mpp_enc_hal module.
2. Connect hal_h264e_api to mpp_enc_hal for later usage.

Change-Id: Ia5dcb9a38004dd1f87daaa766699abb798297684
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Herman Chen
b514b956e3 [hal_h264e]: Add new h264 encoder hal module
New hal api will change interface to the following functions:

1. get_task - receive one task from encoder and process hw rate control.
2. gen_regs - generate register set according to different hardware.
3. start    - start the hardwara.
4. wait     - wait hardware process one task.
5. ret_task - return the processed task back to encoder.

NOTE: change some function to v2 to avoid linker conflict.
NOTE: vepu2_v2 status
1. Add svc and gop ref implement.
2. Without rc config. The QP is fixed.

Change-Id: I5fa890e8e23c0abbc5abb5ce44111c8a10ea1817
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Herman Chen
a712acd78e [enc_impl]: Change enc_impl interface
1. Add start function for fps process and dpb backup.
2. Remove update_dpb function for dpb should be processed at one time.
3. Add device id to encoder config for header generation.
4. Add hal_ret syntax to encoder hal task.

Change-Id: I9dbbc831d46b267701901dc6e80db7efaa7a0b14
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-20 10:54:51 +08:00
Johnson Ding
711a15ad43 [h264d]: fix vdpu2 reg type mistake
Reg of pps_id should be 8-bits long, instead of 5-bits long. This leads
to hard error when pps_id is greater than 31.

Change-Id: I0ecb894a1aa0af4e66bffb97a19c8b4b9ab5a401
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-12-20 08:41:41 +08:00
Herman Chen
2c7f6c2d95 [rc_data]: Add rc data implement
The principle of rc_data is to maintain rate control related data for
default and user define rate control algorithm.

Mpp internal work flow will automatically maintain these data. Then rate
control algorithm can just use the data by some APIs.

RC data has some status transaction betweeen different flow stage.
Stage 1. RcData is at unused status.
Stage 2. RcData is got by encoder and encoder starts to filling data.
Stage 3. When data filling is finished RcData is marked as done status.
Stage 4. When data receive max life cycle it returns to unused status.

Encoder will fill in the RC related data including:
1. Unique sequence id
2. Frame type / status
3. Stream size
4. Extra info (hardware feedback)

 Overall status and stage diagram

 oldest                                                       latest
 +                                               +           +
 |last                                           |  current  | next
 +----------------------------------------------------------------->
 |                     done                      |  filling  |unused
 +head                                       tail+head   tail+head

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib71581d0585f60b46de20662ffe1d20989270884
2019-12-19 10:43:41 +08:00
Herman Chen
4b3ed83529 [rc]: Add hardware related RC parameter header
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I12e96fbf96619b1e30297b7501ed320d96f2b0c8
2019-12-19 10:43:41 +08:00
Johnson Ding
06a6014817 [build]: Update Android build script
1. Detect NDK path and version
2. Enable cmake multithread compiling if version > 3.12
3. Support specifying args to build script

Change-Id: I2179aeb5460de6b8d39a867ba3a4200c51b61be7
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-12-19 10:43:41 +08:00
Herman Chen
2797a44932 [mpp_list]: Add list_for_each_entry_reverse
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0270f5d045434e1a7a9bd25fe35f2a75c1759f2a
2019-12-19 09:02:11 +08:00
Johnson Ding
2026c7b655 [build]: Fix wrong CMAKE_SYSTEM_PROCESSOR issue
See: https://github.com/rockchip-linux/mpp/issues/121

Change-Id: Iefc47632a53652818f701df7cec01875172d1260
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-12-11 20:28:07 +08:00
Herman Chen
f2ede4569c [h264e_slice]: Add prefix nal and some error fix
1. Fix error on no_output_of_prior_pics and marking syntax.
2. Add max_ref_num_frames and poc type to slice config.
3. Fix mmco count error and reading error.
4. Add more slice syntax log.
5. Add h264e_slice_write_prefix_nal_unit_svc function.
6. Use mpp_writer_align_one and mpp_writer_trailing to write tailing.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia3871b8818c1ba73884ab74b58200ea309e01a50
2019-12-11 14:57:41 +08:00
Herman Chen
f627310fa0 [hal_h264e]: Fix common define
1. Use mpp define rather than H264E define.
2. Unify debug function to hal_h264e_debug.h.
3. Change h264e_hal macro to hal_h264e.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I924f717bbffbb37230d9eb3300969a4dce807def
2019-12-11 14:57:41 +08:00
Herman Chen
0547a740fe [mpi]: Add better sync call to get encoder header
Change-Id: Ibbd9b4ee178b0994f3c86738cd623eaffd2bca0f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-11 14:55:24 +08:00
Herman Chen
5b2ccb9344 [rc_debug]: Add rate control module debug function
Change-Id: I0e2728f9080ba4d8ec55635bc78dc15c9402c595
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-11 11:09:52 +08:00
Herman Chen
32210ca331 [h264e_syntax]: Add H264ePrefixNal
Add H264ePrefixNal for encoder.

Change-Id: I57ca7d7d24ec89af80f787f3e7b931a2b228d6d8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-11 09:22:05 +08:00
Herman Chen
e6ab284dee [hal_task]: Add temporal_id to HalEncTask
Change-Id: I6e776426891d3a1e19711ca6aca59c460440801a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-11 09:20:04 +08:00
Herman Chen
7453d6a9da [mpi]: Add change flag for MppEncGopRef
MppEncGopRef change flag contains enable, long-term reference loop,
short-term gop loop and layer rate control flags.

Change-Id: I98b84cf13e18da769af6867af96a3257824e5c63
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-10 20:35:01 +08:00
Herman Chen
0a48d53d01 [hal]: Remove mpp_enc_refs
The encoder will get parameter directly from MppEncCfgSet. The
mpp_enc_refs is not needed any more.

Change-Id: Id8b466a905ae10335159bba3ce8d1e5185e3c714
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-10 20:25:16 +08:00
Ding Wei
7d05e33de8 [mpp]: add /dev/mpp_service support
Add a new ioctl mode for kernel-4.19 or later.
Tips:
    1. There will be only one device /dev/mpp_service in kernel.
       User should use client type to distinguish different device.
    2. Each codec use the same function as before.
    3. Ioctl magic changes from VPU_IOC to MPP_IOC.
    4. Update structure for ioctl argument.
	Original structure:
	    data_ptr | size
	In this mode has many sortcommings:
	a) Need many ioctl cmd for different requirements.
	b) Data_ptr not to differ library for 32 or 64 system.
	c) Contain only one info ioctl once.

    New data structure:
        cmd_type | flags | size | offset | data_ptr
    a) Cmd_type works like previous ioctl cmd.
    b) Flags is extend to mark current data for any purpose.
    c) Size is the same as before.
    d) Data_ptr use 32 bits build in 32 system while 64 bits in 64 system.

kernel-4.19 related commit:
ib94ac0df876dfcc786b25ed3de6a68d861d2ef1e
cda9d27c62017309519bcbf8fe91057dfdc21076

Change-Id: I13d54a2e4823b7378265f100540916a22f62b9d4
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-12-10 20:12:50 +08:00
Grey Li
a9d6b3a994 [mpp_dec_vproc]: Add iep deinterlace capacity judge
Add iep deinterlace capacity judge before process. If iep can't suppurt
I4O2 mode, we always choice I2O1 mode.

Change-Id: I97ba11c6de57b54ac2068f2c1f348ee83e8d001d
Signed-off-by: Grey Li <grey.li@rock-chips.com>
2019-11-29 19:49:08 +08:00
Herman Chen
5c1476f96d [hal_h264e]: Add hal_h264e_debug.h
Change-Id: I2dfc360d56399a71e23a5a2a237e162212cf83d1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-11-26 14:21:27 +08:00
Herman Chen
dd83ba3fb2 [vp9d]: Format code
Change-Id: I57483df0b1ca7c7e8fb9edf4b2fa22a1580efc01
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-11-26 11:05:36 +08:00