[Ffmpeg-devel] WMA decoder improvement

Ian Braithwaite ian
Wed Mar 28 15:50:47 CEST 2007


Hi,


Here's a little improvement to wma decoding.

I've compared the decoded output against that produced by the wmadmo dll
used with mplayer.

Testing on "...samples/A-codecs/WMA/Bangles 01 - Walk Like An Egyptian.wma",
it reduces the difference between MS and ffmpeg from
  max +-4142, rms 21.0  to  max +-575, rms 1.3.

On a 30s clip I use for testing ("g_64k.wma", can't remember now where it came
from:-/) the improvement is from
  max +-1361, rms = 9.3  to  max +-1, rms = 0.04 (!!)


Here's what it does.
Exponents can be reused from one block to the next.
In wma, block sizes vary, for example between 128,256,512,1024 and 2048 samples.
Currently, when reusing exponents in blocks with a different block size,
the exponent block is down or up sampled to the new size.
So a block of exponents can be resized from 512 -> 256 samples, and then
resized back again from 256 -> 512 samples,
discarding and duplicating every other sample, respectively.

The patch keeps the original exponent blocks, and resizes (on the fly) to
each new block size.


 wma.h    |    1
 wmadec.c |   79 ++++++++++++++++++---------------------------------------------
2 files changed, 24 insertions(+), 56 deletions(-)


There seem to be quite a few variants of wma, so I can't be sure that
this is the right thing to do in all cases.

Also, to compare against the MS codec, I had to prevent the first two
blocks from being output.
There's a little patch for that too, but I'm pretty sure it doesn't
do the right thing in all cases.
I've attached it in case anyone wants to reproduce my measurements.


Regards,
Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: expon.diff
Type: text/x-patch
Size: 7816 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070328/f66ba746/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drop.diff
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070328/f66ba746/attachment-0001.bin>



More information about the ffmpeg-devel mailing list