On Tue, Oct 01, 2013 at 09:44:43AM +0200, Vittorio Giovara wrote:
> According to various literature, Lanczos and Sinc are better for downscaling, 
> while Spline and Gaussian so they are set in case these condistions are found.

1) too long line
2) Lanczos and Gaussian deserve capital letter because they come from names,
sinc and spline are ordinary nouns
3) part of missing and formulation is can be called quite ambiguous under
normal circumstances taking into account all of the above

Substitute Diego off. 

> Inspired from a patch by wm4 <[email protected]>
> ---
>  libswscale/utils.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/libswscale/utils.c b/libswscale/utils.c
> index 2781985..200cf55 100644
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -914,6 +914,19 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
> *srcFilter,
>                   SWS_SINC          |
>                   SWS_SPLINE        |
>                   SWS_BICUBLIN);
> +
> +    /* provide a default scaler if not set by caller.
          Provide                  if it is not set by the caller.
> +     * Bicubic performs better for upscaling, bilinear for
> +     * downscaling and lanczos is ok for the general case.
> +     */
> +    if (!i)
> +        if (srcW <= dstW && srcH <= dstH)
> +            i &= SWS_BICUBIC;
> +        else if (srcW > dstW && srcH > dstH)
> +            i &= SWS_BILINEAR;
> +        else
> +            i &= SWS_LANCZOS;
> +
>      if (!i || (i & (i - 1))) {
>          av_log(c, AV_LOG_ERROR,
>                 "Exactly one scaler algorithm must be chosen\n");
> -- 
> 1.7.9.5
> 
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to