Commit Graph

2047 Commits

Author SHA1 Message Date
Herman Chen
11c0b3aaa0 [mpp_enc_refs]: Fix cpb update error
1. When insert long-term reference frame the tid refs should also be
updated.
2. When insert short-term reference frame the queue update direction has
error. It is fixed now.
3. Long-term reference frame delay_cnt update method is fixed.
4. Dump valid flag when dump cpb frame status.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I8db6e71ee5366fefdd1d91018c500d3edc05c6aa
2020-06-23 15:22:42 +08:00
Herman Chen
eb34769db7 [cmake]: Add option to control test building
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic6c6988dad82836cfb87113f2293bc9a2b1abd66
2020-06-22 17:44:01 +08:00
Herman Chen
48e07d877f [mpp_enc_ref]: Fix typos
The check on short-term config should use short-term config count rather
than long-term config count.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0006fe9a30035f636411702290cd9dff4032296d
2020-06-20 09:04:58 +08:00
Herman Chen
fefa75939d [drm]: Update drm header to 4.19
Change-Id: Id8b98e9cacab9a0dbc86f360172f8aab85dbf76d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-18 16:29:39 +08:00
Johnson Ding
7b94cd4050 [h264d]: fix dpb memory leak
When encounting IPIPPPP... stream, the first IP will be kept in dpb
unflushed. This will lead to dpb used size keep growing and memory leak.

Change-Id: I7973c8b18d13a63d10b0d4f034aefb58a3805ab2
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-06-12 11:29:34 +08:00
Herman Chen
0abeafe872 [cmake]: Add option for Address Sanitizer check
Change-Id: I91cf9111000d2e077dafd9871b965e864863e0bf
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-11 17:29:51 +08:00
Herman Chen
c56c01494d [h264d]: Fix heap-use-after-free issue in h264d
Change-Id: I88dced3dbd0a3e6e4f34fee86d7f019bfc130d14
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-11 16:36:19 +08:00
Herman Chen
81d4248166 [mpi_enc_test]: Fix memory leak of test args
Change-Id: Ica87ba3f77eb12e0b36b2ea0d607b4defbea9abb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-11 16:25:58 +08:00
Herman Chen
0efed5ddf1 [mpp_trie]: Fix memory leak of node and info
Change-Id: Ide75f6401c0dceb4fca315fa8a5f84812c6a8eb4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-11 16:16:03 +08:00
Herman Chen
46bfafa614 [mpp_enc_v2]: Fix memory leak of header buffer
Change-Id: If4ef68a09b8e14b127105e41b7e4d17b3e58a5ac
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-11 16:15:36 +08:00
Herman Chen
c7274a6192 [mpp_enc_v2]: Fix memory leak of rc_ctx
Change-Id: Ifbce970cf10797edc04afa0910d422bc5b1d216d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-11 15:55:04 +08:00
Herman Chen
33e7e4c52a [mpi]: Remove unused H.264 mpi cfg structure
Remove sei / ref cfg in MppEncH264Cfg.

Change-Id: Iaef6a8a845b691dc21d0a6a6eca62e27bc5cf5a4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-10 17:37:49 +08:00
Herman Chen
7ff73d991e [hal_h265e_vepu541]: Update l2 quant bias to 256
Change-Id: I6776972297fbda2749195f8b3922b51a39ccffb5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-10 14:25:49 +08:00
Herman Chen
550e2ee6b3 [mpi]: Remove unused encoder cfg cmd defines
Change-Id: I183fa54d9f074ab94f3bb71bb525ff88372a7724
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-10 11:47:16 +08:00
Herman Chen
bb32442d5e [mpp_enc_v2]: Fix missing rc update on qp changed
When qp limit in codec_cfg is changed the rc_cfg should be also updated.

Change-Id: Ia5da305c015e6bc11836b6c358ddee6be51e819a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-08 15:14:31 +08:00
sayon.chen
15e569a552 [mpp_enc_v2]: Fix missing resend_hdr on codec changed
Change-Id: I5ea13f3e5a285a02903c4b65b2854169c0b3753c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-08 15:13:49 +08:00
sayon.chen
27977e2a34 [vepu_541]: Fix rotation issue
1. Add hevc swap w&h when rotation is 90 or 270
2. Fix h264 roation check w&h issue
3. Fix h264 downscale buff issue

Change-Id: Id0e94c3005d00d9d8a54e6c8b710a3ea9f905f5e
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-08 08:59:44 +08:00
sayon.chen
c468393e8e [mpp_enc_v2]: Check resend_hdr must request IDR
Change-Id: Ibaaa408eae165ba99c0a4b61a1f207e393c7f645
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-08 08:57:57 +08:00
Johnson Ding
48761dbe91 [m2vd]: fix incorrect packet split problem
Searching for star code prefix should not exceed buffer length.
Otherwise 00 outside source buffer will be take as picture start code
when there is 00 00 01 at the end of source buffer.

Change-Id: I04f62e2f638bd721815004b86cf3d75d256d03de
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-06-05 16:32:46 +08:00
sayon.chen
fb6cdcb9c0 [vepu]: Add slice split support for vepu1/2
Change-Id: If9f26b1090e4fda50068b325ed15404bd514d1d7
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-02 20:06:13 +08:00
Herman Chen
23d3e82c0c [hal_h264e_vepu1/2]: Add stream amend to hal flow
Change-Id: Ic92959a922983e2e251b03dbc58bf91ab67f9050
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-02 20:06:13 +08:00
Herman Chen
197bda000f [hal_h264e_vepu]: Add tsvc support on vepu1/2
Change-Id: Iba98bf8cceb4b9aa3c24dd779cc3b002336f8c88
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-02 20:06:13 +08:00
sayon.chen
43061a9eac [rc_v2]: Fix divide 0 when gop is infinite
1. Fix bit calc when gop set 0 or 1
2. When gop set 0, will set 300 for bit calc

Change-Id: I8c6f8dfd634a5c5cee760de6226f156e897d91b0
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-02 20:06:13 +08:00
Herman Chen
9f6dcfccc4 [mpp_enc_v2]: Unify sei writing process
Change interface of adding stream prefix which is adding sei packet in
H.264/H.265.

The sei will be added with certain type:
1. version info
2. rate control info (rc api name + rc cfg)
3. user data

Change-Id: Ic17efb6b9f75db774b7ad7e7cc78818170260def
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-02 20:06:13 +08:00
Herman Chen
b8caab0fe0 [mpp_enc]: Fix error when update bps only
When only bps is updated the whole rc_usr_cfg should be updated.

Change-Id: I02ed8fa247b3b56ac286254c55251b594ff2fab2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-01 14:15:07 +08:00
sayon.chen
cc3966a6d8 [h265e_541]: Update l2 bias set
Change-Id: I45654b35092ab659bed10604d96c19f50c3591f7
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-06-01 11:30:24 +08:00
Herman Chen
85046f5648 [mpp_enc_v2]: Add add_prefix function
This function is for debugging usage.
Encoder will write mpp version info before each IDR frame.

Change-Id: I03e2f2a7d751e9ecc3122314c2b3de8aa31b910d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-06-01 10:24:14 +08:00
Herman Chen
439fce52b0 [test]: Add infinite loop mode for mpi_enc_test
Change-Id: Ibf459034f89682ec2accf5c79cf437bc34804808
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-29 17:19:22 +08:00
Ding Wei
a26d0fadd7 [h265d]: fix issue for pps header
slice_header_extension_present_flag has missing in parse.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I479b7f0b67eb998c2a33791828488b37384d446a
2020-05-29 10:46:00 +08:00
sayon.chen
24d215ecfc [h265e_api_v2]: Fix request IDR cause tsvc issue
1.remove unused code
2.fix request IDR cause tsvc can't find ref

Change-Id: I67997dd6b56055038c6a1d4e82dace59b84b7944
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-05-28 16:40:18 +08:00
sayon.chen
dc4dc1d7bf [rc_v2]: First intra qp init no depend seq_idx
Change-Id: Ib47003a09794fe51517a56b8c86af8d21152e317
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-05-28 15:12:27 +08:00
Herman Chen
6041943238 [h264e_debug]: Add h264e control debug flag
Change-Id: I70cce37b21c4db155f6bbe42842e6d952afb4bc1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-28 11:34:35 +08:00
toby.zhang
681557ee5b [smartp]: modify smt algorithm for 1109/1126
Change-Id: I8017bbd94093ac3f37516e1451709d8f5db38589
Signed-off-by: toby.zhang <toby.zhang@rock-chips.com>
2020-05-28 10:59:18 +08:00
Herman Chen
db836b2001 [h264e]: Fix discontinuity frame_num issue
Change-Id: Ie00c0f278ef619a17390fc088691ee4e27a937ca
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-28 10:28:49 +08:00
Herman Chen
cac03245ba [mpp_enc]: Fix error on request IDR frame
The codec will not handle IDR request directly. The force idr / force
LTR will be config to codec by cpb info.

Change-Id: I9aba12ea3080256451115b9fd77433b67e318cf3
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-28 09:30:54 +08:00
Herman Chen
97e871f323 [mpp_enc]: fix error on enc_ref_cfg change
1. Clear cpb on MppEncRefCfg updated in mpp_enc_refs_set_cfg.
2. Clear encoder header status on MPP_ENC_SET_RC_CFG control to
regenerate new header.
3. Update rc user cfg on enc_ref_cfg updated.

Change-Id: I0ababab44611be24e62d2c00e1f281834fcfbcee
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-27 18:08:20 +08:00
Herman Chen
9ec0d9627d [mpp_enc]: Allow MPP_ENC_SET_REF_CFG NULL input
NULL input for MPP_ENC_SET_REF_CFG will disable customized reference
frame hierarchy configuration.

Change-Id: I2319c7ae694160eab6c14192b17855a59fce3d77
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-27 15:15:02 +08:00
Herman Chen
51f87fa5e0 [h264e]: Use new mmco wr / rd function
Change-Id: I963e3e37ecb6c26d406b9095a67d89b971828dc0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-27 10:35:32 +08:00
Herman Chen
482f80c2e2 [h264e]: Use new reorder wr / rd function
When reencode is needed the slice write need to read reorder repeatly.
So the fifo structure is not suitable for this case.
The read / write / rewind access mode is better.

Change-Id: Ifdfce20a91b27f571825b74090d47a530e9e1132
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-27 10:35:05 +08:00
Herman Chen
3166d88321 [test]: Add coding type detection to mpi_dec_test
Change-Id: Ie6353184dab453e479c4f61137f208276386367c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-27 10:34:52 +08:00
Ding Wei
8d38d4b2f0 [mpp_dec]: add immediate_out flag in mpp struct
tips: control cmd for immediate_out, can send both before and after mpp_init.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Ibe66878cfab1f592b952d01bee3adade7c9d31bc
2020-05-27 10:22:03 +08:00
Herman Chen
c21d2dee3b [cmake]: Fix TOOLCHAIN_NAME error on aarch64
Change-Id: I2a56b86a716bfe2d2220e98d78126825e26ef19b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 20:38:03 +08:00
sayon.chen
e78625c47b [rc_v2]: Support i_quality dealt qp setup
Change-Id: I0d6f33ec119b4ac7e3e0c4370a93760a41273d25
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-05-26 17:52:33 +08:00
sayon.chen
4326b07e81 [h265e_v2]: Add MppEncRefs to h265e flow
Change-Id: Ifddbb63736fd7e679fc9a3f7d67d2e7a7f6ffc95
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-05-26 17:37:02 +08:00
Herman Chen
51fed96bd9 [test]: add tsvc sample to mpi_enc_test
Add simple tsvc4 config to mpi_enc_test for test.

Change-Id: Icdb5a91106351a00d3eb07dc233b9341084c5abe
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:50:22 +08:00
Herman Chen
50bf7b7bf0 [utils]: Add encoder reference config sample
Add MppEncRefCfg configure sample to mpi_enc_utils.

Change-Id: I56d87dc6b267a8029c4d539526c368f2f44cec11
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:42:17 +08:00
Herman Chen
ae590b7190 [mpp_enc_ref]: Add vepu541 H.264 reference process
Add vepu541 H.264 reorder / mmco process.

Change-Id: I434a539a111ec749f89d1485d6cab7b4106d4d89
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:29:40 +08:00
Herman Chen
2ec67e6d3c [mpp_enc_v2]: Add MppEncRefs to encoder flow
Add MppEncRefs cpb info to H.264 encoder flow

Change-Id: I7ba26a7c7a2f0e860438af38283ec429128c7351
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:29:40 +08:00
Herman Chen
c2069f3345 [mpp_enc_ref]: Add MppEncRef/MppEncRefs module
Add MppEncRef/MppEncRefs module

MppEncRefs is for mpp encoder coded picture buffer (CPB) management.
MppEncRefs will gnerate reference buffer status EncCpbStatus for each
encoder to implement its own process.

Change-Id: I5f85a0f46dc6bc40954b0393ba52ad4008565643
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:29:40 +08:00
Herman Chen
90a62f52a3 [rk_venc_ref]: Add new reference config interface
Add MppEncRefCfg for reference frame relationship configure.
MppEncRefCfg is for user to setup its own gop reference hierarchy.

Setup flow:
    mpp_enc_ref_cfg_get_preset (can be ommitted, helper for setup lt/st cfg)
    mpp_enc_ref_cfg_init
    mpp_enc_ref_cfg_set_cfg_cnt
    mpp_enc_ref_cfg_add_lt_cfg (can be omitted)
    mpp_enc_ref_cfg_add_st_cfg
    mpp_enc_ref_cfg_check (IMPORTANT: need to check before contol to mpp)
    control to mpp
    mpp_enc_ref_cfg_deinit

Change-Id: Ia0f5c4c713a4b11d8e4e5581609f8501f36549cc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-26 16:29:40 +08:00