Commit Graph

1911 Commits

Author SHA1 Message Date
Herman Chen
5d6e5c857a [cmake]: Default enable drm on Android
Due to more platform using 4.4 kernel with drm we default enable
drm support on Android platform.

Change-Id: I4690d3d5f65a471b797d2474426836e6e357cf66
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-22 08:56:27 +08:00
james.lin
756d6df22d [h265d_parser]: decode rps and update dpb before alloc frame
Alloc_frame function is before mpp_hevc_frame_rps,
In the max order/ref num case, all dpb slots are used
before update rps. But alloc_frame fail first, could not
get a unused slots.

Change-Id: I08cb36004825cd2f99caf1f668b33c25e55c354c
Signed-off-by: james.lin <james.lin@rock-chips.com>
2017-12-21 15:04:05 +08:00
Herman Chen
0bfe09555d [misc]: Update ndk links
Update ndk links to r16

Change-Id: I157ad34ef3877a07cb1a7a88d3c76ebe2e9e518a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-20 17:10:16 +08:00
Herman Chen
b186d04390 [cmake]: Change to shorter RKPLATFORM macro
Change Android and Linux branches to use RKPLATFORM macro.
RKPLATFORM is shorter and it is not a cmake variable.

Change-Id: I09a6fe72e7dacedbb4b2b8e1a66b6f7ca625f019
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-19 19:46:36 +08:00
Jacob Chen
81759e832a [build]: correct install directory and generate pkgconfig for linux
Change-Id: Id4f6b2278ee0fe50ffc9806fffc5b01267f723db
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-12-19 10:51:24 +08:00
Herman Chen
0b71be06ee [mpp_buffer]: Fix mpp_buffer_test crash
1. mpp_buffer_test will crash on legacy buffer non-released. It is
fixed now.
2. Release misc buffer group if it is empty.

Change-Id: Ib8eae910b0167c952d0555389ad65db82a2dbbbf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-18 15:15:07 +08:00
Herman Chen
321b95ad4d [allocator]: Use auto detect on Android and Linux
There is case that Android 7.1+3.10 kernel without drm and also
Android 7.1+4.4 kernel with both drm and ion.
Use the runtime function to support both of them.

This patch needs more test.

Change-Id: I53f0a30abf057f8e0e6e122e09782896d4789168
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-18 15:15:07 +08:00
Herman Chen
7d29f32280 [osal]: Add runtime allocator detection function
Due to complexity of different kernel and usespace combination
we have to detect drm and ion allocator on runtime. The HAVE_DRM
flag may not be trust at all time. So we add a simple detection
function on first run.

Change-Id: Id4f6b2278ee0fe50ffc9806fffc5b01267f723da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-18 15:15:07 +08:00
Ding Wei
785b0f220d [cmake]: Partly merged Android and Linux branch
Use libmpp.so / libvpu.so on Android.
Use librockchip_mpp.so / librockchip_vpu.so

In early stage we use libmpp.so / libvpu.so on Android. later we found
it is better to use vendor name as library prefix. So we fix the name
rule on Linux platform.

But due to historical reason we can not change all sdk to use the same
name. So we choose to use this ugly method to define the name according
to different target platform.

Also we add version to library but Android has binary name issue so we
have to disable version on Android platform.

Change-Id: I785c3bc740f345e473f2d81c5cd2a4e32a1bf0bc
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-18 15:15:07 +08:00
Ding Wei
d7a6ef966b [h264d]: fix bug: fix width and heigth for check
tips: add check :not support frame when is smaller than 64x64

Change-Id: Ibe36dffe961919ec29cda3b4e8ed1f2dc8afdf30
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-12-15 11:57:20 +08:00
Jacob Chen
6c2e3abe05 [build]: debian: update configure
Change-Id: I785c3bc740f345e473f2d81c5cd2a4e32a1bf0bd
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-12-15 11:10:08 +08:00
Herman Chen
170581176e [script]: Update ndk link
Change-Id: I9935f31fa5cea6d08f0e13bbcda2c3f874b4674e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-15 10:04:53 +08:00
Ding Wei
9053b84011 [h264d]: add limit avoid dead loop
Change-Id: I75616801aba579c33d5348f357dbcc9e21250ba5
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-12-14 19:18:01 +08:00
sayon.chen
6c74d876a3 [rkv_enc]: VBR case add new ratecontrol
add AQ_ONLY quality ratecontrol for CVR
qp adjust according bit allocate,mb qp dealt adjust
accroding adaptive quant

Change-Id: Ia9a46e765646a88e2659f5fb19b94a0a5c667681
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2017-12-14 16:17:36 +08:00
Randy Li
84947e3998 [pkgconfig]: offer a sample for pkgconfig
The CMake could use this sample to generate the pkgconfig
files for target system.

Change-Id: I24c54533dc8f307b2e3748a2cce493a86cf274bc
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-14 12:50:37 +08:00
Randy Li
349b60410f [build]: add debian build rules
It offer the build rules for packaging the standard Debian
packages for Ubuntu and Debian.

Change-Id: If301a5698c17189e03ee508f6d609ea5d698fe87
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-14 12:50:10 +08:00
Randy Li
c7e7298b69 [meta]: add the missing meta data for encoder
Fixup for 6d0955c62f.

The encoder would use the KEY_OUTPUT_INTRA to indicate the
current frame is intra frame. The previous commit miss
this type.

Change-Id: Ib35a3d8d7038098bbae85c108f2cec5f030fb6e6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-14 08:38:19 +08:00
Herman Chen
c3d9f8dbb5 [legacy]: Fix legacy path release error
There is mismatch on flag transaction between vpu_open_context and
vpu_close_context. Open use reserve flag but close use ori_vpu flag.

This patch fix this error which will crash on exit.

Change-Id: I39b4425494d4fe3b16586806060477b28d37fe7a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-13 15:12:32 +08:00
timkingh.huang
f783fd9268 [jpege]: reset all registers before encoding
Change-Id: I09e280ba8aa18830c5c626178cc38ae2fa45610c
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-12-13 11:45:31 +08:00
sliver.chen
3f6fc99b81 [test]: modify sleep time to improve the decoding effciency
it is obvious.

Change-Id: I9ce91996ff6cebad01297281a6a0f3e5632680e5
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-12-12 20:46:48 +08:00
Randy Li
45c05512eb [jpegd]: stop the future work when the parser is error
It is not necessary to allocate or decode an error input
source.

Change-Id: I81075a6ea696d2699ec595a02cdcd5163736d27c
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-12 17:35:09 +08:00
Randy Li
97907dc549 [osal]: add rk3036 platform
Change-Id: I82029e8345d3c8e2a9a3baf4be55b7f4c9b284f0
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-12-01 14:07:53 +08:00
sayon.chen
a2a69b9a68 [rkvenc]: rate control no consider sei length
1. sei length no consider in rate control
2. reorder the sei messege print

Change-Id: If84b009eab5c9d228379fa802185870a407881aa
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2017-11-30 14:25:19 +08:00
Randy Li
50bdc4de6a [mpp]: turn off a lots of message
I think those information are very anxious and useless
in daily usage.

Change-Id: I946418a476a332588b1d9b9722bbd5e93213e8dc
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-30 11:32:17 +08:00
Randy Li
b4358193a5 [mpp/hal/vp8d]: fix the missing DCT stream register
I skipped a register at VDPU1, making some videos mess.
The hardware can still decode those video without error
report, we can still see something from the output image
with the mosaic everywhere.

Change-Id: I30aa9e2a36a84769667bc2f0f5930c579064af60
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-30 11:19:48 +08:00
Randy Li
6d0955c62f [meta]: add the missing meta data
The encoder would use the KEY_OUTPUT_INTRA to indicate
the current frame is intra frame.

And the decoder would use the new added KEY_HDR_INFO key
to store the HDR data.

Change-Id: I150a993906f43792474ac5aa02a1e5441fb21e8f
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-24 17:08:56 +08:00
timkingh.huang
47da174ef9 [h264e]: refactor hal_h264e_rkv.c
*dpb.c   : dpb management
*stream.c: encapsulation of stream
*utils.c : functions of h.264 encoder such as osd, roi
*nal.c   : NALs such as sps, pps, sei

Change-Id: I7b947795b94c2f02fd5fe0e7ddd39f45d6c22214
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-11-24 11:31:52 +08:00
Randy Li
687c940566 [hal]: [h265d]: fix the map for the performace monitor
Refer to the latest documents, there are few registers
between the registers for the HEVC and performance monitor,
which are used for the other format.

Change-Id: I85b5db28f9168c8fedc4abdd746f4d12b24fa71b
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-22 19:06:58 +08:00
Ding Wei
f391bd9ea4 [vpu_api]: modify interface to get stride when buffer malloc
1. remove vpu_api_get_format interface.
2. rename vpu_api improper name.

Change-Id: I8986b989ab352972f8f03fb1d3c35447bf3eda47
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-11-22 10:07:04 +08:00
dawnming.huang
2be5b37af5 [avsd] fix avs seek eos error
Change-Id: I71aaa584d8a986041e12a0f23f7a0a8a44c45376
Signed-off-by: dawnming.huang <dawnming.huang@rock-chips.com>
2017-11-22 10:06:03 +08:00
sliver.chen
eaf94fbe5f [osd]: add err info when user try to cfg osd in vpu1 and vpu2
vpu1 and vpu2 don't support osd,add info to describe it.

Change-Id: Ie6da9d4df9086abbe691e001e5b1a6029556e14e
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-11-21 15:39:10 +08:00
Randy Li
c157afe9db [mpp_list]: release the blocked thread at reset
The applcatiion thread is still blocking on the output port.

Change-Id: I4693125362a250e5d2f28af8226d608b3040f138
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-20 14:34:44 +08:00
Randy Li
5de9a6e299 [mpp]: use the blokcing queue on the input
The MppQueue offers an atomic signal mechanism on
the pending data. It could solve the the async problem
with parser thread and input data.

Change-Id: I8201640b28b1d2b4d2186e1bcfbf018bf8f97d32
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-20 11:55:51 +08:00
Randy Li
6e471a0d14 [osal]: add queue data type
Only the src port supports blocking operation. Please
notice the sink port is neither block nor atomic.

Change-Id: Ib710eaca9fe1b5d5aada8e56481102589b52fc52
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-20 11:54:58 +08:00
timkingh.huang
75e8a51b7d [h264e]: rate control for all intra stream
When gop length is 1, that is all intra stream, R-Q model for
I-P-P-P stream is also appropriate. Just adopt it. That will
make bit rate more accurate.

Change-Id: Ia2fdcf5276d29297e3078c88a82c98c6917a563e
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-11-17 10:03:38 +08:00
sliver.chen
5a830697a8 [osal]: force mpp use drm buffer when HAVE_DRM are defined.
Force allocator use drm buffer,otherwise user will get a tuntime error
when they use kernel without /dev/ion.

Change-Id: I8151b743a9b19a03716dec3bdb909ce91b6af0b6
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-11-08 17:13:36 +08:00
sliver.chen
b625ced0af [test]: add err info check when decode
mpp will output error yuv data when process error input stream.
We should check it and discard those error frame to avoid display error.

Change-Id: I04423b5fad13e727594b06c217f491227e465fce
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-11-08 11:22:01 +08:00
Herman Chen
ca06ce98c1 [hal_vp9d]: Fix buffer alignment conflict
In order to optimize vp9 decoder performance rkv vp9 decoder need 255
odd align buffer. But hal_vp9d has a confict on internal setting and
SET_FRAME_INFO feedback.
This patch fix the confict by using same align function.

Change-Id: I22b17602a28d2267a3e19d2c840aa32517925514
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-11-07 10:40:42 +08:00
Randy Li
c56a9365f6 [ion]: file descriptor for the external buffer
The imported buffer may be released from its origin allocator,
I would suggest to use the new file descriptor from new ion
handle.

The ion only has map_user() to export buffer to userspace,
There is no unmap_user() because the mapping is represented as
a file descriptor in user space. The closing of that file
descriptor will cause the memory to be unmapped from
the calling process.

Change-Id: Ief855aab11793238b40b73da92af853ca3b58349
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: ayaka <ayaka@soulik.info>
2017-11-02 17:55:23 +08:00
sayon.chen
167c7dd9cf [rkvenc] modfiy ratecontrol to be more smooth
1. use max min qp to limit qp range
2. open aq mode used adaptive aq prop according inter.p
3. open frame ratecontrol on re-encoding
4. modify bits_per_intra equal ctx->bits_per_pic * 3
5. limit target_bit larger then zero

Change-Id: I71c5b2747ba4e89b5121093a7b110a2a8af20e02
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2017-11-02 08:43:25 +08:00
Herman Chen
ba4b1db7ce [ioctl]: Add compatible patch for different kernel
New kernel use u32 as a fix length ioctl parameter then mpp should keep
compatible to all kernel driver case.

Change-Id: I73afe00971d7b73d6c4695254bc5fdf82422b1f5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-11-01 17:23:13 +08:00
sliver.chen
c3ea5ba258 [h264e]: fix h264 xrgb encode bug
add missing judgement for MPP_FMT_ARGB8888,it will lead to mpp thread stuck and
make kernel occur mmu page fault at addr 0x0.

Change-Id: Iab0db3c9de5c8a17be55bec5fb87840707b440c3
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2017-11-01 14:47:43 +08:00
timkingh.huang
738704e6a2 [jpegd]: just scan parts of markers for rv1108
This can reduce CPU's occupancy, which will result in a problem
that jpeg parser can not judge if input stream is integrated.
Fortunately it doesn't matter for most of cases.

Change-Id: I77d59dc1642f0967e75ba9d15741eeb24789f87c
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-10-31 11:28:26 +08:00
Randy Li
e0a1d6579d [drm]: use mmap() in native way for GNU Linux target
The "[drm]: fix runtime error for 32bit library" is hack way,
it won't work at GNU Linux platform. Also you need to check
_FILE_OFFSET_BITS and _LARGEFILE64_SOURCE before use the
mmap64().

For the normal mmap() with glibc, we only request to
check offset is aligned with page size but not the lenght.
But that doesn't apply for the memory from the drm device,
also the android use a different rule.

I decide not to map all the buffer to cpu at beginning
since most of them won't be access by the cpu.

Change-Id: I74ac7b5b63d45029cae076985a3d0b4526c62bbc
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-10-27 10:06:20 +08:00
Randy Li
8083d5ca60 [drm]: fix a various of bugs in drm allocator
1. The wrong size information;
2. Release the drm buffer when the life of the buffer is ended.

Change-Id: I8a17bf807609dfa940545f2391a62bd0a4f51670
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-10-27 10:05:55 +08:00
Randy Li
070056d842 h264e: add supporting for more input pixel format
It will make most of the pixel formats work well.

Change-Id: I3b4d66c012d74163ce3d4ffcf50f29fb588a2824
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-10-27 10:05:19 +08:00
leo.ding
435d6883af [vp9d]: fix error: opening device should close, when deinit
Change-Id: I6c6c35fcfddfdfd7b29f82b5b78db72847eda595
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-10-26 20:25:03 +08:00
Randy Li
c89b4727c7 [mpp_frame]: add complex formats and more comments
A few comments for the pixel formats are not correct,
also without the mapping to the common name comparing
to the Gstreamer or V4L2.

Both VPU and RKV supports tile format, so I add a new
type to store those pixel formats with a complex layout.

The VDPU does NOT semi-planarity pixel formats and
other than 8x4 marcoblock size for the tile format.

Change-Id: I9abea54a563eafe6902f5cf5e25e741a809f41b0
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-10-12 09:01:27 +08:00
leo.ding
e54fafe8cb [vpu_api]: add vpuCodecContext parameters
a) mpp_mode: if have rkv, can set it 1 to use rkv decoder
b) bit_depth: for calculate stride
c) yuv_format: for setting multiplication coefficient when malloc

Change-Id: Id7c32c7cac17d3c9007a0674979c2b73769ae44f
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-10-11 09:58:01 +08:00
Herman Chen
68d22d8fec [base]: Disable default print on exit
Use finalizing flag to disable print on MppBufferService destroy.

Change-Id: I8f17a6b8ed77101cf4f240dad05f8e886968c3c6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-10-10 14:19:15 +08:00