mirror of
				https://github.com/nyanmisaka/mpp.git
				synced 2025-10-27 02:50:21 +08:00 
			
		
		
		
	[hal_vepu580]: Add scene_mode to distinguish ipc and none ipc scene.
Signed-off-by: toby.zhang <toby.zhang@rock-chips.com> Change-Id: Ib62c3eccbcce4b7517cf4a5d930260e982080ea9
This commit is contained in:
		| @@ -102,12 +102,14 @@ static RK_S32 rime_multi[4][3] = { | |||||||
| static HalH264eVepu580Tune *vepu580_h264e_tune_init(HalH264eVepu580Ctx *ctx) | static HalH264eVepu580Tune *vepu580_h264e_tune_init(HalH264eVepu580Ctx *ctx) | ||||||
| { | { | ||||||
|     HalH264eVepu580Tune *tune = mpp_malloc(HalH264eVepu580Tune, 1); |     HalH264eVepu580Tune *tune = mpp_malloc(HalH264eVepu580Tune, 1); | ||||||
|  |     RK_S32 scene_mode = ctx->cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC ? 0 : 1; | ||||||
|  |  | ||||||
|     if (NULL == tune) |     if (NULL == tune) | ||||||
|         return tune; |         return tune; | ||||||
|  |  | ||||||
|     tune->ctx = ctx; |     tune->ctx = ctx; | ||||||
|     tune->curr_scene_motion_flag = 0; |     tune->curr_scene_motion_flag = 0; | ||||||
|     tune->ap_motion_flag = 0; |     tune->ap_motion_flag = scene_mode; | ||||||
|     memset(tune->md_madp, 0, sizeof(tune->md_madp)); |     memset(tune->md_madp, 0, sizeof(tune->md_madp)); | ||||||
|     memset(tune->txtr_madi, 0, sizeof(tune->txtr_madi)); |     memset(tune->txtr_madi, 0, sizeof(tune->txtr_madi)); | ||||||
|     memset(tune->md_flag_matrix, 0, sizeof(tune->md_flag_matrix)); |     memset(tune->md_flag_matrix, 0, sizeof(tune->md_flag_matrix)); | ||||||
| @@ -127,13 +129,17 @@ static void vepu580_h264e_tune_reg_patch(void *p) | |||||||
| { | { | ||||||
|     HalH264eVepu580Tune *tune = (HalH264eVepu580Tune *)p; |     HalH264eVepu580Tune *tune = (HalH264eVepu580Tune *)p; | ||||||
|     HalH264eVepu580Ctx *ctx = NULL; |     HalH264eVepu580Ctx *ctx = NULL; | ||||||
|  |     RK_S32 scene_mode = 0; | ||||||
|  |  | ||||||
|     if (NULL == tune) |     if (NULL == tune) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     ctx = tune->ctx; |     ctx = tune->ctx; | ||||||
|  |     scene_mode = ctx->cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC ? 0 : 1; | ||||||
|  |  | ||||||
|     H264eSlice *slice = ctx->slice; |     H264eSlice *slice = ctx->slice; | ||||||
|     HalVepu580RegSet *regs = ctx->regs_set; |     HalVepu580RegSet *regs = ctx->regs_set; | ||||||
|  |     tune->ap_motion_flag = scene_mode; | ||||||
|     RK_U32 scene_motion_flag = tune->ap_motion_flag * 2 + tune->curr_scene_motion_flag; |     RK_U32 scene_motion_flag = tune->ap_motion_flag * 2 + tune->curr_scene_motion_flag; | ||||||
|  |  | ||||||
|     if (scene_motion_flag > 3) { |     if (scene_motion_flag > 3) { | ||||||
| @@ -230,12 +236,14 @@ static void vepu580_h264e_tune_stat_update(void *p, HalEncTask *task) | |||||||
|     HalH264eVepu580Tune *tune = (HalH264eVepu580Tune *)p; |     HalH264eVepu580Tune *tune = (HalH264eVepu580Tune *)p; | ||||||
|     HalH264eVepu580Ctx *ctx = NULL; |     HalH264eVepu580Ctx *ctx = NULL; | ||||||
|     EncRcTaskInfo *rc_info = &task->rc_task->info; |     EncRcTaskInfo *rc_info = &task->rc_task->info; | ||||||
|  |     RK_S32 scene_mode = 0; | ||||||
|  |  | ||||||
|     if (NULL == tune) |     if (NULL == tune) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     ctx = tune->ctx; |     ctx = tune->ctx; | ||||||
|  |     scene_mode = ctx->cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC ? 0 : 1; | ||||||
|  |     tune->ap_motion_flag = scene_mode; | ||||||
|     /* update statistic info here */ |     /* update statistic info here */ | ||||||
|     RK_S32 mb_num = 0; |     RK_S32 mb_num = 0; | ||||||
|     RK_S32 madp = 0; |     RK_S32 madp = 0; | ||||||
|   | |||||||
| @@ -141,12 +141,14 @@ static RK_S32 rime_multi[4][3] = { | |||||||
| static HalH265eVepu580Tune *vepu580_h265e_tune_init(H265eV580HalContext *ctx) | static HalH265eVepu580Tune *vepu580_h265e_tune_init(H265eV580HalContext *ctx) | ||||||
| { | { | ||||||
|     HalH265eVepu580Tune *tune = mpp_malloc(HalH265eVepu580Tune, 1); |     HalH265eVepu580Tune *tune = mpp_malloc(HalH265eVepu580Tune, 1); | ||||||
|  |     RK_S32 scene_mode = ctx->cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC ? 0 : 1; | ||||||
|  |  | ||||||
|     if (NULL == tune) |     if (NULL == tune) | ||||||
|         return tune; |         return tune; | ||||||
|  |  | ||||||
|     tune->ctx = ctx; |     tune->ctx = ctx; | ||||||
|     tune->curr_scene_motion_flag = 0; |     tune->curr_scene_motion_flag = 0; | ||||||
|     tune->ap_motion_flag = 0; |     tune->ap_motion_flag = scene_mode; | ||||||
|     memset(tune->md_madp, 0, sizeof(tune->md_madp)); |     memset(tune->md_madp, 0, sizeof(tune->md_madp)); | ||||||
|     memset(tune->txtr_madi, 0, sizeof(tune->txtr_madi)); |     memset(tune->txtr_madi, 0, sizeof(tune->txtr_madi)); | ||||||
|     memset(tune->md_flag_matrix, 0, sizeof(tune->md_flag_matrix)); |     memset(tune->md_flag_matrix, 0, sizeof(tune->md_flag_matrix)); | ||||||
| @@ -166,12 +168,14 @@ static void vepu580_h265e_tune_reg_patch(void *p) | |||||||
| { | { | ||||||
|     HalH265eVepu580Tune *tune = (HalH265eVepu580Tune *)p; |     HalH265eVepu580Tune *tune = (HalH265eVepu580Tune *)p; | ||||||
|     H265eV580HalContext *ctx = NULL; |     H265eV580HalContext *ctx = NULL; | ||||||
|  |     RK_S32 scene_mode = 0; | ||||||
|  |  | ||||||
|     if (NULL == tune) |     if (NULL == tune) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     ctx = tune->ctx; |     ctx = tune->ctx; | ||||||
|  |     scene_mode = ctx->cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC ? 0 : 1; | ||||||
|  |     tune->ap_motion_flag = scene_mode; | ||||||
|     /* modify register here */ |     /* modify register here */ | ||||||
|     H265eV580RegSet *regs = (H265eV580RegSet *)ctx->regs[0]; |     H265eV580RegSet *regs = (H265eV580RegSet *)ctx->regs[0]; | ||||||
|     hevc_vepu580_rc_klut *rc_regs =  ®s->reg_rc_klut; |     hevc_vepu580_rc_klut *rc_regs =  ®s->reg_rc_klut; | ||||||
| @@ -351,12 +355,14 @@ static void vepu580_h265e_tune_stat_update(void *p) | |||||||
| { | { | ||||||
|     HalH265eVepu580Tune *tune = (HalH265eVepu580Tune *)p; |     HalH265eVepu580Tune *tune = (HalH265eVepu580Tune *)p; | ||||||
|     H265eV580HalContext *ctx = NULL; |     H265eV580HalContext *ctx = NULL; | ||||||
|  |     RK_S32 scene_mode = 0; | ||||||
|  |  | ||||||
|     if (NULL == tune) |     if (NULL == tune) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     ctx = tune->ctx; |     ctx = tune->ctx; | ||||||
|  |     scene_mode = ctx->cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC ? 0 : 1; | ||||||
|  |     tune->ap_motion_flag = scene_mode; | ||||||
|     /* update statistic info here */ |     /* update statistic info here */ | ||||||
|     RK_S32 j; |     RK_S32 j; | ||||||
|     RK_S32 i = 0; |     RK_S32 i = 0; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 toby.zhang
					toby.zhang