[FFmpeg-devel] [PATCH RFC] avfilter/vf_delogo: Use AVPixFmtDescriptor.nb_components

Paul B Mahol onemda at gmail.com
Sat Dec 12 13:07:25 CET 2015


On 12/10/15, Jean Delvare <jdelvare at suse.de> wrote:
> 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>
> ---
> I see that most filters use AVPixFmtDescriptor.nb_components while
> others still check data and linesize. Am I correct assuming that the
> former is faster and preferred?
>
>  libavfilter/vf_delogo.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- ffmpeg.orig/libavfilter/vf_delogo.c	2015-12-10 13:06:16.212908502 +0100
> +++ ffmpeg/libavfilter/vf_delogo.c	2015-12-10 13:07:04.877966120 +0100
> @@ -256,7 +256,7 @@ static int filter_frame(AVFilterLink *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;
>
>
>
> --
> Jean Delvare
> SUSE L3 Support
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

lgtm


More information about the ffmpeg-devel mailing list