diff --git a/mpp/codec/enc/h264/src/H264EncApi.c b/mpp/codec/enc/h264/src/H264EncApi.c index c37073e1..3c91df1e 100644 --- a/mpp/codec/enc/h264/src/H264EncApi.c +++ b/mpp/codec/enc/h264/src/H264EncApi.c @@ -968,7 +968,7 @@ H264EncRet H264EncStrmEncodeAfter(H264ECtx *pEncInst, if (stat == H264RC_OVERFLOW) { /* pEncOut->codingType = H264ENC_NOTCODED_FRAME; */ pSlice->frameNum = pSlice->prevFrameNum; /* revert frame_num */ - h264e_dbg_func("H264EncStrmEncode: OK, Frame discarded (HRD overflow)"); + mpp_err("H264EncStrmEncode: OK, Frame discarded (HRD overflow)!"); return H264ENC_FRAME_READY; } } diff --git a/mpp/codec/enc/h264/src/h264e_api.c b/mpp/codec/enc/h264/src/h264e_api.c index 7d9880fa..3962cd80 100644 --- a/mpp/codec/enc/h264/src/h264e_api.c +++ b/mpp/codec/enc/h264/src/h264e_api.c @@ -322,8 +322,8 @@ MPP_RET h264e_config(void *ctx, RK_S32 cmd, void *param) if (mpp_cfg->rc_mode) { /* VBR / CBR mode */ - RK_S32 max_qp = MPP_MAX(mpp_cfg->qp + 6, 48); - RK_S32 min_qp = MPP_MIN(mpp_cfg->qp - 6, 16); + RK_S32 max_qp = MPP_MAX(mpp_cfg->qp + 6, 51); + RK_S32 min_qp = MPP_MIN(mpp_cfg->qp - 6, 18); enc_rc_cfg->pictureRc = 1; enc_rc_cfg->mbRc = 1; @@ -353,7 +353,7 @@ MPP_RET h264e_config(void *ctx, RK_S32 cmd, void *param) enc_rc_cfg->bitPerSecond = mpp_cfg->bps; enc_rc_cfg->gopLen = mpp_cfg->gop; enc_rc_cfg->fixedIntraQp = 0; - enc_rc_cfg->mbQpAdjustment = 3; + enc_rc_cfg->mbQpAdjustment = 0; enc_rc_cfg->hrdCpbSize = mpp_cfg->bps; enc->intraPicRate = enc_rc_cfg->intraPicRate; @@ -437,6 +437,7 @@ MPP_RET h264e_config(void *ctx, RK_S32 cmd, void *param) MPP_RET h264e_callback(void *ctx, void *feedback) { H264ECtx *enc = (H264ECtx *)ctx; + H264EncIn *encIn = &(enc->encIn); regValues_s *val = &(enc->asic.regs); h264e_feedback *fb = (h264e_feedback *)feedback; H264EncOut *encOut = &(enc->encOut); @@ -484,6 +485,8 @@ MPP_RET h264e_callback(void *ctx, void *feedback) break; } + encIn->timeIncrement = 1; + return MPP_OK; } diff --git a/test/vpu_api_test.c b/test/vpu_api_test.c index f658525d..ac129c07 100644 --- a/test/vpu_api_test.c +++ b/test/vpu_api_test.c @@ -343,11 +343,13 @@ static RK_S32 vpu_encode_demo(VpuApiDemoCmdContext_t *cmd) enc_param->height = cmd->height; enc_param->format = ENC_INPUT_YUV420_PLANAR; enc_param->rc_mode = 0; - enc_param->bitRate = 100000; + enc_param->bitRate = 4000000; enc_param->framerate = 25; enc_param->enableCabac = 1; enc_param->cabacInitIdc = 0; enc_param->intraPicRate = 30; + enc_param->profileIdc = 66; + enc_param->levelIdc = 40; if ((ret = ctx->init(ctx, NULL, 0)) != 0) { mpp_log("init vpu api context fail, ret: 0x%X\n", ret);