[FFmpeg-devel] [PATCH] libavfilter/idet: fix double count and offset accuracy on progressive frame

pon pon pon.pon.3876098iu76.ponpon at gmail.com
Wed Nov 28 04:01:21 EET 2018


Hello,

I think idet duplicately counts and offsets accuracy of progressive frames,
as repoert in ticket #7565.
If this is corret, the below patch can fix it.

ponpon

diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index 02ae2edcb9..8c355ee2f9 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -285,12 +285,14 @@ static int filter_frame(AVFilterLink *link, AVFrame
*picref)
         if (idet->cur->interlaced_frame) {
             idet->cur->interlaced_frame = 0;
             filter(ctx);
-            if (idet->last_type == PROGRESSIVE) {
-                idet->interlaced_flag_accuracy --;
-                idet->analyze_interlaced_flag --;
-            } else if (idet->last_type != UNDETERMINED) {
-                idet->interlaced_flag_accuracy ++;
-                idet->analyze_interlaced_flag --;
+            if (idet->last_type != UNDETERMINED) {
+                if (idet->last_type == PROGRESSIVE) {
+                    idet->interlaced_flag_accuracy --;
+                    idet->analyze_interlaced_flag --;
+                } else {
+                    idet->interlaced_flag_accuracy ++;
+                    idet->analyze_interlaced_flag --;
+                }
             }
             if (idet->analyze_interlaced_flag == 1) {
                 ff_filter_frame(ctx->outputs[0],
av_frame_clone(idet->cur));


More information about the ffmpeg-devel mailing list