Commit Graph

1911 Commits

Author SHA1 Message Date
Ding Wei
d7ba353e36 [vp9d]: fix bug: update tile info code
tips: update error in commit: ee44ea521a

Change-Id: I2f24cd0c00ece579116172d35c54c9fc0b42d85d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-09 16:08:00 +08:00
sayon.chen
96f3838011 [vepu] vepu reenocder limit
when reencoder qp equal qpmax stop reencoder

Change-Id: I2e6c9af5cd7cad55268cc2335a62fa78dd0a27e1
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2018-11-07 08:27:56 +08:00
Herman Chen
b9dda0fb95 [mpp_dec]: improve reset process
Use semaphore to protect reset process.

Change-Id: I29b7bb009e38fe3be000663f32748ff7cd3d081f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-24 14:23:50 +08:00
Herman Chen
1a388b0a94 [mpp_dec]: Fix error on random reset call
When decoding is not finish (eos) and user call reset the hal thread
may not clear all the reference frame used in decoder and not clear
frame in display queue. There will be memory leak on this case.

This patch fix this error when user randomly call reset funciton on
decoding by flushing decoder and clearing display queue.

Change-Id: I68a12bd8cfb94a4d56d652a11695ef69f2a78825
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-22 15:41:08 +08:00
Ding Wei
6000ab1e8b [h265d]: supplement disable_error flag when mark error
Change-Id: Ic4b1f4a682f399cdcf2499b45e838a1cbd8834f4
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-19 16:25:14 +08:00
Herman Chen
203ff537c3 [test]: Fix not enough buffer on YUV444 jpeg decode
When decoding YUV444 jpeg image the buffer size should be larger.
Also we add user specified output format support for jpeg decoding.

Change-Id: If8defbc23162dac111aafee6d96d2726c366b7da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-12 16:03:08 +08:00
Herman Chen
ae93472665 [utils]: Add YUV444 frame writing support
VDPU hardware only support semi-planar format for YUV444 which is
hard to display on other software. So utils will change it to YUV444P
and write to file.

Change-Id: Ie81149d7638c2e1d36fc3bc06fe1353ca95c6c01
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-12 15:56:46 +08:00
Herman Chen
7d1f812873 [jpegd]: Add YUV444 support
1. Fix missing 444 case on parser stage. Parser should setup YUV444
   format for original jpeg stream format.
2. Fix missing case on MPP_DEC_SET_OUTPUT_FORMAT. When user change
   the output format the corresponding MppFrameFormat should be
   changed.

Change-Id: I111ba2bcadd675339bfe2948a054301780177f9a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-12 15:35:08 +08:00
Herman Chen
3f22788c07 [test]: Add infinite loop decoding mode
When max frame count is set to negtive value mpi_dec_test will always
loop input file.
This is usefull for longterm pressure test.

Change-Id: I64336d5ec6411ee3712b951ef0b0c02bd5f453cf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-10 10:52:31 +08:00
Ding Wei
ee44ea521a [vp9d]: remove tile info code which is not used
Change-Id: I6d8e8bf951777c260a0f1e3b83c8217f17b926ba
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-10 10:02:00 +08:00
Ding Wei
2a0068de4c [vp9d]: fix warning when build code
Change-Id: I86bdac9205fbc7b58f9d145ef8fcbbb8b21d6591
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-10 09:23:48 +08:00
Ding Wei
39e6d89f90 [h265d]: add max solution support check
Change-Id: I10f16416d72ed47dc7eabc92b4678b71af8fd292
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-09 10:02:41 +08:00
Ding Wei
0b644922ac [vp9d]: fix bug: split frame
tips: updated reference code according to ffmpeg

Change-Id: Iac61df91e2029c0016f691ec91b8a2bc79229e6f
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-10-09 09:16:52 +08:00
Yann Dirson
70a8b862de Fix extraction of U32 values from SPS header
Change-Id: I0798ca2adc14fb5e82e8a9b0fcece1bb3b0f7062
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-10-08 09:10:40 +08:00
Herman Chen
b1bc30ad5f [cmake]: Add armv8 support
Change-Id: I5fb13208f23f9dbd1f0cd4c7ec38b26026dd92f2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-09-29 15:53:07 +08:00
Herman Chen
47011cd647 [platform]: Add RK1808 support
Change-Id: Id8d1bdd61888cc0fedb324f9c63be184edf3e6d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-09-29 15:48:48 +08:00
Ding Wei
7a21a6a045 [h265d]: fix bug: cts in android 9.1
tips:
1. when parse_nal_uint error, should return error back.
2. task->valid need initialize 0, in prepare and parse.
3. when callback, ctx->ref is next frame handle, should
use task->dec.output to get slot_idx.

Change-Id: I802a4ff20683d4fe7e5e1255133a564c46e3c6dc
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-09-14 14:07:56 +08:00
Herman Chen
67e80ebfe4 [mpp]: Remove RKPLATFORM macro
Mpp will only run under Linux environment. Windows support will be
removed.

Change-Id: I52de4bd69f6d7b34507edeb6642668e225fcbd38
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-09-11 10:31:08 +08:00
Herman Chen
15e357ffd0 [utils]: Add YUV422SP frame write support
Add YUV422SP format support to function dump_mpp_frame_to_file for 422
format jpeg file.

Change-Id: I721551f526c2c981f023f638f4efd20bf695f5e9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-09-06 09:10:04 +08:00
Herman Chen
b03cad1c4f [platform]: Add 3128H capability description
rk3128H can support 1080p@60fps H.264/H.265 decoding. While it
do NOT have jpeg encoder nor VP9 decoder.

Change-Id: Id1b9583831036e2a43361b11f963be3599bfa7f8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-09-05 10:23:05 +08:00
Yann Dirson
621dd8592f Fix buffer overflow scanning soc_name.
The soc_name we read from device-tree is NUL-separated so we need to
replace intervening NUL chars, but we don't want to replace the last
one, or the next call to strstr() will overflow the buffer.

Detected with address-sanitizer:

    ==3271==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f940026a0 at pc 0x7f97df7160 bp 0x7fee1fa8e0 sp 0x7fee1fa958
    READ of size 97 at 0x7f940026a0 thread T0
        #0 0x7f97df715f  (/usr/lib/libasan.so.3+0x4215f)
        #1 0x7f97df745b in __interceptor_strstr (/usr/lib/libasan.so.3+0x4245b)
        #2 0x7f97d6b27b in MppPlatformService::MppPlatformService() (/usr/lib/librockchip_mpp.so.1+0x8727b)
        #3 0x7f97d6b64f in mpp_get_vcodec_type (/usr/lib/librockchip_mpp.so.1+0x8764f)
        #4 0x7f97d38da3 in hal_h264d_init (/usr/lib/librockchip_mpp.so.1+0x54da3)

    0x7f940026a0 is located 0 bytes to the right of 96-byte region [0x7f94002640,0x7f940026a0)
    allocated by thread T0 here:
        #0 0x7f97e6445b in __interceptor_posix_memalign (/usr/lib/libasan.so.3+0xaf45b)
        #1 0x7f97d6ed13 in os_malloc (/usr/lib/librockchip_mpp.so.1+0x8ad13)
        #2 0x7f97d6e54b in mpp_osal_malloc (/usr/lib/librockchip_mpp.so.1+0x8a54b)
        #3 0x7f97d6b1d7 in MppPlatformService::MppPlatformService() (/usr/lib/librockchip_mpp.so.1+0x871d7)
        #4 0x7f97d6b64f in mpp_get_vcodec_type (/usr/lib/librockchip_mpp.so.1+0x8764f)
        #5 0x7f97d38da3 in hal_h264d_init (/usr/lib/librockchip_mpp.so.1+0x54da3)
        #6 0x7f97d387c7 in mpp_hal_init (/usr/lib/librockchip_mpp.so.1+0x547c7)
        #7 0x7f97d02ad3 in mpp_dec_init (/usr/lib/librockchip_mpp.so.1+0x1ead3)
        #8 0x7f97cfda3f in Mpp::init(MppCtxType, MppCodingType) (/usr/lib/librockchip_mpp.so.1+0x19a3f)
        #9 0x7f97d0056f in mpp_init (/usr/lib/librockchip_mpp.so.1+0x1c56f)
        #10 0x404347 in mpi_dec_test_decode (/home/root/rockchip-mpp-test/mpi_dec_test+0x404347)
        #11 0x4057b3 in main (/home/root/rockchip-mpp-test/mpi_dec_test+0x4057b3)
        #12 0x7f97bba563 in __libc_start_main (/lib/libc.so.6+0x1f563)
        #13 0x402217  (/home/root/rockchip-mpp-test/mpi_dec_test+0x402217)

    SUMMARY: AddressSanitizer: heap-buffer-overflow (/usr/lib/libasan.so.3+0x4215f)
    Shadow bytes around the buggy address:
      0x1ff2800480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x1ff2800490: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x1ff28004a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x1ff28004b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x1ff28004c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
    =>0x1ff28004d0: 00 00 00 00[fa]fa fa fa fa fa fa fa 00 00 00 00
      0x1ff28004e0: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
      0x1ff28004f0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
      0x1ff2800500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x1ff2800510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      0x1ff2800520: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    Shadow byte legend (one shadow byte represents 8 application bytes):
      Addressable:           00
      Partially addressable: 01 02 03 04 05 06 07
      Heap left redzone:       fa

Change-Id: Ia529035847cc23c612e4039e3d445db9d014d31f
Signed-off-by: Yann Dirson <yann@blade-group.com>
2018-09-05 09:02:22 +08:00
Herman Chen
496808002d [mpp_impl]: Add tid to dump file
1. User often use multi-instance decoder. The dump file name should has
some way to avoid overlap file operation.
Also an extra stream length config file is added for decoder. For
decoder issue reproducing should stay the same with the real user input
stream seperation.
2. Add mpp operation record file for issue reproduction.
3. ops format is similiar to Android time log.

Change-Id: I4b3702fcb4ae1601579762a6d1d7cadc10861759
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-08-30 15:35:31 +08:00
Ding Wei
fc1e2256b7 [mpeg4]: fix bug: add marco MPP_DIV for division
tips: in mpeg4,the divisor named time_pp is likely to be 0.

Change-Id: If9c055cb03139e819fe901009024e3ad4bbe79a5
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-08-30 08:58:33 +08:00
Ding Wei
f7938a8746 [bitread]: h264d: compatible case: pps has zero tails
tips: when pps rbsp has zeror tails, then the check for
whether has_more_rbsb for pps, will judge error.

Change-Id: If8365fca6d49741302779414ab9ff2cb34f4602d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-08-24 18:03:32 +08:00
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