[FFmpeg-soc] [soc]: r4155 - libavfilter/vf_scale.c
stefano
subversion at mplayerhq.hu
Wed Mar 4 01:06:52 CET 2009
Author: stefano
Date: Wed Mar 4 01:06:52 2009
New Revision: 4155
Log:
Use av_gcd() rather than av_reduce() when computing
outpic->pixel_aspect, simplify.
Modified:
libavfilter/vf_scale.c
Modified: libavfilter/vf_scale.c
==============================================================================
--- libavfilter/vf_scale.c Wed Mar 4 01:03:07 2009 (r4154)
+++ libavfilter/vf_scale.c Wed Mar 4 01:06:52 2009 (r4155)
@@ -128,15 +128,17 @@ static void start_frame(AVFilterLink *li
{
ScaleContext *scale = link->dst->priv;
AVFilterLink *out = link->dst->outputs[0];
+ int64_t gcd;
out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE);
out->outpic->pts = picref->pts;
out->outpic->pixel_aspect.num = picref->pixel_aspect.num * out->h * link->w;
out->outpic->pixel_aspect.den = picref->pixel_aspect.den * out->w * link->h;
- av_reduce(&out->outpic->pixel_aspect.num, &out->outpic->pixel_aspect.den,
- out->outpic->pixel_aspect.num, out->outpic->pixel_aspect.den,
- FFMAX(out->outpic->pixel_aspect.num, out->outpic->pixel_aspect.den));
+
+ gcd = av_gcd(out->outpic->pixel_aspect.num, out->outpic->pixel_aspect.den);
+ out->outpic->pixel_aspect.num /= gcd;
+ out->outpic->pixel_aspect.den /= gcd;
avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
More information about the FFmpeg-soc
mailing list