Commit Graph

1737 Commits

Author SHA1 Message Date
Herman Chen
74ac0dfc08 [iep]: Add IEP api and unit test
IEP (Image Enhance Processor) is a hardware for image process. It can
provide ability of deinterlace and color enhancement.

Use ini file to config iep function. Sample config iep_dei.cfg is
attached. Test command is listed below:

iep_test -w 720 -h 480 -c yuv420p -f /sdcard/soccer_720x480_30fps.yuv -W
720 -H 480 -c yuv420sp -F /sdcard/output.yuv -m deinterlace -x
/sdcard/iep_dei.cfg

Source code is based on libiep.so

Change-Id: I765837f88a2fd26abf535db71d21c484dd22d2bd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-07 17:55:23 +08:00
Rimon Xu
fb73f23f53 [alloctor]: add flags for alloctor
Each of the different alloctor has different alloctor modes,
such as allocating physical continuous memory, secure memory,
etc.

Change-Id: Ib032689f0cfd36b494843dcc176a22c6c9587b6a
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2018-05-07 17:34:34 +08:00
Ding Wei
4863d54ff3 [mpp/test]: remove some module test file
Change-Id: I482f55c6120d706ff123b116b5ace4f30776f7a6
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-04 10:00:28 +08:00
Ding Wei
8df4ab798a [hal_apil][parser_api]: use .member type to set static api
Change-Id: Ibe7b053e1571873e32c5978f82af1fdf20ff8be8
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 18:14:29 +08:00
Rimon Xu
ed620a310b [mpp_device]: move dev_fd in mppDevCtx
In order to separate the hardware and decoding protocols
more clearly, all API must be implemented in context.

Change-Id: I9f8128c5399149699b2e0a03bfa72ff902c25b87
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 16:52:41 +08:00
Herman Chen
a1d76b96ce [h263d]: Add error check for h263 decoder
Hardware only support baseline H.263 stream. The stream with
mv_outside_frame flag will be blocky if force hardware decoding.

So we do not use hardware to decode this kind of stream.

Change-Id: I679f37c1d7f248f89b2338a887d4a1e2dea68bf2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-03 16:24:03 +08:00
james.lin
bbc3cfe7a9 [mpp_platform]: add rk3128h support
Change-Id: I9d14872ab1537f9aa23c747f4b3319a284c88c81
Signed-off-by: james.lin <james.lin@rock-chips.com>
2018-05-03 16:02:53 +08:00
Ding Wei
3f9d60aa7c [h264d]: updated appropriate function name
Change-Id: I84c93d414fdcfc350454b33ba9ce051d82dd60dc
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 09:53:10 +08:00
Ding Wei
d3e0413394 [h264d]: fix bug: when is avcC, it should break out parse
Change-Id: Icefc87f468e1e1efa78034294215d8e128d27be6
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 09:53:10 +08:00
Ding Wei
44ad1558ec [vpu_api]: add command VPU_API_SET_IMMEDIATE_OUT
tips: this command is used to set decoded frame immediate out,
whehter is in display order or not.

Change-Id: I0b6b2c34fde722fe724019118c7af142b4b2e6f1
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 09:53:10 +08:00
Herman Chen
aeb361fb3a [cmake]: Remove static library VISIBILITY setting
When cmake upgrade to 3.5.1 it will generate warning when set
C_VISIBILITY / CXX_VISIBILITY to static library.
So we remove static library visibility setting.

Change-Id: I774597a92f5aa4a64677a32f0a642c442092ebaf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-28 11:29:53 +08:00
Ding Wei
7716b36af8 [mpeg4][h263]: remove internal pts mode
tips: the timestamp in slice header is not useful, except for
calculate increment of dispaly frame. so, it cannot use to
dispaly, and remove it.

Change-Id: I748d553d40c4736e2f5ef98d8a8519fcc5e533e0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Ding Wei
2f5bd0bffb [mpp_dec]: add control to set present time order
tips: when input timestamp has not pts, and set pts=dts,
it should use input timestamp order for output.

Change-Id: I8b3ef9a8d150e5729a3fa94df6c1b448edb8f1fd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Ding Wei
38d51610f1 [vp9d]: add errorinfo marking
1. dicard stream when has not got keyframe.
2. when frame is not intra, check the errinfo flag for refs.
3. when hard return is not ready, mark errinfo.
4. when reset setting, discard the frame remainng.

Change-Id: Idd03a8476e76875176475167ca5890e247f75ee3
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Ding Wei
7c4c3538a6 [m2vd]: fix bug: fix value overflow when caculate
tips: use 64bit instead of 32bit for time, then
caculate will be used to 64 bits.otherwise, it will
be overflow in any case.

Change-Id: Ibc6c2cf47c409a47a1877f96995ccebc979574f9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Randy Li
a78598dab5 [osal]: add new buffer type for DMA import buffer
This buffer type is used for the buffer coming from the
application, the application should make sure those
buffers are the dma buffer.

Change-Id: I2c8491f4dea77e5d7ae8d9157b0a1eda204f4bd6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Randy Li
35cb04f7bb [inc]: add error define for operation not permitted
Operation not permitted, it also means that this operation
is not implemented.

Change-Id: I752efb3f5a697125f334f6fdf8bd58fea94a7024
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Randy Li
86c5f925cd [alloactor]: fix some minior errors
1. fix the header protection
2. the incorrect offset in ion memory mapping
3. the commentment of the buffer type in a header file

Change-Id: If9d1db90d41131750a341ab6177f947f7b966317
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Herman Chen
166ddee9e0 [utils]: Add iniparser for ini file parsing
Source from https://github.com/ndevilla/iniparser
With MIT License:
https://github.com/ndevilla/iniparser/blob/master/LICENSE

NOTE: remove getdouble interface due to Android do not support atof.

Change-Id: I6b10f67875144bc0c36182c07024c133aa6987a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-27 17:20:32 +08:00
Ding Wei
6b6c1ae033 [utils]: for avoiding c++ keywrod, rename xor to vor
Change-Id: I6d2f604b33373932ba4df9affa253764e99bae13
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:32 +08:00
Herman Chen
f899f6ef56 [jpeg]: Accept 8K width and height for JPEG dec
JPEG VDPU can support 8K image decoding. So we can change the limit on
hal header file.

Change-Id: Icd744300b391be0fb6387215252145c945caf488
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-27 17:20:32 +08:00
Herman Chen
4e030fa170 [test]: Move some function to utils
Move yuv read function and yuv create function to utils.

Change-Id: I79a861ce869c182a27ed51a976eeb08f1f230d6e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-27 17:20:24 +08:00
Herman Chen
68e49f835c [legacy]: Get vpu_api_debug in early stage
When open vpu_api context we need to get it earlier.

Change-Id: I10ee57df5d746dfe5b655fd2299a782e54e6dd3f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-08 14:38:21 +08:00
Herman Chen
195ac89557 [legacy]: Add vendor lib path for Android 8.0
On Android 8.0 librk_vpuapi.so is under /vendor/lib. We need to add it.
And for debugging case there may be multiple library in system so we had
better to print librk_vpuapi.so path.

Change-Id: Ic85c594d41da723cf8528d06e93c4643de048a99
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-03 17:57:43 +08:00
Herman Chen
77f33cbcb4 [test]: Add delay calculation on performance test
Change-Id: Idc058e900c46ebce406ff0739d6e73e4e78b3cd8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-03 15:25:18 +08:00
Herman Chen
3b4c3eaf2f [mpp]: Add temporally patch for blocking issue
There is a bug of stucking on decoder parser thread:
When decoder parser thread is block by info change and enter waiting.
There is no way to wake up parser thread to continue decoding.
The put_packet only signal sem on packets. May be it better to use
sem on info change too.

Change-Id: I3a3c45629a55d438ae9fee1968db27a94bafb20d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-02 10:11:49 +08:00
Ding Wei
19e2b0f748 [h265d]: fixed bug: set register using align function
tips: 16 align input buffer commit case.
when calculate stride for register, used picture height.
when height is 1080 while ver_stride align 16, then is not matching.

Change-Id: I47dae884ed0eaf7328314daa6a6cb5940359ee91
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-02 10:11:27 +08:00
Herman Chen
ca57f9d31e [legacy]: Use rkvdec default on RK3399
RK3399 has powerfull rkvdec. There is no need to save power on
multi-instance decoding case.

Change-Id: I454594c68a1d620451e36ee4cf46f81404857de3
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-31 20:28:09 +08:00
Herman Chen
0ec78dec05 [hal]: Enable mpp_device_debug
Read mpp_device_debug on opening device.

Change-Id: I8aa17eb93eb251c2dda81a051d809d872ba1948f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-30 15:30:49 +08:00
Herman Chen
de39570d75 [hal]: Add uyvy422 support to jpeg encoder
Add vepu1 and vepu2 jpeg encoder support uyvy422 format.
Remove format limit on hal control operation.

Change-Id: I1bceb45fd3d285941878197256b284875094b44e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-30 10:36:09 +08:00
Herman Chen
87da5bef82 [test]: Add yuyv422 and uyvy422 test case
Add yuyv422 and uyvy422 support to encoder test case: mpi_enc_test.
Note: on these two case the hor_stride should be twice of width.
With this modification test case can output correct stream now.

Change-Id: I463d3c158369d831e4558199c917023773300ac1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-29 12:01:55 +08:00
Herman Chen
5d6b20385e [legacy]: Fix vpu_api_test memory leak issue
Data in DecoderOut_t is malloc from vpu_api_legacy. And Android OMX
component is following this rule for historical reason. We have to
change test case to support it.

Change-Id: I202525eecc461bd9507cfa2c376de11e2fc6fc9b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-27 16:17:59 +08:00
sliver.chen
02e340d445 [doc]: add link to mpp application base on linux and android.
Include linux display demo and android mediacodec interface demo.

Change-Id: Ib1f6eee521b911c84fa8628e907da903fc0a9e2b
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-26 15:59:31 +08:00
sliver.chen
a1d9c05e7f [legacy]: fix memory access segmentfault
expand legacy buffer and align stride when copy buffer.

Change-Id: I68ab7935ab69c37161b586efc0f35f804b29b4f4
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-26 15:58:27 +08:00
sliver.chen
0a73f9f75a [test]: bench mark unit test
Add multi-instance test case with multi-thread decoding.
This test case is mainly for platform performance evaluation.

Change-Id: I79d86a01778c2e7af00e13d1d3c3d2937bcbbcce
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-26 15:49:40 +08:00
Herman Chen
e4d6d81287 [mpp_mem]: Add error log for mpp mem debug
When mpp_mem debug is enabled there is limit for recording mpp_mem
usage. But there is NO obvious log when this limit is reached.

This case will easily happen on multi-instance decoding in one process.
We add obvious log when this case happen.

Change-Id: Ic9160766d4499d442c25fdefae00231d15d71359
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-26 15:41:29 +08:00
Herman Chen
a00b980a71 [mpp_mem]: Fix print error on mpp_mem leak check
Change-Id: I97d7c34034084aed4dfda064b113386d6dede8a8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-26 10:22:06 +08:00
Xingwen Fang
aa277519d3 [osal]: Fix mpp queue deadlock on exit
On mp4 case, we back-up extra data into mPackets at the
end of reset, then MppQueue#mFlushFlag will be reset,
and may be blocked on MppQueue#pull.

Change-Id: I99864ac4b3fbc053107bb35dd47d2f21fb3b6a73
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
2018-03-26 08:43:54 +08:00
Herman Chen
25271e9ad0 [test]: Add mpi multi-thread decoder
Add new test case for multi-thread input / output.
This demo is for performance test and multi-thread decoding.

Change-Id: Iec979ba214dc189d26d2733e90e00ebd7d204f4a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-23 18:42:48 +08:00
Herman Chen
af816d320c [base]: Fill buf_size to mpp_frame when setup slot
There is difficulty for external user to get proper buffer size for
decoding. So we could fill the buf_size field at output info change
mpp_frame. Then user can get buf_size and create buffer group correctly.

Change-Id: Ibf33a81fed085615205035d2b5129029a5096d9a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-23 17:35:39 +08:00
Xingwen Fang
702ccb4a9d [osal]: Reject multiple call mpp queue flush
Change-Id: I31622b38c93e86113ed9a4189d82acadc140e834
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
2018-03-23 17:34:53 +08:00
Herman Chen
ed4151e245 [osal]: Change time function
Change time function from gettimeofday to clock_gettime.
Output of mpp_time() is still in us.

Change-Id: I7f961bb7bb4007e8e42ae5358bd7f568edf6c3d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-23 09:20:56 +08:00
Chengmc
e648d65af8 [allocator] lock ion heap detection operation
When in multi-codecs cases, the check_sysfs_iommu function reenters
with high probability, so some codec instances may fail to obtain
the correct memory type.

The root cause is scandir call in find_dir_in_path function. For
efficiency consideration it is better to lock ion_heap_id value.

Change-Id: I60a0eb27c3ac35bc022aa00b2cffc4e26e54bf24
Signed-off-by: Chengmc <Martin.Cheng@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-22 17:00:49 +08:00
Herman Chen
3bca32d1e0 [inc]: Add eos flag clear function to mpp_packet
For it is inconvenient to clear the eos bit in mpp_packet flag we add a
new function to clear the eos flag only.

Change-Id: I67fad6e416bca68b6b7cee8e816fca386759f35a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-22 11:52:01 +08:00
sliver.chen
7b46386d38 [h264d]: fix a scenes of null nalu
in some case may meet scenes of null nalu pkt,
just like 00 00 00 01 00 00 01,parser should jump over it.
if we don't jump it,p->nalu_len will be zero and p->nalu_len - 1
get 0xffffffff,access the memory addr will leads to segmentfault.

Change-Id: Ie0fae2f38bd76287c9ef924506f0801d571fb1f5
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-20 14:18:43 +08:00
sliver.chen
eb28892adc [jpegd]: add information if input img format may be png
in some case,user may think of png bitstream as jpeg.
and file suffixes can also easily lead to misunderstandings,
so add warning to prevention is necessary.

Change-Id: I2ed319033706b2ef48c8b34c6cdc77098137827c
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-19 17:20:38 +08:00
sliver.chen
e11e7e7e76 [cmake]: fix cmake error about need twice make
modify cmake script to allow multiple define about ndk variables.
It is a bug caused by low version ndk.

Change-Id: I92584f050b0cfd5397b7cf85a8963dbe492baa69
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-07 19:24:09 +08:00
sliver.chen
bf702db051 [test]: add argb fmt support for unit test
modify read yuv image method and buffer size.

Change-Id: I5a5dd63fd98831a744801d5504f4ac6d2e0fcebc
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-02-23 11:38:49 +08:00
sliver.chen
552e2db07f [cmake]: linux aarch should define HAVE_DRM ON by default.
Just like in the android arm/aarch directory.

Change-Id: I27fd97835c92e23e0422cfdcd381c540b9af8fd9
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-02-08 09:20:09 +08:00
Herman Chen
bae30008a7 [cmake]: Simplify cmake script
Change-Id: If5280bdb8d58d995d59f86c4cc5d51d4d5f74fe6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-02-02 11:22:11 +08:00