From 4cb7a3222648da3fb9c87a65e5f39c07754ed0e8 Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Fri, 29 Jan 2021 14:16:07 +0800 Subject: [PATCH] [jpege_api_v2]: Init fixqp as default rc mode for jpege Signed-off-by: Yandong Lin Change-Id: I5d16f3225133386360f83f0853e1e13e4569ebd0 --- mpp/codec/enc/jpeg/jpege_api_v2.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/mpp/codec/enc/jpeg/jpege_api_v2.c b/mpp/codec/enc/jpeg/jpege_api_v2.c index e0b372b5..69d960c6 100644 --- a/mpp/codec/enc/jpeg/jpege_api_v2.c +++ b/mpp/codec/enc/jpeg/jpege_api_v2.c @@ -76,14 +76,21 @@ static MPP_RET jpege_init_v2(void *ctx, EncImplCfg *cfg) mpp_assert(cfg->coding = MPP_VIDEO_CodingMJPEG); cfg->task_count = 1; - /* init default fps config */ - MppEncRcCfg *rc = &p->cfg->rc; - rc->fps_in_flex = 0; - rc->fps_in_num = 30; - rc->fps_in_denorm = 1; - rc->fps_out_flex = 0; - rc->fps_out_num = 30; - rc->fps_out_denorm = 1; + { + /* init default rc config */ + MppEncRcCfg *rc = &p->cfg->rc; + MppEncJpegCfg *jpeg_cfg = &p->cfg->codec.jpeg; + + rc->fps_in_flex = 0; + rc->fps_in_num = 30; + rc->fps_in_denorm = 1; + rc->fps_out_flex = 0; + rc->fps_out_num = 30; + rc->fps_out_denorm = 1; + rc->rc_mode = MPP_ENC_RC_MODE_FIXQP; + /* init default quant */ + jpeg_cfg->quant = 10; + } jpege_dbg_func("leave ctx %p\n", ctx); return MPP_OK;