Commit Graph

47 Commits

Author SHA1 Message Date
Yandong Lin
fad0868986 feat[rk_mpi_cmd]: Merge cmds from mpp_interface
Change-Id: I6550486d6efbac43d6f30cdb6dfefa75a93a437d
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-16 15:04:18 +08:00
Rimon Xu
5a8e1fa682 feat[mpp_dec]: add control for select codec device
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Change-Id: I55cbbf1e2a2b4693325a27af83ae76020d6f4ac2
2024-11-29 15:08:06 +08:00
Chen Jinsen
d0a06d0bed feat[mpp_dec_cfg]: Add disable dpb check config
Change-Id: Ib93948bed0547bec9b2805f9f0e73d83b56226a7
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
2024-05-15 14:19:52 +08:00
Chandler Chen
0a9509431f feat[vdpu383]: support 8K downscale mode
Now there are 2 mode for downscale thumbnail frame buffer

1.MPP_FRAME_THUMBNAIL_MIXED (already use on RK3528 box):
Each buffer contains original output frame and 2x2 downscale
small frame, small image's buffer offset will be set in frame
meta info;
2.MPP_FRAME_THUMBNAIL_ONLY (newly added for rk3576 8K video):
for rk3576: vop & gpu does not support 8K frame,
in this case, mpp use 4K downscale buffer as decoder output

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I3acf9486a657fa3e999ca16140f40b2a01ebcaf4
2024-04-23 15:54:30 +08:00
Johnson Ding
6e954f5142 [mpp]: Add MVC enable option
Change-Id: I11c4ef1954add18491f3745b23c91b79de60d181
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2022-12-14 14:22:41 +08:00
Zhihua Wang
ecbf315ac3 [inc]: Update rk_mpi_cmd compatible for rockit
Signed-off-by: Zhihua Wang <hogan.wang@rock-chips.com>
Change-Id: I0658e15a085217f0feee4177f7fd6731487ae7ee
2022-07-01 11:08:50 +08:00
Hongjin Li
4f4c73a7ae [h264d_dpb]:Fast play is disabled by default
Flip disable_fast_play to enable_fast_play,
Fast play is disabled by default.

Change-Id: I168e02a9d84590c3b2b92fe75b2b37c655c8c63e
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-04-22 09:59:18 +08:00
Herman Chen
f903701f44 [rk_mpi]: Add encoder query function
Change-Id: I869d30bf11b26feee02f5ba307d98f6bbdcf7058
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-13 17:34:36 +08:00
Hongjin Li
98ac9b259b [h264d_dpb]: Fix h264 video flicker issue
When the poc of the idr frame is 0, the subsequent frames with poc<0 are
discarded, which will cause the screen to flicker.
Add parameters in mpp as switches for immediate output of idr frames.

Change-Id: I522334dd1e81fc6aeeb60e71404f3a7071a5ecae
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-03-09 10:22:16 +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
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
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
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
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
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
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
Herman Chen
85f9662150 [mpi_enc_test]: Use MppEncCfg to setup encoder
Change-Id: Ie3506a3555751344f54264d85804ee509a976659
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
Herman Chen
83e2724158 [mpp_enc_cfg]: Add MppEncCfg control
1. Add h264e process function.
1. Add h265e process function.
2. Add jpege process function.
2. Add vpu_api_legacy support.
3. Clear input MppEncCfgSet when MPP_ENC_SET_CFG is finished.

Change-Id: Ida1234c351483bd9f96a75bc77e90ca2d75ec38b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-15 15:48:06 +08:00
Herman Chen
4b8a5f557a [rk_mpi_cmd]: Rename MPP_ENC_SET/GET_ALL_CFG
We are going to use new configure method for all encoders.

Change-Id: Id478d2567714ee9c6ddee3d410a4a855825f1c42
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-05-13 09:42:20 +08:00
Herman Chen
fe4b86b025 [mpp_enc]: Update OSD API
1. Update OSD palette config API. User must specify palette is default
or user defined.
2. OSD palette config will go through control and OSD data (region)
config will go through meta data in each frame.
3. Remove unused code.
4. Add mpi_enc_utils for mpi_enc_test cases

Change-Id: Ib4aeb60789a3e999446212841508e604533efb3c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-04-02 18:21:20 +08:00
Herman Chen
0a2d4e341c [mpp_enc_v2]: Add encoder header output mode
1. Default output mode is output header only on config changed.
2. Add new mode to output header on each intra frame.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Iea8dd1e6bb377318b88300d6a013f2c736b15afc
2020-03-30 17:16:11 +08:00
Herman Chen
61d8063b36 [mpi]: Add command for RC api configure
User can define its own rate control stategy function and can use them
in MPP encoder flow.

Change-Id: I9573ab8cb5a63c543e17faf07e89f64f5d7013ef
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-18 19:37:07 +08:00
Herman Chen
0547a740fe [mpi]: Add better sync call to get encoder header
Change-Id: Ibbd9b4ee178b0994f3c86738cd623eaffd2bca0f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-12-11 14:55:24 +08:00
Herman Chen
66a26a7cf2 [rk_venc_cmd]: Change encoder interface
Add encoder misc config for later extension.

Change-Id: Ie67b2d5e74227e5089b16752d8088a9502142ddd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-27 10:37:01 +08:00
Herman Chen
d17861b67b [rk_mpi.h]: Separate rk_mpi_cmd.h into two headers
1. rk_mpi_cmd.h will contain cmd value only.
2. rk_venc_cmd.h will contain all the encoder command structure.
3. Move MppCtxType and MppCodingType to rk_type.h for better include
dependency.
4. Add MppEncRefCfg to MppEncCfgSet.
5. Remove rk_mpi.h dependency inside mpp.

Change-Id: I6b972738100fb60c0a6a9b7cfe0a012abf4205b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-26 10:09:23 +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
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
0a78fb7102 [mpp]: Combine block control and timeout control
Use MppPollType as block control MPP_SET_INPUT_TIMEOUT and
MPP_SET_OUTPUT_TIMEOUT 's parameter.
Deprecate old block/block_timeout control.

Next step is to change MppPollType to RK_S64 for compatible in different
platform.

Change-Id: I02974f0b8eeb23ff43687448d6c3271ea7dd0a2c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-07-27 11:56:56 +08:00
Herman Chen
44f0ee0353 [mpp_dec]: Add post-process path to mpp_dec
1. Unify the hal thread output process to mpp_dec_put_frame
2. Add vproc path for field source.
3. Reserve one more buffer when deinterlace is enabled.
4. Default enable for normal mpp path but disable on vpuapi path for the
reason that rk_ffplayer has done deinterlace process internally.

Change-Id: I02e7cece844fde01c2d249dafe6f7ce6a325593f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-06-05 15:10:39 +08:00
Ding Wei
44ad1558ec [vpu_api]: add command VPU_API_SET_IMMEDIATE_OUT
tips: this command is used to set decoded frame immediate out,
whehter is in display order or not.

Change-Id: I0b6b2c34fde722fe724019118c7af142b4b2e6f1
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-05-03 09:53:10 +08:00
Ding Wei
7716b36af8 [mpeg4][h263]: remove internal pts mode
tips: the timestamp in slice header is not useful, except for
calculate increment of dispaly frame. so, it cannot use to
dispaly, and remove it.

Change-Id: I748d553d40c4736e2f5ef98d8a8519fcc5e533e0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
Ding Wei
2f5bd0bffb [mpp_dec]: add control to set present time order
tips: when input timestamp has not pts, and set pts=dts,
it should use input timestamp order for output.

Change-Id: I8b3ef9a8d150e5729a3fa94df6c1b448edb8f1fd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-27 17:20:33 +08:00
timkingh.huang
1acefd6207 [h264e]: add configuration of ROI
Change-Id: Ieba60baedc8fabd248112636f5ea59a107775403
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2018-01-15 18:34:28 +08:00
Ding Wei
c6594ae192 [mpi_cmd]: add disable error command
1. Disable error default is not set for normal error detection.
2. On special case like drone streaming the user prefers to ignore
all error and continue decoding. Then disable error flag will be set
to fullfill this requirement.
3. When disable error flag is set H.264/H.265 decoding will ignore
hardware error and mark all output frame as no error.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>

Change-Id: I8fd619511c53ee744ae973ab3fe015565106dd37
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-12-22 11:44:33 +08:00
sayon.chen
6c74d876a3 [rkv_enc]: VBR case add new ratecontrol
add AQ_ONLY quality ratecontrol for CVR
qp adjust according bit allocate,mb qp dealt adjust
accroding adaptive quant

Change-Id: Ia9a46e765646a88e2659f5fb19b94a0a5c667681
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2017-12-14 16:17:36 +08:00
timkingh.huang
5f1583697b [h264e]: add command of MPP_ENC_SET_QP_RANGE
Change-Id: I5c8fedc381537117953e858191f4b2ff8a5a2581
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-09-21 19:14:10 +08:00
timkingh.huang
137618c298 [h264e]: allocate buffers before encoding
Allocate buffers before encoding so that we can save
some time when encoding first frame.

Change-Id: I02d67347313e2050896b545b861bc5fa0bba495d
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-08-07 14:54:05 +08:00
Lin Kesheng
cad4b4b886 [h264e]: add rotation configuration
Change-Id: I148814a644264b341d6db1d7af767dd485942829
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-03-28 14:08:41 +08:00
LongChair
a3f463f9ce [mpi] : Add a block timeout control command.
When retrieving frames current API only allows to define wether
the API should block without any timeout or not block at all.
This allows to specify a block timeout via the
MPP_SET_OUTPUT_BLOCK_TIMEOUT control operation.

Change-Id: Id35ad3d48f72881184009f830c406c3a655e1a90
Signed-off-by: LongChair <LongChair@hotmail.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-24 11:43:08 +08:00
Lin Kesheng
422ecbc204 [mpi]: change rc mode and quality definition
Change-Id: I87008d7294acaa89d9206e5b1cd1ce74c40d4af4
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-02-14 15:50:06 +08:00
Herman Chen
b1a5c18ef9 [mpi/mpp]: Remove MppEncConfig interface
Change-Id: Ie85b780076b22342bfc1837beef00036f5f40a04
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-01-06 18:00:36 +08:00
Herman Chen
4c1ae218e6 [mpi/mpp/enc]: New encoder framework
1. Interface change:
Separate normal config into three basic config and several runtime config:
Three basic config -
a. rate control config
b. preprocess config
c. video codec protocol config
More flexible rate control interfaces are provided.
More codec configure interfaces are provided.
Change flag with bitmap is provided for further optimization.

2. Remove old codec config from controller and left rate control module only
Encoder controller only handle user rate control requirement and bit allocation.
Hal hardware encoder only handle qp calculation according given target bit.
Remove all old codec code.

3. Move codec process to hal
Different hardware will share same codec process function in common protocol
directory. And different hardware api will register to same api set. Codec
header generation is moved to separate hal directory.

4. Encoder will return length by task
Encoder will NOT get stream information feedback from controller. All
information required by encoder will be all stored in Task.

5. Add mpp_rc for rate control
Move some common rate control utils to mpp_base.

6. Update mpi_enc_test and mpi_rc_test with new interface

Change-Id: Iebb5e276a48f547167e1bed4673f21cc2f0c8ad5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-05 10:58:27 +08:00
Lin Kesheng
0e8b435b82 [h264e_prep]: add prep cfg interface for dsp
1. cfg sharpen parameters

export h264e_hal_debug=0x8001, to open log
export h264e_hal_debug=0x1,    to close log

Change-Id: I97322f9819cfbb6909b86afc25f84bacac9841af
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-12-20 11:35:17 +08:00
Lin Kesheng
fad35922fc [h264e_rkv]: pack cfg into SEI and write to stream
1. add SEI writting interface
2. write extra_info_cfg and rc_cfg to SEI
3. stream_get_pos use s->buf_plus8 rather than s->p_start

Change-Id: I71de4d6f5dc31f21c0a32dc5ded275ced260d861
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-25 20:54:06 +08:00
Lin Kesheng
f04d6604f7 [h264e_rkv]: Implement OSD function
1. add description for OSD cmd in rk_mpi_cmd.h
2. judge if input MppBuffer for OSD is NULL

Change-Id: I6d674c81790d9cf57acdfa23f20c929b56f263e9
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-09 10:31:51 +08:00
Lin Kesheng
089660baa8 [hal_h264e_rkv]: support osd configuration
1. add osd control interface
2. remove h264e_hal_rkv_coveragetest_cfg.osd
3. add h264e_hal_test & mpi_enc_test for osd
4. use tool to format code

Change-Id: Iadb3453d8e6976e5f718253f762d144864419e94
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-10-08 11:19:11 +08:00
Herman Chen
c58df3f3f9 [mpp_enc]: Implement new encoder framework
1. Separate encoder configure to four parts
2. Add Preprocess / OSD / Extra configs
3. Implement mv_info interface

Change-Id: I2350a25c9f40b199cee8ef6c75ac6ca099f143c4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-27 11:08:08 +08:00