fs->pts64 = 0;
}
fs->offset_delimiter = fs->top_field->offset_delimiter;
+ fs->decoded_frame_size = fs->top_field->pic_size + fs->bottom_field->pic_size;
} else if (fs->bottom_field) {
fs->pts = fs->bottom_field->pts;
fs->pts64 = fs->bottom_field->pts64;
fs->offset_delimiter = fs->bottom_field->offset_delimiter;
+ fs->decoded_frame_size = fs->top_field->pic_size + fs->bottom_field->pic_size;
}
/* FIELD_CODING ;*/
}
fs->slice_type = p->slice_type;
fs->frame_size = p->frame_size;
fs->offset_delimiter = p->offset_delimiter;
+ fs->decoded_frame_size = p->pic_size;
if (p->used_for_reference) {
fs->is_reference = 3;
fs->is_orig_reference = 3;
static int loop_playback_poc_threshold = 400;
static int poc_threshold = 50;
+static u32 lookup_check_conut = 30;
+
+
/*
*[3:0] 0: default use config from omx.
* 1: force enable fence.
bool discard_dv_data;
int vdec_pg_enable_flag;
u32 save_reg_f;
+ u32 start_bit_cnt;
+ u32 right_frame_count;
+ u32 wrong_frame_count;
};
static u32 again_threshold;
if ((pts_lookup_offset_us64(PTS_TYPE_VIDEO,
frame->offset_delimiter, &frame->pts, &frame->frame_size,
0, &frame->pts64) == 0)) {
- hw->last_pts64 = frame->pts64;
- hw->last_pts = frame->pts;
+ if ((lookup_check_conut && (hw->vf_pre_count > lookup_check_conut) &&
+ (hw->wrong_frame_count > hw->right_frame_count)) &&
+ ((frame->decoded_frame_size * 2 < frame->frame_size))) {
+ /*resolve many frame only one check in pts, cause playback unsmooth issue*/
+ frame->pts64 = hw->last_pts64 +DUR2PTS(hw->frame_dur) ;
+ frame->pts = hw->last_pts + DUR2PTS(hw->frame_dur);
+ }
+ hw->right_frame_count++;
} else {
frame->pts64 = hw->last_pts64 +DUR2PTS(hw->frame_dur) ;
frame->pts = hw->last_pts + DUR2PTS(hw->frame_dur);
+ hw->wrong_frame_count++;
}
}
dpb_print(DECODE_ID(hw), PRINT_FLAG_VDEC_STATUS,
struct StorablePicture *pic =
p_H264_Dpb->mVideo.dec_picture;
u32 offset = pic->offset_delimiter;
+ pic->pic_size = (hw->start_bit_cnt - READ_VREG(VIFF_BIT_CNT)) >> 3;
if (pts_pickout_offset_us64(PTS_TYPE_VIDEO,
offset, &pic->pts, 0, &pic->pts64)) {
pic->pts = 0;
WRITE_VREG(H264_DECODE_INFO, (1<<13));
WRITE_VREG(H264_DECODE_SIZE, size);
WRITE_VREG(VIFF_BIT_CNT, size * 8);
+ hw->start_bit_cnt = size * 8;
}
config_aux_buf(hw);
config_decode_mode(hw);