L'octidi 28 frimaire, an CCXXIV, Clement Boesch a écrit :
> +    }else if (scale->nb_slices) {
> +        int i;
> +        const int nb_slices = FFMIN(scale->nb_slices, link->h);
> +        for (i = 0; i < nb_slices; i++) {
> +            const int slice_start = (link->h *  i   ) / nb_slices;
> +            const int slice_end   = (link->h * (i+1)) / nb_slices;
> +            const int slice_h     = slice_end - slice_start;
> +            scale_slice(link, out, in, scale->sws, slice_start, slice_h, 1, 
> 0);
> +        }

You can do simpler and more robust by computing the boundary only once
(using av_rescale to also avoid overflows):

        int i, slice_start, slice_end = slice_start;
        for (i = 0; i < nb_slices; i++) {
            slice_start = slice_end;
            slice_end = av_rescale(link->h, i + 1, nb_slices);
            ...
        }

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to