[FFmpeg-devel] [PATCH 04/12] Add vector_fmul_matrix to dsputil

Michael Niedermayer michaelni
Sun Oct 18 22:49:50 CEST 2009


On Sun, Oct 18, 2009 at 09:17:48PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
[...]
> >> +        }
> >> +    } else {
> >> +        for (i = 0; i < len; i++) {
> >> +            const float *m = mtx;
> >> +            for (j = 0; j < w; j++) {
> >> +                float s = 0;
> >
> >> +                for (k = 0; k < w; k++)
> >> +                    s += v[k][i] * *m++;
> >
> > this is quite inefficient because for(k) v[k][i] needs 2 memory reads
> > a flat 2d array would be better
> 
> And how will the data magically transform itself into such a layout?

What is the a reason that the data is not in that layout?
If the awnser is that some decoder is implemenetd that way then my next
question is, would there be a disadvanatge in changing it?


> 
> >> @@ -445,6 +445,8 @@ typedef struct DSPContext {
> >>       * @param len length of vectors, multiple of 4
> >>       */
> >>      float (*scalarproduct_float)(const float *v1, const float *v2, int len);
> >> +    void (*vector_fmul_matrix)(float **v, const float *mtx, int len, int w,
> >> +                               float *restrict tmp);
> >>      /**
> >>       * Calculate the sum and difference of two vectors of floats.
> >>       * @param v1  first input vector, sum output, 16-byte aligned
> >
> > missing doxy explaining what this does
> > (in case you wonder why do i complain and you would add it before commit
> >  its because it makes review easier if one can check the API without
> >  reverse engeneering it from the code ...)
> 
> It seemed obvious enough in this case.

The doxy would certainly reduce the time reviewing takes even if just by
a little, and iam sure you noticed iam quite behind with reviews


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091018/59f5a73a/attachment.pgp>



More information about the ffmpeg-devel mailing list