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

Submitted by pon pon on Nov. 28, 2018, 2:01 a.m.

Details

Message ID CAGPT-GLDRR9pbwxQMhhajMHH0yc6W+5P-_sDte=D03=S-vYVtQ@mail.gmail.com
State New
Headers show

Commit Message

pon pon Nov. 28, 2018, 2:01 a.m.
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

                 ff_filter_frame(ctx->outputs[0],
av_frame_clone(idet->cur));

Comments

Carl Eugen Hoyos Nov. 28, 2018, 2:24 a.m.
2018-11-28 3:01 GMT+01:00, pon pon <pon.pon.3876098iu76.ponpon@gmail.com>:

> I think idet duplicately counts and offsets accuracy of progressive
> frames, as repoert in ticket #7565.

Unfortunately, this ticket is missing all necessary information including
the command line, the complete, uncut console output and a sample file.

For which sample is your patch supposed to make a difference?

Carl Eugen
pon pon Nov. 28, 2018, 6:52 a.m.
I have attached logs in tichet #7565.
idet before patch (72.6x) is far faster than after (62.2x).
I think it means processes terminate by double counts than expeccted.
How do you thinnk about it?

ponpon

2018年11月28日(水) 11:24 Carl Eugen Hoyos <ceffmpeg@gmail.com>:

> 2018-11-28 3:01 GMT+01:00, pon pon <pon.pon.3876098iu76.ponpon@gmail.com>:
>
> > I think idet duplicately counts and offsets accuracy of progressive
> > frames, as repoert in ticket #7565.
>
> Unfortunately, this ticket is missing all necessary information including
> the command line, the complete, uncut console output and a sample file.
>
> For which sample is your patch supposed to make a difference?
>
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
Carl Eugen Hoyos Nov. 28, 2018, 2:50 p.m.
2018-11-28 7:52 GMT+01:00, pon pon <pon.pon.3876098iu76.ponpon@gmail.com>:
> I have attached logs in tichet #7565.

No...

Please avoid top-posting here, Carl Eugen
pon pon Nov. 29, 2018, 4:18 a.m.
>Please avoid top-posting here,
Thannk you for your advice. I'll take care.
pon pon Dec. 2, 2018, 6:27 a.m.
Carl Eugen Hoyos

I added logs and explanation in tichet #7565.

Thank you in advance.

ponpon

Patch hide | download patch | download mbox

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) {