mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
lavfi/vf_decimate: do not compare the first frame to itself.
This is a waste of computing power and will result to 0, making it always dropped. Use maximum difference values instead.
This commit is contained in:
parent
35b0c7efda
commit
962727acb4
@ -167,9 +167,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
|||||||
if (in) {
|
if (in) {
|
||||||
/* update frame metrics */
|
/* update frame metrics */
|
||||||
prv = dm->fid ? dm->queue[dm->fid - 1].frame : dm->last;
|
prv = dm->fid ? dm->queue[dm->fid - 1].frame : dm->last;
|
||||||
if (!prv)
|
if (!prv) {
|
||||||
prv = in;
|
dm->queue[dm->fid].maxbdiff = INT64_MAX;
|
||||||
|
dm->queue[dm->fid].totdiff = INT64_MAX;
|
||||||
|
} else {
|
||||||
calc_diffs(dm, &dm->queue[dm->fid], prv, in);
|
calc_diffs(dm, &dm->queue[dm->fid], prv, in);
|
||||||
|
}
|
||||||
if (++dm->fid != dm->cycle)
|
if (++dm->fid != dm->cycle)
|
||||||
return 0;
|
return 0;
|
||||||
av_frame_free(&dm->last);
|
av_frame_free(&dm->last);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user