Commit Graph

1911 Commits

Author SHA1 Message Date
Herman Chen
2c3c72a815 [osal]: Change mpp time print to us
Change-Id: Ifd73aad1e3b65b44a8d7e284647c065fde66ca98
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-27 09:44:40 +08:00
leo.ding
90cca949c9 [h264e]: fix bug: vepu h264 encode rate control
add vepu qp limit to avoid qp_init equal to zero.

Change-Id: I799349252c1bdfc9c9eb32e025307174a05dcff2
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-06-26 17:11:51 +08:00
Herman Chen
e2a45eed9d [test]: Fix rc2 test rc_mode error
Change-Id: Ie4feb07cbe1d3c23e0e78f4e87404f4751a08e00
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-22 16:36:05 +08:00
Herman Chen
fbf35988f4 [rc]: Add bps information print
Add real bps, intra frame bps and inter frame bps print.

Change-Id: I3395c0293f6918691a4bfbeab5f4b3b32feceb1e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-22 15:12:29 +08:00
leo.ding
ef02ca75ff [h264d]: fix bug: when judge whether is end of frame
1. when had slice data and current nalu is SPS PPS AUD SEI,
thus it can consider that last nalu is the end of frame.
2. when pps is missing, frame data is continue, and use
first_mb_in_slice to judge last nalu is end of frame.

Change-Id: I1ccf3ca415e6b04dcd7fe7fc9c357fd600fa5803
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-06-22 15:01:44 +08:00
leo.ding
ca168b9119 [h264e]: fix bug: vepu1 h264 encode
frame_num should be add when encode one frame.

Change-Id: I01aa730f490751b9ba9f4fa24f55c9968b4a4e9c
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-06-20 20:52:36 +08:00
timkingh.huang
a2ef291939 [h264e]: limit bit rate on movement scene
Change-Id: I6cc3398371883a7aab8aeea570dde8df043f3584
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-06-16 15:54:34 +08:00
Herman Chen
4cda5d8e57 [h264e]: Add qp min/max limit by bps max/min
Use bitrate min/max to calculate corresponding qp limit.

Change-Id: I5194271dbb5df62f63743f75c40986b037a6eefc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-16 10:50:26 +08:00
timkingh.huang
b2a6bbfc8b [h264e]: add SSE parameter check
To avoid floating point exception, SSE is set to ONE if
it is less than ONE.

Change-Id: Ib0754fdf9327e8f179e9bf56f29f349867f45d00
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-06-15 09:20:04 +08:00
Herman Chen
c84c7f4e11 [vp8d]: Remove unused table
Change-Id: I4c75b411e01c5d829fb63199f1449e6cf1542cd0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-14 11:42:40 +08:00
Randy Li
19c0237886 [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.

NOTE: User may use file descriptor outside mpp as buffer index.
If mpp chooses new map fd as its output user may lost the
connection between user external buffer and mpp output buffer.

Change-Id: Ie0f42cd3268dfd08ddcbd5148a68406ff4b66b7a
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-14 11:38:32 +08:00
Herman Chen
f96141033d [util]: Add frame checksum calculation function
Add checksum calculation function and file access function for debug.
NOTE: checksum for YUV image and for luma only so far.

Change-Id: I54509bebd64f5e5143e14824733d9c25af9db204
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-13 09:42:57 +08:00
Herman Chen
c360c70be2 [h264e]: Add parameter check for H.264 encoder
Check rc mode, quality and bps parameter.
NOTE: current H.264 bitrate only accept range from 10K to 100M.

Change-Id: I7cacf2e3f7093bc55e1f5686f06b0efdbf865a4d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-13 09:40:15 +08:00
Herman Chen
f67a1a689a [h264e]: Add H.264 encoder YUV range setting
Change-Id: I088499015c476e000c4d4c40737d776a6e230bf9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-12 17:27:32 +08:00
alpha lin
078f6aba84 [test]: add new rc test
Change-Id: I1d076b8454d2de6fb5a6e9bf9c8ab9aed96eeca3
Signed-off-by: alpha lin <alpha.lin@rock-chips.com>
2017-06-09 08:56:59 +08:00
Alpha Lin
acba8f17d3 [test]: add auto test modules
Change-Id: I51e1d0d192bb8d673380e5f1dde97929f15473a4
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
2017-06-09 08:56:50 +08:00
leo.ding
653da65266 [h264d]: fix bug: correct the spspps length, and copy using the packet length
Change-Id: I1bd1baee30f734fd1d662b537c749b2f339b444f
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-06-08 14:49:53 +08:00
leo.ding
b7cbd8a9c0 [mpp_device]: add MppDevCtx for control device status
1. add Mppdevctx to store some infos in every codec.
reason:each codec has its own unique characteristics.
2. add mpp_device_control interface for get or set ctx values.
reason:it simplity interface, which flexible, easy to use and versatile.

Change-Id: I56c9332768c86f62a3ca248ad254fba9e798c577
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-06-07 15:14:30 +08:00
Randy Li
851f1185a3 [mpi]: decode_put_packet() would return the internal error
The reason why the decode_put_packet() could be various, it
should return the correct reason to make the caller use the
properly way to handle that.

Change-Id: I88ee1c06d204b8c3bb7ba09482f2939fdd1e8633
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-06-06 14:21:59 +08:00
hh
8fa1648bac [platform] Distinguish avs and avs+
Add macro avs to distinguish avs and avs+ streams.

Change-Id: Idf6f5d289d09301001f7036dea2c83b8644ba281
Signed-off-by: hh <hh@rock-chips.com>
2017-06-06 09:24:56 +08:00
Herman Chen
9c7b9efe74 [misc]: Remove source code executable attribute
Change-Id: I1bf4ec5782e30869e971e4c27ef50285d4382233
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-06 08:48:50 +08:00
Randy Li
7990b52e8d [osal]: update the build system
The cross toolchains in Linux distributions are more prefer to
auto conf way, move those detecting from build system to toolchain
itself would be more welcome.

Change-Id: Ib42d9a0c65646b679ed14c96d16d1845c596f741
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-06-06 08:38:31 +08:00
Jung Zhao
bb214f0cea [osd]: Add warning when PLT type is not set
The best place to call MPP_ENC_SET_OSD_DATA_CFG is after
MPP_ENC_SET_OSD_PLT_CFG, or the osd may be wrong.

Change-Id: I02b08f28ed7aceb7c77313cea6a0767051681f72
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-06-01 09:40:27 +08:00
timkingh.huang
b468bcbc24 [h264e]: recode the first P frame
Recode the first P frame so that we can get appropriate QP
for the target bits. However, this may result a big gap
between the first I and P frame. It should be fixed in the
future.

Change-Id: I720a1d56554921978f167f1b8d49b1e96e5ea767
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-05-22 11:41:26 +08:00
leo.ding
8cd076afae [mpp_platform]: rename HAVE_265E to HAVE_265ENC for buid warnnig
H265E had defined in Cmakelist.txt to choose whether build
h265 encode module, so it here is redefined.

Change-Id: I54e9704d396d0a8a0e6d0f2ae8595d033131d81b
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-05-15 17:28:16 +08:00
leo.ding
0c1cef5014 [h264d]: error conceal: when sps is too short, ignore VUI read error
Change-Id: Iaf04ac88bf922d5a603777be198f110944222967
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-05-15 16:50:34 +08:00
hh
0da8d1f604 [enc]: add output port awake when encode exit.
If encode thread is blocked in mpp_port_poll(output, MPP_POLL_BLOCK) and
user's get stream thread exit, it must awake this block call before join
encode thread exit.

Change-Id: Iee52d2d45a672464b7f3485086a389041dacdeb0
Signed-off-by: hh <hh@rock-chips.com>
2017-05-04 18:03:45 +08:00
Randy Li
5fa4ff0d48 [osal]: match system implementation with compiler marco
It would make the build system more simple, and the cross
toolchains would do the rest to you.

Toolchains like buildroot default not enable the __gnu_linux__
marco in the pre-processor will surfure from the systsm unknown
problem. You should enable the marco in building toolchains
or have a look on those scripts in build directory.

Change-Id: I8f6af3391aa3d94d602ec8d84ba5e43839859169
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-05-04 14:29:29 +08:00
Randy Li
01943db26d [jpegd]: parse only one image a times
The default behavior of the JPEG parser should ignore
the reminined data.

Change-Id: Id097cf6997bcef048afcbeb9eb72319373dd9ae7
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-05-02 16:38:02 +08:00
Randy Li
1b0d5bc016 [platform]: fixup for reading compatible
Change-Id: Ia0ff40644daaaec90a32d173675fadca7327d79b
Reported-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-27 15:49:32 +08:00
timkingh.huang
09e626dc05 [h264e]: fix mosaic bug
If target bit is zero, it will exist mosaic in the encoded
picture. In this case, half of the average bit rate of
previous P frames is assigned to target bit.

Change-Id: I990e80ae04affb0a6bed2e6f456c77657f31a221
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-04-27 15:26:11 +08:00
timkingh.huang
3d9aec512f [h264e]: adjust AQ parameter for first frame
Given the target bits, the first frame's QP is always
inappropriate because there is no history data. Thus
we adjust AQ parameter for the first frame so that we
can get appropriate QP for target bits.

Change-Id: Iccc3500959d091c40d8bb5d9da6da3767fd8753d
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-04-27 09:35:46 +08:00
ZhouJing
4c5a22f048 [mpp_parser]: rename the functions of mpp_parser
It will cause conflicts with the gb28181 protocol

Change-Id: Ia4c24c528c88caa3e6f7c1ad20ef309607e04794
Signed-off-by: ZhouJing <tracy.zhou@rock-chips.com>
2017-04-20 08:47:41 +08:00
Randy Li
66aa10082c [mpp_buffer]: avoid accessing violation address
Sometimes the offset or the offset plus the size is beyond the
buffer area. It would be better to raise an error and stopping
the future step rather than the kernel halt it.

Change-Id: I32d6f05736c874d56e1e9f77505f16ca3a2c01ac
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-19 14:34:29 +08:00
Randy Li
f98cd806ac [build]: fix version generation from VCS for submodule
It is possible to use the project as the submodule of the
other project or having a top build rules project for it.

Change-Id: I6afb43392f10165005b7bf94a867936242dedd04
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-16 14:04:29 +08:00
ayaka
8bde251d54 [osal]: fix the timeout function
Please notice that clock source is only confirm to work
on the currently Rockchip ARMv7/ARMv8 SoC.
You may meet problem with the other platform.

The time granularities is miliseconds level.

Change-Id: Icf56f88dd15045d7c899bdcfaf3637fab159b35a
Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Reviewed-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-04-14 11:25:58 +08:00
Herman Chen
a92b1ea22a [mpp]: Fix dead lock by redundant port lock
The input / output port should NOT share the same lock. The old port lock
is not necessary for task interface.

Change-Id: I31e50ba539bca7389596093605c7641277ebc5a8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: hh <hh@rock-chips.com>
2017-04-10 15:41:51 +08:00
Herman Chen
d7b2f2f521 [doc]: Add document readme.txt
Change-Id: Iaf3ef36c6068b365ef996b6fb43df45f887d6424
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-07 17:22:00 +08:00
Herman Chen
de26a4a79e [doc]: Create directory for document
Change-Id: I179a2a4568d581f26b4d55dc521f1db806f74d91
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-07 17:09:14 +08:00
Herman Chen
60dbf8389b [doc]: Add document for mpp task and advanced mode
Change-Id: I81a66b5cacf73b708eeca87e6c0e7510017ed667
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-07 16:49:45 +08:00
Randy Li
0de5e0599c [osal]: don't install unit test
The build system may store those files into a package.

Change-Id: I2ab54da5880d1979a19430520d36324629b8a7d8
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-07 10:13:44 +08:00
Herman Chen
61fb2802d0 [legacy]: Fix for windows simulation compile
Change-Id: I1f3ea32878b194ecaf380f1af5cca33179aa8300
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-07 10:13:44 +08:00
leo.ding
4a1e6c3671 [platform]: Add default case for known compatible
Change-Id: Icaaa6b72a395248f53a8f902fa8d62e48bcd351f
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-06 16:26:35 +08:00
Randy Li
d99cc7f2ff [osal]: fixup for reading system compatible
The kernel uses termination character to divisive compatible.

Change-Id: I5db14e22aefa1ea54b8d32a4af7b112f22358dfb
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-04-06 14:40:23 +08:00
Herman Chen
76e5398633 [build]: Add build script for arm64
Change-Id: I4ed1b62ce5baeb21fd8e9fb0d804d48f8d065698
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-06 09:37:31 +08:00
Randy Li
bd43fac60e [mpp_buffer]: access the index field of buffer info
The external buffer would request the index of a buffer to
manage it in an array.

Change-Id: Ifbb169c75dfb6342b428b1fd640db9ec45ff5f73
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-05 16:51:44 +08:00
Herman Chen
8900385917 [platform]: Update chipset name and feature case
3228/3229 3228H/3328 support feature list:
3228 : dec vpu2 + 4K H.264/H.265       + enc vpu2
3229 : dec vpu2 + 4K H.264/H.265/VP9   + enc vpu2
3228H: dec vpu2 + 4K H.264/H.265 + avs + enc vpu2 + H.265
3328 : dec vpu2 + 4K H.264/H.265/VP9   + enc vpu2 + H.265

Change-Id: Ia4f63e764f12f8117757ea05645ffb9b65dc6b12
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-04-05 14:42:58 +08:00
Randy Li
ab07acf076 [legacy]: update hevc device node name
I also fix a number of compiler warnings in this commmit.
A funtion is forgot to be exported and some functions should not
be exported.

Change-Id: I945456721a7507d448cfa0559418c356c6cb6ace
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-04-05 14:13:07 +08:00
Martin Cerveny
bce0f19097 performance: explicit sleep in Mpp::get_frame
Move msleep() to non MPP_POLL_BLOCK (cv wait) branch.
Issue rockchip-linux/mpp#6

Change-Id: I1f95e712a3cfc40cf6cba3a6d67536b2a336e734
2017-04-04 13:21:45 +08:00
leo.ding
a2dd73c249 [h264d]: when got eos, only flush dpb, not to reset flag
Change-Id: Iaee15a21666554aad99598c1359e6a61c6a7bd33
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-04-04 13:02:52 +08:00