* [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: consider chroma subsampling when enforcing minimum dimensions
[not found] <20231125203938.76291-1-cosmin@cosmin.at>
@ 2023-11-25 20:39 ` Cosmin Stejerean via ffmpeg-devel
2023-11-28 13:30 ` Thomas Mundt
0 siblings, 1 reply; 5+ messages in thread
From: Cosmin Stejerean via ffmpeg-devel @ 2023-11-25 20:39 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Cosmin Stejerean
Fixes #10688
Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
---
libavfilter/vf_bwdif.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index 137cd5ef13..bce11c39f7 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -197,6 +197,18 @@ static int config_props(AVFilterLink *link)
}
yadif->csp = av_pix_fmt_desc_get(link->format);
+
+ if (yadif->csp->nb_components > 1) {
+ int w_chroma, h_chroma;
+ h_chroma = AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h);
+ w_chroma = AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w);
+
+ if (w_chroma < 3 || h_chroma < 4) {
+ av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3 columns or 4 lines is not supported\n");
+ return AVERROR(EINVAL);
+ }
+ }
+
yadif->filter = filter;
ff_bwdif_init_filter_line(&s->dsp, yadif->csp->comp[0].depth);
--
2.39.2 (Apple Git-143)
_______________________________________________
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: consider chroma subsampling when enforcing minimum dimensions
2023-11-25 20:39 ` [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: consider chroma subsampling when enforcing minimum dimensions Cosmin Stejerean via ffmpeg-devel
@ 2023-11-28 13:30 ` Thomas Mundt
[not found] ` <1F07E60A-7D51-4DDC-A2F5-00AE2097F401@cosmin.at>
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Mundt @ 2023-11-28 13:30 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Cosmin Stejerean
Hi Cosmin,
Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> schrieb am Sa.,
25. Nov. 2023, 21:39:
> Fixes #10688
>
> Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
> ---
> libavfilter/vf_bwdif.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
> index 137cd5ef13..bce11c39f7 100644
> --- a/libavfilter/vf_bwdif.c
> +++ b/libavfilter/vf_bwdif.c
> @@ -197,6 +197,18 @@ static int config_props(AVFilterLink *link)
> }
>
> yadif->csp = av_pix_fmt_desc_get(link->format);
> +
> + if (yadif->csp->nb_components > 1) {
> + int w_chroma, h_chroma;
> + h_chroma = AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h);
> + w_chroma = AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w);
> +
> + if (w_chroma < 3 || h_chroma < 4) {
> + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3
> columns or 4 lines is not supported\n");
> + return AVERROR(EINVAL);
> + }
> + }
> +
>
Thanks for your quick patch.
Could you please make the size check for all components and remove the old
one to avoid having two size checks in a row?
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: consider chroma subsampling when enforcing minimum dimensions
[not found] ` <1F07E60A-7D51-4DDC-A2F5-00AE2097F401@cosmin.at>
@ 2023-11-29 19:26 ` Cosmin Stejerean via ffmpeg-devel
2023-11-29 19:36 ` Dennis Mungai
0 siblings, 1 reply; 5+ messages in thread
From: Cosmin Stejerean via ffmpeg-devel @ 2023-11-29 19:26 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Cosmin Stejerean
> On Nov 28, 2023, at 5:30 AM, Thomas Mundt <tmundt75@gmail.com> wrote:
>
> Hi Cosmin,
>
> Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> schrieb am Sa.,
> 25. Nov. 2023, 21:39:
>
>> Fixes #10688
>>
>> Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
>> ---
>> libavfilter/vf_bwdif.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
>> index 137cd5ef13..bce11c39f7 100644
>> --- a/libavfilter/vf_bwdif.c
>> +++ b/libavfilter/vf_bwdif.c
>> @@ -197,6 +197,18 @@ static int config_props(AVFilterLink *link)
>> }
>>
>> yadif->csp = av_pix_fmt_desc_get(link->format);
>> +
>> + if (yadif->csp->nb_components > 1) {
>> + int w_chroma, h_chroma;
>> + h_chroma = AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h);
>> + w_chroma = AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w);
>> +
>> + if (w_chroma < 3 || h_chroma < 4) {
>> + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3
>> columns or 4 lines is not supported\n");
>> + return AVERROR(EINVAL);
>> + }
>> + }
>> +
>>
>
> Thanks for your quick patch.
> Could you please make the size check for all components and remove the old
> one to avoid having two size checks in a row?
>
Certainly, will send a v2 shortly.
- Cosmin
_______________________________________________
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: consider chroma subsampling when enforcing minimum dimensions
2023-11-29 19:26 ` Cosmin Stejerean via ffmpeg-devel
@ 2023-11-29 19:36 ` Dennis Mungai
[not found] ` <B9C296D9-37D4-45D0-B54F-28E3560682C4@cosmin.at>
0 siblings, 1 reply; 5+ messages in thread
From: Dennis Mungai @ 2023-11-29 19:36 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Cosmin Stejerean
On Wed, 29 Nov 2023 at 22:26, Cosmin Stejerean via ffmpeg-devel <
ffmpeg-devel@ffmpeg.org> wrote:
>
>
> > On Nov 28, 2023, at 5:30 AM, Thomas Mundt <tmundt75@gmail.com> wrote:
> >
> > Hi Cosmin,
> >
> > Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> schrieb am
> Sa.,
> > 25. Nov. 2023, 21:39:
> >
> >> Fixes #10688
> >>
> >> Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
> >> ---
> >> libavfilter/vf_bwdif.c | 12 ++++++++++++
> >> 1 file changed, 12 insertions(+)
> >>
> >> diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
> >> index 137cd5ef13..bce11c39f7 100644
> >> --- a/libavfilter/vf_bwdif.c
> >> +++ b/libavfilter/vf_bwdif.c
> >> @@ -197,6 +197,18 @@ static int config_props(AVFilterLink *link)
> >> }
> >>
> >> yadif->csp = av_pix_fmt_desc_get(link->format);
> >> +
> >> + if (yadif->csp->nb_components > 1) {
> >> + int w_chroma, h_chroma;
> >> + h_chroma = AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h);
> >> + w_chroma = AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w);
> >> +
> >> + if (w_chroma < 3 || h_chroma < 4) {
> >> + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3
> >> columns or 4 lines is not supported\n");
> >> + return AVERROR(EINVAL);
> >> + }
> >> + }
> >> +
> >>
> >
> > Thanks for your quick patch.
> > Could you please make the size check for all components and remove the
> old
> > one to avoid having two size checks in a row?
> >
>
> Certainly, will send a v2 shortly.
>
> - Cosmin
>
>
Does this change also need to be replicated to bwdif_cuda?
_______________________________________________
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: consider chroma subsampling when enforcing minimum dimensions
[not found] ` <B9C296D9-37D4-45D0-B54F-28E3560682C4@cosmin.at>
@ 2023-11-29 21:59 ` Cosmin Stejerean via ffmpeg-devel
0 siblings, 0 replies; 5+ messages in thread
From: Cosmin Stejerean via ffmpeg-devel @ 2023-11-29 21:59 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Cosmin Stejerean
> On Nov 29, 2023, at 11:36 AM, Dennis Mungai <dmngaie@gmail.com> wrote:
>
> On Wed, 29 Nov 2023 at 22:26, Cosmin Stejerean via ffmpeg-devel <
> ffmpeg-devel@ffmpeg.org> wrote:
>
>>
>>
>>> On Nov 28, 2023, at 5:30 AM, Thomas Mundt <tmundt75@gmail.com> wrote:
>>>
>>> Hi Cosmin,
>>>
>>> Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> schrieb am
>> Sa.,
>>> 25. Nov. 2023, 21:39:
>>>
>>>> Fixes #10688
>>>>
>>>> Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at>
>>>> ---
>>>> libavfilter/vf_bwdif.c | 12 ++++++++++++
>>>> 1 file changed, 12 insertions(+)
>>>>
>>>> diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
>>>> index 137cd5ef13..bce11c39f7 100644
>>>> --- a/libavfilter/vf_bwdif.c
>>>> +++ b/libavfilter/vf_bwdif.c
>>>> @@ -197,6 +197,18 @@ static int config_props(AVFilterLink *link)
>>>> }
>>>>
>>>> yadif->csp = av_pix_fmt_desc_get(link->format);
>>>> +
>>>> + if (yadif->csp->nb_components > 1) {
>>>> + int w_chroma, h_chroma;
>>>> + h_chroma = AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h);
>>>> + w_chroma = AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w);
>>>> +
>>>> + if (w_chroma < 3 || h_chroma < 4) {
>>>> + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3
>>>> columns or 4 lines is not supported\n");
>>>> + return AVERROR(EINVAL);
>>>> + }
>>>> + }
>>>> +
>>>>
>>>
>>> Thanks for your quick patch.
>>> Could you please make the size check for all components and remove the
>> old
>>> one to avoid having two size checks in a row?
>>>
>>
>> Certainly, will send a v2 shortly.
>>
>> - Cosmin
>>
>>
> Does this change also need to be replicated to bwdif_cuda?
>
Good callout, it's like the that both bwdif_cuda and bwdif_vulkan need similar updates as they both have checks for width and height and would likely encounter the same problem on the chroma planes. I'll include both of those in v2.
On a side note the minimum width and height requirements are a bit different between the three filters in terms of whether 3x4, 3x3 or 4x4 are the minimum required dimensions. I'm assuming this is intentional based on the underlying filters but just wanted to double check whether it might be worth unifying all of these to say min 4x4 for consistency.
- Cosmin
_______________________________________________
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-11-29 21:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20231125203938.76291-1-cosmin@cosmin.at>
2023-11-25 20:39 ` [FFmpeg-devel] [PATCH] avfilter/vf_bwdif: consider chroma subsampling when enforcing minimum dimensions Cosmin Stejerean via ffmpeg-devel
2023-11-28 13:30 ` Thomas Mundt
[not found] ` <1F07E60A-7D51-4DDC-A2F5-00AE2097F401@cosmin.at>
2023-11-29 19:26 ` Cosmin Stejerean via ffmpeg-devel
2023-11-29 19:36 ` Dennis Mungai
[not found] ` <B9C296D9-37D4-45D0-B54F-28E3560682C4@cosmin.at>
2023-11-29 21:59 ` Cosmin Stejerean via ffmpeg-devel
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