Commit Graph

1737 Commits

Author SHA1 Message Date
Ding Wei
3b7d0b9e8b [h264d]: fix error: when calculate wrap_frame_num
tips: when frame_num increase by one, must remainder by max_frame_num.

Change-Id: I972e498bf608639dd29293dfed0bd93180d3f2ed
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-08-24 17:37:02 +08:00
Herman Chen
fe17ac5806 [cmake]: Remove static library dependency
Some test depend on mpp_base static library which is unwanted.

Change-Id: Ic3ab0826dee1284c0737d1015648c334a6328f8d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-23 16:38:32 +08:00
Ding Wei
5c2f044d43 [h264d]: relax condition: check frame_num continue
tips:
1. In h264 protocol, last frame is used for reference, current frame num
must increase by one, otherwise equel last frame.
2. Very few error stream, not increase by one, then consider it error.
for this case, relax condition, just check cur->frame_num is equal to
last_frame->frame_num or increse by one, not consider whehter last_frame
is reference or not.

Change-Id: I885074b781fa5a53419e77e9e73243b439bf15d4
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-08-22 16:55:44 +08:00
sayon.chen
84bc2e31c0 [vepu] vepu ratecontrol modify
1. support mb rc rate control
2. modify strategy for last gop fps pid residue bit
3. add virtual buffer interface buf no used in bit alloc
4. support reencoder when p frame stream length is biger then need
5. fix sps vui error when video_signal_type_present_flag is true

Change-Id: I5ce4448ffd78f0c9af94a908d7b1b0e7064550e7
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2018-08-21 11:14:49 +08:00
Herman Chen
033b2e9b22 [drm]: allocator drm code clean up
Add more log to allocator drm.

Change-Id: I3c6ec13ee6045fa06eec682b8e9cc933f8a03fe0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-21 11:00:31 +08:00
Ding Wei
93824dc713 [hal_task]: add ref_err flag, use parse_err instead of had_error
tips:
a) when parse syntax error, enable parse_err;
b) when dpb ref error, enable ref_err;
c) when use disable err, only disable ref_err, parse_err cannot.
above all, using these flags, when  parse error, it also can
go ahead to hal thread, and loop all.

Change-Id: I639248dbf4499a8ed473b9f44f1e1332409c5c22
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-21 09:03:12 +08:00
Ding Wei
e137b0d95f [h264d]: disable hardware check error for frame_num
tips: frmame_num will check in driver layer, so hardware need not
check again. Even these systax error, whether consider it error
by driver, not hardware.

Change-Id: Ide62dd5e5eb0ac04e3d52ca7f11750dbff21ee11
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-08-20 17:54:32 +08:00
Herman Chen
b018b31a23 [mpp_dec]: Fix handwriting error
This handwriting error will cause larger memory usage when decoder is
too fast.

Change-Id: Iea93fcfd265d81c43206499a09d682da2b6231a1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-20 17:08:04 +08:00
Herman Chen
0bc071d8b7 [buf_slot]: Add slot reset log
Add slot reset log for debug

Change-Id: If0fc32609aaa38fff79dde9f47047a1f75f97f9a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-20 14:24:46 +08:00
kenvenis.chen
70669fc265 [m2vd] : add vpu1 support
Change-Id: I8ff5f040153c4b1ebcbabbb4af2420663d1f3f4a
Signed-off-by: kenvenis.chen <kenvenis.chen@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2018-08-14 15:46:00 +08:00
Johnson Ding
df7393d339 [m2vd]: rename some type declaration and Macros
Change-Id: Ie1e4de2d5825ac6e18a5317e26a1d5b4cd0169b2
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2018-08-13 17:22:09 +08:00
Johnson Ding
c8dab97a3c [m2vd]: fix wrong pts init in m2vd parser
Change-Id: Ib6fc585097f05bbfb7b50b15e54a8b6d3c7f12e3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-08-13 09:15:23 +08:00
Eddie Cai
0db0a81839 tools: add yuvplay for play yuv stream on linux
Change-Id: Ifbb5ac41b216919f31829a199035bfbcbd98d816
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
2018-08-07 15:32:41 +08:00
Herman Chen
b81b3e52cd [mpp]: Fix compiling error on Linux
Issue: https://github.com/rockchip-linux/mpp/issues/48

Change-Id: I08bc75a4cab23d4b96c6bac3b671e50edbff55fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-07 08:56:00 +08:00
Ding Wei
76b8c229a2 [mpp]: move dump data from vpu_api_legacy to mpp
tips:
add MppDumpInfo for dump input and output.

Change-Id: Ia2416309e0e6b78671c073ae08409d907e3d0e85
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-06 09:10:28 +08:00
Herman Chen
6d059f65bf [osal]: Change mpp_env string interface
Set get environment string parameter to const char to avoid modification.

Change-Id: Ib5308407fcac2fa58b194fb8df33380efc1487f9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-03 17:44:55 +08:00
Herman Chen
723ee1ec2d [legacy]: Fix 4.4 rkffplayer compatible issue
Old external library do not clear the vpu_context. We need to reset
the ori_vpu flag when goto mpp path.

Change-Id: I31e5dceae83bb196253d6d19a149a55a4f59d9ee
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-03 16:16:46 +08:00
Ding Wei
b440230979 [mpi]: fix define: mpi_impl.h mpp_packet_impl.h
Change-Id: I436fd5f2d15ce6ccabc0986418c001939ea15468
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-07-27 18:18:25 +08:00
Herman Chen
d2b06f4aa9 [mpp_dec]: Add mpp_dec stage timing statistics
Change-Id: Ib9f8558ea59811caab906fc408dda62854bb8c52
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 14:46:12 +08:00
Herman Chen
66ff6456b2 [mpp_dec]: Optimize mpp_dec condition wait
Optimize mpp_dec parser thread wait mechanism to reduce cpu overload.

1. Add mpp signal notify flag
2. Add mpp_dec wait status flag
3. Compare the notify flag with wait status flag. When there wait
condition is fulfilled then signal parser thread to process.

This will greatly reduce cpu overload by block wake up with no sense.

Change-Id: I38da718e80d0487e0300e807bc87cdb1aa070471
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 14:24:58 +08:00
Herman Chen
0a78fb7102 [mpp]: Combine block control and timeout control
Use MppPollType as block control MPP_SET_INPUT_TIMEOUT and
MPP_SET_OUTPUT_TIMEOUT 's parameter.
Deprecate old block/block_timeout control.

Next step is to change MppPollType to RK_S64 for compatible in different
platform.

Change-Id: I02974f0b8eeb23ff43687448d6c3271ea7dd0a2c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 11:56:56 +08:00
Ding Wei
6f91a59d0b [vp9d]: fix case when split error
tips: when split error, and consumed lager than
input length, it will be wrong.

Change-Id: I43ca99f55cb379b93ff08028ed368ce21e6b3611
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-07-26 18:04:59 +08:00
Ding Wei
f2385c1134 [hal_h265d]: use macro to set register length
Change-Id: I910942a34b44173ace6a6e29ff79a814eb79857c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-07-26 16:52:21 +08:00
Ding Wei
993dbb0f8c [vp9d]: fix bug: intra_only reset frame context
tips: reset frame context modes
a) intraonly && resetctx==2, reset all context.
b) intraonly && resetctx==3, rest currently used.
c) keyframe || intraonly, set framectxid = 0.

Change-Id: I0d2c38277f720d33a98f7f5148c96f560e423365
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-07-26 16:49:17 +08:00
Ding Wei
69e51089b0 [h265d]: change log belong to environment key
tips:
Consider case that missing reference is not error,
as warnning instead.

Change-Id: Ia702fda3d427355655dd9dd4c4466dc404e68a46
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-07-26 16:11:30 +08:00
Randy Li
a90f562b39 [mpp]: clear the frame buffers after dec reset
The decoder reset function would push all the reminded
buffers into output queue. It is not necessary and
useless.

A reset order means the application want to be back
to the origin. So we must remove the references
from decoder after a resettting.

Change-Id: Ic4ec5410606ffc815cd6c29e84735a3909b27f62
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-07-18 09:38:53 +08:00
Randy Li
6fe240a469 [oasl]: fix the mem debug condition
Change-Id: Id790199e3a32a9ca93bcb382f473aa59c28c0ecc
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-07-16 18:03:50 +08:00
Herman Chen
ee08efc836 [mpp_buffer]: Print mpp_buffer_group_dump caller
Change-Id: I7c1dcd74d35d185e48d0ec0b6309fcdacc8031f3
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-06 17:41:03 +08:00
Herman Chen
0ce7deaf79 [mpp_buffer]: Fix error printf on exit
Fix MppBufferService dump print error on buffer type. The v4l2 type has
changed to external dma-buf type.

Change-Id: I02c9e2741117efc6e9d84d239a26a28dde3471d4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-06 17:29:02 +08:00
Herman Chen
26889a7bce [mpp_time]: Add MppTimer for time recording
Change-Id: I3d04e677415ae84bc37703cb63a52be66c973798
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-06 16:30:11 +08:00
Herman Chen
e20b535fb4 [m2vd]: Fix missing field flag
The field flag is setup later than slot set_prop operation. It will
cause the failure on deinterlace flag detection.

Change-Id: I7bfcf558a03373f2bd6e3ccda91ce74b54322360
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-05 14:48:42 +08:00
Ding Wei
e8d47b6cc8 [mpp_dec]: updated: only when fast_mode, using wait.dec_all_done
tips: when not fast_mode, both wait.dec_all_done and wait.prev_task
are used.

Change-Id: I7397fe1e60cca4a7518d1d4859c4dad554a7b938
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-07-03 14:05:29 +08:00
Herman Chen
c71ed0cb96 [osal]: Make mpp_time_diff string to const char *
Change-Id: I20f3c65ccbea28bb01e1f739a1d31bf3c5ae936e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-02 17:29:15 +08:00
Herman Chen
741cf4a920 [test]: Improve mjpeg decode file output
Change-Id: Ib0f58417acfa9daa2de1e5db9bdc11d16e7ef693
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-28 16:29:31 +08:00
Herman Chen
2317460248 [mpp_device]: Add unified extra info function
For jpeg encoder and decoder may have address offset larger than 4M mpp
need to patch address register file. We add a new function set to do
this.

Change-Id: Ifd096e33be170e43481a70c743a3c89c71b358fa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-28 16:29:31 +08:00
Herman Chen
31c657e1dc [mpp_buffer]: Signal codec thread on buffer create
When mpp codec thread go into idle status for lack of buffer new buffer
commit or create should wake up the codec thread to check again.

Change-Id: I843f7c790e1f8b8dcd67e209077f2475c8e265c8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-28 16:27:48 +08:00
Ding Wei
ea47dc871a [h264e]: fix bug: case when encode infochange
tips: when input data for encode change solution, the buffer_ready
is on, then not realloc buffer ever. Thus, it must check when hw_cfg
parameters change, and then realloc relative buffer.

Change-Id: I870f04f14d1f05b652a324601fdd7316e29951ed
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-27 17:39:24 +08:00
Ding Wei
13fdedf1fd [mpp_dec]: update control cmd for disable_errinfo
Change-Id: I18a5656cace415654e7becf4e3ae60a5e84a85d8
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-27 11:59:00 +08:00
Rimon Xu
12959bc46e [vpu_api_legacy]: Prioritize info change
When this frame is infochange and EOS, infochange is
processed first and EOS is processed again.

Change-Id: Ia0c800f0c72e5fb1d8569191e3f41914fe50c277
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2018-06-27 08:56:44 +08:00
Ding Wei
2125f4599a [h264d]: add rkv and vdpu fast mode code
Change-Id: I66502299aa2bfbec6e80b9227dc897aae390d31e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-27 08:55:03 +08:00
Herman Chen
016a000689 [mpp_enc]: Simiplify encoder put_frame proccess
Mpp will keep a dequeued task by default to reduce enqueue/dequeue
operation.

Change-Id: Ic519139b3e0830e17a19d80e7a1623387d8f0ede
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-21 11:15:24 +08:00
Herman Chen
91fa55711c [h264e]: Fix memory leak at H.264 encoder
There is a malloc/free mismatch in H.264 encoder. RecordNode is
allocated by mpp_malloc() but it is free by normal free(). This will
cause memory leak.

Change-Id: Ic84cf42feead306dc10dd544a0fc26a11dc4774a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-21 10:55:24 +08:00
Herman Chen
999f88db3e [misc]: Remove source code executable permission
Change-Id: I30fc81af04ace3aae23c6ede886f0bc44af78201
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-20 14:32:47 +08:00
ywj
1bd81bcb53 [mpp_dec]: Fix memory leak on eos
when video quit or eos, mpp allocate a fake frame but not free.

Change-Id: I3079953ed44c578b6ec7e4fac135039eb00140ad
Signed-off-by: ywj <ywj@rock-chips.com>
2018-06-20 14:31:33 +08:00
ywj
88355a42f5 [vp8d]:fix memory leak problem
Change-Id: I4c932ed336c1d44a30e0961b7a26692ff78d7dc6
Signed-off-by: ywj <ywj@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-20 09:01:07 +08:00
Rimon Xu
d72e00411d [legacy]: Use rkvdec default on RK3399
The judgment is reversed

Change-Id: I97e86e9e41c3f7d8aadc5dc49d3f78581856b903
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2018-06-19 14:43:48 +08:00
Herman Chen
e2df612c0b [h265d]: Move slot setup to init stage
H265 decoder setup slot when the first sps is read. It will cause a dead
loop on mpp_dec.cpp on checking unused slot count.

The slot setup on parsing stage is better to adapt to different memory
usage. This is better to be improved in future.

Thanks AreaScout and mo123 for reporting this issue at:
44f0ee0353 (commitcomment-29392434)

Change-Id: I3835397f6df6e5e17402b8b43dc3985e46dff832
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-19 11:10:07 +08:00
Ding Wei
9fc96267a5 [vp9d]: add fast mode for parser
tips: when counts need update, then parser thread wait for hal
thread done, and reset wait flag.

Change-Id: I852c76b672f78e37c3dfdad7761b3b23511ec5ee
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-15 17:55:54 +08:00
Herman Chen
aa675c3446 [mpp_device]: Add timing debug function
Add task consume time debug flag to mpp_device register send/wait
function.
For decoder fast mode we need to record not only one start/end time pair
to avoid mismatch caculation.

Change-Id: I449751231d6c6f56ee3cfbb133a9f718466266a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-14 09:07:29 +08:00
kenvenis.chen
232eb6d86f [h263d] : add vpu1 support
Change-Id: If045d034ca8882a50b0ea930fecd5e3825d5f2fc
Signed-off-by: kenvenis.chen <kenvenis.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-12 14:41:46 +08:00