[FFmpeg-devel] [PATCH] Move MLP's dot product to DSPContext

Ramiro Polla ramiro.polla
Tue Apr 21 04:12:26 CEST 2009


Hi,

On Mon, Apr 20, 2009 at 5:03 AM, Reimar D?ffinger
<Reimar.Doeffinger at gmx.de> wrote:
> On Mon, Apr 20, 2009 at 02:29:09AM -0300, Ramiro Polla wrote:
>> > also state[i] * coeffs[i]; i++
>> > could be tried
>>
>> 8.1% faster than current code, but a bit slower then the
>> while(order--) code, which gives 10.8%.
>>
>> I also tried putting the while(order--) function direcly in mlpdec.c,
>> which gave only 2.7%. The switch code was about the same.
>
> How common is the order == 0 case?

The functions are only called if (order). See below for a distribution of order.

>> do {
>> } while (--order);
> Might well be faster.

Indeed this gives a slight speedup in the "inlined in mlpdec.c" case
(see my reply to michael for the speeds). It gave about 3350ms in x86.

> Partial unrolling like
>> if (order >= 4)
>> ? ?4 times...
>> ? order -= 4;
>> }
>> switch (order), while (order--) etc...
> Might be an option as well.

When optimized in mlpdsp.c with while(order--), all functions are
already unrolled to the proper size, so this should actually make it
slower... Inlined in mlpdec.c it gave no speedup over the
while(order--) code.

> It will all depend a lot on the value distribution of "order".

7.1.thd:
0: 29746448
1: 46656
2: 1810408
3: 2657424
4: 2038496
5: 1972552
6: 5600080
7: 4332160
8: 33252816

hd_dolby_city_redux.thd
0: 9835344
1: 117640
2: 118208
3: 248432
4: 1216584
5: 1602232
6: 1557896
7: 1569392
8: 10076832

luckynight.mlp
0: 4665464
1: 411712
2: 494984
3: 732264
4: 3480704
5: 1114288
6: 771736
7: 759536
8: 566832

Ramiro Polla



More information about the ffmpeg-devel mailing list