if (h->cfg.scenecut) {
if (h->img_rlist[0].sc_ratio > sc_threshold) {
while (cur_ip_idx) {
double sc_ratio = loka_get_sc_ratio(&h->pinter, h->img_rlist[cur_ip_idx].img, h->img_lastIP, bit_depth);
if (sc_ratio <= sc_threshold) {
for (int i = 0; i <= cur_ip_idx; i++) {
h->img_rlist[i].sc_ratio = 0;
}
break;
}
cur_ip_idx--;
}
if (cur_ip_idx == 0) {
add_input_node(h, h->img_rlist[cur_ip_idx].img, 1, FRM_DEPTH_0, SLICE_I);
/****/
update_last_ip(h, h->img_rlist[cur_ip_idx].img, SLICE_I);
/****/
shift_reorder_list(h, cur_ip_idx);
return;
}
}
}
update_last_ip(h, h->img_rlist[cur_ip_idx].img, SLICE_I); should be added there after an I frame asserted in the node, or it might cause h->img_lastIP not updated and results in a series of errors.
if (h->cfg.scenecut) { if (h->img_rlist[0].sc_ratio > sc_threshold) { while (cur_ip_idx) { double sc_ratio = loka_get_sc_ratio(&h->pinter, h->img_rlist[cur_ip_idx].img, h->img_lastIP, bit_depth); if (sc_ratio <= sc_threshold) { for (int i = 0; i <= cur_ip_idx; i++) { h->img_rlist[i].sc_ratio = 0; } break; } cur_ip_idx--; } if (cur_ip_idx == 0) { add_input_node(h, h->img_rlist[cur_ip_idx].img, 1, FRM_DEPTH_0, SLICE_I); /****/ update_last_ip(h, h->img_rlist[cur_ip_idx].img, SLICE_I); /****/ shift_reorder_list(h, cur_ip_idx); return; } } }
update_last_ip(h, h->img_rlist[cur_ip_idx].img, SLICE_I); should be added there after an I frame asserted in the node, or it might cause h->img_lastIP not updated and results in a series of errors.