author | miaohong chen <miaohong.chen@amlogic.com> | 2020-01-14 09:20:27 (GMT) |
---|---|---|
committer | miaohong chen <miaohong.chen@amlogic.com> | 2020-01-15 02:24:00 (GMT) |
commit | a59d2f8c71f7322d2c91861b57b522a968aef030 (patch) | |
tree | 9d95dd06df876931a49aad121ce6f9ecc2972ce1 | |
parent | 17a06af53b105d2c5f49ea2592853715d070da07 (diff) | |
download | media_modules-a59d2f8c71f7322d2c91861b57b522a968aef030.zip media_modules-a59d2f8c71f7322d2c91861b57b522a968aef030.tar.gz media_modules-a59d2f8c71f7322d2c91861b57b522a968aef030.tar.bz2 |
vmh264: Solve the problem of picture shake [1/1]
PD#IPTV-5848
Problem:
local play "LHDMI--wumochou.ts" the video is judders
Solution:
Obtain the top and bottom field priority flags from the sei grammar
to determine whether to output the top or bottom field first.
Verify:
S905L2A
Change-Id: I6163c9e2a32e03d5d2f1ee7b2837a7735ac1c2c1
Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/h264_dpb.c | 16 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/h264_dpb.h | 25 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 17 |
3 files changed, 37 insertions, 21 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c index 71560fa..96c6019 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c @@ -1060,14 +1060,14 @@ static void init_picture(struct h264_dpb_stru *p_H264_Dpb, currSlice->picture_structure_mmco); } - if (currSlice->pic_struct >= 3) - dec_picture->pic_struct = currSlice->pic_struct + 2; - else if (currSlice->pic_struct == 1) - dec_picture->pic_struct = PIC_TOP_BOT; - else if (currSlice->pic_struct >= 2) - dec_picture->pic_struct = PIC_BOT_TOP; - else + if (currSlice->pic_struct < PIC_INVALID) { + dec_picture->pic_struct = currSlice->pic_struct; + } else { dec_picture->pic_struct = PIC_INVALID; + } + + dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL, + "%s pic_struct = %d\n", __func__, dec_picture->pic_struct); } void dump_pic(struct h264_dpb_stru *p_H264_Dpb) @@ -2312,7 +2312,7 @@ int output_frames(struct h264_dpb_stru *p_H264_Dpb, unsigned char flush_flag) dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL, "%s first_insert_frame %d \n", __func__, p_H264_Dpb->first_insert_frame); } - if (prepare_display_buf(p_H264_Dpb->vdec, p_Dpb->fs[pos]) >= 0) + if (prepare_display_buf(p_H264_Dpb, p_Dpb->fs[pos]) >= 0) p_Dpb->fs[pos]->pre_output = 1; else { if (h264_debug_flag & PRINT_FLAG_DPB_DETAIL) { diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h index f701d47..ab71565 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h @@ -53,16 +53,6 @@ */ #define IGNORE_PARAM_FROM_CONFIG 0x8000000 - -#define PIC_SINGLE_FRAME 0 -#define PIC_TOP_BOT_TOP 1 -#define PIC_BOT_TOP_BOT 2 -#define PIC_DOUBLE_FRAME 3 -#define PIC_TRIPLE_FRAME 4 -#define PIC_TOP_BOT 5 -#define PIC_BOT_TOP 6 -#define PIC_INVALID 7 - #define MVC_EXTENSION_ENABLE 0 #define PRINTREFLIST 0 @@ -430,6 +420,19 @@ enum PictureStructure { BOTTOM_FIELD }; +typedef enum { + PIC_SINGLE_FRAME = 0, + PIC_TOP, + PIC_BOT, + PIC_TOP_BOT, + PIC_BOT_TOP, + PIC_TOP_BOT_TOP = 5, + PIC_BOT_TOP_BOT, + PIC_DOUBLE_FRAME, + PIC_TRIPLE_FRAME, + PIC_INVALID, +} PicStruct_E; + #define I_Slice 2 #define P_Slice 5 #define B_Slice 6 @@ -911,7 +914,7 @@ int dpb_print_cont(int index, int debug_flag, const char *fmt, ...); unsigned char dpb_is_debug(int index, int debug_flag); -int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame); +int prepare_display_buf(struct h264_dpb_stru *p_H264_Dpb, struct FrameStore *frame); int release_buf_spec_num(struct vdec_s *vdec, int buf_spec_num); diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 4759eee..7ce59e6 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -2592,9 +2592,11 @@ static int is_iframe(struct FrameStore *frame) { -int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) +int prepare_display_buf(struct h264_dpb_stru *p_H264_Dpb, struct FrameStore *frame) { + struct vdec_s *vdec = p_H264_Dpb->vdec; struct vdec_h264_hw_s *hw = (struct vdec_h264_hw_s *)vdec->private; + struct StorablePicture *p = p_H264_Dpb->mVideo.dec_picture; struct vframe_s *vf = NULL; int buffer_index = frame->buf_spec_num; int vf_count = 1; @@ -2834,9 +2836,20 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) VIDTYPE_VIU_NV21; if (bForceInterlace) { - vf->type |= (i == 0 ? + if (p->pic_struct == PIC_TOP_BOT) { + vf->type |= (i == 0 ? VIDTYPE_INTERLACE_TOP : VIDTYPE_INTERLACE_BOTTOM); + } else if (p->pic_struct == PIC_BOT_TOP) { + vf->type |= (i == 0 ? + VIDTYPE_INTERLACE_BOTTOM : + VIDTYPE_INTERLACE_TOP); + } else { + vf->type |= (i == 0 ? + VIDTYPE_INTERLACE_TOP : + VIDTYPE_INTERLACE_BOTTOM); + } + if (i == 1) { vf->pts = 0; vf->pts_us64 = 0; |