[MPlayer-dev-eng] MS-ADPCM/Stereo Works

Michael Niedermayer michaelni at gmx.at
Fri Dec 28 04:55:28 CET 2001


Hi

On Friday 28 December 2001 04:26, Mike Melanson wrote:
> On Fri, 28 Dec 2001, Michael Niedermayer wrote:
[braindead SIMD opt ...]
>
> 	I was aiming for elegance and brief code when I wrote the ADPCM
> decoders, as opposed to raw speed. The blahblah[channel] convention was
> adopted in order to combine the mono and stereo decoders into a single
> function. Now that I think about it, elegance and brevity of code tend to
> clash with performance...:)
i am just joking with the optimization stuff :)

>
> 	Also, consider that a stream of ADPCM-coded data is a stream of
> nibbles. Each nibble stands in for a 16-bit PCM sample. However, there is
> no math performed directly on the nibble. They're always used as array
> indices (which, I suppose, means that math is performed, but not the kind
> that perhaps you had in mind).
yes, ur right, mmx would be a bit inappropriate here :(

>
> 	Another point to make is that in stereo ADPCM data, the codes are
> already interleaved for us, LRLR... As soon as I get this format 0x62
> decoder done, I'll be able to finish up the first rev of this ADPCM format
> document, which may be of interest to you.
sure iam allways interrested ...
if i understand corrrectly than the imaadpcm decoder only stores
the predictor (=last output sample)
the index (0-88)
the stepsize (which only depends on the index)
allthough the predictor isnt really used except that it is added at the end
so it might be possible to replace the whole decoder with a look up table ... 
assuming that i understand it correctly
int delta= lut[input + index*16];
predictor+= delta;
clamp predictor
output=predictor;
index += adpcm_index[input];
clamp index

>
> 	As for the exercise of optimizing an ADPCM decoder with SIMD
> instructions, it may seem silly, but I've learned never to deride any such
> undertaking as futile since they can be great learning experiences. I've
> never coded with SIMD instructions (studied them, though) and this may
> prove to be a interesting beginner's exercise...if I go through with it
> (big 'if'...:)
after thinking about it again simd doesnt seem to be a that good choice :(
... but who knows, i doubt that a SIMD-adpcm decoder is a good beginers 
exercise

Michael



More information about the MPlayer-dev-eng mailing list