[FFmpeg-devel] [PATCH] vp9: fix type of iadst4_1d intermediates.

Ronald S. Bultje rsbultje at gmail.com
Sat Sep 5 13:29:18 CEST 2015


Hi,

On Sat, Sep 5, 2015 at 4:10 AM, Clément Bœsch <u at pkh.me> wrote:

> On Fri, Sep 04, 2015 at 05:02:01PM -0400, Ronald S. Bultje wrote:
> > Fixes integer overflows for extreme coefficient values in 10/12bpp
> content.
> > ---
> >  libavcodec/vp9dsp_template.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vp9dsp_template.c b/libavcodec/vp9dsp_template.c
> > index 9395a0c..4d810fe 100644
> > --- a/libavcodec/vp9dsp_template.c
> > +++ b/libavcodec/vp9dsp_template.c
> > @@ -1186,7 +1186,7 @@ static av_always_inline void idct4_1d(const
> dctcoef *in, ptrdiff_t stride,
> >  static av_always_inline void iadst4_1d(const dctcoef *in, ptrdiff_t
> stride,
> >                                         dctcoef *out, int pass)
> >  {
> > -    int t0, t1, t2, t3;
> > +    dctint t0, t1, t2, t3;
> >
> >      t0 =  5283 * IN(0) + 15212 * IN(2) +  9929 * IN(3);
> >      t1 =  9929 * IN(0) -  5283 * IN(2) - 15212 * IN(3);
>
> not needed for iwht4_1d?


There's no multiply, so no. (The multiply makes it overflow.)

Ronald


More information about the ffmpeg-devel mailing list