Commit Graph

2084 Commits

Author SHA1 Message Date
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
Johnson Ding
c853e6e0ec [vp8e]: Fix vp8e SEGV_MAPPER error in 64-bits environment
Change-Id: I0116f1e9720c7faba35527368884eec75997b56f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-23 09:31:42 +08:00
Herman Chen
131e76f7af [h264e]: Rename h264e_stream module function
Change-Id: I41d3904b1e315aa090be3d24d20e8ca726acd99c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:08 +08:00
Herman Chen
ef9d577baf [h264e]: Separate h264 encoder stream writing
Separate h264 encoder stream writing to a new module.

Change-Id: Ibf55a20ac73e4eb2e3a3d744573eded3ebd92662
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:08 +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
Johnson Ding
90b2a3838c [vpu]: Fix encoder's improper operation with eos
When encoder receives an empty frame with eos flag set, encoder will
encode an unreasonable extra frame.

Change-Id: I3bd1a2c84780f1b6212171117b67319b2f613b9f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-12 09:52:02 +08:00
Johnson Ding
869ff44980 [jpegd]: Fix jpegd decode error when img without DHT
That is a coding mistake.
See issue: https://redmine.rockchip.com.cn/issues/201155
In the attachments, the "cam.jpg" is a jpeg file without DHT. And it can
be used for testing.

Change-Id: I68086a19958b353d5aee6597b47ee9ac8b02c4d0
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-11 11:37:10 +08:00
Herman Chen
557a24810a [jpegd]: Fix dec_pp mode error
Jpeg decoder with format conversion will use dec_pp mode. On this case The
sw_dec_out_dis flag need to be set in jpegd_setup_pp function. But this
flag is clear in later jpegd_gen_regs again which will lead to failure
on dec_pp mode jpeg decoding.

This fix move jpegd_setup_pp into the end of jpegd_gen_regs.

Change-Id: I6604d9593ec72ac58ad8a1757c6655bedc6b92fe
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-11 11:31:30 +08:00
Herman Chen
ef5c4bc192 [mpp]: Merge notify flag
Merge nofity flag on info change.

Change-Id: Ia46f6de4e4a0f74ab7ef30f0d630ddc48e868cd9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-02 18:05:06 +08:00
Rimon Xu
35019b7d37 [mpp_dec]: Add wait condition with buffer mismatch.
When the buffer does not match, frame group needs to modify
the buffer size before it can be used properly, so it needs
to wake up the wait.dec_buf_match condition after info changed
ready.

Change-Id: I3ef7b2bf59d7649cf0e05731a2e51f40fd082535
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-04-01 11:37:55 +08:00
Rimon Xu
1e7e0faf2d [h264d]: fix sps level invail force to dpb size error.
Change-Id: I0a87ae6f16a3d7254eea8808ec89ac9bfb718db4
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-03-25 14:42:57 +08:00
Herman Chen
fecf31621c [vproc]: Add iep open check to avoid noisy log
Change-Id: I2d2aa49ce4ba9fe2b80dd72b60c286ffd2115195
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-03-19 16:00:07 +08:00
sliver.chen
2dc830f071 [vp8e]: add vpu1 and vpu2 vp8e supprt.
commit a base version of vp8 encoder,include vpu1 and vpu2.
encode input raw picture to ivf stream.

Change-Id: I9ac697edf2249a4ca7464fdbfb5fd22a63fd3c34
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-02-01 18:26:26 +08:00
Herman Chen
056e17df92 [hal_jpegd]: Improve address setup
1. Use mpp_device_patch_add to setup address offset patch
2. Disable slot size check in mpp_dec

Change-Id: Id3c8d94b793cf126040f627c5c67ed0390f0ac86
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-21 09:56:13 +08:00
Herman Chen
095f77b748 [hal_jpege_vepu]: Fix output stream length error
Vepu will return stream write length in 64 bit unit from input aligned
address. So final output length should count from 64 aligned sofeware
header address. Otherwise there will be extra gabage data at the end of
output stream.

Change-Id: Ic96a2bf6599f023a5c13b5f3acf219c231ac3327
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-21 09:56:13 +08:00
Herman Chen
f367af4a37 [utils]: Add YUV420P dump frame support
Change-Id: I0a63b03ab1bb5fb5fdcf52eadc2bde52319d155b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-15 15:33:51 +08:00
Herman Chen
b2d1f805dd [hal_h264d_vdpu1]: Fix handwriting error
Change-Id: Icd837f075d75efe822e88b4c533711ada3c2821e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-15 10:22:29 +08:00