(struct AVS2Decoder_s *)vdec->private;
if (i_only_flag & 0x100)
return 0;
- if (trickmode == TRICKMODE_I)
+ if (trickmode == TRICKMODE_I || trickmode == TRICKMODE_I_HEVC)
dec->i_only = 0x3;
else if (trickmode == TRICKMODE_NONE)
dec->i_only = 0x0;
#undef WRITE_VREG
#define WRITE_VREG WRITE_VREG_DBG
#endif
+extern u32 trickmode_i;
static DEFINE_MUTEX(vh265_mutex);
}
#endif
+int vh265_set_trickmode(struct vdec_s *vdec, unsigned long trickmode)
+{
+ struct hevc_state_s *hevc = (struct hevc_state_s *)vdec->private;
+ hevc_print(hevc, 0, "[%s %d] trickmode:%lu\n", __func__, __LINE__, trickmode);
+
+ if (trickmode == TRICKMODE_I) {
+ trickmode_i = 1;
+ i_only_flag = 0x1;
+ } else if (trickmode == TRICKMODE_NONE) {
+ trickmode_i = 0;
+ i_only_flag = 0x0;
+ } else if (trickmode == 0x02) {
+ trickmode_i = 0;
+ i_only_flag = 0x02;
+ } else if (trickmode == 0x03) {
+ trickmode_i = 1;
+ i_only_flag = 0x03;
+ } else if (trickmode == 0x07) {
+ trickmode_i = 1;
+ i_only_flag = 0x07;
+ }
+ //hevc_print(hevc, 0, "i_only_flag: %d trickmode_i:%d\n", i_only_flag, trickmode_i);
+
+ return 0;
+}
+
static void config_decode_mode(struct hevc_state_s *hevc)
{
#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
#ifdef MULTI_INSTANCE_SUPPORT
pdata->private = hevc;
pdata->dec_status = vh265_dec_status;
+ pdata->set_trickmode = vh265_set_trickmode;
pdata->set_isreset = vh265_set_isreset;
is_reset = 0;
if (vh265_init(pdata) < 0) {
pdata->private = hevc;
pdata->dec_status = vh265_dec_status;
- /* pdata->set_trickmode = set_trickmode; */
+ pdata->set_trickmode = vh265_set_trickmode;
pdata->run_ready = run_ready;
pdata->run = run;
pdata->reset = reset;
struct vdec_info gvs;
struct vframe_qos_s vframe_qos;
unsigned int res_ch_flag;
+ u32 i_only;
};
static void vmpeg12_local_init(struct vdec_mpeg12_hw_s *hw);
static int vmpeg12_hw_ctx_restore(struct vdec_mpeg12_hw_s *hw);
struct vdec_s *vdec = hw_to_vdec(hw);
struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx;
ulong nv_order = VIDTYPE_VIU_NV21;
+ bool pb_skip = false;
#ifdef NV21
type = nv_order;
nv_order = VIDTYPE_VIU_NV12;
}
+ pb_skip = (hw->pics[hw->refs[0]].offset ==
+ hw->pics[hw->refs[1]].offset);
+ if (hw->i_only) {
+ pb_skip = 1;
+ }
+
user_data_ready_notify(hw, pic->pts, pic->pts_valid);
if (hw->frame_prog & PICINFO_PROG) {
vf->type_original = vf->type;
if ((error_skip(hw, pic->buffer_info, vf)) ||
- ((hw->first_i_frame_ready == 0) &&
+ (((hw->first_i_frame_ready == 0) || pb_skip) &&
((PICINFO_TYPE_MASK & pic->buffer_info) !=
PICINFO_TYPE_I))) {
hw->drop_frame_count++;
pr_info("ammvdec_mpeg12: reset.\n");
}
+static int vmpeg12_set_trickmode(struct vdec_s *vdec, unsigned long trickmode)
+{
+ struct vdec_mpeg12_hw_s *hw =
+ (struct vdec_mpeg12_hw_s *)vdec->private;
+ if (!hw)
+ return 0;
+
+ if (trickmode == TRICKMODE_I) {
+ hw->i_only = 0x3;
+ //trickmode_i = 1;
+ } else if (trickmode == TRICKMODE_NONE) {
+ hw->i_only = 0x0;
+ //trickmode_i = 0;
+ }
+ return 0;
+}
+
static int ammvdec_mpeg12_probe(struct platform_device *pdev)
{
struct vdec_s *pdata = *(struct vdec_s **)pdev->dev.platform_data;
pdata->private = hw;
pdata->dec_status = vmmpeg12_dec_status;
+ pdata->set_trickmode = vmpeg12_set_trickmode;
pdata->run_ready = run_ready;
pdata->run = run;
pdata->reset = reset;
bool v4l_params_parsed;
u32 buf_num;
u32 dynamic_buf_num_margin;
+ u32 i_only;
};
static void vmpeg4_local_init(struct vdec_mpeg4_hw_s *hw);
static int vmpeg4_hw_ctx_restore(struct vdec_mpeg4_hw_s *hw);
struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx;
ulong nv_order = VIDTYPE_VIU_NV21;
int index = pic->index;
+ bool pb_skip = false;
/* swap uv */
if (hw->is_used_v4l) {
nv_order = VIDTYPE_VIU_NV12;
}
+ if (hw->i_only)
+ pb_skip = 1;
+
if (pic->pic_info & INTERLACE_FLAG) {
if (kfifo_get(&hw->newframe_q, &vf) == 0) {
mmpeg4_debug_print(DECODE_ID(hw), 0,
"field0: pts %d, pts64 %lld, w %d, h %d, dur %d\n",
vf->pts, vf->pts_us64, vf->width, vf->height, vf->duration);
- if ((hw->first_i_frame_ready == 0)
+ if (((hw->first_i_frame_ready == 0) || pb_skip)
&& (pic->pic_type != I_PICTURE)) {
hw->drop_frame_count++;
hw->vfbuf_use[index]--;
mmpeg4_debug_print(DECODE_ID(hw), PRINT_FLAG_TIMEINFO,
"filed1: pts %d, pts64 %lld, w %d, h %d, dur: %d\n",
vf->pts, vf->pts_us64, vf->width, vf->height, vf->duration);
- if ((hw->first_i_frame_ready == 0) &&
- (pic->pic_type != I_PICTURE)) {
+ if (((hw->first_i_frame_ready == 0) || pb_skip)
+ && (pic->pic_type != I_PICTURE)) {
hw->drop_frame_count++;
hw->vfbuf_use[index]--;
kfifo_put(&hw->newframe_q,
"prog: pts %d, pts64 %lld, w %d, h %d, dur %d\n",
vf->pts, vf->pts_us64, vf->width, vf->height, vf->duration);
- if ((hw->first_i_frame_ready == 0) &&
- (pic->pic_type != I_PICTURE)) {
+ if (((hw->first_i_frame_ready == 0) || pb_skip)
+ && (pic->pic_type != I_PICTURE)) {
hw->drop_frame_count++;
hw->vfbuf_use[index]--;
kfifo_put(&hw->newframe_q,
hw->ctx_valid = 0;
}
+static int vmpeg4_set_trickmode(struct vdec_s *vdec, unsigned long trickmode)
+{
+ struct vdec_mpeg4_hw_s *hw =
+ (struct vdec_mpeg4_hw_s *)vdec->private;
+ if (!hw)
+ return 0;
+
+ if (trickmode == TRICKMODE_I) {
+ hw->i_only = 0x3;
+ trickmode_i = 1;
+ } else if (trickmode == TRICKMODE_NONE) {
+ hw->i_only = 0x0;
+ trickmode_i = 0;
+ }
+ return 0;
+}
+
static int ammvdec_mpeg4_probe(struct platform_device *pdev)
{
struct vdec_s *pdata = *(struct vdec_s **)pdev->dev.platform_data;
pdata->private = hw;
pdata->dec_status = dec_status;
/* pdata->set_trickmode = set_trickmode; */
+ pdata->set_trickmode = vmpeg4_set_trickmode;
pdata->run_ready = run_ready;
pdata->run = run;
pdata->reset = reset;
int vdec_set_trickmode(struct vdec_s *vdec, unsigned long trickmode)
{
int r;
-
if (vdec->set_trickmode) {
r = vdec->set_trickmode(vdec, trickmode);
trickmode);
return r;
}
-
return -1;
}
EXPORT_SYMBOL(vdec_set_trickmode);