History

vf_pad/scale: use double precision for aspect ratios.

Fixes Bug 203.

Anton Khirnov committed 14 years ago

Commit ba041771 parent c07d56a2 files · +3 −3Browse files

Unified · Split

2 files
  1. libavfilter/vf_pad.c +1 −1
  2. libavfilter/vf_scale.c +2 −2
libavfilter/vf_pad.c+1−1
@@ -160,7 +160,7 @@ static int config_input(AVFilterLink *inlink) · 159 unmodified lines
160 var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;160 var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
161 var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;161 var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
162 var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;162 var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
163 var_values[VAR_A] = (float) inlink->w / inlink->h;163 var_values[VAR_A] = (double) inlink->w / inlink->h;
164 var_values[VAR_HSUB] = 1<<pad->hsub;164 var_values[VAR_HSUB] = 1<<pad->hsub;
165 var_values[VAR_VSUB] = 1<<pad->vsub;165 var_values[VAR_VSUB] = 1<<pad->vsub;
166 166
libavfilter/vf_scale.c+2−2
@@ -167,9 +167,9 @@ static int config_props(AVFilterLink *outlink) · 166 unmodified lines
167 var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;167 var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
168 var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;168 var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
169 var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;169 var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
170 var_values[VAR_DAR] = var_values[VAR_A] = (float) inlink->w / inlink->h;170 var_values[VAR_DAR] = var_values[VAR_A] = (double) inlink->w / inlink->h;
171 var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?171 var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
172 (float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;172 (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
173 var_values[VAR_HSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_w;173 var_values[VAR_HSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_w;
174 var_values[VAR_VSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_h;174 var_values[VAR_VSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
175 175

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t