xref: /rockchip-linux_mpp/doc/design/1.mpp_design.txt (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1MPP (Media Process Platform) design (2016.10.12)
2================================================================================
3
4The mpp is a middleware library for Rockchip SoC's cross platform media process.
5The main purpose of mpp is to provide very high performance, high flexibility
6and expansibility on multimedia (mainly video and image) process.
7
8The design target of mpp is to connect different Rockchip hardware kernel driver
9and different userspace application.
10
11Rockchip has two sets of hardware kernel driver.
12
13The first one is vcodec_service/vpu_service/mpp_service which is a high
14performance stateless frame base hardware kernel driver. This driver supports
15all available codecs that hardware can provide. This driver is used on Android/
16Linux.
17
18The second one is v4l2 driver which is developed for ChromeOS. It currently
19supports H.264/H.265/vp8/vp9. This driver is used on ChomeOS/Linux.
20
21Mpp plans to support serval userspace applications including OpenMax,
22gstreamer, libva.
23
24
25Feature explaination
26================================================================================
27
281. Cross Platform
29The target OS platform including Android, Linux, ChromeOS and windows.  Mpp uses
30cmake to compile on different platform.
31
322. High Performance
33Mpp supports sync / async interface to reduce the time blocked in interface. And
34mpp internally make hardware and software run parallelly. When hardware is
35running sofware will prepare next hardware task at the same time.
36
373. High Flexibility
38mpi (Media Process Interface) is easy to extend by different control function.
39The input/output element packet/frame/buffer is easy to extend different
40components.
41
42
43System Diagram
44================================================================================
45
46                +---------------------------------------+
47                |                                       |
48                |      OpenMax / gstreamer / libva      |
49                |                                       |
50                +---------------------------------------+
51
52            +-------------------- MPP ----------------------+
53            |                                               |
54            |   +-------------------------+    +--------+   |
55            |   |                         |    |        |   |
56            |   |        MPI / MPP        |    |        |   |
57            |   |   buffer queue manage   |    |        |   |
58            |   |                         |    |        |   |
59            |   +-------------------------+    |        |   |
60            |                                  |        |   |
61            |   +-------------------------+    |        |   |
62            |   |                         |    |        |   |
63            |   |          codec          |    |  OSAL  |   |
64            |   |    decoder / encoder    |    |        |   |
65            |   |                         |    |        |   |
66            |   +-------------------------+    |        |   |
67            |                                  |        |   |
68            |   +-----------+ +-----------+    |        |   |
69            |   |           | |           |    |        |   |
70            |   |  parser   | |    HAL    |    |        |   |
71            |   |  control  | |  reg_gen  |    |        |   |
72            |   |           | |           |    |        |   |
73            |   +-----------+ +-----------+    +--------|   |
74            |                                               |
75            +-------------------- MPP ----------------------+
76
77                +---------------------------------------+
78                |                                       |
79                |                kernel                 |
80                |       RK vcodec_service / v4l2        |
81                |                                       |
82                +---------------------------------------+
83
84Mpp is composed of four main sub-modules:
85
86OSAL (Operation System Abstraction Layer)
87This module shutters the differences between different operation systems and
88provide basic components including memory, time, thread, log and hardware memory
89allocator.
90
91MPI (Media Process Interface) / MPP
92This module is on charge of interaction with external user. Mpi layer has two
93ways for user. The simple way - User can use put/get packet/frame function set.
94The advanced way - User has to config MppTask and use dequeue/enqueue function
95set to communicate with mpp. MppTask can carry different meta data and complete
96complex work.
97
98Codec (encoder / decoder)
99This module implements the high efficiency internal work flow. The codec module
100provides a general call flow for different video format. Software process will
101be separated from hardware specified process. The software will communicate with
102hardware with a common task interface which combines the buffer information and
103codec specified infomation.
104
105Parser/Controller and hal (Hardware Abstraction Layer)
106This layer provides the implement function call of different video format and
107different hardware. For decoder parser provide the video stream parse function
108and output format related syntax structure to hal. The hal will translate the
109syntax structure to register set on different hardware. Current hal supports
110vcodec_service kernel driver and plan to support v4l2 driver later.
111
112
113