Commit Graph

1911 Commits

Author SHA1 Message Date
Herman Chen
7ebc57b568 [MppBuffer]: Fix block error on Linux
When decoding in internal buffer mode and source is field mode the
decoder need 3 buffer to continue decoding. But mpp_buffer_group_unused
function only return 1 by default.

This patch return correct value considering the buffer limit count and
buffer group mode.

Change-Id: I4331ca026708037f1d9bace090299315d41f4829
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-21 17:20:09 +08:00
Herman Chen
038cd1da10 [mpp_dec_vproc]: Fix Linux compile error
Change-Id: Iec85735fcc202f7867222ffb0aea0e92f39ffd43
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-21 12:01:51 +08:00
Herman Chen
7027566b41 [hal_h264e]: clean up vepu hal code
Change-Id: I96d7998ad11a123a142f34caeefad206b3a3db99
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-21 11:11:39 +08:00
Herman Chen
c04421a94d [vproc]: Add iep function to mpp_dec_vproc
Add iep context and iep function to the mpp_dec_vproc.

Change-Id: I0e4819cccb068fc665d1d3cac89e0d4bcda032a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-21 11:08:07 +08:00
james.lin
db26a246c3 [h265d_parser]: update h265 MAX_DPB_SIZE 17
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. So update MAX_DPB_SIZE as MAX_REF_SIZE + 1

Change-Id: I25044ff0073e9b241575a09d1250683bc923b394
Signed-off-by: james.lin <james.lin@rock-chips.com>
2018-05-21 08:33:18 +08:00
Ding Wei
e39b6456b9 [h264d]: fix bug: when avcC mode, and contains mutil nalus
tips: when one packet has mutil frames, and has muti nalus,
then, it should check first_mb_in_slice, and then split
nalus to frame or field.

Change-Id: Ie8a194f069c1174fc1210896b9f0787cd144159d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-17 10:15:50 +08:00
Herman Chen
6cbdac920c [iep]: Add more protection for iep hardware
1. Iep hardware need to setup src1 and dst1 information even it is not
configured. Otherwise it will crash hardware.
2. When iep generates error on IEP_SET_PARAMETER cmd we need to ioctl
get result to keep iep kernel driver task queue cleared.
3. Update iep kernel message structure.

Change-Id: I72ff5759535df391f55ffa06586675b25375b336
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-17 10:07:20 +08:00
james.lin
71a40faec3 [rga]: include stdint.h to declare uintptr_t
Change-Id: I26148b09420f97ed4d315685ef6fdfe238e4ff48
Signed-off-by: james.lin <james.lin@rock-chips.com>
2018-05-16 15:29:52 +08:00
Herman Chen
08fbc542a7 [iep_test]: Fix crash on iep_deinit
Change-Id: If29e52c5d47ad6b0ea3e74bbe1b1ed3dc962e8ba
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-15 10:12:08 +08:00
Herman Chen
1bab0f1f03 [base]: Fix error on generate default slot info
Change-Id: Ie63052d410d47ba447ce4e58bab73dc6f6c11513
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-14 18:11:20 +08:00
Herman Chen
e8c1db2556 [mpp_dec_vproc]: Add post process module
Add mpp dec post-process thread and functions.

Change-Id: I2a03e6ddfd6c746d272dd58b629e81f98b530c4a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-14 14:49:59 +08:00
Herman Chen
2098ea9de1 [Thread]: Rename thread lock / signal type
Rename thread lock / signal type by its source.

Change-Id: I426cb9490dd05183badffa36f0a861c439c5f23b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-14 14:49:59 +08:00
Herman Chen
dec3c10b1f [base]: Add more queue status to MppBufSlot
Add more function to MppBufSlot:
1. Add used / unused count for querying with corresponding log.
2. Add more queue (deinterlace / color convertion)
3. Add MppFrame generation for slot index.
4. Add post process flag for field image.

Change-Id: I2666d026fc19816d2e32547604228f2a3747211f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-14 14:49:59 +08:00
Ding Wei
be4c7ab545 [h264d_api]: fix bug: when avcC, free buffer erorr
tips: when avcC ,p_strm->nalu_buf is free and still used following,
 while h264d_deinit free this buf again, it must be wrong.

Change-Id: I143bdb0847b77380cd2658be1b9db64b003344bb
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-14 14:49:01 +08:00
Herman Chen
a73b58a337 [rga]: Fix compling error on 64bit
Fix void* -> u32 convertion error on 64bit platform.

Change-Id: Ie2d09416aed91e550f5581753d8f37357387b980
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-14 11:43:31 +08:00
Ding Wei
082c404fa7 [m2vd]: fix bug: missing set extra_data flag when prepare
Change-Id: I1ba32d8039c8f669c8ad1dc1c6307ebf1e4a4cb5
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-11 20:40:36 +08:00
Herman Chen
331c93682d [mpp_dec]: Fix crash error of rkffplayer control
rkffplayer send MPP_DEC_SET_PRESENT_TIME_ORDER command with NULL
parameter. We need to support NULL parameter.

Change-Id: I0f75810324546bbce24e19daf5eff6e26bd164d8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-11 18:21:23 +08:00
Herman Chen
01c79e3d05 [mpp_dec]: Fix minor error
Fix some small error.

Change-Id: Ifb696fac9138eca67d34cffe835fb28c6089c0c8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-10 16:07:10 +08:00
Herman Chen
c1a44d762a [mpp_dec]: Simplify code
Simplify task sending code in mpp_dec.
Add task put/get count check.

Change-Id: Icd7fdeca90604d6d5c278f5ca983ee5b38caee7a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-10 16:01:00 +08:00
Herman Chen
866b6bd170 [test]: Simplify mpi_enc_test
Remove motion detection / ROI / OSD setup from mpi_enc_test. These
complicated funciton will be move to a new test case later.

Change-Id: I8b212a191f4e1ba6a4ec21a23fd2f4cc51dc4c5d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-10 08:34:21 +08:00
Herman Chen
e855cb171a [misc]: Fix some minor issues
1. Fix rga.cpp compile error on Linux.
2. Fix mpp_runtime.cpp warning on Linux.
3. Remove print when fail to dlopen vpuapi library.

Change-Id: I3891bdd39ae77bac68a67a39893d8caa31dbe6fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-09 16:23:09 +08:00
Herman Chen
c87119b698 [platform]: Update some SOC's codec support
rk3228 do NOT have jpeg encoder and rk3036 do NOT have all encoder. we
update the device name in mpp_get_vcodec_dev_name function.

Change-Id: If80d864543761572645928e59e1e09fc906fec31
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-09 15:50:57 +08:00
Herman Chen
73056c6eb1 [jpege]: Add no extra info path for compatibility
Some old kernel do not support register file with extra info. So when it
is no necessary to add extra info slots just disable it.

The reason for extra info is to handle buffer offset larger than 4M. Due
to low 10bit of 32bit address register is used for file handle and only
high 22bit can be used to as offset from buffer head. Then the offset is
limited to 4M. When we need a offset larger than 22bit we need to add
extra info slot behind register file to let kernel handle it as a
register value patch.

BTW, this is not a good design but it fix the issue so far.

Change-Id: Id5cb694f72b15958164175e402dcc03b08e898b5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-09 10:52:45 +08:00
sliver.chen
c72247fb96 [rga]: Add RGA api and unit test
RGA (Raster Graphic Accelerator) is a 2D graphic accelerator. It is
mainly for copy, scaling, color space convertion and rotation.

Add rga function with control operation and build-in unit test.
Add rga copy function and field duplicate function.

Change-Id: I9ce9f877fec5e7b5eaadcfa63b7eb583f194d725
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-05-07 17:55:33 +08:00
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