[mpp]: Add MVC enable option

Change-Id: I11c4ef1954add18491f3745b23c91b79de60d181
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding
2022-10-19 16:39:32 +08:00
committed by Herman Chen
parent 0923f061ad
commit 6e954f5142
8 changed files with 19 additions and 6 deletions

View File

@@ -105,6 +105,7 @@ typedef enum {
MPP_DEC_SET_ENABLE_FAST_PLAY, /* enable idr output immediately */
MPP_DEC_SET_DISABLE_THREAD, /* MPP no thread mode and use external thread to decode */
MPP_DEC_SET_MAX_USE_BUFFER_SIZE,
MPP_DEC_SET_ENABLE_MVC, /* enable MVC decoding*/
MPP_DEC_CMD_QUERY = CMD_MODULE_CODEC | CMD_CTX_ID_DEC | CMD_DEC_QUERY,
/* query decoder runtime information for decode stage */

View File

@@ -123,6 +123,7 @@ public:
ENTRY(base, enable_fast_play, U32, RK_U32, MPP_DEC_CFG_CHANGE_ENABLE_FAST_PLAY, base, enable_fast_play) \
ENTRY(base, enable_hdr_meta, U32, RK_U32, MPP_DEC_CFG_CHANGE_ENABLE_HDR_META, base, enable_hdr_meta) \
ENTRY(base, enable_thumbnail, U32, RK_U32, MPP_DEC_CFG_CHANGE_ENABLE_THUMBNAIL, base, enable_thumbnail) \
ENTRY(base, enable_mvc, U32, RK_U32, MPP_DEC_CFG_CHANGE_ENABLE_MVC, base, enable_mvc) \
ENTRY(base, disable_thread, U32, RK_U32, MPP_DEC_CFG_CHANGE_DISABLE_THREAD, base, disable_thread) \
ENTRY(cb, pkt_rdy_cb, Ptr, MppExtCbFunc, MPP_DEC_CB_CFG_CHANGE_PKT_RDY, cb, pkt_rdy_cb) \
ENTRY(cb, pkt_rdy_ctx, Ptr, MppExtCbCtx, MPP_DEC_CB_CFG_CHANGE_PKT_RDY, cb, pkt_rdy_ctx) \
@@ -231,7 +232,7 @@ MppDecCfgService::MppDecCfgService() :
* NOTE: The dec_node_len is not the real node count should be allocated
* The max node count should be stream lengthg * 2 if each word is different.
*/
ret = mpp_trie_init(&trie, 328, cfg_cnt);
ret = mpp_trie_init(&trie, 334, cfg_cnt);
if (ret) {
mpp_err_f("failed to init dec cfg set trie\n");
return ;

View File

@@ -51,7 +51,6 @@ static MPP_RET init_input_ctx(H264dInputCtx_t *p_Inp, ParserCfg *init)
INP_CHECK(ret, !p_Inp && !init);
mpp_env_get_u32("rkv_h264d_mvc_disable", &p_Inp->mvc_disable, 1);
open_stream_file(p_Inp, "/sdcard");
if (rkv_h264d_parse_debug & H264D_DBG_WRITE_ES_EN) {
p_Inp->spspps_size = HEAD_BUF_MAX_SIZE;

View File

@@ -891,7 +891,6 @@ typedef struct h264d_input_ctx_t {
RK_S64 in_pts;
RK_S64 in_dts;
RK_U8 has_get_eos;
RK_U32 mvc_disable;
//!< output data
RK_U8 task_valid;
RK_U32 task_eos;

View File

@@ -233,7 +233,7 @@ static MPP_RET parser_one_nalu(H264_SLICE_t *currSlice)
H264D_DBG(H264D_DBG_PARSE_NALU, "nalu_type=SLICE.");
FUN_CHECK(ret = process_slice(currSlice));
currSlice->p_Dec->nalu_ret = StartOfPicture;
if (currSlice->layer_id && currSlice->p_Inp->mvc_disable)
if (currSlice->layer_id && !currSlice->p_Dec->cfg->base.enable_mvc)
currSlice->p_Dec->nalu_ret = MvcDisAble;
break;
case H264_NALU_TYPE_SPS:

View File

@@ -137,7 +137,8 @@ MPP_RET mpp_dec_proc_cfg(MppDecImpl *dec, MpiCmd cmd, void *param)
case MPP_DEC_SET_OUTPUT_FORMAT :
case MPP_DEC_SET_DISABLE_ERROR :
case MPP_DEC_SET_ENABLE_DEINTERLACE :
case MPP_DEC_SET_ENABLE_FAST_PLAY : {
case MPP_DEC_SET_ENABLE_FAST_PLAY :
case MPP_DEC_SET_ENABLE_MVC : {
ret = mpp_dec_set_cfg_by_cmd(&dec->cfg, cmd, param);
mpp_dec_update_cfg(dec);
dec->cfg.base.change = 0;
@@ -523,6 +524,9 @@ MPP_RET mpp_dec_set_cfg(MppDecCfgSet *dst, MppDecCfgSet *src)
if (change & MPP_DEC_CFG_CHANGE_ENABLE_THUMBNAIL)
dst_base->enable_thumbnail = src_base->enable_thumbnail;
if (change & MPP_DEC_CFG_CHANGE_ENABLE_MVC)
dst_base->enable_mvc = src_base->enable_mvc;
if (change & MPP_DEC_CFG_CHANGE_DISABLE_THREAD)
dst_base->disable_thread = src_base->disable_thread;
@@ -1018,6 +1022,11 @@ MPP_RET mpp_dec_set_cfg_by_cmd(MppDecCfgSet *set, MpiCmd cmd, void *param)
cfg->change |= MPP_DEC_CFG_CHANGE_ENABLE_FAST_PLAY;
dec_dbg_func("disable idr immediately output %d\n", cfg->enable_fast_play);
} break;
case MPP_DEC_SET_ENABLE_MVC : {
cfg->enable_mvc = (param) ? (*((RK_U32 *)param)) : (0);
cfg->change |= MPP_DEC_CFG_CHANGE_ENABLE_MVC;
dec_dbg_func("enable MVC decoder %d\n", cfg->enable_mvc);
} break;
default : {
mpp_err_f("unsupported cfg update cmd %x\n", cmd);
ret = MPP_NOK;

View File

@@ -37,8 +37,10 @@ typedef enum MppDecCfgChange_e {
MPP_DEC_CFG_CHANGE_ENABLE_FAST_PLAY = (1 << 16),
MPP_DEC_CFG_CHANGE_ENABLE_HDR_META = (1 << 17),
MPP_DEC_CFG_CHANGE_ENABLE_THUMBNAIL = (1 << 18),
MPP_DEC_CFG_CHANGE_ENABLE_MVC = (1 << 19),
/* reserve high bit for global config */
MPP_DEC_CFG_CHANGE_DISABLE_THREAD = (1 << 28),
MPP_DEC_CFG_CHANGE_ALL = (0xFFFFFFFF),
} MppDecCfgChange;
@@ -67,6 +69,7 @@ typedef struct MppDecBaseCfg_t {
RK_U32 enable_fast_play;
RK_U32 enable_hdr_meta;
RK_U32 enable_thumbnail;
RK_U32 enable_mvc;
RK_U32 disable_thread;
} MppDecBaseCfg;

View File

@@ -1154,7 +1154,8 @@ MPP_RET Mpp::control_dec(MpiCmd cmd, MppParam param)
case MPP_DEC_SET_IMMEDIATE_OUT :
case MPP_DEC_SET_DISABLE_ERROR :
case MPP_DEC_SET_ENABLE_DEINTERLACE :
case MPP_DEC_SET_ENABLE_FAST_PLAY : {
case MPP_DEC_SET_ENABLE_FAST_PLAY :
case MPP_DEC_SET_ENABLE_MVC: {
/*
* These control may be set before mpp_init
* When this case happen record the config and wait for decoder init