[FFmpeg-devel] [PATCH 1/2] swresample/resample_template: flip order of operations in swri_resample_linear() for 32bit
Michael Niedermayer
michaelni at gmx.at
Sun Jun 29 22:26:19 CEST 2014
On Sun, Jun 29, 2014 at 02:28:02PM -0400, Ronald S. Bultje wrote:
> Hi,
>
>
> On Sun, Jun 29, 2014 at 8:53 AM, Michael Niedermayer <michaelni at gmx.at>
> wrote:
>
> > Fixes integer overflow
> >
> > Found-by: BBB
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libswresample/resample_template.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/libswresample/resample_template.c
> > b/libswresample/resample_template.c
> > index db208e3..3d566d0 100644
> > --- a/libswresample/resample_template.c
> > +++ b/libswresample/resample_template.c
> > @@ -174,7 +174,11 @@ int RENAME(swri_resample_linear)(ResampleContext *c,
> > v2 += src[sample_index + i] * (FELEM2)filter[i +
> > c->filter_alloc];
> > }
> > #endif
> > +#ifdef FELEML
> > val += (v2 - val) * (FELEML) frac / c->src_incr;
> > +#else
> > + val += (v2 - val) / c->src_incr * frac;
> > +#endif
> > OUT(dst[dst_index], val);
>
>
> I bet you were intending to remove this line in the same commit:
>
> # define FELEML int64_t
>
> I guess this is OK, at least short-term it fixes the issue. Long-term, I'd
> like something slightly more simd-friendly but I'll do that separately...
fixed, applied, ok
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140629/f60b735b/attachment.asc>
More information about the ffmpeg-devel
mailing list