Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/5] avfilter/vf_yadif: Fix edge size when MAX_ALIGN is < 4
@ 2022-07-20  4:41 Chris Phlipot
  2022-07-20  4:41 ` [FFmpeg-devel] [PATCH 2/5] avfilter/vf_yadif: Allow alignment to be configurable Chris Phlipot
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Chris Phlipot @ 2022-07-20  4:41 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Chris Phlipot

If alignment is set to less than 4 filter_edges will produce incorrect
output and not filter the entire edge. To fix this, make sure that
the edge size is at least 3.

Signed-off-by: Chris Phlipot <cphlipot0@gmail.com>
---
 libavfilter/vf_yadif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index afa4d1d53d..055327d7a4 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -120,7 +120,7 @@ static void filter_edges(void *dst1, void *prev1, void *cur1, void *next1,
     uint8_t *prev2 = parity ? prev : cur ;
     uint8_t *next2 = parity ? cur  : next;
 
-    const int edge = MAX_ALIGN - 1;
+    const int edge = FFMAX(MAX_ALIGN - 1, 3);
     int offset = FFMAX(w - edge, 3);
 
     /* Only edge pixels need to be processed here.  A constant value of false
@@ -169,7 +169,7 @@ static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,
     uint16_t *prev2 = parity ? prev : cur ;
     uint16_t *next2 = parity ? cur  : next;
 
-    const int edge = MAX_ALIGN / 2 - 1;
+    const int edge = FFMAX(MAX_ALIGN / 2 - 1, 3);
     int offset = FFMAX(w - edge, 3);
 
     mrefs /= 2;
-- 
2.25.1

_______________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2022-07-21  2:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20  4:41 [FFmpeg-devel] [PATCH 1/5] avfilter/vf_yadif: Fix edge size when MAX_ALIGN is < 4 Chris Phlipot
2022-07-20  4:41 ` [FFmpeg-devel] [PATCH 2/5] avfilter/vf_yadif: Allow alignment to be configurable Chris Phlipot
2022-07-20  4:41 ` [FFmpeg-devel] [PATCH 3/5] avfilter/vf_yadif: reformat code to improve readability Chris Phlipot
2022-07-20  4:41 ` [FFmpeg-devel] [PATCH 4/5] avfilter/vf_yadif: Process more pixels using filter_line Chris Phlipot
2022-07-20  4:41 ` [FFmpeg-devel] [PATCH 5/5] avfilter/vf_yadif: Add x86_64 avx yadif asm Chris Phlipot
2022-07-20 13:16   ` Michael Niedermayer
2022-07-21  2:30     ` Chris Phlipot

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