Commit Graph

1911 Commits

Author SHA1 Message Date
Johnson Ding
a711528671 [dec]: fix info_changed property setting error
After info_change is encountered by paser thread, HalDecTaskFlag will
have info_change flag set. Although mpp_dec_flush is called there may be
some frame still remaining in display queue and waiting to be output. So
these frames shouldn't have info_change set since their resolution and
bit depth are the same as before. What's more, the info_change flag has
nothing to do with frames need to be output.

Change-Id: Ia01d1ecca5a6deb1a5d2914c34147d5c46c21684
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-30 11:46:14 +08:00
Johnson Ding
07d8ec26d1 [h264d]: resize rkv CABAC table size to avoid useless memory
consumption.

Change-Id: I3b46d7f90e1638ae54825439f10f7b112f4dbba1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-24 15:03:27 +08:00
Johnson Ding
226d098207 [h264d]: fix start code parsing error
When there is [xx xx 00 00 03 01] 6 bytes data right after a start code in the
bitstream, parser will take [00 00 03 01] as start code. This is an error.

Change-Id: I7e530f77892c5316656588f6bbf634cfe4198859
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-17 15:25:43 +08:00
Herman Chen
6debebebce [osal]: Add large file support for drm allocator
Change-Id: I9bfe995935bca3419a8f75376af23a446b7eea03
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-05-16 15:02:07 +08:00
Herman Chen
9cea464859 [mpp_packet]: Fix missing pointer assignment
Change-Id: I75efe0731dd30b4e6aaa05e0c3700f8d71008325
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-05-16 14:38:22 +08:00
Herman Chen
c2e89f5010 [h264d]: Fix dpb stuck issue on decoding airplay
The no_output_of_prior_pics_flag flag in apple airplay stream is true.
This will cause dpb slot leak in idr_memory_management function.
The no_output_of_prior_pics_flag flag require the frame before IDR frame
should be discard rather than display. So we need to unmark the frames
in dpb and then mark them to be displayed to avoid they to be send to
display queue.

NOTE: when clearing no output frame we need to remove it first with
p_mark->out_flag is false to insure the CODEC_USE flag in mpp_buf_slot is
clear. Then set is_output flag to true to avoid real output this frame
to display queue.

Change-Id: Ib9bcebe6b84ceb96350bf405b9bed96e7fa0ca2e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-05-13 16:56:09 +08:00
Johnson Ding
eaa9840c1d [h264d]: Fix bit_depth configuration error in h264d_rkv
Change-Id: Ie045755feb0c13d0e4f53ea54c773953db338e35
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-05-09 17:00:30 +08:00
Herman Chen
75d0b29681 [misc]: Astyle format change
Change-Id: Ieec4152cc58faf1714bc752df7cb3c408ae9383a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-29 11:39:37 +08:00
Johnson Ding
da0f013bc6 [jpegd]: Fix vpu1 encoder problem
1. When the width of a input picture is not stride to 16, vpu1 will
encountered Page Fault problem.
2. Make hor_stride and ver_stride less ambiguous, since they
should be set to original values from outside configuration, not the result of
MPP_ALIGN from mpp inside, although they should be exactly equal.
3. Fix the caculation of xFill in vepu2, this should be divide by 4.

Change-Id: I3e6c394ff9c15a730714a0e5938d18ca83c24d09
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-24 10:45:37 +08:00
Herman Chen
3426e7b28e [hal_h264e]: Change hal_h264e debug flag
Change-Id: I6ace4915c1213f4c9c65678920a2ae863211c814
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-24 10:39:46 +08:00
Rimon Xu
a3116b8ce4 [ion]: scandir operation need to be protected by lock.
When multi thread calls scandir, crash may occur, so
the operation needs to be synchronized.

Change-Id: Idbdf539208259313d36c4acd17934af0e4dcf911
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-04-23 15:10:24 +08:00
Johnson Ding
c853e6e0ec [vp8e]: Fix vp8e SEGV_MAPPER error in 64-bits environment
Change-Id: I0116f1e9720c7faba35527368884eec75997b56f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-23 09:31:42 +08:00
Herman Chen
131e76f7af [h264e]: Rename h264e_stream module function
Change-Id: I41d3904b1e315aa090be3d24d20e8ca726acd99c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:08 +08:00
Herman Chen
ef9d577baf [h264e]: Separate h264 encoder stream writing
Separate h264 encoder stream writing to a new module.

Change-Id: Ibf55a20ac73e4eb2e3a3d744573eded3ebd92662
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:08 +08:00
Herman Chen
a1ae919a33 [h264e]: Remove unused i_frame_packing
Change-Id: Ia53c2513bc57dde47960c06374d1c6d5fa729da7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-17 14:35:07 +08:00
Johnson Ding
90b2a3838c [vpu]: Fix encoder's improper operation with eos
When encoder receives an empty frame with eos flag set, encoder will
encode an unreasonable extra frame.

Change-Id: I3bd1a2c84780f1b6212171117b67319b2f613b9f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-12 09:52:02 +08:00
Johnson Ding
869ff44980 [jpegd]: Fix jpegd decode error when img without DHT
That is a coding mistake.
See issue: https://redmine.rockchip.com.cn/issues/201155
In the attachments, the "cam.jpg" is a jpeg file without DHT. And it can
be used for testing.

Change-Id: I68086a19958b353d5aee6597b47ee9ac8b02c4d0
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-04-11 11:37:10 +08:00
Herman Chen
557a24810a [jpegd]: Fix dec_pp mode error
Jpeg decoder with format conversion will use dec_pp mode. On this case The
sw_dec_out_dis flag need to be set in jpegd_setup_pp function. But this
flag is clear in later jpegd_gen_regs again which will lead to failure
on dec_pp mode jpeg decoding.

This fix move jpegd_setup_pp into the end of jpegd_gen_regs.

Change-Id: I6604d9593ec72ac58ad8a1757c6655bedc6b92fe
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-11 11:31:30 +08:00
Herman Chen
ef5c4bc192 [mpp]: Merge notify flag
Merge nofity flag on info change.

Change-Id: Ia46f6de4e4a0f74ab7ef30f0d630ddc48e868cd9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-04-02 18:05:06 +08:00
Rimon Xu
35019b7d37 [mpp_dec]: Add wait condition with buffer mismatch.
When the buffer does not match, frame group needs to modify
the buffer size before it can be used properly, so it needs
to wake up the wait.dec_buf_match condition after info changed
ready.

Change-Id: I3ef7b2bf59d7649cf0e05731a2e51f40fd082535
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-04-01 11:37:55 +08:00
Rimon Xu
1e7e0faf2d [h264d]: fix sps level invail force to dpb size error.
Change-Id: I0a87ae6f16a3d7254eea8808ec89ac9bfb718db4
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-03-25 14:42:57 +08:00
Herman Chen
fecf31621c [vproc]: Add iep open check to avoid noisy log
Change-Id: I2d2aa49ce4ba9fe2b80dd72b60c286ffd2115195
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-03-19 16:00:07 +08:00
sliver.chen
2dc830f071 [vp8e]: add vpu1 and vpu2 vp8e supprt.
commit a base version of vp8 encoder,include vpu1 and vpu2.
encode input raw picture to ivf stream.

Change-Id: I9ac697edf2249a4ca7464fdbfb5fd22a63fd3c34
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-02-01 18:26:26 +08:00
Herman Chen
056e17df92 [hal_jpegd]: Improve address setup
1. Use mpp_device_patch_add to setup address offset patch
2. Disable slot size check in mpp_dec

Change-Id: Id3c8d94b793cf126040f627c5c67ed0390f0ac86
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-21 09:56:13 +08:00
Herman Chen
095f77b748 [hal_jpege_vepu]: Fix output stream length error
Vepu will return stream write length in 64 bit unit from input aligned
address. So final output length should count from 64 aligned sofeware
header address. Otherwise there will be extra gabage data at the end of
output stream.

Change-Id: Ic96a2bf6599f023a5c13b5f3acf219c231ac3327
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-21 09:56:13 +08:00
Herman Chen
f367af4a37 [utils]: Add YUV420P dump frame support
Change-Id: I0a63b03ab1bb5fb5fdcf52eadc2bde52319d155b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-15 15:33:51 +08:00
Herman Chen
b2d1f805dd [hal_h264d_vdpu1]: Fix handwriting error
Change-Id: Icd837f075d75efe822e88b4c533711ada3c2821e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-01-15 10:22:29 +08:00
Ding Wei
930a273730 [h264d]: fix bug: fast mode buffer malloc
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>
2019-01-11 17:17:42 +08:00
sayon.chen
3642e59e7c [h265d]: Fix prepare failure on non-standard stream
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>
2019-01-11 10:39:34 +08:00
sayon.chen
f7ded0e377 [h265d]: fix hevc parser extra data crash
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>
2019-01-07 16:49:35 +08:00
Johnson Ding
c8875a2db9 [mpp]: avoid crash when dumping a frame whose fd is -1
Change-Id: I6c7252ac32a4b857a79a4203fdaa56a2f0443645
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2019-01-07 09:12:53 +08:00
hh
ce946385b0 [h265e] fix bug set parameters of gop and rc
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>
2019-01-04 16:29:11 +08:00
Rimon Xu
ea21bdfc5d [h264d]: add sei parser for pic timing.
parser picture timing to judge frame type.

Change-Id: If573a36d84a521ce6a4d4d53905a2822e822baaf
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-01-04 16:28:48 +08:00
Rimon Xu
d6bf6dd894 [h264d]: error stream adpative.
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>
2019-01-04 15:10:36 +08:00
Herman Chen
10c9a2d64e [jpegd]: Add vpu jpegd stream patch
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>
2019-01-02 15:40:04 +08:00
hh
ed43d014be [h265e] translate input format for H265E
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>
2018-12-19 11:30:59 +08:00
hh
8f4199a0f4 [rga]: fix bug of rga config
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>
2018-12-19 10:49:08 +08:00
Herman Chen
14de09a401 [jpege]: Add YUYV422 format support
Change-Id: Idbecbab280ce1128d21ee6656307b6c95a9523cf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-12-19 10:44:41 +08:00
Herman Chen
50d2179ff5 [vepu]: Fix row length errror when not aligned
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>
2018-12-12 10:43:29 +08:00
Herman Chen
e350315c34 [mpp_dec]: Fix eos on info change
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>
2018-12-10 16:21:36 +08:00
Rimon Xu
b4199f0c84 [vproc]: close iep config: dei_high_freq_en = 0
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>
2018-12-05 10:42:04 +08:00
Herman Chen
4a6fd29168 [h265d]: Fix error on multi-frame packet decoding
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>
2018-11-30 18:19:08 +08:00
Ding Wei
1babbc9cc2 [h264d]: fix bug: fast output frame
tip: when first frame is field, missing to write out.

Change-Id: I22f3e6041b9cceebefd3bec953c333a91e721b00
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-21 10:28:58 +08:00
Jeffy Chen
1bd32f0745 [cmake]: Skip processor detection for buildroot toolchain
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>
2018-11-21 10:23:35 +08:00
Ding Wei
3e5ad4fed3 [h265e]: add h265 encoder code
Change-Id: I08350dc76d3040bc1a16a3d8234f836f5fbf69d0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-21 09:59:31 +08:00
Herman Chen
4553fac11e [test]: Add read packet config function
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>
2018-11-21 09:57:32 +08:00
Herman Chen
a0f76729d5 [utils]: Optimize YUV422SP frame write function
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>
2018-11-20 11:43:06 +08:00
Ding Wei
455832480f [mpp_bitread]: fix bug when using mpp_read_longbits
tips: when bits less than 16, it will be wrong.

Change-Id: I8e371f77dfdd6dcb37eb75d66ca039a37d16d9cf
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-19 10:37:50 +08:00
Herman Chen
e2b49ac9d4 [mpp_dec]: Fix stuck issue on field source seek
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>
2018-11-19 10:37:34 +08:00
Ding Wei
44b1e15f7b [vp9d]: remove warnning for unused variabled
Change-Id: I4bbd1f5ce31c903333a374d5c210717fd3e57383
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-11-14 10:56:27 +08:00