Commit Graph

312 Commits

Author SHA1 Message Date
Yandong Lin
ac6f8b1384 [h264e_vepu]: add cfg to disable mb rc
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I71e72164756b23f181a67a8b8799b9867a0854fb
2021-11-09 18:26:25 +08:00
sayon.chen
09d2bca7e7 [h265e]: Add sao disable cfg
Change-Id: I446178d5d2aefa26750382f126fac582ae93e16c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-10-25 10:21:49 +08:00
Herman Chen
02320fb506 [meta]: Add qpmap for encoder roi direct config
Change-Id: Ic64fa548f60f723e971c5574b6b290ddaf454809
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-20 14:55:46 +08:00
Herman Chen
0589fb5bd3 [mpp_dec_cfg]: Add external notification callback
Add callback on two events:
1. packet ready and wait for new packet input.
2. frame ready and wait for output frame poll.e

NOTE:
Add callback command param for version compatible sync between user
and mpp library.

Change-Id: Ic41d495a06cf653acb6b5100699f1b7f5f735f2e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-13 15:42:11 +08:00
Herman Chen
c5cd650fdd [mpi]: Add start / stop / pause / resume ctrl cmd
1. Move mpp_start / mpp_stop function to control command.
2. Add pause / resume control command.

Change-Id: I525668a2831eb8f23e12fbd7c1cb29c11fdcc868
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-17 11:11:43 +08:00
sayon.chen
37397d6376 [rc_v2]: Rename stat_times to stats_time
Change-Id: I3cfd444b2d26d5bb2ce2a806efc1a74f4cce05b2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-28 16:17:50 +08:00
sayon.chen
f53dfac47c [rc_v2]: Support hierarchical QP cfg
Change-Id: I0827689ee27a7007cb157b2990089e3c34c6ad50
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-02 15:24:24 +08:00
Yandong Lin
33784aca30 [rkv_enc_cmd]: Fix check info err when enc_cfg_set
Fix issue frome github:
https://github.com/rockchip-linux/mpp/issues/201
Err message:
mpp_cfg: cfg h264:max_tid expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:max_ltr expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:prefix_mode expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:base_layer_pid expect RK_S32 input NOT RK_S32

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9dbd49a6ce04807455d1a7dc090cad96ae0f2c83
2021-05-21 15:41:11 +08:00
Yandong Lin
a0ec1ba235 [rkv_enc_cmd]: Fix check info err when mpp_enc_cfg_set
Err message:
mpp[16915]: mpp_cfg: cfg h264:poc_type expect RK_U32 input NOT RK_U32
mpp[16915]: mpp_cfg: cfg h264:log2_max_poc_lsb expect RK_U32 input NOT
RK_U32
mpp[16915]: mpp_cfg: cfg h264:log2_max_frm_num expect RK_U32 input NOT
RK_U32

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ide77867beed2ee4e94df1179882713e600d3448b
2021-05-21 11:39:00 +08:00
Herman Chen
dbd2e2a77b [mpi]: Add mpp_start and mpp_stop
The purpose of mpp_start and mpp_stop is to break mpp_init_into two
stage.

Original mpp_init conbine the init and start for example mpp_dec_init
and mpp_dec_start then the global (or static) config which dominate the
fundamental working way can be only be set before mpp_init. That is
unreasonable. Another example is the encode memory prealloc flow.

The mpp_start is added to end global param receiving and do real
preparation of current operation in mpp_init.
The mpp_stop is the opposite of mpp_start.

Change-Id: I2bdcc29a9ff75777acc5c39c7e7f01477e597bb0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-20 10:24:25 +08:00
Chen Jinsen
a26e71291e [vpu_api_legacy]: support fbc fmt setup
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: If43694ce50a0f163776a260a1a919d2f9d12a4d0
2021-04-22 11:29:48 +08:00
Herman Chen
a91439bef4 [mpp_buffer]: Add mem and buffer usage function
Change-Id: I356ef9311802868fe8d234dbff178ad8463985d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-20 14:39:52 +08:00
Herman Chen
fc8fcacc49 [mpi]: Change mpi return value meaning
The 0 and positive return is success. The negative return is failure.

Change-Id: I9c4586286ce7368a52b7d9dd776fd40c6af4a1da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-08 09:08:48 +08:00
Herman Chen
85dcfcc8e6 [rk_mpi]: Add rk_vdec_cfg.h
Change-Id: If15b5eb8b0222c1a3978d3ca7c3d4a7fc83faa73
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-17 10:55:48 +08:00
Herman Chen
434f15ff26 [enc_cfg]: Fix max_reenc_times size check error
Change-Id: Ieb19f47d57ea54d450cf904475732d46a5b52928
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-30 18:20:56 +08:00
Herman Chen
c440a5ee28 [mpp_enc]: Deprecate MPP_ENC_PRE_ALLOC_BUFF
Change-Id: I42ea6ce9897af4e5b6f1a1d1bf3beb5173a8f568
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-20 17:19:13 +08:00
Johnson Ding
e6d2ab3c60 [h264e]: Add gaps in frame_num config entry
Some of NVR product may do some thing special when decoding the first
GOP of bitstream encoded by MPP, and report "gaps in frame_num is not
allowed" although frame_num is bitstream is continuous. Setting
gaps_in_frame_num_allowed_flag to true will avoid this problem.

1. Set gaps_in_frame_num_allowed_flag true as default
2. call mpp_enc_cfg_set_u32(cfg, "h264:gaps_not_allowed", 1) if you
want gaps_in_frame_num_allowed_flag to be false.

Change-Id: I8242fb318e051a61772c02a2c8bb59e4b589ff6d
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-15 16:40:48 +08:00
sayon.chen
bae7d889e7 [rc_api]: Reorganize RcMode same as MppEncRcMode
Change-Id: I04f5b7a1335aa0b6d7f9a03f98950dbedc5cd4cf
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 15:23:46 +08:00
sayon.chen
816f1a4f7d [rc_v2]: Add debreath cfg interface
Change-Id: Id8a729dc35e1b4fd2c9d3eab95d902bd5d7d96f2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 14:55:14 +08:00
sayon.chen
148a2b0b7a [rc_v2]: Add iblk4_prop info
Change-Id: I2d573a2170226472ad913e6b5068d80a18d220e5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-01-15 14:11:52 +08:00
Herman Chen
b84425e15d [mpp_meta]: Add meta key average qp for encoder
Change-Id: Iab3fde1a2a3e8e6f6150dfbeb6f5803d6e3cc240
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-14 10:01:46 +08:00
Herman Chen
f04fabc136 [mpp_enc_cfg]: Add global rc qp config
1. Add rc:qp config for user rate control config at frame level.
2. Add hw:qp config for hardware detail config.

NOTE: hardware config is only recommended for expert developer.

Change-Id: I8e28de97304577bcf77d67521f945355779ae102
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-08 16:26:53 +08:00
Herman Chen
e0df28b509 [mpp_cfg]: Add general config function
1. Add struct config function.
2. Do not check data type when data size is matched.
3. Use type/size/offset to define data and update info.

Change-Id: Ief21107cf9a8a6b89c2b01c1a430d88e0cf827f4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-08 16:26:53 +08:00
Herman Chen
4aa5b4a046 [mpp_enc]: Restore max_qp_step
1. Restore max_qp_step which limit the qp change between two frames.
2. Set default H.265 ip_qp_delta to 5.

Change-Id: Iacd795da7f2df46e60ab3f5c45bc8b0f30aff5a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-31 18:03:17 +08:00
Yandong Lin
2111a438c5 [mpp_enc]: Update osd data cfg
1. Add new structure: MppEncOSDData2
2. Different osd layer use separate buffer

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3be533eb602f23192086f56e06a1439dbb19c35c
2020-12-31 10:00:13 +08:00
sayon.chen
41c9c809b0 [mpp2str]: Add rc_gop_mode 2 str
Change-Id: I3fd4334cf108d62726e3caae5eda9801922d8ef9
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-24 17:21:33 +08:00
sayon.chen
476e6adfa5 [mpp_frame]: Add hor_stride_pixel interface
Change-Id: Ia6065b7c3832511c5d01263e6f07713028e8abd6
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-24 16:04:21 +08:00
Herman Chen
de8ace6622 [mpp_enc]: Separate qp change flag
Separate H.264 QP limit change flag into 3 flags

Change-Id: I658ab337569f8f715bde7633dce02b631a7d4239
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-17 14:33:17 +08:00
Herman Chen
96a7affc2b [mpp_enc_cfg]: Add low delay to MppEncCfgSet
Change-Id: I5f9e595b44cc39cc255c69a875618ea36de5e878
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-12 09:47:09 +08:00
Herman Chen
d523aaa888 [mpp_packet]: Add partition property
The partition property is for slice encoding / decoding.

Change-Id: Ibc5fa77293490ed520e7112b3b9ac53f0f5f42c6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-11 21:08:18 +08:00
shine.liu
9714d846d9 [legacy]: add cfg for FIXQP mode from outside
Change-Id: I6945630c8fb2fc8188c8ff8d608e017c34f4239d
Signed-off-by: shine.liu <shine.liu@rock-chips.com>
2020-12-09 17:46:50 +08:00
Herman Chen
d9c59b7c0a [mpp_dec]: Add MppDecCfg ctrl process to mpp_dec
Change-Id: I767e7b248922904d61aa19afd657a5543a2b9995
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 17:48:09 +08:00
Herman Chen
5d648bad8b [mpp_dec_cfg]: Add mpp_dec_cfg implement
Change-Id: Ic57fb37604930e841af8cdd6784120662f529110
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-30 09:46:27 +08:00
sayon.chen
e4f4b4f690 [vepu54x]: Compatible different device fbc input
RK isp fbc output use AFBC_V1 format.
RK rkvdec fbc output use AFBC_V2 format.
These two formats have different fbc payload offset calculation method.

Change-Id: Id050cbd58e33a1249098a2dc226d47c376d7c163
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-11-30 09:46:27 +08:00
sayon.chen
dfe9428017 [rc_v2]: Support super frame cfg process
Change-Id: I4de4d3e27925d81f26ed5819e07d3e45ed42061e
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-11-30 09:46:27 +08:00
Herman Chen
7ae2f73bca [mpp_enc_cfg]: Add super frame config
Change-Id: I0df2db8fd7c5e10412584ded557da3962b77f882
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-30 09:46:27 +08:00
Herman Chen
a875c5a308 [mpp_frame]: Add comment for MppFrame parameters
Add comment for width, height, hor_stride, ver_stride, offset_x and
offset_y.

Change-Id: If0297eafdd550902d40485d786f9494c85123622
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-24 14:09:20 +08:00
Herman Chen
302582b3b9 [mpp_frame]: Add offset x/y for cropping
Change-Id: Id3da30527fe709f7f89044a667c089b3dab6ef4f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-24 11:53:30 +08:00
sayon.chen
5012336bc2 [enc_v2]: Suppport user data set
User data set is for multiple user data with uuid.

Change-Id: Iad952961ab6242ff3a14f554410144bebd3801ba
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-11-16 09:46:53 +08:00
Herman Chen
a75c5edcb7 [legacy]: Remove vpu dependence on mpp_service cmd
Change-Id: Ib447f1612f16cb9854fcee32c79eef5bcf26fe75
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-06 11:47:53 +08:00
Herman Chen
93bc0690d4 [mpp_enc_refs]: Add flag for recon frame writing
Change-Id: I8f68573a4156056b61a05c14d5eb7d2734958e0d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-28 15:20:06 +08:00
Herman Chen
3c55b55e46 [mpp_dec]: Add query interface for debug
1. Add query interface.
2. Add query result in mpi_dec_test.

Change-Id: Ie0026f155331c0b0f8e1b5409aeb7d41b6a3ecc6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-23 14:17:34 +08:00
yandong.lin
e54234a11b [vp8e]: Fix vp8e reencode and ivf problems
1. Not do reencode in vp8 enc
2. Add api to control whether need to add ivf header
   (default: have ivf header)

Signed-off-by: yandong.lin <yandong.lin@rock-chips.com>
Change-Id: I59a3a7193abead6c73e6e1eed593a115add77888
2020-10-23 10:07:10 +08:00
timkingh.huang
0f8aeda99d [comment]: add comments in the format of Doxygen
Change-Id: I1df49ed78b5b5cf88ff253c35c59cb0b061b4ea9
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2020-10-23 09:27:53 +08:00
Herman Chen
e509662728 [mpp_frame]: Make MppFrameFormat value visible
Change-Id: I1276af32ca4907bfabae2664ff6f0fe67eb8aa0d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-09 08:54:59 +08:00
Herman Chen
51d01e0069 [utils]: Fix error on RGB color fill
Change-Id: I5b7768e410135910d5c20994c84629678cd37524
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-29 16:39:10 +08:00
sayon.chen
96aad17638 [rc_v2]: Used I frame tuning config set
Change-Id: Iaaa717268804e047fa51bb0cf05790e25df143ba
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-09-28 17:59:02 +08:00
Herman Chen
cd311d877f [rc]: Separate check reenc and rc_end function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib594afdd25a0e4283612fd5808a27b229d40f597
2020-09-24 11:54:22 +08:00
Herman Chen
85ada595ee [mpp_enc_cfg]: Add encoder I frame tuning config
Add max_i_prop, min_i_prop and init_ip_ration for I frame tuning config.

max_i_prop:
The max percentage of intra frame size in one gop.

min_i_prop:
The min percentage of intra frame size in one gop.

init_ip_ration:
Define the first I frame size is how many times of one P frame size.
Set to 16 mean I frame size is equal to P frame size.
Set to 160 mean I frame size is 10 times of P frame size.

These three parameters are for tuning Intra frame quality.

Change-Id: Iac1e700fe2a51fb3a6ad94753784cd54ee789176
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00
Herman Chen
e3278d7655 [vepu541]: Fix OSD AYUV bit order definition error
Change-Id: I89ddd7b626873ea1d4ba22569f79d8706b216b55
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-09-23 10:28:43 +08:00