Commit Graph

3026 Commits

Author SHA1 Message Date
Herman Chen
53f4de365f [misc]: Remove unused include of mpp_buffer_impl.h
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ibb43ea044781313d64d781f1498a486cd81b17dd
2020-08-20 08:57:04 +08:00
sayon.chen
16e26697e0 [vepu541_common]: Fix ROI cfg random value
Flush roi buf to default cfg when ROI region is invaid

Change-Id: I7a6b8373db947657c8eff9a0e7458b215a82e17a
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-18 11:40:11 +08:00
Herman Chen
fbcaa0e9f6 [mpp_enc_cfg]: Format encoder configure string log
Change-Id: Iab89ac7a81d1a0651816f0ec0cec1a61143a0dd0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-13 15:42:15 +08:00
sayon.chen
f5e2f6e1ee [vepu541_hevc]: Adjust rc parameter set
Change-Id: Ibcb5b57def106125b7ad6cb6fb9f95f9e332e8e5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-13 15:17:12 +08:00
sayon.chen
49548c171e [rc_v2]: Adjust reenc policy and I frame bit alloc
1. Modify the thresh value for I and P frame
2. I frame reencode qp calc by (log(b_t) - madi * b - c) / a
3. First_frm_flg will clear after rc_hal_end
4. Cbr case max i_scale for bit alloc clip to 800

Change-Id: I65222f1747a8ab1e0c5c3ea45bfd607d33890cdc
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-13 15:15:23 +08:00
sayon.chen
2b473a88d2 [rc_v2]: Reorganize cbr water level ratio
1.inlarge water level ratio range
2.modify debug log

Change-Id: I069be1d10f21280d54359ff5b3b79c6587c86eba
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-13 15:08:50 +08:00
sayon.chen
d5f8e9a441 [mpp_enc_v2]: Fix reencoder flow issue
Change-Id: If8543d4501c726fe504d04eaeb7103fd1583cda4
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-13 15:03:09 +08:00
Johnson Ding
9c7da3919d [jpegd]: clear regs before generated
Application may call jpegd decoder without doing re-initial for every
single JPEG image. In this case, if registers are not fully cleaned,
there may be something wrong with decoder.

Change-Id: Ia8c2b01b0fb31047b749a88bd67a7affc593150b
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-08-13 11:47:26 +08:00
Herman Chen
455e1ceb40 [legacy]: Add VPU_API_SET_PARSER_SPLIT_MODE ctrl
Add VPU_API_SET_PARSER_SPLIT_MODE control for MPP_DEC_SET_PARSER_SPLIT_MODE

Change-Id: I7d6c2738f8d39ac4b179ae5d0c8534b580de80b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-11 11:52:41 +08:00
Ding Wei
84e9f44108 [h264d]: remove nalu_type_prefix in judge new frame
tip: nalu_type may insert in slices of one frame. thus, it cannot
consider it the new frame start prefix.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Iee6022f69d10d22a6ddfbeb6722b9fc0092d67a7
2020-08-11 10:30:00 +08:00
Herman Chen
177a97a14f [jpegd]: Fix qtable print
Change-Id: I579322382a431d3a9b46d88faa0a2138cd5ef4d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-10 17:06:18 +08:00
Herman Chen
c2b04493d2 [hal_h264e_vepu1]: Fix prefix syntax read error
Change-Id: I86855cacb12d958d1a5872578f16c8d1a69acdfc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-07 18:12:11 +08:00
Herman Chen
2549bbf657 [legacy]: Fix vpuapi color format print
1. Fix vpuapi color format print.
2. Fix decoder usage on rk3399. Default on rk3399 should use rkvdec to
decode H.264 stream.

Change-Id: I65fb41e9ca5c6448e96e20c7ead139d8f38f7229
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-07 16:16:53 +08:00
Herman Chen
e48ece08be [legacy]: Align input ver_stride to 8 not 16
1. The input ver_stride can not be set by EncParameter. It is better to
align it to 8 not 16 to avoid green lines at bottom when the input frame
buffer is not aligned to 16.
2. But the allocated buffer size should be aligned to 16 to avoid
hardware error because hardware requires 16 aligned buffer to access.

Change-Id: I402ac167f29e22c9c363135e95bb4ad431d3c3ef
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-06 14:54:09 +08:00
Johnson Ding
408c54cd82 [h264e]: remove unused definition
Change-Id: Ia1b83318e87c504e3a3632dfab08f0a832711498
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-08-05 18:35:17 +08:00
Herman Chen
21c21209c8 [h264e]: Add qp_delta_ip
The qp_delta_ip for H.264 is 3.

Change-Id: I33c052489011e93e8b496a284a84db1450ef5981
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-05 18:13:59 +08:00
sayon.chen
07170b1903 [mpi_enc_test]: Update cmd param used utils set
Change-Id: I87e33de9f592974e52a19259d1a7a0d3c8542b8f
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-05 18:13:59 +08:00
sayon.chen
71f9142c50 [mpp_enc_utils]: Add more cmd params set
1. -b bps_target:bps_min:bps_max:rc_mode
2. -g gop_mode:gop_len:vi_len
3. -x read ini cfg

Change-Id: I937d2200da9427d7079eeb437e379db11c7e29d7
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-08-05 18:13:59 +08:00
Herman Chen
f151697412 [hal_h264e_vepu]: Warn the stride issue only once
Change-Id: Ib989b0e85ba3d44f7e9ed075f538882cbdc00087
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-08-05 16:19:15 +08:00
Johnson Ding
cba637c3f1 [jpege/h264e]: fix RGB encode config
Change-Id: Iec9d928ad6fb1a31cbf6f224b264ebb6797294a3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-08-05 10:52:05 +08:00
sayon.chen
4a61fda3cb [vepu_api_v2]: Fix rotation issue
1.when input set rotation 0->90->180, due to 0->90 w&h will sawp
if only set 90->180 w&h no change will cause error,so when
rotatio must recheck w&h
2.when input is fbc no support rotation and mirror

Change-Id: I4e77b10e25fd66caccaa131be8a9063570f1e3df
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-07-31 16:15:45 +08:00
Herman Chen
f16b87ae0f [legacy]: Disable mlvec frame_qp by default
Change-Id: I06e45693c37303b8dfb31471e56f8679ed79bce4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-31 14:35:47 +08:00
Herman Chen
83eadfb637 [rc]: Fix FIXQP mode quality setup
Change-Id: If0f7763af36cbeecc87f48c97beddab3abad0a41
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-30 14:44:28 +08:00
Herman Chen
33ea28d42e [legacy]: Fix legacy bps config typo
Change-Id: Iffe761aed418179171ef024f5ba8b207ba46d884
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-30 14:13:54 +08:00
sayon.chen
95e7a230d2 [h265d_hal]: Fix h265d cycle reg pos issue
Change-Id: I21b26aa182dfd42e912b08ef6f742513699cef29
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-07-29 17:38:06 +08:00
Herman Chen
41dd3ea054 [test]: Format mpi_dec_test output log
1. Add temporal layer id print and error/discard value print.
2. Add mpp instance print to separate different instances.

Change-Id: I4d85e4ec80e957316a6aab82e3661e27389bebc8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 16:21:45 +08:00
Herman Chen
1b926a4f0c [h264d]: Add temporal layer id report
When there is prefix nal report temporal layer id by metadata in output
frame.

Change-Id: I0b420a3c39f1955f2c9ae39d16ecf7c061fe4766
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 16:20:13 +08:00
Herman Chen
c31fd4dc27 [enc_utils]: Add tsvc demo (control by gop_mode)
Change-Id: I034d631b3d6c473b82d12e3434860c7f8e9f9318
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 14:11:22 +08:00
Herman Chen
69c42f78d3 [test]: Format mpi_enc_test output log
Change-Id: Idd62077731b65570ab535954280e148f637719fa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 11:41:53 +08:00
Herman Chen
708c6668b5 [h264e]: Add more info report by packet metadata
Add temporal layer id and long-term reference index of current frame by
metadata in output packet.

Change-Id: I095437f1aacd13fa54c8cb1e3a5272c080db2ec1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 11:40:05 +08:00
Herman Chen
e638362114 [mpp_enc]: Add max/min intra qp for H.264
NOTE: may change the behavior of get cfg

Change-Id: I1b3cd4cbbe7dc0f03e4cc38f1e831e429d4911c2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 10:26:30 +08:00
Herman Chen
5b47293917 [mpp_task]: Improve mpp_task queue work flow log
Change-Id: Ifa39726f376ac0254a8a88189b1cb918fb33a2f9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 09:22:04 +08:00
Herman Chen
3f2a548916 [mpp_enc_refs]: Add refs configure force path
1. Add keep_cpb flag to keep the cpb status on refs cfg changed.
2. Add hdr_need_update check flag for resend header.
3. Add force flag implement in refs process.
4. Do not resend header on max_tid change only.
5. When gop is update the cpb should restart.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2eb3191ce6f45ccea081fa861e4927abae96ff2b
2020-07-29 08:33:39 +08:00
Herman Chen
df0a7f0203 [h264e]: Add poc type / poc_lsb / frm_num setup
1. Add poc type / poc_lsb / frm_num default device value.
2. Add force update path.
3. Sps will use codec cfg directly.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5f23b74f0453213c89c7238a36570484b91b48ce
2020-07-28 11:29:49 +08:00
yandong.lin
ad8be25073 [h265d]: cut slice header extension data
1. when slice_header_extension_present_flag is 1 in pps segment
2. we should cut the slice header externsion data in slice header segment

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I074e64f6e6c62e4bcc8a12f95c49aa6cf77505c1
2020-07-28 10:56:20 +08:00
Herman Chen
f7e400f8b7 [mpp_enc_v2]: Check meta before getting user data
Use has_meta to check input frame has meta data or not. Otherwise each
frame will have a metadata.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I166346b668fe5ec46032d5c27a7a368fe2fea3b1
2020-07-27 18:07:01 +08:00
sayon.chen
03c91713cf [h265e_vepu541]: update hevc l2 reg atf_thd
Change-Id: I1403843694de37702a2e391c953dac4b03ed18bf
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-07-27 17:37:57 +08:00
yandong.lin
0f91ba604c [jpege:] Add q_factor and qtable
Add q_factor and qtalbe interface

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I6b59d0b2e740e4b2815e7c83ad9a3641fe700e2f
2020-07-27 17:37:38 +08:00
Herman Chen
576650aa05 [misc]: Remove some encoder runtime print
1. Remove rc api impl print.
2. Remove mpp_enc_cfg create print.
3. Change mpp_enc_cfg init and show log on node count.
3. Add header resend log.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I273db39b844d8c3fcd6a0ac9763a4df9b65b56d0
2020-07-27 16:37:31 +08:00
Herman Chen
483d77ccc8 [mpp_enc_refs]: Change cpb info print function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic57f96a1ead552d54f4eb9da4bec4c0eae619fe9
2020-07-27 13:58:48 +08:00
Herman Chen
8fedaf96a4 [rc_model_v2]: Add force frame qp path
Change-Id: Ic7bf13188357e20d4851fc045cc77cf8611c83b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-27 10:56:03 +08:00
Herman Chen
94afabae3d [h264e_api_v2]: Add more configure update check
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I5bba62769882980f91501a58c954b0f9f5321c91
2020-07-24 17:19:03 +08:00
Herman Chen
37ba4229ad [hal_enc_task]: Add MppEncRefFrmUsrCfg
There force reference frame user configure is added to encoder task.

Change-Id: I4482a831f988f47913c6e1d0385ccbdd0cd46031
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 16:18:31 +08:00
Herman Chen
6a64cde817 [mlvec]: Add MLVEC interface in vpu_api
1. Add vpu_api_mlvec module.
2. Attach vpu_api_mlvec module to vpu_api_legacy.
3. Add static and dynamic configure process.
4. At VpuApiLegacy::init if the extra_data is NULL do not get sps/pps.
5. Add VPU_API_GET_EXTRA_INFO (0x200) control to provide sps/pps.

Change-Id: I4666148ba4c150eea81bfa8cd25b63264cd16a2b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 16:18:31 +08:00
Alpha Lin
9523c81879 [IEP] remove warnings during iep2 library build.
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Change-Id: I5f0d8ae75350d0401f28a1945c9dc1397bbd626d
2020-07-24 16:18:31 +08:00
Alpha Lin
d9cce8d0e1 Add iep2 HAL library and unit test
Add iep2 HAL library and corresponding unit test.
Add a adapter layer for iep and iep2 compatible.

there will be libiep2.so generated after build.
this library will support direct using iep2 api outside
MPP platform, such as using in analog camera application.

Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Change-Id: Ide9662bf099e5374602dda7417ee6973de64c912
2020-07-24 15:05:06 +08:00
Herman Chen
aec5989e03 [hal_h264e_vepu]: Add checking on nal_ref_idc
Mainly for MLVEC test.

Change-Id: I1f329e0401d69147152e57e9329e3b670802c264
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 15:00:00 +08:00
Herman Chen
7604d66417 [h264e]: Change prefix nal process
1. Prefix nal is setup in h264e_api and send to hal by syntax.
2. Hal receives prefix config and writes prefix nal before each slice.
3. Add vepu1 / vepu2 prefix implement. vepu541 is not implemented yet.
4. Add max temporal layer id check to enable prefix nal.

Change-Id: I8bc40af12b9d9cedd64c1aa6a2666d3ffe7bf694
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 14:59:53 +08:00
Xinhuang Li
aa5c13d3a8 [test]: init encoder output packet length to zero
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
Change-Id: Iae1bdf28104ea7d7dc9929c267556fe6bf36299b
2020-07-24 14:59:18 +08:00
Herman Chen
0b5a25d903 [utils]: Fix encoder width / stride mismatch
Fix the default width stride value in RGB format.

Change-Id: I330bc81bfc5057484a46815d62eccd3fd212a49d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-24 11:36:38 +08:00