Commit Graph

1911 Commits

Author SHA1 Message Date
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
Ding Wei
9466a60452 [vpu_api_legacy]: add no map buffer iusse
tips: when buffer is external mode, getoutframe buffer not get
buffer vir_add, thus it avoids buffer map, and then reduces
first frame display time.

Change-Id: Ie50e162685a058e474e8918bf07a265696be064a
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-08 15:04:41 +08:00
Herman Chen
982f23b44d [mpp_dec]: Fix dead loop on output frame block
When output frame is not get_frame by user immediately the parser thread
will be stuck in a dead loop can cause high cpu usage.

Thanks to mo123's reporting here:
https://forum.libreelec.tv/thread/12151-feedback-for-test-build-libreelec-rk3328-arm-9-0-devel-box-trn9-img/?postID=93519#post93519

Change-Id: If4209e3cf2d329872f05554282e65f4fdce0f3c9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-08 10:40:20 +08:00
Ding Wei
6797faca0a [vp8d]: fix bug: parser error when meet segmentation
Change-Id: I5928a191a6442bdbb522aa128be9be6907a24904
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-08 09:41:33 +08:00
Herman Chen
89a1fd39ba [test]: Fix NULL buffer group input for usage
When decoder frame buffer group does not exist do not call usage
function.

Change-Id: I677d9bf1cd116886b94959c90161a4500795eacc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-07 17:31:13 +08:00
Herman Chen
8461f01c38 [test]: Change mpp_buffer_test for external mode
Change external mode mpp_buffer_group test from normal type to ion type
which is more closer to real decoder pure external mode.

Change-Id: I601f18340d760a0e630149209bd4d63ec3bbf995
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:54 +08:00
Herman Chen
7d74efafc3 [mpp_dec]: Fix crash on reset at info change
When paser thread generate a info change task then user call reset
operation right before hal thread receive this info change task. This
task will be released and hal thread will get a invalid buf_slot.

The patch bring in the async reset / sync reset done mechanism:
User can call reset at anytime. So it is a async reset.
Then parser / hal / vproc thread need to finish all reset operation
before process next loop.
This means decoder thread need to sync at the reset done point.
It will keep reset operation save and clear.

Change-Id: Ia8482fd09d84e5fa6a096f2740ed1319d4cf79a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:39 +08:00
Herman Chen
35aee9221a [misc]: Add extra log
Add extra log to mpp_dec and vpu_mem_legacy

Change-Id: I27599077093a34a70aa7c590034f100fdc32416b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:39 +08:00
Herman Chen
44f0ee0353 [mpp_dec]: Add post-process path to mpp_dec
1. Unify the hal thread output process to mpp_dec_put_frame
2. Add vproc path for field source.
3. Reserve one more buffer when deinterlace is enabled.
4. Default enable for normal mpp path but disable on vpuapi path for the
reason that rk_ffplayer has done deinterlace process internally.

Change-Id: I02e7cece844fde01c2d249dafe6f7ce6a325593f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:39 +08:00
Ding Wei
3f57e7bda0 [h264d]: remove build warnning
Change-Id: Ib90aea0e28114ba137dc82927399407268bc304b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-05 11:05:03 +08:00
Ding Wei
ceb00a4361 [mpp_dec]: adjust decode order: check task before infochange
tips: when task is not valid, and width and height is wrong,
then infochange will be tripper, which is unnecessary.

Change-Id: I45c4ee75a8d1e2928995be0562f032fabe8c95cb
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-05 08:48:15 +08:00
Ding Wei
5bd1c557e9 [h264d]: when meet svc stream, not to return failed
Change-Id: Idffb31a9ff135604a2c411b5a6b538330da93589
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-06-05 08:47:43 +08:00
XunChangqing
64c8ad3248 [mpp_enc]: set motion info buffer to output task
Change-Id: I43b2139721b91326a265397f17b0a3ee1b252a50
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-04 16:38:46 +08:00
Ding Wei
a386893d74 [mpp]: update improble count for mPacketGetCount
Change-Id: If87420cdedea0bc26bcc21c52619d515a2749718
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-31 09:28:44 +08:00
Herman Chen
91189232df [osal]: Use access to replace file open
When doing ion / drm detection use access is a better idea. For open
will introduce some unnecessary kernel operation. And access is more
flexible to use library on different stage of boot up.

Change-Id: Ib6e98d26cb59dd1c8b0899cfa43911fc25097bd4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 16:56:10 +08:00
Ding Wei
50eac8ef38 [mpeg4d]: cts issue: eos frame not decode when use split_mode
tips: split mode need got eos, than the last frame to decode,
if flush directly, it must lost the last frame.

Change-Id: I9e0a64efdf55ca586bade1852688e7c3ca7b5310
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-28 15:15:38 +08:00
Herman Chen
e01b5376f0 [vproc]: Fix memory leak on mpp_dec_vproc reset
When mpp_dec_vproc reset buffer slot index should be dequeue and release
its MppFrame property to insure MppBuffer is not leaked.

Change-Id: I2dc35505306135907fe812b18ae3b8178adb942b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:52:12 +08:00
Herman Chen
b403830430 [test]: Update decoder test function
1. Add buffer group clear when buffer group exists.
2. Add buf_size and limit to buffer group
3. Add max memory usage calc to mpi_dec_test
4. Set mpi_dec_multi_test default thread count to 1

Change-Id: Ia165c9a213b0aed9bc634121dd70776fd6c4801f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:51:22 +08:00
Herman Chen
bed754e33f [osal]: Use multiple status in MppThread
One thread May have multiple lock/wait/signal source:

Input  : signal source from input.
Output : signal source from output.
Control: signal source from async control operation.

Then the main working loop may stop on these lock/wait/signal points.

Change-Id: Ia6270b865cfb7087567fc21f07feb9248b929d7a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:48:35 +08:00
Herman Chen
3ed61e06e1 [MppBuffer]: Add buffer group memory usage
Add mpp_buffer_group_usage function to return runtime buffer group
memory usage.

Change-Id: Ibb2893087e84b6d40de1b44accf45439b7ba925e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-28 09:14:41 +08:00
Randy Li
b99bb30c0d [cmake]: correct the cmake file
Change-Id: I0528c844557a5f431ad2db8e67c742b57094c22c
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: hertz.wang <wangh@rock-chips.com>
2018-05-28 08:58:17 +08:00
hertz.wang
347aeedbe8 [cmake]: make h264e and jpege removable
Change-Id: If3f726313e9b7d98bbcbe014ba6a12ac0447ce46
Signed-off-by: hertz.wang <wangh@rock-chips.com>
2018-05-28 08:39:43 +08:00
Ding Wei
83ff127132 [h264e]: disable write sei info default.
Change-Id: I0d2f88c80393bcdf47467c5b5cfd2385ae993994
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-25 11:38:36 +08:00
Ding Wei
18b2d6a372 [vpu_api_legacy]: fix bug: when encode send empty frame
tips:
1. when send frame is empty should not to buffer.
2. when get packet is empty should not copy data.

Change-Id: I5f43ab89a57c264f1768ad8ba6187f5027fc40d0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-23 17:45:17 +08:00
Herman Chen
5950ce6340 [base]: Set buffer size requirement on info change
1. Remove unused post_proc flag
2. Change code order to output buf_size through MppFrame in bufslot.

Change-Id: I4901f487399f211f31e137b5567315cd3b08130f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-23 10:49:49 +08:00
Herman Chen
e38a5ad357 [test]: Add frame count limit to mpi_dec_test
Add max frame number parameter with "-n" option to mpi_dec_test.

Change-Id: I21c00baee4d94cab69a95060ac5a694cd9f28945
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-23 10:49:49 +08:00
Herman Chen
6cfc565a2c [buf_slot]: Fix slip of pen
mpp_slots_get_unused_count should use buffer count rather than buf_size
as the minuend.

Change-Id: I975e186c826edfbadf6115cdf375826d03a5adc9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-05-22 15:33:15 +08:00