h265: some special case video freeze in playback [1/1]
authorHui Zhang <hui.zhang@amlogic.com>
Wed, 11 Nov 2020 01:40:43 +0000 (09:40 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Mon, 23 Nov 2020 09:06:46 +0000 (01:06 -0800)
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 <hui.zhang@amlogic.com>
Change-Id: I954e1491b88b695072000574206aa487c6c034a0

drivers/frame_provider/decoder/h265/vh265.c

index df572ff893a0c994d905cf64c314255a70a79659..0a23180e46599e94e2bf0570318b3cf8b9b8c775 100644 (file)
@@ -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;
        }