Commit Graph

1911 Commits

Author SHA1 Message Date
Herman Chen
498a43aa2e [mpp_enc]: Add MppEncImpl layer
Change-Id: If9a63606c2ec4a1f96e422a06681cf8a11ec4c7b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-19 17:46:58 +08:00
Herman Chen
14076644ea [mpp_dec]: Add MppDecImpl layer
Add MppDecImpl layer for separate encoder and decoder.

Change-Id: I02e04acddf617ae5188572af89312ab20fbf21b6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-19 14:54:24 +08:00
Herman Chen
9ee20c594a [mpp]: Clean up header
Remove extra mpp_dec.h and mpp_enc.h for later modification.

Change-Id: I43c0e1c4ca0cf36070887556b1cd9d428f167090
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-19 11:40:59 +08:00
Ding Wei
5526523736 h264d: add svc and prefix nal parse
Change-Id: If04c3a506e54130f257ac507c15eadc1182d8f0d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-09-18 15:03:24 +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
359881f819 [base]: increase meta data ref_count on copy
When copy MppFrame or MppPacket increase its meta data reference count.

Change-Id: I72879edbc4e20fbf831e9a013b6c012f4bb1c2dd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-12 15:17:40 +08:00
Herman Chen
9afb1d2e04 [meta]: Add reference counter to MppMeta
For the requirement of transporting MppMeta between different thread add
reference counter and inc_ref interface to MppMeta functions.

Change-Id: I9e355b66b6de933c2499713e1a2406149fa7e0e8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-12 15:17:17 +08:00
Herman Chen
16d69714d7 [hal_task]: Add frame and packet to HalEncTask
Add frame and packet to HalEncTask for meta data transaction.

Change-Id: Ife81442d472baee6d50e2c5f1c602e96db3beb4b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-12 08:52:15 +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
syzby
451ae59386 [cmake]: Fix aarch linux cmake compile error
Change CMAKE_SYSTEM_PROCESSOR from armv8 to armv8-a

Change-Id: I4e0021a44b933813d336383b5363170ecf2b7027
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-05 17:17:49 +08:00
Ding Wei
8ca9d3cec7 [m2vd]: fix bug: correct interlace paramters.
Change-Id: Iea9f99747fe4a117f6b3f28f503287947aa65f9f
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-09-04 10:33:12 +08:00
Herman Chen
b165fcd4b0 [mpp_enc]: Change encoder work thread flow
1. Add wait and status flag for encoder
2. Add notify for encoder
3. Use wait and notify for encoder task handling.

Change-Id: I6ce0f676084f7c27cc95d6abc56557bfa286ef87
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-03 09:08:17 +08:00
Ding Wei
60c82d6d7b [mpp]: add dump function for nv12 10bit to 8bit
tips: when dump 10bit yuv, change it to 8bit, and write out.

Change-Id: I710399d61056e32d68c3f6f9d6ff209d73f6b904
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-08-29 16:10:50 +08:00
Ding Wei
11f4844482 [h265d]: fix bug: hor_stride mismatch
tips: hor_stride value sett mismatch between parser and hal.

Change-Id: Ia8b9ab660c1a5f29ad71ccba418bb629f1487ef2
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-08-29 11:09:45 +08:00
Ding Wei
d499d95128 [h264d]: add svc extension syntax
Change-Id: Ia2ed3553802e62b507809db15a593bd072d1aece
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-08-27 16:02:07 +08:00
Ding Wei
5fa1da887d [h264d]: when level_idc missing, use max_num_ref instead
Change-Id: I5652f0b2ea3be010aab26be057d7c09b2c44aa8e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-08-27 10:30:51 +08:00
Herman Chen
0a7e306cd1 [cmake]: Add make path detection
Higher cmaker version require CMAKE_MAKE_PROGRAM parameter.

Change-Id: I4ed9f4ef1592f5683ec0f9a3679840bf6dfb0d2d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-21 09:35:28 +08:00
Herman Chen
796bfb0a97 [tools]: Update pre-commit hook
Set pre-commit hook to detect changes on staged file.

Change-Id: I041a82577263abcdfffc146b5aaba1d0a51def76
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-20 11:23:27 +08:00
Herman Chen
bbbc9afd5e [test]: Fix error on mpp_thread_test
Change-Id: Id9f0bc58e72256f27cab6bc7fb39d441803a2bfb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-20 10:58:59 +08:00
Herman Chen
666782b834 [mpp_list]: Add fifo function to mpp_list
Add fifo access function to mpp_list class.
NOTE: The interface is different and node contain RK_S32 size data
before real data.

Change-Id: I8875312a7a6247b71be7df71044d2b779c228b0a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-19 15:02:13 +08:00
Herman Chen
003f8806af [vproc]: Pass HalTask between hal and vproc
Use HalTask to communicate between hal thread and vproc thread.

Change-Id: I4e87b7ca63bdf86e46045e31296ffa69958ae719
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-19 15:02:13 +08:00
Herman Chen
05bba59fa9 [hal_task]: Change hal task to a general task
Hal task will be changed to a more general task between mpp components.

Change-Id: I8ed46da8d02f530cddcdc785f6f6b3778afac5b9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-19 14:56:13 +08:00
Rimon Xu
454f065572 [h264d]: fix cts security patch: cve_2017_0765
When nal buf len is 0, nal buf shouldn't be read.

Change-Id: Id8326081d40bbf5c2109c2ff0fa9c2636583f9ac
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-08-14 18:06:43 +08:00
Ding Wei
a57fd68ccc [vdpu2]: fix bug: set ref list
tips: listp list0 list1 should reoder by paired when field mode.

Change-Id: Ia1177c95e9d8fdc90293ddf8b16058592d2e0b15
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-08-12 11:05:00 +08:00
Hertz Wang
38eaa92f63 [jpegd_parser]: skip unhandled jpeg section
Change-Id: I621a4f09a49d886b7db13324ef1fe69952986567
Signed-off-by: Hertz Wang <wangh@rock-chips.com>
2019-07-30 02:34:51 +00:00
Johnson Ding
3d35398706 [jpege]: Fix jpeg encoder stride problem
Change-Id: Ibf29cca121d48aa1fb3774280fd7fff0c93f1de1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-07-11 09:33:40 +08:00
Herman Chen
168188163e [h264e_dpb]: Fix memory leak
Fix MppEncFrmRefInfo memory leak when pointer info has been changed.

Change-Id: Ieccdac1236f5506743b9f5b60382f3ccaff1dc28
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-07-10 17:05:42 +08:00
Johnson Ding
7e13df0813 [jpegd]: Fix paser error
After pasering SOF makers and DQT, DHT etc, buffer pointer should point
to the position after what has been read. Otherwise, paser will be
finding markers right after the last marker. And may lead to take datas
in DHT or DQT as markers.

Refer to this issue: https://redmine.rockchip.com.cn/issues/212649

Change-Id: Ie4edc8ab43aeedf1678894a9968a1254ca10ac50
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-07-10 10:51:18 +08:00
Johnson Ding
662b64c4ee [vp8d]: Fix assigning wrong DCT address problem
Refer to this issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=979091

Change-Id: I6d99f1f6444f93ea51a6a8827e8c8fb5cff54e5e
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-07-08 17:04:23 +08:00
Herman Chen
11ac01351a [misc]: Fix compile warning on NDK r16b
Change-Id: I1c1f1137fbbb7875d48cee1b6c17aa1d4c6f0863
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-07-03 15:50:35 +08:00
Johnson Ding
031ec1f546 [jpegd]: Fix UV data is cut out on odd height case
A picture vertical stride should align with 16. But in jpeg decoding
picture is dividing into 8x8 blocks. So hardware decoder is designed to
keep the original data rather than cut out redundant data. If more than 7
is need to fill into the height of a picture when aligning the height
with 16, there will be an extra line of 8x8 blocks which do not contain
any information of the original picture. In this case jpeg_height8_flag
should be enabled to tell hardware to cut out them. In other case,
don't. Otherewise there will be a 8 pixels-height green bar in the
bottom of the picture after decoding.

Change-Id: Ic042eb0b6deccb6fc3727d7a288b4cd4efd8320d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-07-03 10:51:35 +08:00
Herman Chen
671b3e0f00 [hal_common_h264e]: Add slice and dpb function
1. Add slice function for hardware slice header modification
2. Add dpb function for hierarchy infomation parsing and list building
3. Due to these two patches are so closely related we need to make it
   one commit.

Detailed changes:
1. Change poc type to 0
2. Add lsb writing
3. Add non-reference frame support and frame_num change
4. Add longterm support
5. Add multi longterm frame support
6. Add bit shift and 03 process

Change-Id: I70f6fa550a5d19069ec9b21c3d9ee1875ffbe59e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-27 10:37:01 +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
bdcd66b9c4 [mpp_enc]: Add reference hierarchy config
Change-Id: I44a8e1f158db8cfce745b352575af738dea112e8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-26 10:10:14 +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
Jonas Karlman
ea1ee9f489 [h264d]: fix mpp_buf_slot_get_prop crash
Merged from
9d24b076db

Change-Id: I491dc7b653d81a737aa2fd49c3866e26dfcd51de
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-24 15:16:33 +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
f3072a3d44 [h264e_stream]: init function accept external buff
Change-Id: Ia2d36a0d9dc10a196eab20d94c5063da47c66c1b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-18 08:57:43 +08:00
Johnson Ding
66b140eed8 [h264d]: Fix unused parameter warning
Change-Id: Icf5233a95b3715bb4c7f61eb6f0961fe4d7da451
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-06-14 18:35:39 +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
Hertz Wang
b3a34b84db [hal_h264e_vepu]: ignore cmd MPP_ENC_PRE_ALLOC_BUFF
Change-Id: I3ed69ea6f9b7cd5963704d79a8d739379cf3df7e
Signed-off-by: Hertz Wang <wangh@rock-chips.com>
2019-06-12 11:24:19 +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