Commit Graph

3324 Commits

Author SHA1 Message Date
Chandler Chen
dd1be23a61 [h264d_api] add compatible for avcc fmt judgement
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: If7b077238c21fb5b4e07d8073e093350afc98984
2023-02-10 09:56:38 +08:00
Yandong Lin
404a526759 [av1d_vdpu]: optimize some debug info
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ice87860624585cf73502aeafb2a5953b116eb7b2
2023-02-09 16:11:18 +08:00
Yandong Lin
0801cf6cb6 [av1d_vdpu]: fix dec err for streams with infochange
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ia2a9e2303238b5f7f4d185d5c4254a4db26f1a93
2023-02-09 16:11:18 +08:00
Yandong Lin
d9430171f9 [av1d_parser]: fix split frame issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9e96b099e47352ad986253a2ed8278569d48cf3a
2023-02-09 16:11:18 +08:00
Yandong Lin
a7401eded1 [av1d_parser]: fix parse err with unknown metadata
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie6a7c1085bd126c6b776b53f2488f7700aa6d395
2023-02-09 16:08:42 +08:00
Yandong Lin
efd877e4d2 [av1d]: fix dec err for stream with seperate tile groups obu
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib50dd56ad65fbf298b288ebdff0344151de88aa5
2023-02-09 16:08:42 +08:00
Yandong Lin
ba36d64fee [av1d]: fix gm params parse issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5eadcdccba796201ba697c12f6983579608e0998
2023-02-09 16:07:01 +08:00
Herman Chen
eee1ed838e [mpp_dec]: Fix crash on send eos frame to vproc
When sending eos frame to vproc with -1 slot_index and decoder is reset
the -1 index will enter mpp_buf_slot_get_prop and trigger slot assert.

Remove the mpp_buf_slot_get_prop process and just wait until vproc
thread is idle.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Change-Id: Idf4a523ea039a16c92cd466f6d8d954f5709e70e
2023-02-02 10:31:45 +08:00
Johnson Ding
5652daa280 [vdpu382_avs2]: Fix ref info reading at link mode
According to patch at https://10.10.10.29/c/rk/kernel/+/174932,
reference usage should be read from reg265.

Change-Id: I59aa3476e90a85debaf2f64e7aa64c2a75b621fa
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-02-01 17:42:12 +08:00
xueman.ruan
4c9071d19a [vp8e]: Fix vp8 reencode logic error.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I0ca2e7725fb2dfb746c882eed14c0e9cf17353db
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-01-31 11:40:35 +08:00
xueman.ruan
69870145ef [avs2d]: Fix fbc output error.
1. add offset_y for output frame.
2. set hor_stride 64 aligned.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: Ie399c2d1f9d783e498d16fbaa409529f7dff71ea
2023-01-29 08:56:27 +08:00
Herman Chen
f36b3425dc [h264e]: Add segment info for gdr prefix nal
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I12a5efd496496ddba43f15a3a5358bcbed86ec94
2023-01-15 15:26:12 +08:00
Chandler Chen
8189983f15 [vdpu382] fix build error
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I57ac847f07ae7a4e627bdfc2c7e0978477184e9a
2023-01-15 09:49:01 +08:00
Johnson Ding
75fa02920f [h264d]: Fix MVC slice parsing error
When packet is splited outside, the slice_layer_extension NALU won't be
store correctly. We need to treat it as a normal slice NALU.

Change-Id: I4bc3a700e30dffd6a028b63876773889cb01eaff
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-01-13 14:49:09 +08:00
Chandler Chen
4c14bb1556 [mpp_soc] dec hw_cap add cap_colmv_compress
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I13b98c5227f03a235c48cfdb639286e7ee595b3f
2023-01-13 14:20:00 +08:00
Chandler Chen
726840336e [mpp_soc] add hw cap for rk3528
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Iadd4e3b99789a52f24a8da1dc96896ffc59a0266
2023-01-13 14:20:00 +08:00
Chandler Chen
1756c9a4de [mpp_soc][hal]: Add rk3562 support
add hw_id define for rk3562 & rk3528

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Ie32ecec242da6bdcb59a1df3e3f2a3a1a54fd695
2023-01-13 14:20:00 +08:00
Yandong Lin
f3c5e843cb [vdpu382]: add two mode to config rcb info
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5b90f129ee29ed656b5b1c47a268274de29de6c2
2023-01-13 10:17:53 +08:00
Herman Chen
101d43bef1 [mpp_enc]: Send header on gdr recovery point
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I50a3420555320dd77eceee038d53afeade35963f
2023-01-12 16:25:08 +08:00
Yandong Lin
d9fd027ab3 [vdpu382]: optimize the rcb buf size calculation
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie32b0a973bb999960a65aa03204eefe503ecc7fc
2023-01-12 16:09:49 +08:00
Yandong Lin
7f676f7099 [vp9d_vdpu34x]: fix vp9 dec err on multicore parallel
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id5658d7d6bf61255ff3966a213e6250b7ae4fc22
2023-01-12 16:02:07 +08:00
Chandler Chen
97f4c8ef90 [mpi_dec_multi_test] fix output frame_count > frame_num issue
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I87601b91cbbb3561ec022cb5e8e936876f2f6202
2023-01-12 11:34:47 +08:00
Johnson Ding
6ac409acf0 [vepu580_hevc]: optimize intra setting
The old rountine will spend too much time at configuring intra flag at
ROI configuration buffer. For lower time cost, simplifying bits
configuration, and not operating DMA buffer directly.

Change-Id: Ia8af52bba1dca941811ae2c4e776d57e529bd663
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-01-11 11:09:27 +08:00
Johnson Ding
cc703a6cd9 [vepu]: fix roi setting page fault
Change-Id: Ifed795d9fda47760b436d620ecfdea02b2ee00a2
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-01-11 11:09:12 +08:00
Hongjin Li
e9df981525 [vepu580_gdr]: Support h264&h265 intra refresh
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ib6745640702522bb671854ca1dfc1f5802c2c399
2023-01-11 11:04:44 +08:00
Hongjin Li
4a134b5042 [vepu540_gdr]: Support h265 intra refresh
Change-Id: Ie5472d078bf7d67e6df9b748de1ef6ee800559ec
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2023-01-11 11:04:44 +08:00
Hongjin Li
962a88827b [vepu540_gdr]: Support h264 intra refresh
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Ia30e11d29f24f82525ed675142dbdd42a07b4d6c
2023-01-11 11:04:44 +08:00
Hongjin Li
0ee683acf3 [enc_gdr]: Platform supports intra refresh
Add parameters required for intra refresh
Add rate control corresponding to intra refresh

Change-Id: I6dbaf70e3c50cd0debf909ded9fb5c4f30df26ec
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2023-01-11 11:04:44 +08:00
Yandong Lin
6ff45db4e8 [h264d_api]: fix misjudging as avcc fmt issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie96deb45f7c609bca5b504cb501d07f40f51cd26
2023-01-11 10:15:40 +08:00
Rimon Xu
c25c137b6c [h264d_parser]: fix decode parser crash
cpb_cnt_minus1 need to check value less than 32. Otherwise,
it will cause memory otherwise.
crash trace:
0)  0x0000007fa03e5864 in update_curbyte_h264 (bitctx=0x325a1b20)
    at mpp/base/mpp_bitread.c:45
1)  0x0000007fa03e59ac in mpp_read_bits ()
    at mpp/base/mpp_bitread.c:106
2)  mpp_read_bits (bitctx=0x325a1b20, num_bits=1, out=0x7f64feb568)
    at mpp/base/mpp_bitread.c:95
3)  0x0000007fa03e5c0c in mpp_read_ue (bitctx=bitctx@entry=0x325a1b20, val=val@entry=0x7f64feb5bc)
    at mpp/base/mpp_bitread.c:225
4)  0x0000007fa03f7034 in read_hrd_parameters (p_bitctx=p_bitctx@entry=0x325a1b20, hrd=hrd@entry=0x325a0e58)
    at mpp/codec/dec/h264/h264d_sps.c:55
5)  0x0000007fa03f7aa0 in read_VUI (vui=0x325a0e08, p_bitctx=0x325a1b20)
    at mpp/codec/dec/h264/h264d_sps.c:117
6)  parser_sps (p_bitctx=p_bitctx@entry=0x325a1b20, cur_sps=cur_sps@entry=0x325a01a0, p_Dec=<optimized out>)
    at mpp/codec/dec/h264/h264d_sps.c:272
7)  0x0000007fa03f7e60 in process_sps (currSlice=currSlice@entry=0x325a1bb0)
    at mpp/codec/dec/h264/h264d_sps.c:453
8)  0x0000007fa03f588c in parser_one_nalu (currSlice=0x325a1bb0)
    at mpp/codec/dec/h264/h264d_parse.c:240
9)  parse_loop (p_Dec=p_Dec@entry=0x3259fa00)
    at mpp/codec/dec/h264/h264d_parse.c:912
10) 0x0000007fa03f38c4 in h264d_parse (decoder=0x3259fa00, in_task=0x7f64feb7e8)
    at mpp/codec/dec/h264/h264d_api.c:594

Change-Id: I3f2bdcb603cdbcf4757f32db162924c575e739fd
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2023-01-10 17:37:38 +08:00
xueman.ruan
3831e531dd [h264d]: Fix incompatible compare warning.
this issue is introduced by patch as followed.
    Change-Id: I2386f3a215027d2cda9a189bc49806f6358cf9ef

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I6e2587bcbc87fdfe1b63cfbe6705c072d6eb5d4c
2023-01-09 11:57:49 +08:00
Rimon Xu
6e42f173ec [h264d_parser] fix MVC decode crash
When there is an MVC type in the slice, but no MVC view actually
exists, this situation needs to be treated as an AVC source.
crash backtrace:
0)  0x0000007faa485f1c in set_slice_user_parmeters (currSlice=0x20b363e0)
    at mpp/codec/dec/h264/h264d_slice.c:345
1)  process_slice (currSlice=currSlice@entry=0x20b363e0)
    at mpp/codec/dec/h264/h264d_slice.c:464
2)  0x0000007faa485804 in parser_one_nalu (currSlice=0x20b363e0)
    at mpp/codec/dec/h264/h264d_parse.c:233
3)  parse_loop (p_Dec=p_Dec@entry=0x20b34240)
    at mpp/codec/dec/h264/h264d_parse.c:912
4)  0x0000007faa4838c4 in h264d_parse (decoder=0x20b34240, in_task=0x7f8926b7e8)
    at mpp/codec/dec/h264/h264d_api.c:594

Change-Id: Icc975dc8209b85679a2e1c8e095f24109c730422
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2023-01-09 10:26:31 +08:00
Rimon Xu
04b0a9f279 [h264d_parser]: num_views_minus1 use RK_S8 instead of RK_U8
num_views_minus1 maybe is -1, when type is RK_U8, the value is
255, num_views will be 256, correct num_views_minus1 should be
-1, num_views is 0.
crash backtrace:
0)  0x0000007f99216b64 in fill_picparams (p_Vid=0xd8065a0, pp=pp@entry=0xd8089c4)
    at mpp/codec/dec/h264/h264d_fill.c:229
1)  0x0000007f9921632c in init_picture (currSlice=0xd805dc0)
    at mpp/codec/dec/h264/h264d_init.c:2066
2)  0x0000007f9920ad38 in parse_loop (p_Dec=p_Dec@entry=0xd803c00)
    at mpp/codec/dec/h264/h264d_parse.c:929
3)  0x0000007f99208abc in h264d_parse (decoder=0xd803c00, in_task=0xd80b770)
    at mpp/codec/dec/h264/h264d_api.c:607

Change-Id: I2386f3a215027d2cda9a189bc49806f6358cf9ef
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2023-01-09 09:48:22 +08:00
Yandong Lin
5e76528fd6 [hal_vdpu382]: enable fbc head fill when error
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9e7fbdbfda7a1cd7678000a9de679922c6a71da8
2023-01-09 09:40:07 +08:00
Johnson Ding
cce925058a [h264d]: Fix MVC decoding error
Layer id and view id information setting to hardware SPS, RPS should be
cleaned for each frame, otherwise the base layer will encountered error
for some MVC bistream.

Change-Id: I830768ad65fba1be6ab6bf4092d938c6134a288d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2023-01-06 19:09:26 +08:00
Rimon Xu
3c90e68fb8 [h264d_parser]: use calloc instead of malloc subsps pps struct
malloc will bring random values, resulting in some unknown errors

Change-Id: I22d5f61edb09780e3145397c0509eb71b7bf1183
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2023-01-06 19:08:40 +08:00
Hongjin Li
520980b83b [h264_dpb]: add fast play once
fast once can be controlled by cmake cmd:
-DENABLE_FASTPLAY_ONCE=ON

Change-Id: Id0073ef8356acec700030b98b417d4f6999bf894
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2023-01-05 18:42:49 +08:00
Hongjin Li
219b81cf8b [h264_dpb]: Fix frm with negative poc is marked err issue
[Scenes]
poc has negative value
nal_reference_idc is not 0

[Issue]
Mark the current frame as error frm, when the poc value is
less than the I frame(such as negative poc).

[Solution]
Add a flag to judge whether the I frame has been output.
In the case of current frame poc is smaller than the I frame poc:
1. The current frame will be marked with an error flag, when
the I frame has been output.
2. The current frame will not be marked with an error flag,
when the I frame has not been output.

Change-Id: I164cea77fce031716645b5c5c992a0bcf737dd4e
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2023-01-05 18:41:33 +08:00
Herman Chen
e402a8423f [h264d]: Fix fbc_hdr_offset error issue
The impl->width is invalid before it is initialized.
So move fbc_hdr_stride setup after impl->width is initialized.

This issue is introduced by:

commit 5469f9d08b
Author: Herman Chen <herman.chen@rock-chips.com>
Date:   Fri Dec 23 16:38:54 2022 +0800

    [misc]: Add compatible for fbc header alignment

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I3f3f4bfd2d84b813c900e05492eb6df5ea6f7a29
2022-12-30 16:54:45 +08:00
dawnming.huang
9793b87ae2 [vpu_api_legacy] add contorl fbc horstride 256 odd align
Change-Id: Ife97b9585f9471705557612139c03caea479268b
Signed-off-by: dawnming.huang <dawnming.huang@rock-chips.com>
2022-12-30 12:32:14 +08:00
Grey Li
9b9ba0e645 [mpp_buf_slot]: fix fbc buf size calculation
calculate fbc size according to ext_fbc_hdr.

Signed-off-by: Grey Li <grey.li@rock-chips.com>
Change-Id: I5b66460798cb70512ceb9c142bab42d7dd817231
2022-12-28 08:52:25 +08:00
Chandler Chen
272caca7c1 [h264d]: fix possible poc_used_bits counting error
when poc_used_bits calculation met emulation prevention byte,
poc_used_bits counting need to minus emulation_prevention_bytes_

related issue:https://redmine.rock-chips.com/issues/389676

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Ibc1b077d836412743aaddd868d16eda8685ca307
2022-12-27 18:08:18 +08:00
xueman.ruan
68b1e1072e [h264d]: Fix empty EOS process error.
Dpb can not be flushed before split process when sending EOS in split mode.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: Id8ac89960ea2311f06ab80a2551ee114afafc83f
2022-12-27 17:53:47 +08:00
He Hua
93b1cd14f2 [vpu_api]: modify struct VideoFrame
1. add viewid in struct VideoFrame for mvc output
2. modify reserved to int type for future

Signed-off-by: He Hua <hh@rock-chips.com>
Change-Id: Ib95999221bef8c9d385b70736ab7978926a78836
2022-12-26 11:00:49 +08:00
He Hua
0f15067fcb [vpu_api]: Support mvc enable/disable cmd
Signed-off-by: He Hua <hh@rock-chips.com>
Change-Id: I58ffbfff1e9df937f54f8a92422838e30c49c15a
2022-12-26 09:31:33 +08:00
Herman Chen
dde7c5ae48 [vepu5xx]: Fix encoder hw stuck
Set rfp_load_thd to zero to avoid reference window timeout stuck.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0d24ef109304cb3262167538e2872447bad707f7
2022-12-26 09:24:44 +08:00
Johnson Ding
f07778c8c1 [vproc]: Fix output frame repeated problem
For IEP2, the first two frames will be deinterlaced at I1O1 mode. I5O2
mode only works when the 3rd frame arrived. Thus the 2nd frame will be
deinterlaced twice and PTS will be repeated as following pattern:
-------------------------------------
IEP in  : 0   1   2       3     4
IEP out : 0   1   0.5 1   2.5 3   3.5
-------------------------------------
To fix this, just skip the 2nd frame processing.

Change-Id: I2d66951a941a664da093f1b9edbdd73855c57060
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2022-12-26 09:02:19 +08:00
Grey Li
5d3623ac29 [mpp_buffer]: fix group callback crash
thread1:
  1)control(MPP_DEC_SET_EXT_BUF_GROUP)
  2)mpp_buffer_group_set_callback
    p->callback = callback;
thread2:
  1)mpp_buffer_commit
  2)mpp_buffer_create
    group->callback(group->arg, group);
    But arg is NULL now.

backtrace:
  #00 (Mpp::notify(void*))
  #01 (mpp_buffer_create+712)
  #02 (mpp_buffer_import_with_tag+212)
  #03 (commit_memory_handle+116)

Signed-off-by: Grey Li <grey.li@rock-chips.com>
Change-Id: Id50e2f1b46d127c8bf0fe8080751949fcccc6e25
2022-12-23 18:23:09 +08:00
Herman Chen
5469f9d08b [misc]: Add compatible for fbc header alignment
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0ae4ec4b8603648a7186d0cccf63aa3ea3fb29b3
2022-12-23 17:36:34 +08:00
Herman Chen
f115d415b4 [mpp_dec]: Fix stuck on not enough buf slot
Add buf_slot callback to notify decoder parser flow.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ie193225f54d65f1e27326915f28f4c0ddfd03d43
2022-12-22 14:28:26 +08:00