From 9162b350f0054f906820e6f9f1d795a48a97fed9 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 11 Nov 2020 09:40:43 +0800 Subject: [PATCH] h265: some special case video freeze in playback [1/1] PD#SWPL-36642 Problem: some h265 stream has more reference, and offset is big, video playback freeze easily, no buffer vailable to decode Solution: change condition to use sps_max_dec_buf to cal max_buf_num Verify: S905X3 Signed-off-by: Hui Zhang Change-Id: I954e1491b88b695072000574206aa487c6c034a0 --- drivers/frame_provider/decoder/h265/vh265.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index df572ff..0a23180 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -3478,7 +3478,7 @@ static int get_work_pic_num(struct hevc_state_s *hevc) "save buf _mode : dynamic_buf_num_margin %d ----> %d \n", dynamic_buf_num_margin, hevc->dynamic_buf_num_margin); - if (sps_pic_buf_diff >= 4) + if (sps_pic_buf_diff >= 3) used_buf_num += sps_pic_buf_diff; if (hevc->is_used_v4l) { @@ -14020,7 +14020,6 @@ static int ammvdec_h265_probe(struct platform_device *pdev) &config_val) == 0) { hevc->max_pic_h = config_val; } - if (get_config_int(pdata->config, "sidebind_type", &config_val) == 0) hevc->sidebind_type = config_val; @@ -14068,11 +14067,12 @@ static int ammvdec_h265_probe(struct platform_device *pdev) hevc->double_write_mode = 0x1000; if (!hevc->is_used_v4l) { + /* get valid double write from configure or node */ + //hevc->double_write_mode = get_double_write_mode(hevc); if (hevc->save_buffer_mode && dynamic_buf_num_margin > 2) hevc->dynamic_buf_num_margin = dynamic_buf_num_margin -2; else hevc->dynamic_buf_num_margin = dynamic_buf_num_margin; - hevc->mem_map_mode = mem_map_mode; } -- 2.20.1