[FFmpeg-devel] [PATCH 6/6] Add rotate90 filter.

Stefano Sabatini stefano.sabatini-lala
Tue Nov 23 21:29:16 CET 2010


On date Sunday 2010-10-17 13:23:25 +0200, Stefano Sabatini encoded:
> On date Sunday 2010-10-17 11:05:34 +0200, Michael Niedermayer encoded:
> > On Fri, Oct 15, 2010 at 01:13:59AM +0200, Stefano Sabatini wrote:
> [...]
> > > +        for (y = 0; y < outh; y++) {
> > > +            for (x = 0; x < outw; x++) {
> > > +                int32_t v;
> > > +                int x1 = outw -1 -x;
> > > +                int y1 = outh -1 -y;
> > > +
> > > +                switch (pixstep) {
> > > +                case 1:
> > > +                    *(out + x) = *(in + y1*inlinesize + x1);
> > > +                    break;
> > > +                case 2:
> > > +                    *((uint16_t *)(out + 2*x)) = *((uint16_t *)(in + y1*inlinesize + x1*2));
> > > +                    break;
> > > +                case 3:
> > > +                    v = AV_RB24(in + y1*inlinesize + x1*3);
> > > +                    AV_WB24(out + 3*x, v);
> > > +                    break;
> > > +                case 4:
> > > +                    *((uint32_t *)(out + 4*x)) = *((uint32_t *)(in + y1*inlinesize + x1*4));
> > > +                    break;
> > > +                }
> > > +            }
> > 
> > please put the for loop inside the switch
> 
> Updated.

Updated again, avoids unnecessary loops when angle is 0.
-- 
FFmpeg = Forgiving and Furious Multimedia Practical Enchanting Gigant



More information about the ffmpeg-devel mailing list