amlogic/deinterlace: Don't bypass if the stream is mixed Interlaced and

Progressive

It fixes slowdowns on I/P switching.
Some UK streams switch between I and P (mostly) in commercials. 98% of
the stream is still interlaced so it is safe to DI the whole stream.
This commit is contained in:
Ray
2019-06-05 11:15:04 +02:00
committed by Dongjin Kim
parent 376f0c0936
commit d2cf4290e8

View File

@@ -1585,9 +1585,11 @@ static unsigned char is_source_change(vframe_t *vframe)
((di_pre_stru.cur_inp_type & VIDTYPE_VIU_FIELD) !=
(vframe->type & VIDTYPE_VIU_FIELD))
) {
/* just scan mode changed */
if (!di_pre_stru.force_interlace)
pr_dbg("DI I<->P.\n");
if (is_progressive(vframe)) {
pr_dbg("DI I->P.\n");
} else {
pr_dbg("DI P->I.\n");
}
return 2;
}
return 0;
@@ -1619,7 +1621,9 @@ unsigned char is_bypass(vframe_t *vf_in)
if (bypass_all)
return 1;
if (di_pre_stru.cur_prog_flag)
if ((di_pre_stru.cur_prog_flag) &&
(!di_pre_stru.force_interlace))
return 1;
if ((di_pre_stru.cur_width < 16) || (di_pre_stru.cur_height < 16))
@@ -3526,7 +3530,6 @@ static unsigned char pre_de_buf_config(void)
#endif
)
return 0;
di_patch_post_update_mc_sw(DI_MC_SW_OTHER, false);
} else if (di_pre_stru.prog_proc_type == 2) {
di_linked_buf_idx = peek_free_linked_buf();
@@ -3666,8 +3669,11 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64));
queue_out(di_buf);
change_type = is_source_change(vframe);
/* source change, when i mix p,force p as i*/
if (change_type == 1 || (change_type == 2 &&
di_pre_stru.cur_prog_flag == 1)) {
if (change_type == 1 || (change_type == 2)) {
/* check if top/bot interleaved */
if (change_type == 2)
/* source is i interleaves p fields */
di_pre_stru.force_interlace = true;
if (di_pre_stru.di_mem_buf_dup_p) {
/*avoid only 2 i field then p field*/
if (
@@ -3770,10 +3776,6 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64));
#endif
di_pre_stru.field_count_for_cont = 0;
} else if (di_pre_stru.cur_prog_flag == 0) {
/* check if top/bot interleaved */
if (change_type == 2)
/* source is i interleaves p fields */
di_pre_stru.force_interlace = true;
if ((di_pre_stru.cur_inp_type &
VIDTYPE_TYPEMASK) == (di_buf->vframe->type &
VIDTYPE_TYPEMASK)) {
@@ -3963,6 +3965,7 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64));
di_pre_stru.field_count_for_cont = 0;
/* ignore contp2rd and contprd */
}
di_buf->post_proc_flag = 1;
di_pre_stru.di_inp_buf = di_buf;
di_print("%s: %s[%d] => di_inp_buf\n", __func__,