summaryrefslogtreecommitdiff
authorMiaohong Chen <miaohong.chen@amlogic.com>2020-01-16 08:47:57 (GMT)
committer Miaohong Chen <miaohong.chen@amlogic.com>2020-01-16 08:47:57 (GMT)
commitcafa710736959c3ca2272e8ef5f13a21ce05930e (patch)
tree28515006ca507c84950467b4007b764050f5d519
parenta59d2f8c71f7322d2c91861b57b522a968aef030 (diff)
downloadmedia_modules-cafa710736959c3ca2272e8ef5f13a21ce05930e.zip
media_modules-cafa710736959c3ca2272e8ef5f13a21ce05930e.tar.gz
media_modules-cafa710736959c3ca2272e8ef5f13a21ce05930e.tar.bz2
Revert "vmh264: Solve the problem of picture shake [1/1]"
This reverts commit a59d2f8c71f7322d2c91861b57b522a968aef030. Change-Id: Ia5dc9ffc2211666e97796fb18f1e853cfa916e11
Diffstat
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.c16
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.h25
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c17
3 files changed, 21 insertions, 37 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c
index 96c6019..71560fa 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 < PIC_INVALID) {
- dec_picture->pic_struct = currSlice->pic_struct;
- } else {
+ 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
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, p_Dpb->fs[pos]) >= 0)
+ if (prepare_display_buf(p_H264_Dpb->vdec, 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 ab71565..f701d47 100644
--- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h
+++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h
@@ -53,6 +53,16 @@
*/
#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
@@ -420,19 +430,6 @@ 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
@@ -914,7 +911,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 h264_dpb_stru *p_H264_Dpb, struct FrameStore *frame);
+int prepare_display_buf(struct vdec_s *vdec, 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 7ce59e6..4759eee 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -2592,11 +2592,9 @@ static int is_iframe(struct FrameStore *frame) {
-int prepare_display_buf(struct h264_dpb_stru *p_H264_Dpb, struct FrameStore *frame)
+int prepare_display_buf(struct vdec_s *vdec, 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;
@@ -2836,20 +2834,9 @@ int prepare_display_buf(struct h264_dpb_stru *p_H264_Dpb, struct FrameStore *fra
VIDTYPE_VIU_NV21;
if (bForceInterlace) {
- 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 ?
+ vf->type |= (i == 0 ?
VIDTYPE_INTERLACE_TOP :
VIDTYPE_INTERLACE_BOTTOM);
- }
-
if (i == 1) {
vf->pts = 0;
vf->pts_us64 = 0;