[FFmpeg-devel] [PATCH] Move MLP's dot product to DSPContext
Michael Niedermayer
michaelni
Mon Apr 20 05:14:43 CEST 2009
On Sun, Apr 19, 2009 at 10:10:05PM -0300, Ramiro Polla wrote:
> Hi,
>
> Attached file move MLP's dot product to DSPContext. The filter order
> is a maximum of 8, and in the rematrix stage it's a maximum of 5+2
> channels for MLP and 7+0 channels for TrueHD, so it all fits in 8
> (hopefully) optimized functions.
the functions are too small, the call overhead is too much
1-8 multiplicatons and 1-8 additions is not enough ...
[...]
> static int64_t mlp_dotproduct_c(int32_t *state, int32_t *coeffs, int order)
the arguments should be const
> {
> int64_t accum = 0;
>
> while (order--)
> accum += (int64_t) *state++ * *coeffs++;
switch(order){
case 8: accum = (int64_t) *state++ * *coeffs++;
case 7: accum += (int64_t) *state++ * *coeffs++;
case 6: accum += (int64_t) *state++ * *coeffs++;
case 5: accum += (int64_t) *state++ * *coeffs++;
case 4: accum += (int64_t) *state++ * *coeffs++;
case 3: accum += (int64_t) *state++ * *coeffs++;
case 2: accum += (int64_t) *state++ * *coeffs++;
case 1: accum += (int64_t) *state * *coeffs ;
case 0:
}
also state[i] * coeffs[i]; i++
could be tried
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20090420/0b378d94/attachment.pgp>
More information about the ffmpeg-devel
mailing list