On 2012-10-05 14:52:05 +0200, Anton Khirnov wrote:
> Fixes Bug 203.
> 
> CC:[email protected]
> ---
>  libavfilter/vf_pad.c   |    2 +-
>  libavfilter/vf_scale.c |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
> index 2291b13..8adab3b 100644
> --- a/libavfilter/vf_pad.c
> +++ b/libavfilter/vf_pad.c
> @@ -160,7 +160,7 @@ static int config_input(AVFilterLink *inlink)
>      var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
>      var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
>      var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
> -    var_values[VAR_A]     = (float) inlink->w / inlink->h;
> +    var_values[VAR_A]     = (double) inlink->w / inlink->h;
>      var_values[VAR_HSUB]  = 1<<pad->hsub;
>      var_values[VAR_VSUB]  = 1<<pad->vsub;
>  
> diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
> index 949691f..4941e8d 100644
> --- a/libavfilter/vf_scale.c
> +++ b/libavfilter/vf_scale.c
> @@ -167,9 +167,9 @@ static int config_props(AVFilterLink *outlink)
>      var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
>      var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
>      var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
> -    var_values[VAR_DAR]   = var_values[VAR_A]  = (float) inlink->w / 
> inlink->h;
> +    var_values[VAR_DAR]   = var_values[VAR_A]  = (double) inlink->w / 
> inlink->h;
>      var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
> -        (float) inlink->sample_aspect_ratio.num / 
> inlink->sample_aspect_ratio.den : 1;
> +        (double) inlink->sample_aspect_ratio.num / 
> inlink->sample_aspect_ratio.den : 1;
>      var_values[VAR_HSUB]  = 
> 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_w;
>      var_values[VAR_VSUB]  = 
> 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_h;

ok, looks strange that it used less precision in the computation than
in storage.

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to