[FFmpeg-cvslog] avfilter/vf_delogo: Use AVPixFmtDescriptor.nb_components

Jean Delvare git at videolan.org
Sat Dec 12 16:02:47 CET 2015


ffmpeg | branch: master | Jean Delvare <jdelvare at suse.de> | Thu Dec 10 15:25:57 2015 +0100| [ec11cfdf75d8ad228da6fb159b253a5fc75e8e66] | committer: Michael Niedermayer

avfilter/vf_delogo: Use AVPixFmtDescriptor.nb_components

Relying on AVPixFmtDescriptor.nb_components is cleaner and faster than
checking data and linesize for every possible plane.

Signed-off-by: Jean Delvare <jdelvare at suse.de>
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec11cfdf75d8ad228da6fb159b253a5fc75e8e66
---

 libavfilter/vf_delogo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index 1b8e408..168af89 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -256,7 +256,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     if (!sar.num)
         sar.num = sar.den = 1;
 
-    for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {
+    for (plane = 0; plane < desc->nb_components; plane++) {
         int hsub = plane == 1 || plane == 2 ? hsub0 : 0;
         int vsub = plane == 1 || plane == 2 ? vsub0 : 0;
 



More information about the ffmpeg-cvslog mailing list