* [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic
@ 2023-03-24 22:20 Philip Langdale
2023-03-24 23:02 ` Thomas Mundt
0 siblings, 1 reply; 5+ messages in thread
From: Philip Langdale @ 2023-03-24 22:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Thomas Mundt, Philip Langdale
bwdif inherited this check from yadif, which was originally supposed to
prefer the spatial predictor if the temporal predictor was too far off.
However, the core bwdif algorithm already accounts for the spatial
predictor, so this additional check actually ends up preferring a worse
value, reducing the overall quality.
This was found by cyanreg while writing bwdif_vulkan, and the visual
improvement is pretty dramatic in some samples. If we agree that this
change is desirable, we should update all implementations.
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libavfilter/vf_bwdif.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index 65c617ebb3..441bb11e7b 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -106,11 +106,6 @@ typedef struct ThreadData {
interpol = (c + e) >> 1;
#define FILTER2() \
- if (interpol > d + diff) \
- interpol = d + diff; \
- else if (interpol < d - diff) \
- interpol = d - diff; \
- \
dst[0] = av_clip(interpol, 0, clip_max); \
} \
\
--
2.37.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic
2023-03-24 22:20 [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic Philip Langdale
@ 2023-03-24 23:02 ` Thomas Mundt
2023-06-11 2:53 ` Philip Langdale
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Mundt @ 2023-03-24 23:02 UTC (permalink / raw)
To: Philip Langdale; +Cc: FFmpeg development discussions and patches
Hi Philip,
Philip Langdale <philipl@overt.org> schrieb am Fr., 24. März 2023, 23:21:
> bwdif inherited this check from yadif, which was originally supposed to
> prefer the spatial predictor if the temporal predictor was too far off.
>
> However, the core bwdif algorithm already accounts for the spatial
> predictor, so this additional check actually ends up preferring a worse
> value, reducing the overall quality.
>
> This was found by cyanreg while writing bwdif_vulkan, and the visual
> improvement is pretty dramatic in some samples. If we agree that this
> change is desirable, we should update all implementations.
>
> Signed-off-by: Philip Langdale <philipl@overt.org>
> ---
> libavfilter/vf_bwdif.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
> index 65c617ebb3..441bb11e7b 100644
> --- a/libavfilter/vf_bwdif.c
> +++ b/libavfilter/vf_bwdif.c
> @@ -106,11 +106,6 @@ typedef struct ThreadData {
> interpol = (c + e) >> 1;
>
> #define FILTER2() \
> - if (interpol > d + diff) \
> - interpol = d + diff; \
> - else if (interpol < d - diff) \
> - interpol = d - diff; \
> - \
>
Removing this will make lower thirds and other graphic jump up and down
each frame. It is the main improvement over w3fdif that I have ported from
yadif.
Can you provide samples including still graphics that are improved with
this patch?
Regards,
Thomas
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic
2023-03-24 23:02 ` Thomas Mundt
@ 2023-06-11 2:53 ` Philip Langdale
2023-06-11 18:11 ` Lynne
0 siblings, 1 reply; 5+ messages in thread
From: Philip Langdale @ 2023-06-11 2:53 UTC (permalink / raw)
To: ffmpeg-devel
On Sat, 25 Mar 2023 00:02:03 +0100
Thomas Mundt <tmundt75@gmail.com> wrote:
> Hi Philip,
>
> Philip Langdale <philipl@overt.org> schrieb am Fr., 24. März 2023,
> 23:21:
>
> > bwdif inherited this check from yadif, which was originally
> > supposed to prefer the spatial predictor if the temporal predictor
> > was too far off.
> >
> > However, the core bwdif algorithm already accounts for the spatial
> > predictor, so this additional check actually ends up preferring a
> > worse value, reducing the overall quality.
> >
> > This was found by cyanreg while writing bwdif_vulkan, and the visual
> > improvement is pretty dramatic in some samples. If we agree that
> > this change is desirable, we should update all implementations.
> >
> > Signed-off-by: Philip Langdale <philipl@overt.org>
> > ---
> > libavfilter/vf_bwdif.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
> > index 65c617ebb3..441bb11e7b 100644
> > --- a/libavfilter/vf_bwdif.c
> > +++ b/libavfilter/vf_bwdif.c
> > @@ -106,11 +106,6 @@ typedef struct ThreadData {
> > interpol = (c + e) >> 1;
> >
> > #define FILTER2() \
> > - if (interpol > d + diff) \
> > - interpol = d + diff; \
> > - else if (interpol < d - diff) \
> > - interpol = d - diff; \
> > - \
> >
>
> Removing this will make lower thirds and other graphic jump up and
> down each frame. It is the main improvement over w3fdif that I have
> ported from yadif.
> Can you provide samples including still graphics that are improved
> with this patch?
Hi Thomas,
Sorry for this thread going unanswered for so long. With the Vulkan
hwaccel stuff sorted out, I wanted to come back to this. I discussed
more with Lynne and we're no longer convinced this change is obviously
desirable. You are right about the jumping behaviour - and although
there are samples (eg: the burosch ones on samples.ffmpeg.org) which
look better with the change, I don't think that's something to over
index on.
Thanks,
--phil
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic
2023-06-11 2:53 ` Philip Langdale
@ 2023-06-11 18:11 ` Lynne
2023-06-14 22:34 ` Thomas Mundt
0 siblings, 1 reply; 5+ messages in thread
From: Lynne @ 2023-06-11 18:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Jun 11, 2023, 04:53 by philipl@overt.org:
> On Sat, 25 Mar 2023 00:02:03 +0100
> Thomas Mundt <tmundt75@gmail.com> wrote:
>
>> Hi Philip,
>>
>> Philip Langdale <philipl@overt.org> schrieb am Fr., 24. März 2023,
>> 23:21:
>>
>> > bwdif inherited this check from yadif, which was originally
>> > supposed to prefer the spatial predictor if the temporal predictor
>> > was too far off.
>> >
>> > However, the core bwdif algorithm already accounts for the spatial
>> > predictor, so this additional check actually ends up preferring a
>> > worse value, reducing the overall quality.
>> >
>> > This was found by cyanreg while writing bwdif_vulkan, and the visual
>> > improvement is pretty dramatic in some samples. If we agree that
>> > this change is desirable, we should update all implementations.
>> >
>> > Signed-off-by: Philip Langdale <philipl@overt.org>
>> > ---
>> > libavfilter/vf_bwdif.c | 5 -----
>> > 1 file changed, 5 deletions(-)
>> >
>> > diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
>> > index 65c617ebb3..441bb11e7b 100644
>> > --- a/libavfilter/vf_bwdif.c
>> > +++ b/libavfilter/vf_bwdif.c
>> > @@ -106,11 +106,6 @@ typedef struct ThreadData {
>> > interpol = (c + e) >> 1;
>> >
>> > #define FILTER2() \
>> > - if (interpol > d + diff) \
>> > - interpol = d + diff; \
>> > - else if (interpol < d - diff) \
>> > - interpol = d - diff; \
>> > - \
>> >
>>
>> Removing this will make lower thirds and other graphic jump up and
>> down each frame. It is the main improvement over w3fdif that I have
>> ported from yadif.
>> Can you provide samples including still graphics that are improved
>> with this patch?
>>
>
> Hi Thomas,
>
> Sorry for this thread going unanswered for so long. With the Vulkan
> hwaccel stuff sorted out, I wanted to come back to this. I discussed
> more with Lynne and we're no longer convinced this change is obviously
> desirable. You are right about the jumping behaviour - and although
> there are samples (eg: the burosch ones on samples.ffmpeg.org) which
> look better with the change, I don't think that's something to over
> index on.
>
I don't recall agreeing that this is desirable.
bwdif_vulkan still looks better than bwdif or bwdif_cuda (and it's got proper edge handling).
I just forgot to investigate this, that's all.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic
2023-06-11 18:11 ` Lynne
@ 2023-06-14 22:34 ` Thomas Mundt
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Mundt @ 2023-06-14 22:34 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Lynne <dev@lynne.ee> schrieb am So., 11. Juni 2023, 20:11:
> Jun 11, 2023, 04:53 by philipl@overt.org:
>
> > On Sat, 25 Mar 2023 00:02:03 +0100
> > Thomas Mundt <tmundt75@gmail.com> wrote:
> >
> >> Hi Philip,
> >>
> >> Philip Langdale <philipl@overt.org> schrieb am Fr., 24. März 2023,
> >> 23:21:
> >>
> >> > bwdif inherited this check from yadif, which was originally
> >> > supposed to prefer the spatial predictor if the temporal predictor
> >> > was too far off.
> >> >
> >> > However, the core bwdif algorithm already accounts for the spatial
> >> > predictor, so this additional check actually ends up preferring a
> >> > worse value, reducing the overall quality.
> >> >
> >> > This was found by cyanreg while writing bwdif_vulkan, and the visual
> >> > improvement is pretty dramatic in some samples. If we agree that
> >> > this change is desirable, we should update all implementations.
> >> >
> >> > Signed-off-by: Philip Langdale <philipl@overt.org>
> >> > ---
> >> > libavfilter/vf_bwdif.c | 5 -----
> >> > 1 file changed, 5 deletions(-)
> >> >
> >> > diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
> >> > index 65c617ebb3..441bb11e7b 100644
> >> > --- a/libavfilter/vf_bwdif.c
> >> > +++ b/libavfilter/vf_bwdif.c
> >> > @@ -106,11 +106,6 @@ typedef struct ThreadData {
> >> > interpol = (c + e) >> 1;
> >> >
> >> > #define FILTER2() \
> >> > - if (interpol > d + diff) \
> >> > - interpol = d + diff; \
> >> > - else if (interpol < d - diff) \
> >> > - interpol = d - diff; \
> >> > - \
> >> >
> >>
> >> Removing this will make lower thirds and other graphic jump up and
> >> down each frame. It is the main improvement over w3fdif that I have
> >> ported from yadif.
> >> Can you provide samples including still graphics that are improved
> >> with this patch?
> >>
> >
> > Hi Thomas,
> >
> > Sorry for this thread going unanswered for so long. With the Vulkan
> > hwaccel stuff sorted out, I wanted to come back to this. I discussed
> > more with Lynne and we're no longer convinced this change is obviously
> > desirable. You are right about the jumping behaviour - and although
> > there are samples (eg: the burosch ones on samples.ffmpeg.org) which
> > look better with the change, I don't think that's something to over
> > index on.
> >
>
> I don't recall agreeing that this is desirable.
> bwdif_vulkan still looks better than bwdif or bwdif_cuda (and it's got
> proper edge handling).
>
Could you please prove this claim with some samples? I don't have any
suitable hardware for Vulkan.
Just saw that bwdif_vulkan was added to master. Somehow I didn't see the
commit in the cvs log.
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-14 22:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 22:20 [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: Remove undesireable spatial preference logic Philip Langdale
2023-03-24 23:02 ` Thomas Mundt
2023-06-11 2:53 ` Philip Langdale
2023-06-11 18:11 ` Lynne
2023-06-14 22:34 ` Thomas Mundt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git