author | miaohong chen <miaohong.chen@amlogic.com> | 2020-01-16 12:42:05 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-01-16 12:57:15 (GMT) |
commit | 58b2b74d09d712ba132c9391dbff7f25d7a9ba60 (patch) | |
tree | 28398b74a173ee8f1134bd3b44a208413457753b | |
parent | 3ba925c5c9237322cc84d9103ac6c7e56d193354 (diff) | |
download | media_modules-58b2b74d09d712ba132c9391dbff7f25d7a9ba60.zip media_modules-58b2b74d09d712ba132c9391dbff7f25d7a9ba60.tar.gz media_modules-58b2b74d09d712ba132c9391dbff7f25d7a9ba60.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: Id3dd99d90b782a97014c7b0f7b7b0c4c94537751
Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/h264_dpb.c | 14 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/h264_dpb.h | 23 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 11 |
3 files changed, 31 insertions, 17 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..a408b0e 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) diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h index f701d47..e9a7489 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 diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 4759eee..6b6260c 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -2834,9 +2834,20 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) VIDTYPE_VIU_NV21; if (bForceInterlace) { + if (frame->frame != NULL && frame->frame->pic_struct == PIC_TOP_BOT) { vf->type |= (i == 0 ? VIDTYPE_INTERLACE_TOP : VIDTYPE_INTERLACE_BOTTOM); + } else if (frame->frame != NULL && frame->frame->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; |