[FFmpeg-cvslog] avfilter/vf_mpdecimate: debug logging of threshold stats

Peter Cordes git at videolan.org
Sun May 31 13:27:13 CEST 2015


ffmpeg | branch: master | Peter Cordes <peter at cordes.ca> | Mon Mar  2 22:57:30 2015 -0400| [50f112c91535b2f1fca1f5e96aa434a08af54633] | committer: Michael Niedermayer

avfilter/vf_mpdecimate: debug logging of threshold stats

It's often really helpful to know why a frame wasn't decimated (lo or
hi), and how much you exceeded the threshold by, if you're trying to
tweak the thresholds to get what you want.

mpdecimate already prints a line per input frame with -v debug, this
just makes it longer.

Signed-off-by: Peter Cordes <peter at cordes.ca>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50f112c91535b2f1fca1f5e96aa434a08af54633
---

 libavfilter/vf_mpdecimate.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_mpdecimate.c b/libavfilter/vf_mpdecimate.c
index 5c41de7..429121d 100644
--- a/libavfilter/vf_mpdecimate.c
+++ b/libavfilter/vf_mpdecimate.c
@@ -84,15 +84,21 @@ static int diff_planes(AVFilterContext *ctx,
         for (x = 8; x < w-7; x += 4) {
             d = decimate->sad(cur + y*cur_linesize + x, cur_linesize,
                               ref + y*ref_linesize + x, ref_linesize);
-            if (d > decimate->hi)
+            if (d > decimate->hi) {
+                av_log(ctx, AV_LOG_DEBUG, "%d>=hi ", d);
                 return 1;
+            }
             if (d > decimate->lo) {
                 c++;
-                if (c > t)
+                if (c > t) {
+                    av_log(ctx, AV_LOG_DEBUG, "lo:%d>=%d ", c, t);
                     return 1;
+                }
             }
         }
     }
+
+    av_log(ctx, AV_LOG_DEBUG, "lo:%d<%d ", c, t);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list