Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Codecs
  • Assigned To No-one
  • Operating System SW-codec
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by MichaelGiacomelli - 2008-07-06
Last edited by MichaelGiacomelli - 2008-07-18

FS#9160 - Use Tremor IMDCT for WMA

The Tremor IMDCT is much, much faster then the WMA (and almost certainly the FAAD) one. This patch copies the Tremor IMDCT over to libwma with minor changes to remove it’s connection to Vorbis.

The resulting decoder sounds correct on the Sim and ARM, while being 4MHz faster on PP5024.

I have not tested it on Coldfire, but expect some speedup and hopefully no reduction in quality.

Closed by  MichaelGiacomelli
2008-07-18 01:24
Reason for closing:  Accepted
MichaelGiacomelli commented on 2008-07-06 19:59

Coldfire results from IRC:

<PaulJam> saratoga: without the patch: 249,25% and with the patch: 298,75%
<PaulJam> saratoga: 128kbps (it is one of the windows example music songs)

Also, updated patch to not produce a warning. Output should be identical. If no one finds any glitches, I will try to clean this up and commit it sometime this week or next, then look into adding it to AAC.

Thom Johansen commented on 2008-07-07 10:43

Have you actually tested to see if the output is identical?

PaulJam commented on 2008-07-07 12:03

Hi,

i just used the “write WAV” functionality of the test_codec plugin and did an ABX test using Foobar2000 to compare the output with and without the patch.
And the volume of the output with the patch applied is noticeably lower in direct comparison to the output without the patch.

Thom Johansen commented on 2008-07-07 13:04

Sounds like a wrong fixed point format is used somewhere.

MichaelGiacomelli commented on 2008-07-08 23:26

Heres an updated patch.

Gives me more or less identical output (←140dB RMS error) meaning that resolution remains well above 16 bits. We probably lost a bit of accuracy since the fixed point format in Tremor and libwma are mismatched, but I don’t see much sense in rewriting the IMDCT in ARM ASM just to save some accuracy above the 16th bit.

However, this does not rule out the possibility of clipping on loud samples, so any testing is appreciated.

Edit: Sorry, patch had some other junk in it related to Tremor. Should be fixed now.

Magnus Holmgren commented on 2008-07-09 21:20

From what I’ve read, an FFT-based IMDCT would be even faster, and that is what FAAD uses, as far as I can tell (though it might not be well optimized for our targets). Wouldn’t it be better to try to optimize and use that one? Still, a nice speed-up for WMA.

MichaelGiacomelli commented on 2008-07-09 21:47

The old IMDCT was also FFT based, but substantially slower then the Tremor one even ignoring ASM optimization. A faster FFT algorithm that was optimized for the minimum number of multiplies at the expense of adds would have been faster, but I don’t know how much so. Unfortunately, few fixed point FFT implementations exist, and designing fast ones is a nontrivial task.

Regarding choice of algorithm, I’ve actually seen claims that both methods are fastest, so I tend to think there is not a huge difference.

MichaelGiacomelli commented on 2008-07-13 19:57

Corrected lowered volume on files using noise coding.
Removed some unneeded fixed point functions left over from the ffmpeg imdct.

Andree Buschmann commented on 2008-07-17 05:41

I would say → go for svn. Because

a) the speed increase is significant
b) it seems you already measured a very low RMS error
c) you won’t get much feedback on possible errors here

Good job!

Thom Johansen commented on 2008-07-17 09:13

Go for it!

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing