[FFmpeg-devel] [PATCH 05/12] WMA: use vector_fmul_step_scalar
Måns Rullgård
mans
Wed Sep 30 00:32:32 CEST 2009
Michael Niedermayer <michaelni at gmx.at> writes:
> On Tue, Sep 29, 2009 at 12:04:06PM +0100, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>>
>> > On Sun, Sep 27, 2009 at 11:49:21AM +0100, Mans Rullgard wrote:
>> >> ---
>> >> libavcodec/wmadec.c | 6 +++---
>> >> 1 files changed, 3 insertions(+), 3 deletions(-)
>> >>
>> >> diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
>> >> index a4d5ad6..9367e97 100644
>> >> --- a/libavcodec/wmadec.c
>> >> +++ b/libavcodec/wmadec.c
>> >> @@ -601,9 +601,9 @@ static int wma_decode_block(WMACodecContext *s)
>> >> for(i = 0;i < s->coefs_start; i++)
>> >> *coefs++ = 0.0;
>> >> n = nb_coefs[ch];
>> >> - for(i = 0;i < n; i++) {
>> >> - *coefs++ = coefs1[i] * exponents[i<<bsize>>esize] * mult;
>> >> - }
>> >> + s->dsp.vector_fmul_step_scalar(coefs, coefs1, exponents,
>> >> + mult, 1<<bsize>>esize, n);
>> >> + coefs += n;
>> >> n = s->block_len - s->coefs_end[bsize];
>> >> for(i = 0;i < n; i++)
>> >> *coefs++ = 0.0;
>> >
>> > i suspect that highlevel optimizations are possible and should be done first
>> > as they likely would render this optimized code obsolete
>> >
>> > for example: what value does 1<<bsize>>esize generally have?
>> > if its commonly 1 the others could be convertet ...
>>
>> On a randomly chosen test file, 1 is the most common value, roughly
>> 50%, with 2, 3, and 4 also occurring frequently.
>
> i assume you speak of bsize-esize, because 1<<bsize>>esize cant be 3
> i also assume that the % are scaled so that smaller n are weighted
> accordingly less
>
> ive not checked at all but from the hunk above it looks as if the original
> code was written to also handle bsize < esize, the new code would not ...
I just noticed that too. Working on it.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list