Commit Graph

1700 Commits

Author SHA1 Message Date
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
Johnson Ding
a711528671 [dec]: fix info_changed property setting error
After info_change is encountered by paser thread, HalDecTaskFlag will
have info_change flag set. Although mpp_dec_flush is called there may be
some frame still remaining in display queue and waiting to be output. So
these frames shouldn't have info_change set since their resolution and
bit depth are the same as before. What's more, the info_change flag has
nothing to do with frames need to be output.

Change-Id: Ia01d1ecca5a6deb1a5d2914c34147d5c46c21684
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-30 11:46:14 +08:00
Johnson Ding
07d8ec26d1 [h264d]: resize rkv CABAC table size to avoid useless memory
consumption.

Change-Id: I3b46d7f90e1638ae54825439f10f7b112f4dbba1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-24 15:03:27 +08:00
Johnson Ding
226d098207 [h264d]: fix start code parsing error
When there is [xx xx 00 00 03 01] 6 bytes data right after a start code in the
bitstream, parser will take [00 00 03 01] as start code. This is an error.

Change-Id: I7e530f77892c5316656588f6bbf634cfe4198859
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-17 15:25:43 +08:00
Herman Chen
6debebebce [osal]: Add large file support for drm allocator
Change-Id: I9bfe995935bca3419a8f75376af23a446b7eea03
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-05-16 15:02:07 +08:00
Herman Chen
9cea464859 [mpp_packet]: Fix missing pointer assignment
Change-Id: I75efe0731dd30b4e6aaa05e0c3700f8d71008325
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-05-16 14:38:22 +08:00
Herman Chen
c2e89f5010 [h264d]: Fix dpb stuck issue on decoding airplay
The no_output_of_prior_pics_flag flag in apple airplay stream is true.
This will cause dpb slot leak in idr_memory_management function.
The no_output_of_prior_pics_flag flag require the frame before IDR frame
should be discard rather than display. So we need to unmark the frames
in dpb and then mark them to be displayed to avoid they to be send to
display queue.

NOTE: when clearing no output frame we need to remove it first with
p_mark->out_flag is false to insure the CODEC_USE flag in mpp_buf_slot is
clear. Then set is_output flag to true to avoid real output this frame
to display queue.

Change-Id: Ib9bcebe6b84ceb96350bf405b9bed96e7fa0ca2e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-05-13 16:56:09 +08:00
Johnson Ding
eaa9840c1d [h264d]: Fix bit_depth configuration error in h264d_rkv
Change-Id: Ie045755feb0c13d0e4f53ea54c773953db338e35
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-09 17:00:30 +08:00
Herman Chen
75d0b29681 [misc]: Astyle format change
Change-Id: Ieec4152cc58faf1714bc752df7cb3c408ae9383a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-29 11:39:37 +08:00
Johnson Ding
da0f013bc6 [jpegd]: Fix vpu1 encoder problem
1. When the width of a input picture is not stride to 16, vpu1 will
encountered Page Fault problem.
2. Make hor_stride and ver_stride less ambiguous, since they
should be set to original values from outside configuration, not the result of
MPP_ALIGN from mpp inside, although they should be exactly equal.
3. Fix the caculation of xFill in vepu2, this should be divide by 4.

Change-Id: I3e6c394ff9c15a730714a0e5938d18ca83c24d09
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-24 10:45:37 +08:00
Herman Chen
3426e7b28e [hal_h264e]: Change hal_h264e debug flag
Change-Id: I6ace4915c1213f4c9c65678920a2ae863211c814
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-24 10:39:46 +08:00
Rimon Xu
a3116b8ce4 [ion]: scandir operation need to be protected by lock.
When multi thread calls scandir, crash may occur, so
the operation needs to be synchronized.

Change-Id: Idbdf539208259313d36c4acd17934af0e4dcf911
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-04-23 15:10:24 +08:00