tips:
cabac_buf, poc_buf and scalist_buf shares one address,
becase these use different section using offset.
Change-Id: I2b3de96909b530e2866990de7f374120e49b587e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Youku app h265 stream has non-standard at bit before nal_unit_type.
This bit should be zero according to H.265 standard. Hardware does
not parse this bit so software parser can skip this bit to avoid
failure on checking.
Change-Id: Iba4fe42de229c73eb149a84c08e17d1ceef1efdc
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
hevc extra data contain frame data,cause in prepare status parser
frame, when this case founded stop parser frame, no skip extra data
directly but goto prepare status for decode
Change-Id: I3fa9919f1577a551ca9bc3ae9f46cbd8a0910255
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
1. fix some error
2. set parameters of gop and rc at first init operation if the bit of change not set corret
Change-Id: If0bbcfbffb3224c4b3e520fdc7c4a796503dc161
Signed-off-by: hh <hh@rock-chips.com>
when i frame poc and frame_num equal last frame, now dpb is error,
we should flush dpb.
Change-Id: I8b0f4eeab3d07ffc7d0eeb6e8fbf31e648ddd44c
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
VPU hardware will generate error when there is extra 0xFF or 0x00FF
before tailing 0xFFD9. Remove them will fix some jpeg stream.
Change-Id: Ifac26870086e13958e17a41b547fa94c763062f6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
translate YUV420P(YU12/YV12) to NV12 if input format is YUV420P(YU12/YV12)
and the stride of input buffer not align 32.H265 Encoder need the stride of
luma and chroma must align 16
Change-Id: I0e36d1c249a0270b6e5df3e16d769a817f967a2d
Signed-off-by: hh <hh@rock-chips.com>
1. Modify data type of rga_request to keep consistent with kernel
2. Modify error yuv fomrat translate and error yuv2rgb_mode config of rga
Change-Id: Iaee7b101f510c9d6f90aabe7d5ce2794b4502bf7
Signed-off-by: hh <hh@rock-chips.com>
When picture width is not aligned to 16 vepu row length should be
aligned to 16. This is the case when default luma offset is zero.
Change-Id: Ia8e97fd89fd396f59b448ae6e759dcde40af5519
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Eos should not go alone with info change flag.
If input stream is only 1 frame and require info change decoder will
create a info change with eos flag which will cause buf_slot dump log
like this: "can not clr queue_use on slot"
This patch clears eos flag on creating info change task to hal thread.
Change-Id: Ibbb92155ec1d7d0d406c781ebaaa81a98a2fc893
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
We need to turn off this switch to prevent some areas
of the video from flickering, but there may be other effects.
However, a choice needs to be made.
Change-Id: Ia52a604eed21e381f7310b1c85fe1c0434a1db13
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
When need_split flag is disabled decoder can only receive input packet
as one frame. But if user send two frames in one packet decoder will
loss a valid frame and finally lead to memory leak.
This patch treat this case as an error and bypass later hardware
proccsing. Althrough this process will lead to frame skip it still
brings in more stability.
Change-Id: Ibe566c847e0c7e259d14913ac210171edcfc903b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
tip: when first frame is field, missing to write out.
Change-Id: I22f3e6041b9cceebefd3bec953c333a91e721b00
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Buildroot uses it's own toolchain.cmake, which leads to completely
different CMAKE_SYSTEM_PROCESSOR settings.
And buildroot's toolchain is built for specific architecture, there's
no need to specify architecture features.
Change-Id: I6516bc083f809b01f485db7ba92b1543c6191959
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
When mpp output packet binary file with size config file test case
should be enable to parser the corresponding config file.
This patch implement the config file option with "-c" prefix.
Command line sample:
mpi_dec_test -t 7 -i /sdcard/in.bin -i /sdcard/ops.bin
Then the test case will read in.bin file with size division specified
in ops.bin.
Change-Id: I8b18a6475d77f0303f12614a063888dcd9505f16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When decoding 422 source the YUV422 frame is default in YUV422SP mode.
But software like vooya does not support this format. So we change it to
YUV422P format for better user experience.
Change-Id: I103445470db5e6dd46ff1dc2cb705ae7e47bd8bc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When there is hal_task on PROC_DONE status on reset the reset process
should set these tasks to IDLE status.
Change-Id: I8a9e25fb98e597e22b9b99a6d13f84a4a0e59e3b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Some test depend on mpp_base static library which is unwanted.
Change-Id: Ic3ab0826dee1284c0737d1015648c334a6328f8d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
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>