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>
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>
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>
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>
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>
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>
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>
tips: add check :not support frame when is smaller than 64x64
Change-Id: Ibe36dffe961919ec29cda3b4e8ed1f2dc8afdf30
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
*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>
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>
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>
The applcatiion thread is still blocking on the output port.
Change-Id: I4693125362a250e5d2f28af8226d608b3040f138
Signed-off-by: Randy Li <randy.li@rock-chips.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Use finalizing flag to disable print on MppBufferService destroy.
Change-Id: I8f17a6b8ed77101cf4f240dad05f8e886968c3c6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>