summaryrefslogtreecommitdiff
authormiaohong chen <miaohong.chen@amlogic.com>2020-07-02 06:00:57 (GMT)
committer Miaohong Chen <miaohong.chen@amlogic.com>2020-07-06 02:28:37 (GMT)
commitf8085c8f359f746d7a8d0f5f7916d69757b14307 (patch)
treeb3bde4482e287b410d173d0da1f131daa0ce405e
parentc2fc09851c8f774e4fb932c45092f757adaaf2a9 (diff)
downloadmedia_modules-f8085c8f359f746d7a8d0f5f7916d69757b14307.zip
media_modules-f8085c8f359f746d7a8d0f5f7916d69757b14307.tar.gz
media_modules-f8085c8f359f746d7a8d0f5f7916d69757b14307.tar.bz2
vmh264: stream not smooth [1/1]
PD#SWPL-28869 Problem: H264 stream frequently not smooth Solution: cause:The number of inverted frames is inaccurate, which results in the frame not being output in time and the code stream is not smooth. If the grammar has reverse frame number reoder_num_frames, reoder_num_frames is preferred. Verify: u212 Change-Id: I1b176ae825db01caed44a2a49de0789a2af8d562 Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.c2
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.h2
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c13
3 files changed, 12 insertions, 5 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
index 29910d4..958c7fa 100644
--- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
+++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
@@ -2293,7 +2293,7 @@ int output_frames(struct h264_dpb_stru *p_H264_Dpb, unsigned char flush_flag)
if (fast_output_flag)
;
else if (none_displayed_num <
- p_H264_Dpb->origin_max_reference)
+ p_H264_Dpb->reorder_output)
return 0;
}
diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h
index 4935017..e94404b 100644
--- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h
+++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h
@@ -900,7 +900,7 @@ struct h264_dpb_stru {
unsigned int last_dpb_status;
unsigned char buf_alloc_fail;
unsigned int dpb_error_flag;
- unsigned int origin_max_reference;
+ unsigned int reorder_output;
unsigned int first_insert_frame;
int first_output_poc;
int dpb_frame_count;
diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c
index 8e877eb..d92722b 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -4868,7 +4868,7 @@ static int vh264_set_params(struct vdec_h264_hw_s *hw,
reg_val = param4;
level_idc = reg_val & 0xff;
max_reference_size = (reg_val >> 8) & 0xff;
- hw->dpb.origin_max_reference = max_reference_size;
+ hw->dpb.reorder_output = max_reference_size;
dpb_print(DECODE_ID(hw), 0,
"mb height/widht/total: %x/%x/%x level_idc %x max_ref_num %x\n",
mb_height, mb_width, mb_total,
@@ -4881,10 +4881,11 @@ static int vh264_set_params(struct vdec_h264_hw_s *hw,
max_reference_size, mb_width, mb_height);
dpb_print(DECODE_ID(hw), 0,
- "restriction_flag=%d, max_dec_frame_buffering=%d, reorder_pic_num=%d\n",
+ "restriction_flag=%d, max_dec_frame_buffering=%d, reorder_pic_num=%d num_reorder_frames %d\n",
hw->bitstream_restriction_flag,
hw->max_dec_frame_buffering,
- hw->dpb.reorder_pic_num);
+ hw->dpb.reorder_pic_num,
+ hw->num_reorder_frames);
if ((hw->bitstream_restriction_flag) &&
(hw->max_dec_frame_buffering <
@@ -4895,6 +4896,12 @@ static int vh264_set_params(struct vdec_h264_hw_s *hw,
hw->dpb.reorder_pic_num);
}
+ if (p_H264_Dpb->bitstream_restriction_flag &&
+ p_H264_Dpb->num_reorder_frames <= p_H264_Dpb->max_dec_frame_buffering &&
+ p_H264_Dpb->num_reorder_frames >= 0) {
+ hw->dpb.reorder_output = hw->num_reorder_frames + 1;
+ }
+
active_buffer_spec_num =
hw->dpb.reorder_pic_num
+ used_reorder_dpb_size_margin;