[FFmpeg-devel] [PATCH] Transpose filter

Michael Niedermayer michaelni
Tue Oct 12 21:01:43 CEST 2010


On Tue, Oct 12, 2010 at 08:51:46PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2010-10-12 02:28:09 +0200, Michael Niedermayer encoded:
> > On Mon, Oct 11, 2010 at 03:25:54PM +0200, Stefano Sabatini wrote:
> > > On date Sunday 2010-10-10 12:03:11 +0200, Stefano Sabatini encoded:
> > > [...]
> > [...]
> > > +static void end_frame(AVFilterLink *inlink)
> > > +{
> > > +    TransContext *trans = inlink->dst->priv;
> > > +    AVFilterBufferRef *in  = inlink->cur_buf;
> > > +    AVFilterBufferRef *out = inlink->dst->outputs[0]->out_buf;
> > > +    AVFilterLink *outlink = inlink->dst->outputs[0];
> > > +    int i, j, plane;
> > > +
> > > +    for (plane = 0; plane < trans->nb_planes; plane++) {
> > > +        int hsub = plane == 1 || plane == 2 ? trans->hsub : 0;
> > > +        int vsub = plane == 1 || plane == 2 ? trans->vsub : 0;
> > > +        int pixstep = trans->pixsteps[plane];
> > > +        for (i = 0; i < out->video->h>>vsub; i++) {
> > > +            uint8_t *pout = out->data[plane] + i * out->linesize[plane];
> > > +            for (j = 0; j < out->video->w>>hsub; j++, pout += pixstep) {
> > > +                uint8_t *pin = in ->data[plane] + j * in ->linesize[plane] + i * pixstep;
> > > +                int32_t v;
> > > +
> > > +                switch (pixstep) {
> > > +                case 1:
> > > +                    *pout = *pin;
> > > +                    break;
> > > +                case 2:
> > > +                    *((uint16_t *)pout) = *((uint16_t *)pin);
> > > +                    break;
> > > +                case 3:
> > > +                    v = AV_RB24(pin);
> > > +                    AV_WB24(pout, v);
> > > +                    break;
> > > +                case 4:
> > > +                    *((uint32_t *)pout) = *((uint32_t *)pin);
> > > +                    break;
> > > +                }
> > > +            }
> > 
> > The filter in soc is much more efficient
> 
> From what I can see it shouldn't be *much* less efficient, I suppose a
> benchmark is welcome...

ill wager a bet that a wraper around libmpcodecs and its rotate filter + vflip
beats this

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101012/a930855c/attachment.pgp>



More information about the ffmpeg-devel mailing list