[FFmpeg-devel] [Patch] Scale filter should use multiples of 2

Michael Niedermayer michaelni
Thu Jul 22 19:49:30 CEST 2010


On Thu, Jul 22, 2010 at 11:33:10AM -0400, Daniel G. Taylor wrote:
[...]
> +static inline double round_clip(void *ctx, double arg1, double arg2)
> +{
> +    int orig = (int)arg1;
> +    int clip = (int)arg2;
> +    
> +    return orig -= (orig % clip < clip / 2) ? orig % clip : -(clip - (orig % clip));
> +}

trailing whitespace and missing documentation


[...]
> @@ -109,11 +157,19 @@
>      AVFilterLink *inlink = outlink->src->inputs[0];
>      ScaleContext *scale = ctx->priv;
>      int64_t w, h;
> +    
> +    scale->var_values[PI] = M_PI;
> +    scale->var_values[E] = M_E;
> +    scale->var_values[W] = inlink->w;
> +    scale->var_values[H] = inlink->h;
> +    scale->var_values[A] = (float) inlink->w / inlink->h;
> +    
> +    scale->w = av_eval_expr(scale->w_expr, scale->var_values, scale);
> +    scale->h = av_eval_expr(scale->h_expr, scale->var_values, scale);

the scale->w and scale->h values should be available to teh expressions
so that each can refer to the other

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100722/2a352baf/attachment.pgp>



More information about the ffmpeg-devel mailing list