mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-14 13:23:41 +08:00
[mpp_enc_v2]: config qp range if mb rc is disable
On FIXQP mode all qp will be set to init_quality. Change-Id: Ic614c583e5dba0e5e4e129f46437adc87cd13fa0 Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:

committed by
Herman Chen

parent
8eb95cde37
commit
aeb320ed33
@@ -667,6 +667,11 @@ MPP_RET rc_model_v2_start(void *ctx, EncRcTask *task)
|
||||
rc_dbg_func("enter %p\n", ctx);
|
||||
|
||||
if (p->usr_cfg.mode == RC_FIXQP) {
|
||||
if (p->usr_cfg.init_quality <= 0) {
|
||||
mpp_log("invalid fix %d qp found set default qp 26\n",
|
||||
p->usr_cfg.init_quality);
|
||||
p->usr_cfg.init_quality = 26;
|
||||
}
|
||||
info->quality_max = p->usr_cfg.init_quality;
|
||||
info->quality_min = p->usr_cfg.init_quality;
|
||||
info->quality_target = p->usr_cfg.init_quality;
|
||||
|
@@ -582,26 +582,16 @@ MPP_RET h264e_vepu_mbrc_prepare(HalH264eVepuMbRcCtx ctx, HalH264eVepuMbRc *mbrc,
|
||||
RK_S32 tmp, nonZeroTarget;
|
||||
RK_S32 coeffCntMax = p->mbs * 24 * 16;
|
||||
|
||||
if (!p->mb_bit_rc_enable) {
|
||||
if (codec->qp_init == -1) {
|
||||
mpp_log("fix qp case but qp no set default qp = 26");
|
||||
mbrc->qp_init = 26;
|
||||
} else {
|
||||
mbrc->qp_init = codec->qp_init;
|
||||
}
|
||||
|
||||
mbrc->qp_min = mbrc->qp_init;
|
||||
mbrc->qp_max = mbrc->qp_init;
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
p->pre_frame_type = p->frame_type;
|
||||
p->frame_type = (frm->is_intra) ? INTRA_FRAME : INTER_P_FRAME;
|
||||
|
||||
mbrc->qp_init = info->quality_target;
|
||||
mbrc->qp_min = codec->qp_min;
|
||||
mbrc->qp_max = codec->qp_max;
|
||||
|
||||
if (!p->mb_bit_rc_enable)
|
||||
return MPP_OK;
|
||||
|
||||
p->pre_frame_type = p->frame_type;
|
||||
p->frame_type = (frm->is_intra) ? INTRA_FRAME : INTER_P_FRAME;
|
||||
|
||||
if (mbrc->rlc_count == 0) {
|
||||
mbrc->rlc_count = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user