diff mbox

[FFmpeg-devel] lavfi/decimate: Do not assume a scene change for the first frame

Message ID 201608311735.47423.cehoyos@ag.or.at
State Rejected
Headers show

Commit Message

Carl Eugen Hoyos Aug. 31, 2016, 3:35 p.m. UTC
Hi!

Attached patch fixes ticket #4990 concerning the output file.
It is possible that there is nothing to fix though, the input 
file is "dirty" and "dupthresh" is not underbid by two visually 
identical frames.

Please comment, Carl Eugen
From 195df26b7017448d0bfbbe32f4b1c7c6df8ad26c Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Wed, 31 Aug 2016 17:27:06 +0200
Subject: [PATCH] lavfi/decimate: Do not assume a scenechange for the first
 frame.

Fixes ticket #4990.
---
 libavfilter/vf_decimate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Carl Eugen Hoyos Sept. 3, 2016, 12:04 p.m. UTC | #1
2016-08-31 17:35 GMT+02:00 Carl Eugen Hoyos <cehoyos@ag.or.at>:
>
> Attached patch fixes ticket #4990 concerning the output file.
> It is possible that there is nothing to fix though, the input
> file is "dirty" and "dupthresh" is not underbid by two visually
> identical frames.

Please ignore, the patch (that I had already had dismissed
myself months ago) is wrong.

The question is still why the user claims his sample is
correctly processed by the original filter and output is
different with FFmpeg's implementation.

Carl Eugen
diff mbox

Patch

diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index 39c3331..d5dccb1 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -172,7 +172,7 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         prv = dm->fid ? (dm->ppsrc ? dm->clean_src[dm->fid - 1] : dm->queue[dm->fid - 1].frame) : dm->last;
         if (!prv) {
             dm->queue[dm->fid].maxbdiff = INT64_MAX;
-            dm->queue[dm->fid].totdiff  = INT64_MAX;
+            dm->queue[dm->fid].totdiff  = 0;
         } else {
             calc_diffs(dm, &dm->queue[dm->fid], prv, in);
         }