Commit Graph

220 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
2c7148f110 [meta]: Add MV_LIST meta for smartp
Change-Id: I7960eadef22220a4a895b88d8b09895f07e4d694
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-02-24 14:17:34 +08:00
Herman Chen
9f3ac0e7dd [mpp_frame]: Add more color format
Change-Id: Ibf66d81887addec859fb986382c8f1ae1a1dafe8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-01-19 18:02:52 +08:00
Herman Chen
9ce259355a [mpp_frame]: Add format check macro
Change-Id: I0b84cd55951dd5c085b1dd8b9926c4308ac24371
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-01-19 18:02:52 +08:00
sayon.chen
d39238c871 [h265e]: Add row_dealt_qp set for rkvenc mbrc
Change-Id: Ib0cd342f7b2c2060871d5f540f08b37574c89e31
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-01-07 09:55:20 +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
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
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
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
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
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
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
Chen Jinsen
1af542e405 [legacy]: vframe add vui info
Change-Id: I595e90cd46412a37440b9555f93fb8fa46d9d6dd
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Signed-off-by: Hery Xu <hery.xu@rock-chips.com>
2019-11-19 09:08:38 +08:00
Herman Chen
cdadaa9bba [h264e_pps]: Add h264e pps function
NOTE: Add scaling list mode flag to rk_venc_cmd.h

Change-Id: Idd3b33c577ce5ffd79dabc850f7c98a98c1ac19a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-11-18 19:45:10 +08:00
Herman Chen
a961ef5534 [venc_cmd]: Change gop ref cmd definition
1. Remove Hisilicon interface.
2. Add LTR configure.
3. Add temporal layer rate control interface.

Change-Id: I5172e69e828bdbe8e7f0cfc8ab0ca5a6b00d022a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-10-22 20:36:32 +08:00
Herman Chen
ea476ad4d1 [misc]: Change internal API interface
1. Change internal api RK_S32 cmd to MpiCmd.
2. Remove external MppEncCfgSet in MPI and move it internal data.

Change-Id: I0b93429f3b9f92712a57d0df54a1c76b3e08bf9d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-10-14 20:21:41 +08:00
Herman Chen
7782c8ea11 [enc_impl]: Add new interface for work flow change
Change-Id: Ic110aaf53964f532b59bbb0fbd6347c95accf324
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-20 16:59:15 +08:00
Herman Chen
dc79923e1d [mpp_frame]: Add set meta function to mpp_frame
Change-Id: I8b61b29d534d6d77f8be0bb2f033d7ba5e2a2496
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-17 09:07:29 +08:00
Herman Chen
2dfcb96976 [meta]: Add long-term reference index to meta data
This meta data is used for SVC/TSVC encoding / decoding.

Cases and meaning when using KEY_LONG_REF_IDX:

1. On decoder output frame
Represents the long-term reference frame index of the output frame.

2. On encoder input frame
Represents the long-term reference frame which should be used as
reference frame for current encoding frame.

3. On encoder output packet
Represetns the long-term reference frame index of the output packet.

Change-Id: I41dd2eb754b84cc0d8873f7dfbb695e31bc866ae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-12 08:52:15 +08:00
Herman Chen
66a26a7cf2 [rk_venc_cmd]: Change encoder interface
Add encoder misc config for later extension.

Change-Id: Ie67b2d5e74227e5089b16752d8088a9502142ddd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-27 10:37:01 +08:00
Herman Chen
d17861b67b [rk_mpi.h]: Separate rk_mpi_cmd.h into two headers
1. rk_mpi_cmd.h will contain cmd value only.
2. rk_venc_cmd.h will contain all the encoder command structure.
3. Move MppCtxType and MppCodingType to rk_type.h for better include
dependency.
4. Add MppEncRefCfg to MppEncCfgSet.
5. Remove rk_mpi.h dependency inside mpp.

Change-Id: I6b972738100fb60c0a6a9b7cfe0a012abf4205b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-26 10:09:23 +08:00
Hertz Wang
e4f3d1f8bf [common]: fix comment of MPP_FMT_YUV422SP(_VU)
yuv422sp should be nv16, but comment show nv24

Change-Id: Ifdc620e05addccfafe967817d876860ca92b84e5
Signed-off-by: Hertz Wang <wangh@rock-chips.com>
2019-06-25 20:48:00 +08:00
Jonas Karlman
24efdae140 [h265d]: export mastering display and content light metadata
Merged from
30ac9fb8b0

Change-Id: Id20e2f6fb511bd365493f1296ec9c9a2a46b4841
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-24 15:49:55 +08:00
Jonas Karlman
b00f32fd4c [h265d]: fix color range and colorspace metadata
Merged from
f85d62a7d9

Change-Id: I33ff292d3a484c4036900c58399f6c5e6e9c2faa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-24 15:37:21 +08:00
Jonas Karlman
d571f9c4f9 [m2vd]: export aspect ratio information
Merged from
30476f13ad

Change-Id: I2f5d9b77f703cb23a6b5720eb5966e1631600ac7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-24 15:26:53 +08:00
Herman Chen
ba2fab3018 [mpp_task]: Hide port and task queue from rk_mpi.h
Move MppPort and MppTaskQueue function to mpp_task_impl.h.
Add caller parameter to mpp_port_poll, mpp_port_dequeue,
mpp_port_enqueue, mpp_port_awake functions for debug purpose.

Change-Id: I39f69d934d45b65c3bc751d71ec98388c2fb9849
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-21 17:49:20 +08:00
Herman Chen
ab235fd62e [mpp_meta]: Add meta size interface
1. Add mpp_meta_size and mpp_meta_next_node function
2. Move mpp_meta_size and mpp_meta_next_node to mpp_meta_impl.h

mpp_meta_size      - Return node count in metadata.
mpp_meta_next_node - Return next MppMetaNode in metadata.

These two functions are useful in debug.

Change-Id: If0be59c4621fd8ba2e2dbe96124a653b397bac7c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-21 17:44:03 +08:00
Herman Chen
584d8565cd [meta]: Add key for temporal id
Temporal id is the temporal layer id for H.264 and H.265. It is
usefull for TSVC stream storage and frame display.

Users can determine their behave according to this id.

Change-Id: I06f039b63e0665d3542dc6bd89cc6b52d957af25
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 11:26:43 +08:00
Herman Chen
a5995e3aab [mpp_packet]: Add MppMeta to MppPacket
MppPacket will NOT create meta data by default. Then user and mpp can
attach or remove flexible parameter without adding or remove
interface which will break binary compatibility.

Change-Id: I2c2ff24f7e1c22adb7085a75a4c857e5760d2eae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 11:09:48 +08:00
Herman Chen
0ee116f416 [mpp_frame]: Add MppMeta to MppFrame
MppFrame will NOT create meta data by default. Then user and mpp can
attach or remove flexible parameter without adding or remove
interface which will break binary compatibility.

Change-Id: Ia3c0d15d6daa210deab7a7d5dffcb54303fbb73e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 11:09:48 +08:00
Herman Chen
cd9a1cca3f [misc]: Change interface header file dependency
Move MppCtx, MppParam, MppFrame, MppPacket, MppBuffer, MppBufferGroup,
MppTask and MppMeta to rk_type.h.

Later development need to bring in cross reference between these
objects. So we choose to move these declaration together.

Change-Id: I7ea39138ca87d6ca4cb86556464a5de89d172846
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-14 10:15:12 +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
a1ae919a33 [h264e]: Remove unused i_frame_packing
Change-Id: Ia53c2513bc57dde47960c06374d1c6d5fa729da7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:07 +08:00
hh
8f4199a0f4 [rga]: fix bug of rga config
1. Modify data type of rga_request to keep consistent with kernel
2. Modify error yuv fomrat translate and error yuv2rgb_mode config of rga

Change-Id: Iaee7b101f510c9d6f90aabe7d5ce2794b4502bf7
Signed-off-by: hh <hh@rock-chips.com>
2018-12-19 10:49:08 +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
0a78fb7102 [mpp]: Combine block control and timeout control
Use MppPollType as block control MPP_SET_INPUT_TIMEOUT and
MPP_SET_OUTPUT_TIMEOUT 's parameter.
Deprecate old block/block_timeout control.

Next step is to change MppPollType to RK_S64 for compatible in different
platform.

Change-Id: I02974f0b8eeb23ff43687448d6c3271ea7dd0a2c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 11:56:56 +08:00
Herman Chen
44f0ee0353 [mpp_dec]: Add post-process path to mpp_dec
1. Unify the hal thread output process to mpp_dec_put_frame
2. Add vproc path for field source.
3. Reserve one more buffer when deinterlace is enabled.
4. Default enable for normal mpp path but disable on vpuapi path for the
reason that rk_ffplayer has done deinterlace process internally.

Change-Id: I02e7cece844fde01c2d249dafe6f7ce6a325593f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:39 +08:00
Herman Chen
3ed61e06e1 [MppBuffer]: Add buffer group memory usage
Add mpp_buffer_group_usage function to return runtime buffer group
memory usage.

Change-Id: Ibb2893087e84b6d40de1b44accf45439b7ba925e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:14:41 +08:00
Rimon Xu
fb73f23f53 [alloctor]: add flags for alloctor
Each of the different alloctor has different alloctor modes,
such as allocating physical continuous memory, secure memory,
etc.

Change-Id: Ib032689f0cfd36b494843dcc176a22c6c9587b6a
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2018-05-07 17:34:34 +08:00
Ding Wei
44ad1558ec [vpu_api]: add command VPU_API_SET_IMMEDIATE_OUT
tips: this command is used to set decoded frame immediate out,
whehter is in display order or not.

Change-Id: I0b6b2c34fde722fe724019118c7af142b4b2e6f1
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 09:53:10 +08:00
Ding Wei
7716b36af8 [mpeg4][h263]: remove internal pts mode
tips: the timestamp in slice header is not useful, except for
calculate increment of dispaly frame. so, it cannot use to
dispaly, and remove it.

Change-Id: I748d553d40c4736e2f5ef98d8a8519fcc5e533e0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Ding Wei
2f5bd0bffb [mpp_dec]: add control to set present time order
tips: when input timestamp has not pts, and set pts=dts,
it should use input timestamp order for output.

Change-Id: I8b3ef9a8d150e5729a3fa94df6c1b448edb8f1fd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00